/* The app's base styles: layout, theme tokens, the calculator and the
   shared components. hea-features.css adds the Dataset, Design and
   Benchmark tabs, and the landing page keeps its own inline block. */
      :root {
        --bg: #faf8f3;
        --surface: #ffffff;
        --surface-muted: #f3f1ea;
        --surface-subtle: #f7f5ee;
        --text: #1b1b18;
        --text-strong: #000000;
        --text-muted: #5a5a52;
        --text-muted-2: #8a8880;
        --border: #d9d6cc;
        --border-2: #c5c2b6;
        --rule: #1b1b18;
        --accent: #8b3a2f;
        --accent-2: #5e2a23;
        --danger: #962d24;
        --shadow-panel: none;
        --radius-lg: 3px;
        --radius-md: 2px;
        --radius-sm: 2px;
        --glow: none;
        --serif: "Charter", "Iowan Old Style", "Sitka Text", "Cambria", "Source Serif Pro", "Hoefler Text", Georgia, serif;
        --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
        --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
      }

      @media (prefers-color-scheme: dark) {
        :root:not([data-theme="light"]) {
          --bg: #14140f;
          --surface: #1c1c17;
          --surface-muted: #24241f;
          --surface-subtle: #1a1a16;
          --text: #e6e3da;
          --text-strong: #ffffff;
          --text-muted: #a09d92;
          --text-muted-2: #75726a;
          --border: #33322c;
          --border-2: #4a4842;
          --rule: #75726a;
          --accent: #d97757;
          --accent-2: #b85a3d;
          --danger: #e08a7e;
          --shadow-panel: none;
          --glow: none;
        }
      }
      :root[data-theme="dark"] {
        --bg: #14140f;
        --surface: #1c1c17;
        --surface-muted: #24241f;
        --surface-subtle: #1a1a16;
        --text: #e6e3da;
        --text-strong: #ffffff;
        --text-muted: #a09d92;
        --text-muted-2: #75726a;
        --border: #33322c;
        --border-2: #4a4842;
        --rule: #75726a;
        --accent: #d97757;
        --accent-2: #b85a3d;
        --danger: #e08a7e;
        --shadow-panel: none;
        --glow: none;
      }

      * {
        box-sizing: border-box;
      }
      body {
        margin: 0;
        font-family: var(--sans);
        background: var(--bg);
        color: var(--text);
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        min-height: 100vh;
        position: relative;
      }
      .container {
        max-width: 1460px;
        margin: 0 auto;
        padding: 32px 20px 60px;
        position: relative;
        z-index: 1;
      }

      .layout {
        display: grid;
        grid-template-columns: minmax(0, 820px);
        justify-content: center;
        gap: 18px;
      }
      .main {
        min-width: 0;
        order: -1;
      }

      /* Background / equations grid (quick reference) */
      .background-section {
        max-width: 820px;
        margin: 0 auto 20px;
        padding: 0 8px;
      }
      .background-section .bg-title {
        font-family: var(--sans);
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--text-strong);
        margin-bottom: 16px;
        padding-left: 0;
      }
      .eq-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        border-top: 1px solid var(--border);
        border-left: 1px solid var(--border);
      }
      @media (max-width: 700px) {
        .eq-grid { grid-template-columns: 1fr; }
      }
      .eq-card {
        background: var(--surface);
        border: 0;
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        padding: 14px 18px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        overflow: hidden;
      }
      .eq-card.wide {
        grid-column: 1 / -1;
      }
      .eq-card h3 {
        font-family: var(--sans);
        margin: 0;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--text-muted);
      }
      .eq-card .eq-block {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 2px 0;
      }
      .eq-card .eq-block mjx-container {
        display: inline-block !important;
        max-width: 100%;
      }
      .eq-card .eq-vars {
        font-size: 12.5px;
        color: var(--text-muted);
        line-height: 1.5;
        margin: 0;
      }
      .eq-card .eq-vars span {
        white-space: nowrap;
      }
      .eq-card ul.eq-list {
        margin: 2px 0 0;
        padding-left: 16px;
        font-size: 12.5px;
        color: var(--text-muted);
        line-height: 1.55;
      }
      .eq-card ul.eq-list li {
        margin-bottom: 2px;
      }

      /* Theoretical background section */
      .theory-section {
        max-width: 820px;
        margin: 0 auto 28px;
        padding: 0 8px;
        line-height: 1.65;
      }
      .theory-section .theory-eyebrow {
        font-family: var(--sans);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: var(--text-muted);
        margin: 0 0 4px;
      }
      .theory-section .theory-title {
        font-family: var(--sans);
        font-size: 28px;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: var(--text-strong);
        margin: 0 0 14px;
        line-height: 1.2;
        text-transform: none;
        border: 0;
        padding: 0;
      }
      .theory-section .theory-lede {
        font-family: var(--serif);
        font-size: 16px;
        color: var(--text);
        margin: 0 0 28px;
        padding-bottom: 24px;
        border-bottom: 1px solid var(--border);
        max-width: 64ch;
        font-style: italic;
      }
      .theory-section h3 {
        font-family: var(--sans);
        font-size: 19px;
        font-weight: 700;
        margin: 40px 0 12px;
        color: var(--text-strong);
        letter-spacing: -0.01em;
        scroll-margin-top: 16px;
        padding-bottom: 6px;
        border-bottom: 1px solid var(--border);
      }
      .theory-section h3 .sec-num {
        display: inline;
        font-family: var(--mono);
        font-size: 13px;
        font-weight: 500;
        color: var(--accent);
        background: transparent;
        padding: 0;
        border-radius: 0;
        margin-right: 12px;
        font-variant-numeric: tabular-nums;
        letter-spacing: 0;
      }
      .theory-section h4 {
        font-family: var(--sans);
        font-size: 13px;
        font-weight: 700;
        margin: 22px 0 6px;
        color: var(--text-strong);
        text-transform: uppercase;
        letter-spacing: 0.08em;
      }
      .theory-section p {
        font-family: var(--serif);
        margin: 0 0 14px;
        font-size: 16px;
        color: var(--text);
        max-width: 64ch;
        hyphens: auto;
      }
      .theory-section .display-eq {
        margin: 16px 0 20px;
        padding: 8px 0 8px 20px;
        background: transparent;
        border-left: 2px solid var(--accent);
        border-radius: 0;
        overflow-x: auto;
        overflow-y: hidden;
      }
      .theory-section .display-eq mjx-container {
        display: inline-block !important;
        max-width: 100%;
      }
      .theory-section ul,
      .theory-section ol.body-list {
        font-family: var(--serif);
        margin: 8px 0 16px;
        padding-left: 24px;
        font-size: 16px;
        color: var(--text);
        max-width: 62ch;
      }
      .theory-section li {
        margin-bottom: 6px;
      }
      .theory-section .callout {
        margin: 20px 0;
        padding: 14px 18px;
        border-radius: 0;
        border: 0;
        border-left: 2px solid var(--text-strong);
        background: var(--surface-muted);
      }
      .theory-section .callout.warning {
        border-left-color: var(--accent);
        background: var(--surface-muted);
      }
      .theory-section .callout.note {
        border-left-color: var(--text-muted);
        background: var(--surface-muted);
      }
      .theory-section .callout-title {
        display: block;
        font-family: var(--sans);
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: var(--text-strong);
        margin-bottom: 4px;
      }
      .theory-section .callout.warning .callout-title { color: var(--accent); }
      .theory-section .callout.note .callout-title { color: var(--text-muted); }
      .theory-section .callout p {
        font-family: var(--serif);
        margin: 0;
        font-size: 15px;
      }
      .theory-section .callout p + p { margin-top: 8px; }
      .theory-section .ref-cite {
        font-size: 12px;
        color: var(--text-muted);
        font-style: italic;
      }
      .theory-section table.param-table {
        width: 100%;
        max-width: 64ch;
        margin: 16px 0 20px;
        border-collapse: collapse;
        font-size: 13.5px;
        font-family: var(--sans);
      }
      .theory-section table.param-table th,
      .theory-section table.param-table td {
        border: 0;
        border-bottom: 1px solid var(--border);
        padding: 7px 10px 7px 0;
        text-align: left;
        vertical-align: top;
      }
      .theory-section table.param-table thead th {
        border-bottom: 1.5px solid var(--text-strong);
        background: transparent;
        font-weight: 700;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-strong);
        padding-bottom: 6px;
      }
      .theory-section table.param-table td:first-child {
        font-weight: 500;
        white-space: nowrap;
        font-family: var(--mono);
      }
      @media (max-width: 760px) {
        .theory-section { padding: 0 4px; }
        .theory-section .theory-title { font-size: 24px; }
      }

      header {
        max-width: 820px;
        margin: 0 auto 32px;
        text-align: left;
        padding: 28px 0 24px;
        border-bottom: 1px solid var(--rule);
      }
      h1 {
        margin: 0 0 6px;
        font-size: 30px;
        letter-spacing: -0.015em;
        font-weight: 700;
        color: var(--text-strong);
        font-family: var(--sans);
      }
      header p {
        color: var(--text-muted);
        font-size: 14.5px;
        margin: 0;
        max-width: 70ch;
      }
      h2 {
        margin: 0 0 14px;
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-strong);
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
      }
      .panel {
        background: var(--surface);
        border-radius: var(--radius-lg);
        padding: 22px 24px;
        margin-bottom: 18px;
        border: 1px solid var(--border);
      }
      .row {
        display: flex;
        gap: 16px;
        align-items: end;
        flex-wrap: wrap;
        margin-bottom: 12px;
      }
      .ratio-table {
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        overflow: hidden;
        background: var(--surface);
      }
      .ratio-table table {
        width: 100%;
        border-collapse: collapse;
      }
      .ratio-table th,
      .ratio-table td {
        padding: 9px 12px;
        border-bottom: 1px solid var(--border);
        text-align: left;
      }
      .ratio-table th {
        font-family: var(--sans);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        background: var(--surface-muted);
      }
      .ratio-table tbody tr:hover {
        background: var(--surface-subtle);
      }
      .ratio-table input,
      .ratio-table select,
      #element-count {
        width: 100%;
        padding: 7px 8px;
        border: 1px solid var(--border-2);
        border-radius: var(--radius-sm);
        background: var(--surface);
        color: var(--text);
        font-family: var(--sans);
        font-size: 13px;
      }
      #element-count {
        max-width: 120px;
      }
      .actions {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
      }
      button {
        border: 1px solid var(--border-2);
        padding: 8px 16px;
        border-radius: var(--radius-sm);
        cursor: pointer;
        font-weight: 500;
        font-family: var(--sans);
        font-size: 13px;
        line-height: 1.2;
        white-space: nowrap;
        background: var(--surface);
        color: var(--text);
        transition: background-color 0.12s ease, border-color 0.12s ease;
      }
      button.primary {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
      }
      button.primary:hover {
        background: var(--accent-2);
        border-color: var(--accent-2);
      }
      button.secondary {
        background: var(--surface-muted);
        color: var(--text);
        border: 1px solid var(--border);
      }
      button.secondary:hover {
        background: var(--border);
      }
      button.ghost {
        background: transparent;
        color: var(--accent);
        border: 1px solid var(--border);
      }
      button.ghost:hover {
        border-color: var(--accent);
        color: var(--accent-2);
      }
      button:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 1px;
      }
      button:disabled {
        cursor: not-allowed;
        opacity: 0.5;
      }
      .ratio-table input:focus,
      .ratio-table select:focus,
      #element-count:focus {
        outline: none;
      }
      .ratio-table input:focus-visible,
      .ratio-table select:focus-visible,
      #element-count:focus-visible {
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(139, 58, 47, 0.18);
        outline: none;
      }
      .error {
        color: var(--danger);
        font-weight: 600;
      }
      .results {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 14px;
      }
      .results .composition-card {
        grid-column: 1 / -1;
      }
      .result-card {
        padding: 14px 16px;
        border-radius: var(--radius-md);
        background: var(--surface-subtle);
        border: 1px solid var(--border);
      }
      .panel-secondary {
        background: var(--surface-subtle);
        padding: 18px 20px;
      }
      .panel-secondary > h2 {
        font-size: 12px;
        color: var(--text-muted);
        border-bottom-color: var(--border);
      }
      .results-compact {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 10px;
      }
      /* ---- Phase-selection maps ---- */
      .maps-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 16px;
      }
      .map-figure {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 3px;
        padding: 12px 12px 10px;
        margin: 0;
      }
      .map-figure--wide { grid-column: 1 / -1; }
      .map-figure svg { display: block; width: 100%; height: auto; }
      .map-figure figcaption {
        margin-top: 8px;
        font-size: 11.5px;
        color: var(--text-muted);
        line-height: 1.45;
      }
      .map-figure figcaption a { color: inherit; }
      .map-title {
        font-size: 11.5px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        font-weight: 600;
        margin: 0 0 8px;
      }
      .map-axis { stroke: var(--border-2); stroke-width: 1; }
      .map-grid-line { stroke: var(--border); stroke-width: 0.5; stroke-dasharray: none; opacity: 0.6; }
      .map-tick-label, .map-axis-title, .map-region-label, .map-point-label, .map-note {
        font-family: var(--mono, monospace);
        fill: var(--text-muted);
        font-size: 10px;
      }
      .map-axis-title { font-size: 10.5px; }
      .map-region-label { font-size: 10px; fill: var(--text-muted); }
      .map-note { font-size: 9.5px; fill: var(--text-muted-2); }
      .map-region--ss { fill: var(--accent); fill-opacity: 0.10; stroke: var(--accent); stroke-opacity: 0.45; stroke-width: 1; }
      .map-region--ss2 { fill: none; stroke: var(--accent-2); stroke-opacity: 0.55; stroke-width: 1; stroke-dasharray: 4 3; }
      .map-region--bmg { fill: var(--text-muted-2); fill-opacity: 0.10; stroke: var(--text-muted-2); stroke-opacity: 0.45; stroke-width: 1; }
      .map-region--warn { fill: var(--danger); fill-opacity: 0.14; stroke: var(--danger); stroke-opacity: 0.5; stroke-width: 1; }
      .map-band { fill: var(--text-muted-2); }
      .map-threshold { stroke: var(--border-2); stroke-width: 1; stroke-dasharray: 4 3; }
      .map-point { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
      .map-point--offscale { fill: none; stroke: var(--accent); stroke-width: 2; }
      .map-point-label { fill: var(--text); font-weight: 600; }
      .anchor-flash { outline: 2px solid var(--accent); outline-offset: 3px; transition: outline-color 1.2s ease; }
      /* ---- Provenance drawer ("where does this number come from?") ---- */
      .result-card { position: relative; }
      .prov-btn {
        position: absolute;
        top: 6px;
        right: 6px;
        width: 22px;
        height: 22px;
        border: none;
        border-radius: 50%;
        background: transparent;
        color: var(--text-muted-2);
        font-size: 13px;
        line-height: 1;
        cursor: pointer;
        padding: 0;
      }
      .prov-btn:hover, .prov-btn:focus-visible { color: var(--accent); background: var(--surface-muted); }
      .prov-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
      .prov-drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(430px, 94vw);
        background: var(--surface);
        border-left: 1px solid var(--border-2);
        box-shadow: -12px 0 32px rgba(0, 0, 0, 0.12);
        z-index: 60;
        display: flex;
        flex-direction: column;
        transform: translateX(102%);
        transition: transform 0.22s ease;
        visibility: hidden;
      }
      @media (prefers-reduced-motion: reduce) { .prov-drawer { transition: none; } }
      .prov-drawer.is-open { transform: translateX(0); visibility: visible; }
      .prov-drawer__head {
        display: flex;
        align-items: baseline;
        gap: 10px;
        padding: 14px 16px 10px;
        border-bottom: 1px solid var(--border);
      }
      .prov-drawer__title { font-size: 14px; font-weight: 600; margin: 0; flex: 1; }
      .prov-drawer__symbol { font-family: var(--mono, monospace); color: var(--text-muted); font-size: 12.5px; }
      .prov-drawer__close {
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--text-muted);
        border-radius: 3px;
        width: 26px;
        height: 26px;
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
      }
      .prov-drawer__close:hover, .prov-drawer__close:focus-visible { color: var(--accent); border-color: var(--accent); }
      .prov-drawer__body { overflow-y: auto; padding: 12px 16px 20px; flex: 1; }
      .prov-sec { margin: 0 0 16px; }
      .prov-sec h4 {
        margin: 0 0 6px;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        font-weight: 600;
      }
      .prov-value { font-family: var(--mono, monospace); font-size: 18px; }
      .prov-value .prov-units { font-size: 12px; color: var(--text-muted); margin-left: 6px; }
      .prov-eq { overflow-x: auto; padding: 4px 0; }
      .prov-inputs { width: 100%; border-collapse: collapse; font-size: 12px; }
      .prov-inputs th, .prov-inputs td { text-align: left; padding: 3px 8px 3px 0; border-bottom: 1px solid var(--border); }
      .prov-inputs th { color: var(--text-muted); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; }
      .prov-inputs td { font-family: var(--mono, monospace); }
      .prov-inputs .prov-src { font-family: inherit; color: var(--text-muted); font-size: 11px; }
      .prov-inputs tr.prov-edited td { color: var(--accent); }
      .prov-note { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 6px 0 0; }
      .prov-note a, .prov-inputs a, .prov-refs a, .data-colsrc a,
      .data-el-note-row a, .data-file-card a {
        color: var(--accent);
        text-decoration: underline;
        text-underline-offset: 2px;
      }
      .prov-note a:hover, .prov-inputs a:hover, .prov-refs a:hover,
      .data-colsrc a:hover, .data-el-note-row a:hover, .data-file-card a:hover {
        color: var(--accent-2);
      }
      .prov-refs { list-style: none; margin: 0; padding: 0; font-size: 12px; }
      .prov-refs li { margin: 0 0 8px; line-height: 1.45; }
      .prov-refs a { color: inherit; }
      .prov-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
      .prov-links a, .prov-actions button {
        font-size: 11.5px;
        border: 1px solid var(--border);
        border-radius: 3px;
        padding: 4px 9px;
        background: var(--surface);
        color: var(--text);
        text-decoration: none;
        cursor: pointer;
      }
      .prov-links a:hover, .prov-actions button:hover { border-color: var(--accent); color: var(--accent); }
      .prov-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
      /* ---- Cite-this-result panel ---- */
      .cite-panel__grid { display: grid; gap: 6px; }
      .cite-panel__row { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; }
      .cite-panel__label {
        min-width: 84px;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        font-weight: 600;
      }
      .cite-panel__row code {
        font-family: var(--mono, monospace);
        font-size: 12px;
        word-break: break-all;
        background: var(--surface-subtle);
        border: 1px solid var(--border);
        border-radius: 3px;
        padding: 2px 6px;
      }
      /* ---- Data view ---- */
      .data-colsrc { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }
      .data-controls { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
      .data-controls input {
        font: inherit;
        font-size: 13px;
        padding: 6px 10px;
        border: 1px solid var(--border-2);
        border-radius: 3px;
        background: var(--surface);
        color: var(--text);
        width: 240px;
      }
      .data-elements th[data-sort] { cursor: pointer; user-select: none; }
      .data-elements th[data-sort]:hover { color: var(--accent); }
      .data-elements td:first-child { font-weight: 600; }
      .data-el-note-row td {
        background: var(--surface-subtle);
        font-size: 12px;
        color: var(--text-muted);
        line-height: 1.5;
      }
      .data-el-flag {
        display: inline-block;
        font-size: 10.5px;
        border: 1px solid var(--border-2);
        border-radius: 999px;
        padding: 1px 8px;
        margin: 2px 4px 2px 0;
        color: var(--text-muted);
      }
      .data-el-crossdiff { color: var(--danger); }
      .data-toggle {
        border: none;
        background: none;
        color: var(--text-muted);
        cursor: pointer;
        font-size: 12px;
        padding: 0;
        text-decoration: underline dotted;
      }
      .data-toggle:hover { color: var(--accent); }
      .data-pairlookup { display: flex; align-items: center; gap: 8px; margin: 10px 0 18px; flex-wrap: wrap; }
      .data-pairlookup select {
        font: inherit;
        font-size: 13px;
        padding: 5px 8px;
        border: 1px solid var(--border-2);
        border-radius: 3px;
        background: var(--surface);
        color: var(--text);
      }
      .data-pairlookup code {
        font-family: var(--mono, monospace);
        font-size: 12.5px;
        background: var(--surface-subtle);
        border: 1px solid var(--border);
        border-radius: 3px;
        padding: 4px 8px;
      }
      .data-file-card {
        border: 1px solid var(--border);
        border-radius: 3px;
        background: var(--surface);
        padding: 10px 14px;
        margin: 0 0 10px;
        font-size: 12.5px;
      }
      .data-file-card code { font-size: 11px; word-break: break-all; color: var(--text-muted); }
      .data-file-card .data-file-name { font-family: var(--mono, monospace); font-weight: 600; }
      .result-card-compact {
        padding: 10px 12px;
        background: var(--surface);
      }
      .result-card-compact h3 {
        font-size: 10.5px;
      }
      .result-card-compact .symbol {
        font-size: 11px;
        margin-bottom: 4px;
      }
      .result-card-compact p {
        font-size: 16px;
        font-weight: 500;
      }
      .result-card-compact .units {
        font-size: 11px;
        margin-top: 2px;
      }
      .result-card-compact .rule-note {
        font-size: 11px;
        line-height: 1.35;
        margin-top: 6px;
        padding-left: 6px;
        border-left: 2px solid var(--danger);
        color: var(--text-muted);
      }
      .result-card h3 {
        margin: 0 0 4px;
        font-size: 11.5px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        font-weight: 600;
      }
      .result-card .symbol {
        font-size: 12px;
        color: var(--text-muted-2);
        margin-bottom: 8px;
        font-style: italic;
      }
      .result-card p {
        margin: 0;
        font-size: 22px;
        font-weight: 600;
        color: var(--text-strong);
        font-variant-numeric: tabular-nums;
      }
      .result-card .units {
        font-size: 12px;
        color: var(--text-muted);
        margin-top: 4px;
      }
      .composition-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
      }
      .composition-cell {
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 10px 12px;
        background: var(--surface);
      }
      .composition-cell .element {
        font-weight: 700;
        color: var(--text-strong);
        margin-bottom: 2px;
        font-size: 14px;
      }
      .composition-cell .fraction {
        font-weight: 500;
        color: var(--text);
        font-size: 14px;
        font-variant-numeric: tabular-nums;
      }
      .warnings {
        margin: 0;
        padding-left: 18px;
        color: var(--accent-2);
        font-family: var(--sans);
        font-size: 13px;
      }
      @media (prefers-color-scheme: dark) {
        :root:not([data-theme="light"]) .warnings { color: var(--accent); }
      }
      :root[data-theme="dark"] .warnings { color: var(--accent); }
      .hidden {
        display: none;
      }
      .table-wrap {
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        overflow-x: auto;
        background: var(--surface);
      }
      /* Long tables below the fold: the browser lays them out only when
         they scroll into view, so opening their tab stays one quick frame. */
      .table-wrap--deferred {
        content-visibility: auto;
        contain-intrinsic-size: auto 1200px;
      }
      table.data {
        width: 100%;
        border-collapse: collapse;
        min-width: 820px;
        font-family: var(--sans);
        font-size: 13px;
      }
      table.data th,
      table.data td {
        padding: 9px 12px;
        border-bottom: 1px solid var(--border);
        text-align: left;
        vertical-align: top;
      }
      table.data td {
        font-variant-numeric: tabular-nums;
      }
      table.data th {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        background: var(--surface-muted);
      }
      table.data tbody tr:hover {
        background: var(--surface-subtle);
      }
      .small-note {
        color: var(--text-muted);
        font-size: 12.5px;
        margin: 8px 0 0;
      }
      .pair-source {
        display: inline-block;
        font-family: var(--sans);
        font-size: 9.5px;
        padding: 1px 6px;
        border: 1px solid var(--border-2);
        border-radius: var(--radius-sm);
        vertical-align: middle;
        margin-left: 6px;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        background: transparent;
        color: var(--text-muted);
      }
      .pair-source-manual {
        border-color: var(--accent);
        color: var(--accent);
      }
      .custom-panel {
        margin-top: 12px;
        padding: 16px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--surface-subtle);
      }
      .custom-panel h3 {
        margin: 0 0 10px;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-strong);
      }
      .custom-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
        margin-bottom: 12px;
      }
      .custom-grid label {
        display: block;
        font-family: var(--sans);
        font-size: 11.5px;
        font-weight: 600;
        color: var(--text-muted);
        margin-bottom: 4px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
      }
      .custom-grid input {
        width: 100%;
        padding: 7px 8px;
        border: 1px solid var(--border-2);
        border-radius: var(--radius-sm);
        background: var(--surface);
        color: var(--text);
        font-family: var(--sans);
        font-size: 13px;
      }
      .custom-grid input:focus {
        outline: none;
      }
      .custom-grid input:focus-visible {
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(139, 58, 47, 0.18);
        outline: none;
      }
      .custom-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        align-items: center;
      }

      /* Scrollbar */
      ::-webkit-scrollbar { width: 10px; height: 10px; }
      ::-webkit-scrollbar-track { background: transparent; }
      ::-webkit-scrollbar-thumb {
        background: var(--border-2);
        border-radius: 0;
      }
      ::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted-2);
      }

      /* ============================================================
         DESKTOP APP SHELL (V2 redesign)
         Layered over the base styles above. Every class the
         calculator's generated content relies on is left intact;
         this only adds the window chrome and re-flows the layout
         into a titlebar / two-pane workspace / status-bar app.
         ============================================================ */
      html, body { height: 100%; }
      body { overflow: hidden; min-height: 0; }

      .app {
        display: flex;
        flex-direction: column;
        height: 100vh;
        background: var(--bg);
      }

      /* --- Title bar -------------------------------------------------- */
      .titlebar {
        flex: 0 0 auto;
        display: flex;
        align-items: stretch;
        max-width: none;
        margin: 0;
        padding: 0 14px;
        height: 46px;
        background: var(--surface);
        border: 0;
        border-bottom: 1px solid var(--border-2);
        text-align: left;
        user-select: none;
        -webkit-user-select: none;
      }
      .titlebar__brand {
        display: flex;
        align-items: baseline;
        gap: 9px;
        padding-right: 20px;
        align-self: center;
      }
      .titlebar__logo {
        font-size: 17px;
        line-height: 1;
        color: var(--accent);
        align-self: center;
      }
      .titlebar__name {
        font-family: var(--sans);
        font-weight: 700;
        font-size: 15px;
        letter-spacing: -0.01em;
        color: var(--text-strong);
      }
      .titlebar__sub {
        font-family: var(--sans);
        font-size: 12px;
        color: var(--text-muted-2);
      }
      .titlebar__tabs {
        display: flex;
        align-items: stretch;
        gap: 2px;
      }
      .tab {
        appearance: none;
        border: 0;
        border-bottom: 2px solid transparent;
        background: transparent;
        padding: 0 15px;
        margin: 0;
        height: 100%;
        font-family: var(--sans);
        font-size: 12.5px;
        font-weight: 600;
        letter-spacing: 0.01em;
        color: var(--text-muted);
        cursor: pointer;
        border-radius: 0;
        white-space: nowrap;
        transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
      }
      .tab:hover { color: var(--text); background: var(--surface-subtle); }
      .tab.is-active {
        color: var(--text-strong);
        border-bottom-color: var(--accent);
      }
      .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
      .titlebar__meta {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 14px;
        font-family: var(--mono);
        font-size: 11px;
        color: var(--text-muted-2);
        letter-spacing: 0.02em;
      }
      @media (max-width: 760px) {
        .titlebar__sub { display: none; }
        .tab { padding: 0 11px; }
      }

      /* --- View area (one view visible at a time) -------------------- */
      .views {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
      }
      .view { display: none; height: 100%; overflow: auto; }
      .view.view--active { display: block; }
      .view[data-view-panel="calc"] { overflow: hidden; }
      .view[data-view-panel="calc"].view--active { display: flex; }
      .view[data-view-panel="theory"] > .theory-section,
      .view[data-view-panel="reference"] > .background-section,
      .view[data-view-panel="refs"] > .theory-section {
        padding-top: 30px;
      }

      /* --- Two-pane workspace ---------------------------------------- */
      .workspace {
        flex: 1 1 auto;
        display: flex;
        min-width: 0;
        width: 100%;
      }
      .rail {
        flex: 0 0 clamp(360px, 33%, 470px);
        min-width: 0;
        overflow: auto;
        padding: 14px;
        background: var(--surface-subtle);
        border-right: 1px solid var(--border-2);
      }
      .results-area {
        flex: 1 1 auto;
        min-width: 0;
        overflow: auto;
        padding: 14px 16px;
      }

      /* --- Density tweaks for the working surface -------------------- */
      .app .panel {
        margin-bottom: 12px;
        padding: 14px 16px;
        border-radius: var(--radius-md);
      }
      .rail .panel { background: var(--surface); }
      .rail .panel:last-child { margin-bottom: 0; }
      .app .panel > h2 { font-size: 11.5px; }
      .rail .row { gap: 8px 10px; margin-bottom: 10px; }
      .rail .ratio-table { overflow-x: auto; }
      .results-area .results { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 8px; }
      .results-area .result-card { padding: 10px 12px; background: var(--surface); }
      .results-area .result-card p { font-size: 19px; }
      .results-area .composition-card { background: var(--surface-subtle); }

      /* --- Status bar ------------------------------------------------- */
      .statusbar {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 9px;
        height: 26px;
        max-width: none;
        margin: 0;
        padding: 0 14px;
        background: var(--surface-muted);
        border: 0;
        border-top: 1px solid var(--border-2);
        font-family: var(--sans);
        font-size: 11px;
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
      }
      .statusbar .sb-spacer { margin-left: auto; }
      .statusbar .sb-sep { color: var(--text-muted-2); }

      /* ============================================================
         DOCUMENTATION VIEWS: Theory (docs) + Equations (reference).
         Styled to read like an app's built-in docs viewer, not an
         academic article: sans body, sticky section nav, admonition
         callouts, code-like equation blocks, a filterable card grid.
         ============================================================ */

      /* ---- Theory: two-pane documentation layout ---- */
      .docs {
        display: grid;
        grid-template-columns: 234px minmax(0, 752px);
        gap: 0 48px;
        max-width: 1080px;
        margin: 0 auto;
        padding: 30px 28px 80px;
        align-items: start;
        line-height: 1.6;
      }
      @media (max-width: 920px) {
        .docs { grid-template-columns: minmax(0, 1fr); }
        .docs-nav { display: none; }
      }
      .docs-nav {
        position: sticky;
        top: 22px;
        align-self: start;
        border-left: 1px solid var(--border);
        max-height: calc(100vh - 120px);
        overflow: auto;
      }
      .docs-nav__title {
        font-family: var(--sans);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.13em;
        color: var(--text-muted-2);
        padding: 0 0 12px 16px;
      }
      .docs-nav__list {
        margin: 0;
        padding: 0;
        list-style: none;
        counter-reset: docnav;
      }
      .docs-nav__list li { counter-increment: docnav; margin: 0; }
      .docs-nav__list a {
        display: block;
        position: relative;
        margin-left: -1px;
        padding: 5px 10px 5px 16px;
        border-left: 2px solid transparent;
        font-family: var(--sans);
        font-size: 12.5px;
        line-height: 1.35;
        color: var(--text-muted);
        text-decoration: none;
        transition: color 0.1s ease, border-color 0.1s ease;
      }
      .docs-nav__list a::before {
        content: counter(docnav, decimal-leading-zero);
        font-family: var(--mono);
        font-size: 10px;
        color: var(--text-muted-2);
        margin-right: 8px;
      }
      .docs-nav__list a:hover { color: var(--text); }
      .docs-nav__list a.is-active {
        color: var(--accent);
        border-left-color: var(--accent);
        font-weight: 600;
      }
      .docs-nav__list a.is-active::before { color: var(--accent); }

      .docs-main { min-width: 0; }
      .docs .theory-eyebrow { margin-top: 2px; }
      .docs .theory-title { font-size: 25px; margin-bottom: 10px; }
      .docs .theory-lede {
        font-family: var(--sans);
        font-style: normal;
        font-size: 15px;
        color: var(--text-muted);
        line-height: 1.6;
        margin-bottom: 8px;
        padding-bottom: 22px;
        max-width: 70ch;
      }
      .docs p,
      .docs ul,
      .docs ol.body-list,
      .docs li { font-family: var(--sans); }
      .docs p { font-size: 14.5px; line-height: 1.7; max-width: 70ch; }
      .docs ul, .docs ol.body-list { font-size: 14.5px; line-height: 1.65; max-width: 68ch; }
      .docs h3 {
        display: flex;
        align-items: baseline;
        gap: 12px;
        font-size: 17px;
        margin: 40px 0 14px;
        padding-bottom: 8px;
      }
      .docs h3 .sec-num {
        flex: 0 0 auto;
        font-family: var(--mono);
        font-size: 10.5px;
        font-weight: 700;
        color: #fff;
        background: var(--accent);
        padding: 2px 7px;
        border-radius: 3px;
        margin: 0;
        letter-spacing: 0;
      }
      .docs h4 { font-size: 11.5px; margin-top: 20px; }
      .docs .display-eq {
        background: var(--surface-subtle);
        border: 1px solid var(--border);
        border-left: 2px solid var(--accent);
        border-radius: var(--radius-sm);
        padding: 10px 18px;
        margin: 16px 0 18px;
      }
      .docs .callout {
        margin: 18px 0;
        border: 1px solid var(--border);
        border-left: 3px solid var(--text-muted-2);
        border-radius: var(--radius-sm);
        background: var(--surface-subtle);
        padding: 12px 16px;
      }
      .docs .callout.warning { border-left-color: var(--accent); }
      .docs .callout.note { border-left-color: var(--text-muted-2); }
      .docs .callout p { font-family: var(--sans); font-size: 13.5px; margin: 0; }
      .docs .param-table { font-size: 13px; max-width: none; }

      /* ---- References: grouped bibliography ---- */
      .docs .ref-list {
        list-style: none;
        margin: 0 0 6px;
        padding: 0;
        max-width: none;
      }
      .docs .ref-list li {
        font-family: var(--sans);
        font-size: 13.5px;
        line-height: 1.6;
        color: var(--text);
        padding: 11px 0 11px 20px;
        text-indent: -20px;
        border-bottom: 1px solid var(--border);
      }
      .docs .ref-list li:last-child { border-bottom: 0; }
      .docs .ref-list li em { color: var(--text); }
      .docs .ref-list li a {
        display: block;
        text-indent: 0;
        margin-top: 3px;
        font-family: var(--mono);
        font-size: 11px;
        color: var(--text-muted);
        text-decoration: none;
        word-break: break-all;
      }
      .docs .ref-list li a:hover { color: var(--accent); }

      /* ---- References: about / legal block ---- */
      .docs .legal {
        font-size: 12.5px;
        color: var(--text-muted);
        line-height: 1.7;
        max-width: 70ch;
      }
      .docs .legal p { font-size: 12.5px; color: var(--text-muted); margin: 0 0 10px; }
      .docs .legal a { color: var(--text-muted); text-decoration: underline; }
      .docs .legal a:hover { color: var(--accent); }
      .docs .legal code { font-size: 11px; }
      .docs .legal .legal-label {
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.07em;
        color: var(--text);
      }
      .docs .legal details { margin: 0; }
      .docs .legal summary { cursor: pointer; color: var(--text-muted); text-decoration: underline; }
      .docs .legal .legal-details { margin-top: 8px; }

      /* ---- Equations: filterable reference grid ---- */
      .background-section {
        max-width: 1040px;
        margin: 0 auto;
        padding: 30px 28px 80px;
      }
      .eq-toolbar {
        display: flex;
        align-items: flex-end;
        gap: 16px;
        flex-wrap: wrap;
        margin-bottom: 18px;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--border);
      }
      .eq-toolbar .bg-title { margin-bottom: 4px; }
      .eq-toolbar__sub {
        margin: 0;
        font-family: var(--sans);
        font-size: 12.5px;
        color: var(--text-muted);
      }
      .eq-search {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 6px;
        position: relative;
      }
      .eq-search__icon {
        position: absolute;
        left: 9px;
        font-size: 14px;
        color: var(--text-muted-2);
        pointer-events: none;
      }
      .eq-search input {
        width: 250px;
        max-width: 52vw;
        padding: 7px 10px 7px 28px;
        border: 1px solid var(--border-2);
        border-radius: var(--radius-sm);
        background: var(--surface);
        color: var(--text);
        font-family: var(--sans);
        font-size: 13px;
      }
      .eq-search input:focus { outline: none; }
      .eq-search input:focus-visible {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(139, 58, 47, 0.18);
      }
      .eq-grid { border-radius: var(--radius-sm); overflow: hidden; }
      .eq-card { transition: background-color 0.1s ease; }
      .eq-card:hover { background: var(--surface-subtle); }
      .eq-card.eq-hidden { display: none; }

      /* ---- Equations: docs-style header + grouped sections ---- */
      .background-section .theory-eyebrow {
        font-family: var(--sans);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: var(--text-muted);
        margin: 2px 0 4px;
      }
      .background-section .theory-title {
        font-family: var(--sans);
        font-size: 25px;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: var(--text-strong);
        margin: 0 0 6px;
        line-height: 1.2;
      }
      .eq-group { margin-bottom: 34px; }
      .eq-group.eq-hidden { display: none; }
      .eq-group-title {
        display: flex;
        align-items: baseline;
        gap: 12px;
        font-family: var(--sans);
        font-size: 17px;
        font-weight: 700;
        color: var(--text-strong);
        margin: 0 0 12px;
      }
      .eq-group-title .sec-num {
        flex: 0 0 auto;
        font-family: var(--mono);
        font-size: 10.5px;
        font-weight: 700;
        color: #fff;
        background: var(--accent);
        padding: 2px 7px;
        border-radius: 3px;
        letter-spacing: 0;
      }
      .eq-empty { border: 1px solid var(--border); border-radius: var(--radius-sm); }
      .eq-empty {
        grid-column: 1 / -1;
        padding: 28px 16px;
        text-align: center;
        color: var(--text-muted-2);
        font-family: var(--sans);
        font-size: 13px;
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
      }

      /* ============================================================
         CALM PASS: fewer nested boxes, quieter secondary actions,
         a real empty state, and a draggable rail divider.
         ============================================================ */

      /* ---- Rail: one cohesive input column, not a stack of cards ---- */
      .rail { border-right: 0; padding-top: 6px; }
      .rail .panel {
        background: transparent;
        border: 0;
        border-radius: 0;
        margin: 0;
        padding: 16px 0;
        border-top: 1px solid var(--border);
      }
      .rail > .panel:first-child { border-top: 0; padding-top: 4px; }
      .rail .panel > h2 {
        border-bottom: 0;
        padding-bottom: 0;
        margin-bottom: 10px;
      }
      /* de-emphasize secondary actions so the primary Calculate leads */
      .rail button.ghost {
        border-color: transparent;
        color: var(--text-muted);
        padding-left: 10px;
        padding-right: 10px;
      }
      .rail button.ghost:hover {
        border-color: var(--border-2);
        color: var(--accent);
        background: var(--surface);
      }

      /* ---- Results: flatter tiles, fewer hairlines ---- */
      .results-area .result-card,
      .results-area .result-card-compact {
        border: 0;
        background: var(--surface-subtle);
      }
      .results-area .panel-secondary .result-card-compact { background: var(--surface); }
      .results-area .composition-card { background: var(--surface-muted); }
      .results-area .composition-cell { border: 0; background: var(--surface); }
      /* hide the Warnings panel until there is something to warn about */
      .results-area .panel:has(> #warnings:empty) { display: none; }

      /* ---- Alloys / Oxides mode switch ---- */
      .mode-switch {
        display: flex;
        gap: 4px;
        padding: 4px;
        background: var(--surface-muted);
        border: 1px solid var(--border-2);
        border-radius: 10px;
      }
      .mode-btn {
        flex: 1;
        padding: 7px 10px;
        border: 0;
        background: transparent;
        color: var(--text-muted);
        font-family: var(--sans);
        font-size: 13px;
        font-weight: 600;
        border-radius: 7px;
        cursor: pointer;
      }
      .mode-btn:hover { color: var(--text); }
      .mode-btn.is-active {
        background: var(--surface);
        color: var(--text);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
      }
      body:not(.mode-oxide) .mode-oxide { display: none !important; }
      body.mode-oxide .mode-alloy { display: none !important; }
      #oxide-results:empty + .results-empty { display: flex; }
      .results-area #oxide-results-panel:has(#oxide-results:empty) .actions { display: none; }

      /* ---- Titlebar utility buttons (theme, what's new) ---- */
      .titlebar__btn {
        border: 1px solid transparent;
        background: transparent;
        color: inherit;
        font: inherit;
        cursor: pointer;
        padding: 3px 8px;
        border-radius: 6px;
        line-height: 1.2;
      }
      .titlebar__btn:hover {
        border-color: var(--border-2);
        background: var(--surface-muted);
      }

      /* ---- What's-new popover ---- */
      .about-popover {
        position: absolute;
        top: 52px;
        right: 18px;
        z-index: 60;
        width: min(440px, calc(100vw - 36px));
        max-height: 60vh;
        overflow-y: auto;
        background: var(--surface);
        border: 1px solid var(--border-2);
        border-radius: var(--radius-lg);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
        padding: 14px 16px;
        font-family: var(--sans);
        font-size: 13px;
      }
      .about-popover h3 {
        margin: 0 0 8px;
        font-size: 14px;
        color: var(--text-strong);
      }
      .about-popover .about-entry {
        padding: 8px 0;
        border-top: 1px solid var(--border);
      }
      .about-popover .about-entry:first-of-type { border-top: 0; }
      .about-popover .about-version {
        font-family: var(--mono);
        font-size: 12px;
        color: var(--accent);
        margin-right: 8px;
      }
      .about-popover .about-date {
        color: var(--text-muted-2);
        font-size: 12px;
      }
      .about-popover .about-notes {
        margin: 4px 0 0;
        color: var(--text-muted);
        line-height: 1.5;
      }

      /* ---- Click-to-copy result cards ---- */
      .results .result-card:not(.composition-card),
      .results-compact .result-card {
        cursor: copy;
        position: relative;
      }
      .result-card.copied::after {
        content: "copied";
        position: absolute;
        bottom: 7px;
        left: 9px;
        font-family: var(--mono);
        font-size: 10px;
        letter-spacing: 0.05em;
        color: var(--accent);
        background: var(--surface);
        padding: 1px 5px;
        border: 1px solid var(--accent);
        border-radius: 3px;
      }

      /* ---- Welcome empty-state quick actions ---- */
      .results-empty__actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        margin: 4px 0 10px;
      }

      /* ---- Empty state (before the first calculation) ---- */
      .results-empty {
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 5px;
        padding: 40px 24px 44px;
        color: var(--text-muted);
      }
      #results:empty + .results-empty { display: flex; }
      .results-empty__mark {
        font-size: 34px;
        line-height: 1;
        color: var(--border-2);
        margin-bottom: 6px;
      }
      .results-empty__title {
        margin: 0;
        font-family: var(--sans);
        font-size: 15px;
        font-weight: 600;
        color: var(--text);
      }
      .results-empty__hint {
        margin: 0 0 10px;
        font-family: var(--sans);
        font-size: 13px;
        line-height: 1.5;
        max-width: 44ch;
      }
      .results-empty kbd {
        font-family: var(--mono);
        font-size: 11px;
        background: var(--surface-muted);
        border: 1px solid var(--border-2);
        border-bottom-width: 2px;
        border-radius: 3px;
        padding: 1px 5px;
        color: var(--text);
      }

      /* ---- Draggable rail divider ---- */
      .rail-resizer {
        flex: 0 0 6px;
        align-self: stretch;
        position: relative;
        z-index: 2;
        cursor: col-resize;
        background: transparent;
        touch-action: none;
      }
      .rail-resizer::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 1px;
        margin-left: -0.5px;
        background: var(--border-2);
        transition: background-color 0.12s ease, width 0.12s ease;
      }
      .rail-resizer:hover::before,
      .rail-resizer:focus-visible::before,
      body.is-resizing .rail-resizer::before {
        background: var(--accent);
        width: 2px;
        margin-left: -1px;
      }
      .rail-resizer:focus-visible { outline: none; }
      body.is-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
