    :root {
      color-scheme: dark;
      --bg: #081018;
      --panel: #101b25;
      --panel-2: #152431;
      --line: #29404f;
      --text: #eaf2f6;
      --muted: #8ca4b3;
      --cyan: #31d5c8;
      --blue: #52a8ff;
      --amber: #ffbd59;
      --red: #ff6b78;
      --green: #64e39a;
      --shadow: 0 18px 50px rgba(0, 0, 0, .28);
      --radius: 18px;
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      min-width: 320px;
      background:
        radial-gradient(circle at 15% -10%, rgba(49, 213, 200, .14), transparent 28rem),
        radial-gradient(circle at 100% 20%, rgba(82, 168, 255, .10), transparent 32rem),
        var(--bg);
      color: var(--text);
      font-family: Inter, "Segoe UI", Arial, sans-serif;
      line-height: 1.45;
    }

    button, input, select { font: inherit; }
    button { cursor: pointer; }
    button:focus-visible, input:focus-visible, select:focus-visible {
      outline: 3px solid rgba(49, 213, 200, .38);
      outline-offset: 2px;
    }

    .app-shell { width: min(1720px, 100%); margin: auto; padding: 22px; }
    .public-nav {
      width: min(1720px, 100%);
      margin: 0 auto;
      padding: 12px 22px 0;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
    }
    .public-nav a {
      padding: 7px 10px;
      border-radius: 999px;
      color: var(--muted);
      font-size: .78rem;
      font-weight: 750;
      text-decoration: none;
    }
    .public-nav a:hover, .public-nav a:focus-visible { color: var(--text); background: rgba(49, 213, 200, .08); }
    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      margin-bottom: 18px;
    }
    .brand { display: flex; align-items: center; gap: 14px; }
    .brand-mark {
      width: 48px;
      height: 48px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(49, 213, 200, .5);
      border-radius: 14px;
      background: linear-gradient(145deg, rgba(49, 213, 200, .18), rgba(82, 168, 255, .08));
      color: var(--cyan);
      font-weight: 900;
      letter-spacing: -.08em;
      box-shadow: inset 0 0 28px rgba(49, 213, 200, .08);
    }
    h1 { margin: 0; font-size: clamp(1.25rem, 2.5vw, 2rem); letter-spacing: -.035em; }
    .subtitle { margin: 3px 0 0; color: var(--muted); font-size: .92rem; }
    .privacy-badge {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 9px 12px;
      border: 1px solid rgba(100, 227, 154, .4);
      border-radius: 999px;
      background: rgba(100, 227, 154, .08);
      color: var(--green);
      font-size: .78rem;
      font-weight: 800;
      letter-spacing: .08em;
      white-space: nowrap;
    }
    .privacy-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }

    .layout {
      display: grid;
      grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
      gap: 18px;
      align-items: start;
    }
    .panel {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: linear-gradient(155deg, rgba(21, 36, 49, .92), rgba(12, 22, 31, .96));
      box-shadow: var(--shadow);
    }
    .controls { position: sticky; top: 16px; overflow: hidden; }
    .panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 16px 18px;
      border-bottom: 1px solid var(--line);
    }
    .panel-head h2, .panel-head h3 { margin: 0; font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; }
    .step-number { color: var(--cyan); font-variant-numeric: tabular-nums; }

    .topology-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      padding: 14px;
    }
    .topology-card {
      min-height: 72px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(8, 16, 24, .45);
      color: var(--text);
      text-align: left;
      transition: border-color .16s, transform .16s, background .16s;
    }
    .topology-card:hover { transform: translateY(-1px); border-color: #486579; }
    .topology-card.active {
      border-color: var(--cyan);
      background: rgba(49, 213, 200, .10);
      box-shadow: inset 0 0 0 1px rgba(49, 213, 200, .15);
    }
    .topology-code { display: block; color: var(--cyan); font-size: .68rem; font-weight: 900; letter-spacing: .09em; }
    .topology-name { display: block; margin-top: 4px; font-size: .83rem; font-weight: 750; }

    .preset-box {
      margin: 0 14px 12px;
      padding: 11px;
      border: 1px solid rgba(82, 168, 255, .32);
      border-radius: 12px;
      background: rgba(82, 168, 255, .06);
    }
    .preset-box label { display: block; color: var(--blue); font-size: .68rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
    .preset-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 7px; }
    .preset-row select { min-height: 38px; }
    .preset-row button {
      min-height: 38px;
      padding: 0 12px;
      border: 1px solid rgba(82, 168, 255, .65);
      border-radius: 9px;
      background: rgba(82, 168, 255, .14);
      color: #b9dcff;
      font-weight: 850;
    }
    .preset-note { display: block; margin-top: 7px; color: var(--muted); font-size: .67rem; line-height: 1.45; }

    .mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 14px 14px; }
    label.select-label { color: var(--muted); font-size: .72rem; font-weight: 700; }
    select, input {
      width: 100%;
      margin-top: 5px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #09131c;
      color: var(--text);
    }
    select { height: 39px; padding: 0 9px; }
    input { height: 36px; padding: 0 9px; font-variant-numeric: tabular-nums; }
    input.invalid { border-color: var(--red); background: rgba(255, 107, 120, .07); }

    .input-tabs { display: flex; gap: 5px; padding: 0 14px 10px; overflow-x: auto; }
    .input-tab {
      padding: 7px 10px;
      border: 1px solid var(--line);
      border-radius: 9px;
      background: transparent;
      color: var(--muted);
      font-size: .72rem;
      font-weight: 750;
      white-space: nowrap;
    }
    .input-tab.active { background: var(--panel-2); color: var(--cyan); border-color: #3d6672; }
    .fields {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      max-height: 340px;
      padding: 2px 14px 15px;
      overflow: auto;
      scrollbar-color: #3b5362 transparent;
    }
    .field label { display: block; color: var(--muted); font-size: .71rem; font-weight: 650; }
    .unit { color: #5f7c8d; font-size: .66rem; font-weight: 500; }
    .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 14px; border-top: 1px solid var(--line); }
    .wide-action { grid-column: 1 / -1; }
    .primary, .secondary, .ghost {
      min-height: 42px;
      border-radius: 11px;
      font-weight: 800;
    }
    .primary { border: 0; background: linear-gradient(135deg, var(--cyan), #34a7ed); color: #041018; }
    .secondary { border: 1px solid #3c6673; background: rgba(49, 213, 200, .07); color: var(--cyan); }
    .ghost { border: 1px solid var(--line); background: transparent; color: var(--muted); }

    .workspace { display: grid; gap: 16px; min-width: 0; }
    .hero {
      display: grid;
      grid-template-columns: 1.2fr .8fr;
      gap: 16px;
      padding: 20px;
      overflow: hidden;
    }
    .eyebrow { color: var(--cyan); font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
    .hero h2 { margin: 7px 0 9px; font-size: clamp(1.35rem, 3vw, 2.15rem); letter-spacing: -.035em; }
    .hero p { margin: 0; color: var(--muted); max-width: 70ch; }
    .hero-state {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 9px;
      align-content: center;
    }
    .state-tile { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(4, 12, 18, .35); }
    .state-tile span { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; }
    .state-tile strong { display: block; margin-top: 3px; font-size: 1rem; font-variant-numeric: tabular-nums; }

    .schematic-panel { overflow: hidden; }
    .schematic-body { display: grid; gap: 12px; padding: 12px 14px 15px; }
    .schematic-canvas-wrap {
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 12px;
      background:
        linear-gradient(rgba(49, 213, 200, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(49, 213, 200, .025) 1px, transparent 1px),
        #050b10;
      background-size: 24px 24px;
    }
    #schematicCanvas { height: 340px; border-radius: 0; background: transparent; }
    .schematic-legend {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
      gap: 8px;
    }
    .schematic-key {
      display: grid;
      grid-template-columns: 48px minmax(0, 1fr);
      align-items: start;
      gap: 9px;
      min-width: 0;
      padding: 9px 10px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: rgba(8, 16, 24, .48);
      color: var(--text);
      text-align: left;
    }
    .schematic-key:hover, .schematic-key.active { border-color: var(--cyan); background: rgba(49, 213, 200, .075); }
    .device-ref {
      display: grid;
      place-items: center;
      min-height: 31px;
      padding: 3px 5px;
      border: 1px solid rgba(49, 213, 200, .55);
      border-radius: 8px;
      color: var(--cyan);
      background: rgba(49, 213, 200, .08);
      font-size: .68rem;
      font-weight: 900;
      letter-spacing: .04em;
    }
    .schematic-key strong { display: block; overflow-wrap: anywhere; font-size: .74rem; }
    .schematic-key small { display: block; margin-top: 2px; color: var(--muted); font-size: .62rem; line-height: 1.35; }
    .schematic-key .device-result { color: var(--amber); font-variant-numeric: tabular-nums; }
    .schematic-parts { display: flex; flex-wrap: wrap; gap: 6px; }
    .schematic-part {
      padding: 5px 8px;
      border: 1px solid rgba(41, 64, 79, .8);
      border-radius: 999px;
      color: #7895a6;
      background: rgba(4, 12, 18, .25);
      font-size: .61rem;
    }
    .schematic-note { display: flex; justify-content: space-between; gap: 14px; color: #668090; font-size: .65rem; }
    tr.device-row-highlight td { background: rgba(255, 189, 89, .13) !important; box-shadow: inset 0 1px rgba(255, 189, 89, .3), inset 0 -1px rgba(255, 189, 89, .3); }

    .metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
    .metric {
      min-width: 0;
      padding: 15px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: linear-gradient(150deg, rgba(21, 36, 49, .88), rgba(12, 22, 31, .94));
    }
    .metric-label { color: var(--muted); font-size: .7rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
    .metric-value { display: block; margin-top: 8px; font-size: clamp(1.15rem, 2.3vw, 1.65rem); font-weight: 850; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
    .metric-note { display: block; margin-top: 3px; color: #648091; font-size: .68rem; }
    .metric-value.good { color: var(--green); }
    .metric-value.warn { color: var(--amber); }
    .metric-value.bad { color: var(--red); }

    .result-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 16px; }
    .table-panel, .loss-panel, .scope-panel { overflow: hidden; }
    .table-wrap { overflow: auto; max-height: 355px; }
    table { width: 100%; border-collapse: collapse; font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
    th { position: sticky; top: 0; z-index: 1; padding: 10px 9px; background: #152431; color: #91a9b7; text-align: right; font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; }
    th:first-child, td:first-child { text-align: left; }
    td { padding: 10px 9px; border-top: 1px solid rgba(41, 64, 79, .65); text-align: right; }
    tr:hover td { background: rgba(49, 213, 200, .035); }
    .status-pill { display: inline-block; padding: 3px 7px; border-radius: 99px; font-size: .62rem; font-weight: 900; }
    .status-safe { background: rgba(100, 227, 154, .1); color: var(--green); }
    .status-review { background: rgba(255, 189, 89, .1); color: var(--amber); }
    .status-over { background: rgba(255, 107, 120, .12); color: var(--red); }

    .loss-list { display: grid; gap: 12px; padding: 15px 18px 18px; }
    .loss-row { display: grid; grid-template-columns: 108px minmax(0, 1fr) 64px; align-items: center; gap: 10px; font-size: .72rem; }
    .loss-bar { height: 8px; overflow: hidden; border-radius: 9px; background: #08131c; }
    .loss-bar > span { display: block; height: 100%; min-width: 2px; border-radius: inherit; }
    .loss-value { text-align: right; font-variant-numeric: tabular-nums; color: #bdd0d9; }
    .system-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 18px 18px; }
    .detail { padding: 9px 10px; border: 1px solid rgba(41, 64, 79, .7); border-radius: 9px; }
    .detail span { display: block; color: var(--muted); font-size: .62rem; text-transform: uppercase; }
    .detail strong { display: block; margin-top: 2px; font-size: .82rem; font-variant-numeric: tabular-nums; }

    .scope-toolbar { display: flex; align-items: center; gap: 7px; }
    .scope-tab { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: .68rem; font-weight: 800; }
    .scope-tab.active { color: var(--cyan); border-color: var(--cyan); background: rgba(49, 213, 200, .08); }
    .scope-wrap { padding: 10px 12px 14px; background: #050b10; }
    canvas { display: block; width: 100%; height: 420px; border-radius: 10px; background: #050b10; }
    .scope-note { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: #668090; font-size: .66rem; }

    .footer {
      display: flex;
      justify-content: space-between;
      gap: 18px;
      padding: 14px 4px 2px;
      color: #647d8c;
      font-size: .68rem;
    }

    dialog {
      width: min(1000px, calc(100vw - 24px));
      max-height: calc(100vh - 24px);
      padding: 0;
      overflow: hidden;
      border: 1px solid #3a5869;
      border-radius: 18px;
      background: #f7fafb;
      color: #152a38;
      box-shadow: 0 30px 100px rgba(0, 0, 0, .6);
    }
    dialog::backdrop { background: rgba(1, 7, 11, .78); backdrop-filter: blur(5px); }
    .dialog-head { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px; background: #eaf1f4; border-bottom: 1px solid #cbd9df; }
    .dialog-head h2 { margin: 0; font-size: 1rem; }
    .close-button { width: 36px; height: 36px; border: 1px solid #b6c8d0; border-radius: 10px; background: white; color: #29404f; font-weight: 900; }
    .math-pages { max-height: calc(100vh - 90px); padding: 20px; overflow: auto; }
    .math-section { margin-bottom: 24px; }
    .math-section h3 { margin: 0 0 12px; color: #294d63; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
    .equation-card { margin: 9px 0; padding: 15px 17px; border-left: 4px solid #4d8097; border-radius: 5px 12px 12px 5px; background: white; box-shadow: 0 5px 18px rgba(31, 60, 75, .07); }
    .equation-label { margin-bottom: 8px; color: #607b8a; font-size: .67rem; font-family: "Segoe UI", Arial, sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
    .equation {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: .24em;
      min-height: 42px;
      color: #132c3a;
      font-family: Cambria, "Times New Roman", serif;
      font-size: clamp(1.02rem, 2.3vw, 1.32rem);
      font-style: italic;
      line-height: 1.9;
    }
    .equation.result { color: #087a5c; font-weight: 700; }
    .equation.final { color: #a0202c; font-size: clamp(1.15rem, 2.6vw, 1.5rem); font-weight: 800; }
    .calculation-steps { display: grid; gap: 9px; }
    .calculation-step { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: start; gap: 10px; }
    .step-label { padding-top: .42em; color: #718894; font-family: "Segoe UI", Arial, sans-serif; font-size: .62rem; font-style: normal; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
    .calculation-step.substitute { padding-top: 8px; border-top: 1px dashed #d5e0e5; }
    .calculation-step.answer { padding: 9px 10px; border-radius: 8px; background: #edf8f4; }
    .calculation-step.answer .step-label { color: #087a5c; }
    .calculation-step.answer .equation { color: #087a5c; font-weight: 800; }
    .roman { font-style: normal; }
    .frac { display: inline-grid; grid-template-rows: auto auto; vertical-align: middle; text-align: center; line-height: 1.2; margin: 0 .15em; }
    .frac > span:first-child { padding: 0 .22em .1em; border-bottom: 1.5px solid currentColor; }
    .frac > span:last-child { padding: .1em .22em 0; }
    .sqrt { display: inline-flex; align-items: stretch; }
    .sqrt-sign { font-size: 1.6em; line-height: 1; }
    .radicand { border-top: 1.5px solid currentColor; padding: .05em .15em 0 .05em; }
    .math-note { margin: 8px 0 0; color: #667e8b; font-size: .75rem; }
    .engineering-body { max-height: calc(100vh - 90px); padding: 16px; overflow: auto; }
    .engineering-tabs { display: flex; gap: 7px; margin-bottom: 14px; overflow-x: auto; }
    .engineering-tab {
      padding: 8px 12px;
      border: 1px solid #b8cbd3;
      border-radius: 9px;
      background: white;
      color: #54707e;
      font-size: .73rem;
      font-weight: 800;
      white-space: nowrap;
    }
    .engineering-tab.active { border-color: #168e88; background: #e1f6f3; color: #08756f; }
    .engineering-page { display: none; }
    .engineering-page.active { display: block; }
    .engineering-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
    .engineering-card { padding: 14px; border: 1px solid #cbd9df; border-radius: 12px; background: white; color: #183342; }
    .engineering-card h3 { margin: 0 0 10px; color: #294d63; font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; }
    .engineering-card dl { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 0; font-size: .73rem; }
    .engineering-card dt { color: #617a87; }
    .engineering-card dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
    .check-pass { color: #087a5c; }
    .check-review { color: #b96f0c; }
    .analysis-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 12px; padding: 12px; border: 1px solid #cbd9df; border-radius: 12px; background: white; }
    .analysis-controls label { min-width: 120px; color: #58727f; font-size: .7rem; font-weight: 750; }
    .analysis-controls input, .analysis-controls select, textarea {
      margin-top: 5px;
      border: 1px solid #b9cbd3;
      background: #f8fbfc;
      color: #183342;
    }
    .analysis-controls button { min-height: 37px; padding: 0 14px; border: 0; border-radius: 9px; background: #168e88; color: white; font-weight: 800; }
    .analysis-result { margin: 10px 0; padding: 12px; border-left: 4px solid #168e88; border-radius: 6px 11px 11px 6px; background: white; color: #294d63; font-size: .77rem; line-height: 1.7; }
    .analysis-canvas { width: 100%; height: 340px; border: 1px solid #cbd9df; background: #f9fcfd; }
    textarea { width: 100%; min-height: 130px; padding: 10px; border-radius: 10px; resize: vertical; font: .76rem Consolas, monospace; }
    .compare-table { background: white; color: #183342; }
    .compare-table th { position: static; background: #eaf1f4; color: #496572; }
    .compare-table td { border-color: #d9e4e8; }
    .cllc-panel[hidden] { display: none; }
    .tank-body { display: grid; gap: 14px; padding: 15px 18px 18px; }
    .tank-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
    .tank-metric { padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(4, 12, 18, .38); }
    .tank-metric span { display: block; color: var(--muted); font-size: .63rem; text-transform: uppercase; letter-spacing: .06em; }
    .tank-metric strong { display: block; margin-top: 4px; color: var(--cyan); font-size: .93rem; font-variant-numeric: tabular-nums; }
    .tank-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
    .tank-check { padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(8, 16, 24, .45); }
    .tank-check span { display: block; color: var(--muted); font-size: .62rem; text-transform: uppercase; }
    .tank-check strong { display: block; margin-top: 3px; font-size: .79rem; }
    #cllcGainCanvas { height: 370px; border: 1px solid var(--line); background: #050b10; }
    .tank-note { color: #668090; font-size: .68rem; }
    .print-report { display: none; }
    .print-report-title { margin: 0 0 6px; color: #163447; font-size: 1.55rem; }
    .print-report-subtitle { margin: 0 0 18px; color: #587180; font-size: .82rem; }
    .print-section-title { margin: 24px 0 12px; padding-bottom: 7px; border-bottom: 2px solid #9fb8c4; color: #294d63; font-size: 1rem; }
    .print-report-section { margin: 0; }
    .print-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border: 1px solid #c7d4da; }
    .print-facts > div { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 10px; padding: 8px 10px; border-bottom: 1px solid #d9e3e7; }
    .print-facts > div:nth-child(odd) { border-right: 1px solid #d9e3e7; }
    .print-facts > div:last-child, .print-facts > div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
    .print-facts dt { color: #526b78; font-size: .7rem; }
    .print-facts dd { margin: 0; color: #183342; font-size: .72rem; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
    .print-table-wrap { overflow: visible; }
    .print-table { width: 100%; border-collapse: collapse; color: #183342; font-size: .65rem; }
    .print-table th, .print-table td { padding: 6px 5px; border: 1px solid #c7d4da; text-align: right; vertical-align: top; }
    .print-table th:first-child, .print-table td:first-child { text-align: left; }
    .print-table th { background: #eaf1f4; color: #375565; }
    .print-report-note { margin: 22px 0 0; padding-top: 10px; border-top: 1px solid #c7d4da; color: #587180; font-size: .68rem; line-height: 1.55; }

    .toast {
      position: fixed;
      right: 20px;
      bottom: 20px;
      z-index: 20;
      max-width: min(380px, calc(100vw - 40px));
      padding: 12px 15px;
      border: 1px solid #3a6170;
      border-radius: 11px;
      background: #122531;
      color: var(--text);
      box-shadow: var(--shadow);
      transform: translateY(120px);
      opacity: 0;
      transition: .2s ease;
      font-size: .78rem;
    }
    .toast.show { transform: translateY(0); opacity: 1; }

    .ad-slot {
      min-height: 86px;
      margin: 0 0 18px;
      padding: 16px;
      display: grid;
      place-items: center;
      border: 1px dashed #355061;
      border-radius: 14px;
      background: rgba(4, 12, 18, .35);
      color: #6f8998;
      text-align: center;
      font-size: .72rem;
      letter-spacing: .06em;
      text-transform: uppercase;
    }
    .ad-slot strong { display: block; margin-bottom: 4px; color: #9cb0bc; font-size: .76rem; }
    .public-content { display: grid; gap: 18px; margin-top: 22px; }
    .content-panel { padding: clamp(20px, 4vw, 36px); }
    .content-eyebrow { color: var(--cyan); font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
    .content-panel h2 { max-width: 24ch; margin: 8px 0 10px; font-size: clamp(1.45rem, 3vw, 2.4rem); letter-spacing: -.04em; }
    .content-panel > p { max-width: 78ch; margin: 0; color: var(--muted); }
    .content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
    .content-card, .topology-summary {
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 13px;
      background: rgba(8, 16, 24, .45);
    }
    .content-card span { color: var(--cyan); font-size: .68rem; font-weight: 900; letter-spacing: .09em; }
    .content-card h3, .topology-summary h3 { margin: 7px 0 7px; font-size: .95rem; }
    .content-card p, .topology-summary p { margin: 0; color: var(--muted); font-size: .8rem; }
    .topology-directory { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
    .topology-summary { min-height: 132px; }
    .topology-summary b { color: var(--amber); font-size: .65rem; letter-spacing: .09em; }
    .reference-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-top: 22px; }
    .reference-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(8, 16, 24, .45); }
    .reference-card header { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
    .reference-card h3 { margin: 0; font-size: .91rem; }
    .reference-status { padding: 4px 7px; border-radius: 999px; font-size: .61rem; font-weight: 900; letter-spacing: .06em; }
    .reference-status.pass { background: rgba(100, 227, 154, .12); color: var(--green); }
    .reference-status.fail { background: rgba(255, 107, 120, .12); color: var(--red); }
    .reference-formula { min-height: 42px; margin: 10px 0; color: #b9dcff; font: .72rem/1.5 Consolas, "Segoe UI", sans-serif; }
    .reference-values { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; margin: 0; font-size: .7rem; }
    .reference-values dt { color: var(--muted); }
    .reference-values dd { margin: 0; color: var(--text); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
    .reference-note { margin-top: 12px; color: var(--muted); font-size: .69rem; }
    .public-footer {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      padding: 18px 2px 4px;
      color: var(--muted);
      font-size: .72rem;
    }
    .public-footer nav { display: flex; flex-wrap: wrap; gap: 12px; }
    .public-footer a { color: var(--muted); }
    .public-footer a:hover, .public-footer a:focus-visible { color: var(--cyan); }

    @media (max-width: 1050px) {
      .layout { grid-template-columns: 1fr; }
      .controls { position: static; }
      .fields { max-height: none; }
      .hero { grid-template-columns: 1fr; }
      .metrics { grid-template-columns: repeat(2, 1fr); }
      .result-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 620px) {
      .app-shell { padding: 12px; }
      .topbar { align-items: flex-start; }
      .privacy-badge { padding: 7px 9px; font-size: .66rem; }
      .topology-grid { grid-template-columns: 1fr 1fr; }
      .fields { grid-template-columns: 1fr; }
      .metrics { grid-template-columns: 1fr 1fr; }
      .metric { padding: 12px; }
      .metric-value { font-size: 1.08rem; }
      .hero-state { grid-template-columns: repeat(2, 1fr); }
      #schematicCanvas { height: 300px; }
      .schematic-legend { grid-template-columns: 1fr; }
      .schematic-note { flex-direction: column; gap: 4px; }
      .footer { flex-direction: column; }
      canvas { height: 360px; }
      .engineering-grid { grid-template-columns: 1fr; }
      .tank-metrics { grid-template-columns: repeat(2, 1fr); }
      .tank-checks { grid-template-columns: 1fr 1fr; }
      .public-nav { justify-content: center; padding: 10px 10px 0; }
      .content-grid, .topology-directory, .reference-grid { grid-template-columns: 1fr; }
      .public-footer { flex-direction: column; }
    }
    @media print {
      @page { size: auto; margin: 12mm; }
      :root { color-scheme: light; }
      html, body { width: auto; min-width: 0; background: white !important; color: #111; }
      body { margin: 0; overflow: visible !important; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.4; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
      body > .skip-link, body > .public-nav, .app-shell > :not(.print-report), body > dialog, body > .toast { display: none !important; }
      .app-shell { width: auto; max-width: none; margin: 0; padding: 0; }
      .print-report { display: block !important; width: auto; max-width: none; margin: 0; padding: 0; color: #152a38; }
      .print-report-title { font-size: 18pt; break-after: avoid; }
      .print-report-subtitle { margin-bottom: 14pt; font-size: 9pt; }
      .print-section-title { margin: 16pt 0 8pt; font-size: 11pt; break-after: avoid; page-break-after: avoid; }
      .print-report-section, .print-facts, .print-table-wrap { max-width: 100%; overflow: visible !important; }
      .print-facts { break-inside: avoid; page-break-inside: avoid; }
      .print-table { table-layout: fixed; font-size: 6.5pt; }
      .print-table th, .print-table td { padding: 4pt 3pt; overflow-wrap: anywhere; }
      .print-table th:first-child, .print-table td:first-child { width: 17%; }
      .print-table tr { break-inside: avoid; page-break-inside: avoid; }
      .print-report .math-pages { max-height: none; padding: 0; overflow: visible !important; }
      .print-report .math-section { break-inside: auto; }
      .print-report .math-section > h3 { break-after: avoid; page-break-after: avoid; }
      .print-report .equation-card, .print-report .engineering-card { break-inside: avoid; page-break-inside: avoid; box-shadow: none; border: 1px solid #c7d4da; }
      .print-report .engineering-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .print-report svg, .print-report canvas, .print-report img { max-width: 100% !important; height: auto !important; break-inside: avoid; page-break-inside: avoid; }
      .print-report a[href]::after { content: none !important; }
      p, li { orphans: 3; widows: 3; }
    }
