/* =========================================================
   ATOM TYPOGRAPHY STANDARD
   Widget chrome and working copy share one readable baseline.
   Popups use a slightly larger transaction-focused baseline.
   Larger instrument readouts, game HUDs, and data-density views keep
   their scales; no visible ATOM copy may compute below 10.5px.
   ========================================================= */

:root {
  --atom-widget-text-size: 10.5px;
  --atom-widget-min-text-size: 10.5px;
  --atom-widget-title-size: 12px;
  --atom-popup-text-size: 12px;
  --atom-popup-title-size: 13px;
  --atom-widget-line-height: 1.3;
  --atom-popup-line-height: 1.35;
}

/* 10.5px is the floor, not the average. Semantic secondary copy and normal
   widget controls can no longer opt into a smaller module-local size. */
.widget small,
.widget:not([data-kind="arcade"]):not([data-kind="calculator"]) .widget-body :where(input,select,textarea,label > span),
.widget .widget-footer,
.widget .widget-footer * {
  font-size:var(--atom-widget-min-text-size) !important;
  line-height:var(--atom-widget-line-height);
}

.atom-type-min {
  font-size:var(--atom-widget-min-text-size) !important;
}

/* Shared widget chrome */
.widget {
  font-size: var(--atom-widget-text-size);
}

.widget .widget-title strong {
  font-size: var(--atom-widget-title-size) !important;
  line-height: 1.15;
}

.widget .widget-title small,
.widget .widget-footer,
.widget .widget-footer *,
.widget .footer-filter,
.widget .footer-filter *,
.widget .scope-field,
.widget .scope-field *,
.widget .universal-filter-search,
.widget .universal-filter-search input {
  font-size: var(--atom-widget-text-size) !important;
  line-height: var(--atom-widget-line-height);
}

.widget:not([data-kind="arcade"]):not([data-kind="calculator"]) .widget-body {
  font-size: var(--atom-widget-text-size);
  line-height: var(--atom-widget-line-height);
}

.widget:not([data-kind="arcade"]):not([data-kind="calculator"]) .widget-body :where(input,select,textarea) {
  font-size: var(--atom-widget-text-size) !important;
  line-height: var(--atom-widget-line-height);
}

/* Common working surfaces. Data sheets and hierarchy rows continue to obey
   the site-wide Compact / Standard / Comfortable density setting. */
.widget :where(
  .empty-state,
  .empty-state *,
  .detail-empty,
  .detail-empty *,
  .pinning-empty-v46 > span:last-child,
  .heartbeat-instrument small,
  .utility-display small,
  .weather-caption-v17,
  .clock-digital-v17 > small
) {
  font-size: var(--atom-widget-text-size) !important;
  line-height: var(--atom-widget-line-height) !important;
}

/* Notes is prose and controls, not a scaled instrument. */
.rich-notes-workspace,
.rich-notes-workspace :where(button,input,select,textarea,label,small,span,p),
.rich-note-surface,
.notes-master-workspace .rich-note-surface,
.notes-utility-widget[data-size="full"] .rich-note-surface {
  font-size: var(--atom-widget-text-size) !important;
}

/* Master Key Generator + System Tree */
.mkg-shell {
  font-size: var(--atom-widget-text-size);
  line-height: var(--atom-widget-line-height);
}

.mkg-shell :where(
  button,
  input,
  select,
  textarea,
  label > span,
  label > small,
  .mkg-tabs > span,
  .mkg-section-head > span,
  .mkg-validation strong,
  .mkg-validation span,
  .mkg-review-head small,
  .mkg-system-tree > header small,
  .mkg-tree-editbar > div strong,
  .mkg-tree-editbar > div span,
  .mkg-tree-no-level,
  .mkg-tree-label > i,
  .mkg-tree-key i,
  .mkg-tree-label strong,
  .mkg-tree-key strong,
  .mkg-tree-label small,
  .mkg-tree-key small,
  .mkg-tree-more,
  .mkg-key-row,
  .mkg-key-row *,
  .mkg-pager,
  .mkg-pager *,
  .mkg-sop-column > header,
  .mkg-sop-column > header *,
  .mkg-cut,
  .mkg-cut *,
  .mkg-column-weight,
  .mkg-column-weight *,
  .mkg-system-index-row,
  .mkg-system-index-row *,
  .mkg-tree-back
) {
  font-size: var(--atom-widget-text-size) !important;
  line-height: var(--atom-widget-line-height);
}

.mkg-section-head small,
.mkg-review-head small,
.mkg-system-tree > header small {
  font-size: var(--atom-widget-text-size) !important;
}

.mkg-section-head strong,
.mkg-review-head strong,
.mkg-system-tree > header strong {
  font-size: var(--atom-widget-title-size) !important;
}

/* Preserve symbol-sized affordances inside the generator. */
.mkg-tree-toggle {
  font-size: 14px !important;
}

.mkg-tree-toggle.is-static {
  font-size: 13px !important;
}

.mkg-row-remove,
.mkg-key-row [aria-label*="Remove"] {
  font-size: 15px !important;
}

.mkg-drag-handle {
  font-size:15px !important;
  line-height:1 !important;
}

.mkg-fixed-cut strong {
  font-size:18px !important;
}

/* Pinning workspace copy and controls. The runtime floor also lifts older
   physical core/kit markings that were authored below the ATOM minimum. */
.pinning-lab-widget-v47 :where(
  .pin-v47-left > nav button,
  .pin-v47-source,
  .pin-v47-primary label > span,
  .pin-v47-primary small,
  .pin-v47-ops > div > span,
  .pin-v47-no-key,
  .pin-v47-status,
  .pin-v47-project-empty p,
  .pin-v47-overview strong,
  .pin-v47-overview span,
  .pin-v47-bench > header,
  .pin-v47-job > span,
  .pin-v47-job > div strong,
  .pin-v47-job > div small,
  .pin-v47-job > b,
  .pin-v47-detail-empty,
  .pin-v47-empty small,
  .pin-v47-result-foot,
  .p51-header-modes button,
  .p51-tabs button,
  .p51-tabs button span,
  .p51-source-line b,
  .p51-source-line small,
  .p51-area-label strong,
  .p51-area-label span,
  .p51-data-status,
  .p51-data-footer button,
  .p52-mode-controls button,
  .p53-panel-title span
) {
  font-size: var(--atom-widget-text-size) !important;
  line-height: var(--atom-widget-line-height);
}

/* Universal popup transaction scale */
.focus-modal-card,
.mkg-derive-dialog,
.pin-v47-save-overlay {
  --atom-current-popup-text: var(--atom-popup-text-size);
  font-size: var(--atom-current-popup-text);
  line-height: var(--atom-popup-line-height);
}

.focus-modal-body,
.focus-modal-body :where(button,input,select,textarea,label,small,span,strong,p,li,th,td),
.mkg-derive-dialog :where(button,input,select,textarea,label,small,span,strong,p,li,th,td),
.pin-v47-save-overlay :where(button,input,select,textarea,label,small,span,strong,p,li) {
  font-size: var(--atom-popup-text-size) !important;
  line-height: var(--atom-popup-line-height);
}

.focus-modal-title strong,
.mkg-derive-dialog > header strong,
.pin-v47-save-overlay strong {
  font-size: var(--atom-popup-title-size) !important;
  line-height: 1.2;
}

/* Close/remove glyphs remain optically sized as symbols rather than copy. */
.focus-modal-header :where(.modal-cancel,[aria-label*="Close"]),
.mkg-derive-dialog > header button,
.focus-modal-body :where(.row-remove,[aria-label*="Remove"]) {
  font-size: 19px !important;
  line-height: 1;
}
