/* ==========================================================================
   RF π/T 衰减器 — 样式表
   --------------------------------------------------------------------------
   1. 设计变量
   2. 页面骨架与输入面板
   3. 结果卡片、电路图与推荐表
   4. 响应式布局
   ========================================================================== */
:root {
      --ink: #1e293b;
      --ink-2: #334155;
      --muted: #64748b;
      --muted-2: #94a3b8;
      --line: #e2e8f0;
      --line-strong: #cbd5e1;
      --panel: #ffffff;
      --canvas: #f8fafc;
      --soft: #f1f5f9;
      --accent: #0891b2;
      --accent-deep: #0e7490;
      --accent-soft: #ecfeff;
      --good: #0f766e;
      --warn: #b45309;
      --bad: #b91c1c;
      --radius-lg: 20px;
      --radius-md: 14px;
      --radius-sm: 10px;
      --shadow: 0 20px 45px -32px rgba(15, 23, 42, 0.45), 0 1px 2px rgba(15, 23, 42, 0.04);
      --font-sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
    }

    *,
    *::before,
    *::after {
      box-sizing: border-box;
    }

    [hidden] {
      display: none !important;
    }

    html {
      -webkit-text-size-adjust: 100%;
    }

    body {
      margin: 0;
      min-width: 320px;
      color: var(--ink);
      font-family: var(--font-sans);
      font-size: 15px;
      line-height: 1.55;
      background:
        radial-gradient(900px 520px at 5% -10%, rgba(224, 242, 254, 0.9) 0%, rgba(224, 242, 254, 0) 62%),
        radial-gradient(760px 420px at 100% 2%, rgba(236, 254, 255, 0.9) 0%, rgba(236, 254, 255, 0) 58%),
        var(--canvas);
      background-attachment: fixed;
    }

    button,
    input {
      font: inherit;
    }

    button {
      cursor: pointer;
    }

    h1,
    h2,
    h3,
    p {
      margin: 0;
    }

    .sr-only {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      padding: 0 !important;
      margin: -1px !important;
      overflow: hidden !important;
      clip: rect(0, 0, 0, 0) !important;
      white-space: nowrap !important;
      border: 0 !important;
    }

    .page-shell {
      width: min(1320px, 100%);
      margin: 0 auto;
      padding: 34px 24px 52px;
    }

    /* ---------- Masthead ---------- */
    .masthead {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 25px;
      padding: 4px 2px 28px;
    }

    .brand {
      display: flex;
      align-items: flex-start;
      gap: 15px;
      min-width: 0;
    }

    .brand-mark {
      position: relative;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      width: 54px;
      height: 54px;
      margin-top: 2px;
      border-radius: 15px;
      color: #ffffff;
      background: linear-gradient(145deg, var(--ink) 0%, #334155 100%);
      box-shadow: 0 10px 22px -12px rgba(15, 23, 42, 0.7);
      font-family: Georgia, "Times New Roman", serif;
      font-size: 30px;
      line-height: 1;
    }

    .brand-mark::after {
      content: "";
      position: absolute;
      right: 8px;
      bottom: 8px;
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #22d3ee;
      box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
    }

    .eyebrow {
      margin-bottom: 5px;
      color: var(--accent-deep);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.2em;
      text-transform: uppercase;
    }

    h1 {
      color: var(--ink);
      font-size: clamp(24px, 3.1vw, 33px);
      font-weight: 800;
      letter-spacing: -0.035em;
      line-height: 1.2;
    }

    .subtitle {
      max-width: 660px;
      margin-top: 7px;
      color: var(--muted);
      font-size: 13.5px;
    }

    .masthead-meta {
      display: flex;
      align-items: center;
      gap: 9px;
      flex: 0 0 auto;
      margin-top: 8px;
      padding: 8px 12px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--ink-2);
      background: rgba(255, 255, 255, 0.76);
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
      font-size: 11.5px;
      font-weight: 600;
      white-space: nowrap;
      backdrop-filter: blur(6px);
    }

    .live-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #10b981;
      box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
    }

    .meta-divider {
      width: 1px;
      height: 12px;
      background: var(--line-strong);
    }

    /* ---------- Main layout ---------- */
    .workspace {
      display: grid;
      grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
      align-items: start;
      gap: 22px;
    }

    .panel,
    .card {
      border: 1px solid var(--line);
      background: var(--panel);
      box-shadow: var(--shadow);
    }

    .panel {
      padding: 22px;
      border-radius: var(--radius-lg);
    }

    .results {
      display: flex;
      flex-direction: column;
      gap: 16px;
      min-width: 0;
    }

    .panel-heading {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px;
    }

    .kicker {
      margin-bottom: 3px;
      color: var(--accent-deep);
      font-size: 9.5px;
      font-weight: 800;
      letter-spacing: 0.18em;
      text-transform: uppercase;
    }

    .panel-heading h2,
    .card-heading h2 {
      color: var(--ink);
      font-size: 18px;
      font-weight: 750;
      letter-spacing: -0.02em;
      line-height: 1.3;
    }

    .heading-note {
      margin-top: 3px;
      color: var(--muted);
      font-size: 12px;
    }

    .step-pill {
      display: inline-flex;
      align-items: center;
      height: 24px;
      padding: 0 9px;
      border: 1px solid #bae6fd;
      border-radius: 999px;
      color: var(--accent-deep);
      background: var(--accent-soft);
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.09em;
      white-space: nowrap;
    }

    .control-block {
      min-width: 0;
      margin: 0;
      padding: 0;
      border: 0;
    }

    .control-block + .control-block {
      margin-top: 17px;
    }

    .control-label {
      display: block;
      width: 100%;
      margin-bottom: 7px;
      padding: 0;
      color: var(--ink-2);
      font-size: 11.5px;
      font-weight: 700;
      letter-spacing: 0.01em;
    }

    .legend-note {
      margin-left: 5px;
      color: var(--muted-2);
      font-size: 9.5px;
      font-weight: 500;
      letter-spacing: 0.02em;
    }

    .dual-fields {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .dual-fields .field + .field {
      margin-top: 0;
    }

    .dual-fields .field-error {
      font-size: 10px;
    }

    .matching-note {
      display: flex;
      align-items: flex-start;
      gap: 7px;
      margin-top: 10px;
      padding: 9px 10px;
      border: 1px solid #e0f2fe;
      border-radius: 9px;
      color: #475569;
      background: #f8fdff;
      font-size: 10px;
      line-height: 1.55;
      transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
    }

    .matching-note::before {
      content: "i";
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      width: 14px;
      height: 14px;
      margin-top: 1px;
      border: 1px solid #a5f3fc;
      border-radius: 50%;
      color: var(--accent-deep);
      background: #ecfeff;
      font-family: Georgia, serif;
      font-size: 9px;
      font-style: italic;
      font-weight: 700;
    }

    .matching-note.is-warning {
      border-color: #fde68a;
      color: #92400e;
      background: #fffbeb;
    }

    .matching-note.is-warning::before {
      border-color: #fcd34d;
      color: #b45309;
      background: #fef3c7;
    }

    .segmented {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      padding: 4px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--soft);
    }

    .segmented-three {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .seg-option {
      position: relative;
      display: block;
      min-width: 0;
    }

    .seg-option input {
      position: absolute;
      inset: 0;
      z-index: 2;
      width: 100%;
      height: 100%;
      margin: 0;
      opacity: 0;
      cursor: pointer;
    }

    .seg-option span {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 36px;
      padding: 7px 8px;
      border: 1px solid transparent;
      border-radius: 8px;
      color: var(--muted);
      font-size: 12.5px;
      font-weight: 650;
      line-height: 1.2;
      transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    }

    .seg-option:hover span {
      color: var(--ink-2);
    }

    .seg-option input:checked + span {
      border-color: rgba(203, 213, 225, 0.8);
      color: var(--ink);
      background: #ffffff;
      box-shadow: 0 3px 8px -4px rgba(15, 23, 42, 0.28);
    }

    .seg-option input:focus-visible + span {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .panel-divider {
      height: 1px;
      margin: 20px 0;
      background: linear-gradient(90deg, var(--line) 0%, rgba(226, 232, 240, 0.25) 100%);
    }

    .field + .field {
      margin-top: 16px;
    }

    .field-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 7px;
    }

    .field-label {
      color: var(--ink-2);
      font-size: 12px;
      font-weight: 700;
    }

    .field-label .symbol {
      color: var(--muted);
      font-weight: 600;
    }

    .field-range {
      color: var(--muted-2);
      font-family: var(--font-mono);
      font-size: 10px;
      white-space: nowrap;
    }

    .input-shell {
      display: flex;
      align-items: stretch;
      overflow: hidden;
      border: 1.5px solid var(--line-strong);
      border-radius: 11px;
      background: #ffffff;
      transition: border-color 0.16s ease, box-shadow 0.16s ease;
    }

    .input-shell:hover {
      border-color: #b6c2d1;
    }

    .input-shell:focus-within {
      border-color: var(--accent);
      box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.11);
    }

    .field.has-error .input-shell {
      border-color: #ef4444;
      box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
    }

    .input-shell input {
      width: 100%;
      min-width: 0;
      padding: 11px 13px;
      border: 0;
      outline: 0;
      color: var(--ink);
      background: transparent;
      font-family: var(--font-mono);
      font-size: 16px;
      font-variant-numeric: tabular-nums;
      font-weight: 600;
    }

    .input-shell input::placeholder {
      color: var(--muted-2);
      font-weight: 400;
    }

    .input-unit {
      display: flex;
      align-items: center;
      flex: 0 0 auto;
      padding: 0 12px;
      border-left: 1px solid var(--line);
      color: var(--muted);
      background: #fbfdff;
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 600;
    }

    .preset-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 7px;
      margin-top: 8px;
      color: var(--muted-2);
      font-size: 10.5px;
    }

    .chip {
      padding: 4px 9px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--ink-2);
      background: #ffffff;
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 600;
      line-height: 1.35;
      transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
    }

    .chip:hover {
      border-color: #67e8f9;
      color: var(--accent-deep);
      background: var(--accent-soft);
    }

    .chip:active {
      transform: translateY(1px);
    }

    .chip:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .field-hint {
      margin-top: 5px;
      color: var(--muted-2);
      font-size: 10.5px;
      line-height: 1.45;
    }

    .field-error {
      display: flex;
      align-items: flex-start;
      gap: 5px;
      margin-top: 6px;
      color: var(--bad);
      font-size: 11px;
      font-weight: 600;
      line-height: 1.45;
    }

    .field-error::before {
      content: "!";
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      width: 14px;
      height: 14px;
      margin-top: 1px;
      border-radius: 50%;
      color: #ffffff;
      background: #ef4444;
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 800;
    }

    .calculate-button {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      width: 100%;
      min-height: 45px;
      margin-top: 19px;
      padding: 11px 16px;
      border: 0;
      border-radius: 11px;
      color: #ffffff;
      background: var(--accent);
      box-shadow: 0 9px 18px -12px rgba(8, 145, 178, 0.9);
      font-size: 13.5px;
      font-weight: 750;
      letter-spacing: 0.01em;
      transition: background-color 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
    }

    .calculate-button:hover {
      background: var(--accent-deep);
      box-shadow: 0 12px 22px -12px rgba(8, 145, 178, 0.95);
      transform: translateY(-1px);
    }

    .calculate-button:active {
      transform: translateY(0) scale(0.995);
      box-shadow: 0 5px 12px -9px rgba(8, 145, 178, 0.9);
    }

    .calculate-button:focus-visible {
      outline: 3px solid rgba(8, 145, 178, 0.32);
      outline-offset: 2px;
    }

    .button-arrow {
      font-family: var(--font-mono);
      font-size: 16px;
      font-weight: 400;
      transition: transform 0.16s ease;
    }

    .calculate-button:hover .button-arrow {
      transform: translateX(2px);
    }

    .topology-help {
      display: flex;
      align-items: flex-start;
      gap: 9px;
      margin-top: 18px;
      padding: 11px 12px;
      border: 1px solid #e0f2fe;
      border-radius: 10px;
      color: #475569;
      background: #f8fdff;
      font-size: 10.5px;
      line-height: 1.55;
    }

    .topology-help::before {
      content: "i";
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      width: 15px;
      height: 15px;
      margin-top: 1px;
      border: 1px solid #a5f3fc;
      border-radius: 50%;
      color: var(--accent-deep);
      background: #ecfeff;
      font-family: Georgia, serif;
      font-size: 10px;
      font-style: italic;
      font-weight: 700;
    }

    /* ---------- Cards ---------- */
    .card {
      padding: 20px 22px;
      border-radius: var(--radius-lg);
      min-width: 0;
    }

    .card-heading {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
    }

    .card-heading > div {
      min-width: 0;
    }

    .card-subtitle {
      margin-top: 3px;
      color: var(--muted);
      font-size: 11.5px;
    }

    .status-pill,
    .soft-pill {
      display: inline-flex;
      align-items: center;
      flex: 0 0 auto;
      min-height: 24px;
      padding: 3px 9px;
      border-radius: 999px;
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 700;
      line-height: 1.4;
      white-space: nowrap;
    }

    .status-pill {
      border: 1px solid #bae6fd;
      color: var(--accent-deep);
      background: var(--accent-soft);
    }

    .soft-pill {
      border: 1px solid var(--line);
      color: var(--muted);
      background: var(--soft);
    }

    .circuit-card {
      overflow: hidden;
    }

    .circuit-stage {
      margin-top: 14px;
      overflow: hidden;
      border: 1px solid #eef2f7;
      border-radius: var(--radius-md);
      background-color: #fbfdff;
      background-image: radial-gradient(rgba(148, 163, 184, 0.2) 0.7px, transparent 0.7px);
      background-size: 14px 14px;
    }

    .circuit-stage svg {
      display: block;
      width: 100%;
      height: auto;
    }

    .svg-wire {
      fill: none;
      stroke: #7c8da3;
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .svg-resistor {
      fill: #ffffff;
      stroke: var(--ink);
      stroke-width: 1.8;
    }

    .svg-node {
      fill: var(--accent);
      stroke: #ffffff;
      stroke-width: 1.5;
    }

    .svg-port {
      fill: #ffffff;
      stroke: var(--accent);
      stroke-width: 1.8;
    }

    .svg-ref {
      fill: var(--ink);
      font-family: var(--font-sans);
      font-size: 11px;
      font-weight: 750;
    }

    .svg-value {
      fill: #64748b;
      font-family: var(--font-mono);
      font-size: 9.5px;
      font-weight: 500;
      font-variant-numeric: tabular-nums;
    }

    .svg-port-label {
      fill: #94a3b8;
      font-family: var(--font-sans);
      font-size: 9px;
      font-weight: 750;
      letter-spacing: 0.08em;
    }

    .svg-ground {
      fill: none;
      stroke: #7c8da3;
      stroke-width: 1.6;
      stroke-linecap: round;
    }

    /* ---------- Ideal values ---------- */
    .metric-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      margin-top: 15px;
    }

    .metric-grid.is-four {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .metric {
      min-width: 0;
      padding: 12px 13px 13px;
      border: 1px solid #e8edf4;
      border-radius: 11px;
      background: var(--soft);
    }

    .metric-label {
      display: flex;
      align-items: center;
      gap: 5px;
      margin-bottom: 4px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.04em;
    }

    .metric-value {
      overflow: hidden;
      color: var(--ink);
      font-family: var(--font-mono);
      font-size: clamp(17px, 2vw, 21px);
      font-variant-numeric: tabular-nums;
      font-weight: 650;
      letter-spacing: -0.03em;
      line-height: 1.3;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .metric-value .unit {
      margin-left: 3px;
      color: var(--muted-2);
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0;
    }

    .card-note {
      margin-top: 12px;
      color: var(--muted);
      font-size: 10.5px;
      line-height: 1.6;
    }

    .inline-code {
      padding: 1px 4px;
      border: 1px solid var(--line);
      border-radius: 4px;
      color: var(--ink-2);
      background: var(--soft);
      font-family: var(--font-mono);
      font-size: 0.95em;
      font-variant-numeric: tabular-nums;
    }

    /* ---------- Reverse result ---------- */
    .reverse-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
      gap: 10px;
      margin-top: 15px;
    }

    .reverse-grid.is-four {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reverse-metric {
      min-width: 0;
      padding: 14px 16px;
      border: 1px solid #e8edf4;
      border-radius: 12px;
      background: var(--soft);
    }

    .reverse-metric.is-primary {
      border-color: #bae6fd;
      background: linear-gradient(135deg, #ecfeff 0%, #f0fdfa 100%);
    }

    .reverse-label {
      display: flex;
      align-items: center;
      gap: 5px;
      margin-bottom: 4px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.035em;
    }

    .reverse-value {
      display: flex;
      align-items: baseline;
      gap: 4px;
      overflow: hidden;
      color: var(--ink);
      font-family: var(--font-mono);
      font-size: clamp(25px, 3.2vw, 34px);
      font-variant-numeric: tabular-nums;
      font-weight: 700;
      letter-spacing: -0.045em;
      line-height: 1.18;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .reverse-value .unit {
      color: var(--muted);
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0;
    }

    .reverse-value.is-k {
      font-size: clamp(21px, 2.7vw, 28px);
    }

    .reverse-value.is-z {
      font-size: clamp(19px, 2.4vw, 25px);
    }

    /* ---------- Alert ---------- */
    .result-alert {
      display: flex;
      align-items: flex-start;
      gap: 9px;
      padding: 12px 14px;
      border: 1px solid #fecaca;
      border-radius: 12px;
      color: #991b1b;
      background: #fef2f2;
      font-size: 12px;
      font-weight: 550;
      line-height: 1.55;
      box-shadow: 0 1px 2px rgba(185, 28, 28, 0.04);
    }

    .alert-mark {
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      width: 18px;
      height: 18px;
      margin-top: 1px;
      border-radius: 50%;
      color: #ffffff;
      background: #dc2626;
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 800;
    }

    /* ---------- Recommendations ---------- */
    .recommend-card {
      padding-bottom: 18px;
    }

    .best-strip {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin-top: 14px;
      padding: 10px 13px;
      border: 1px solid #bae6fd;
      border-radius: 10px;
      color: #155e75;
      background: #f0fdff;
      font-size: 11.5px;
      line-height: 1.5;
    }

    .best-strip strong {
      color: #0e7490;
      font-weight: 750;
    }

    .best-strip .best-metric {
      flex: 0 0 auto;
      font-family: var(--font-mono);
      font-size: 11px;
      font-variant-numeric: tabular-nums;
      font-weight: 700;
      white-space: nowrap;
    }

    .table-wrap {
      margin-top: 12px;
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: 12px;
      scrollbar-width: thin;
      scrollbar-color: var(--line-strong) transparent;
    }

    .rec-table {
      width: 100%;
      min-width: 720px;
      border-collapse: collapse;
      color: var(--ink-2);
      font-size: 11.5px;
    }

    .rec-table.is-bridged {
      min-width: 800px;
    }

    .rec-table th,
    .rec-table td {
      padding: 10px 12px;
      text-align: left;
      vertical-align: middle;
    }

    .rec-table th {
      color: var(--muted);
      background: #f8fafc;
      font-size: 9.5px;
      font-weight: 750;
      letter-spacing: 0.045em;
      line-height: 1.35;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .rec-table th:not(:first-child),
    .rec-table td:not(:first-child) {
      text-align: right;
    }

    .rec-table td {
      border-top: 1px solid #eef2f7;
      white-space: nowrap;
    }

    .rec-table tbody tr {
      transition: background-color 0.14s ease;
    }

    .rec-table tbody tr:hover {
      background: #fbfdff;
    }

    .rec-table tbody tr.is-best {
      background: #f7feff;
    }

    .rec-table tbody tr.is-best:hover {
      background: #f0fdff;
    }

    .scheme-cell {
      display: flex;
      align-items: center;
      gap: 9px;
      min-width: 132px;
      text-align: left;
    }

    .scheme-badge {
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      width: 24px;
      height: 24px;
      border-radius: 7px;
      color: #ffffff;
      background: var(--ink);
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 800;
    }

    .is-best .scheme-badge {
      background: var(--accent);
    }

    .scheme-copy {
      display: flex;
      flex-direction: column;
      gap: 1px;
      min-width: 0;
    }

    .scheme-name {
      color: var(--ink);
      font-size: 11.5px;
      font-weight: 750;
      line-height: 1.3;
    }

    .scheme-tag {
      color: var(--muted-2);
      font-size: 9px;
      line-height: 1.3;
      white-space: normal;
    }

    .scheme-match {
      color: #94a3b8;
      font-family: var(--font-mono);
      font-size: 9px;
      font-variant-numeric: tabular-nums;
      line-height: 1.35;
      white-space: nowrap;
    }

    .scheme-match.is-off {
      color: var(--warn);
    }

    .best-mark {
      display: inline-flex;
      align-items: center;
      margin-left: 5px;
      padding: 1px 5px;
      border-radius: 999px;
      color: var(--accent-deep);
      background: #cffafe;
      font-family: var(--font-sans);
      font-size: 8px;
      font-weight: 800;
      letter-spacing: 0.04em;
      vertical-align: 1px;
    }

    .number {
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums;
      font-weight: 600;
    }

    .number .unit {
      color: var(--muted-2);
      font-size: 9.5px;
      font-weight: 500;
    }

    .error-chip {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      min-width: 67px;
      padding: 2px 6px;
      border-radius: 5px;
      font-family: var(--font-mono);
      font-size: 10px;
      font-variant-numeric: tabular-nums;
      font-weight: 650;
      line-height: 1.5;
    }

    .error-chip.is-excellent {
      color: var(--good);
      background: #f0fdfa;
    }

    .error-chip.is-good {
      color: #0e7490;
      background: #ecfeff;
    }

    .error-chip.is-warn {
      color: var(--warn);
      background: #fffbeb;
    }

    .error-chip.is-bad {
      color: var(--bad);
      background: #fef2f2;
    }

    .table-footnote {
      margin-top: 10px;
      color: var(--muted-2);
      font-size: 9.5px;
      line-height: 1.55;
    }

    .footer {
      margin-top: 28px;
      padding: 0 4px;
      color: var(--muted-2);
      font-size: 10px;
      line-height: 1.6;
      text-align: center;
    }

    /* ---------- Responsive ---------- */
    @media (max-width: 900px) {
      .workspace {
        grid-template-columns: minmax(0, 1fr);
      }

      .panel {
        padding: 21px;
      }

      .masthead {
        padding-bottom: 23px;
      }
    }

    @media (max-width: 640px) {
      .page-shell {
        padding: 22px 14px 38px;
      }

      .masthead {
        flex-direction: column;
        gap: 13px;
        padding: 0 2px 20px;
      }

      .brand {
        gap: 12px;
      }

      .brand-mark {
        width: 47px;
        height: 47px;
        border-radius: 13px;
        font-size: 26px;
      }

      h1 {
        font-size: 21px;
      }

      .subtitle {
        font-size: 12px;
      }

      .masthead-meta {
        margin-top: 0;
        align-self: flex-start;
        font-size: 10.5px;
      }

      .panel,
      .card {
        border-radius: 15px;
      }

      .panel {
        padding: 18px;
      }

      .card {
        padding: 17px;
      }

      .card-heading {
        gap: 10px;
      }

      .card-heading h2 {
        font-size: 16.5px;
      }

      .status-pill,
      .soft-pill {
        max-width: 165px;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .metric-grid {
        gap: 7px;
      }

      .metric-grid.is-four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .metric {
        padding: 10px 9px 11px;
      }

      .metric-value {
        font-size: 15px;
      }

      .reverse-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
      }

      .reverse-metric {
        padding: 12px 11px;
      }

      .reverse-value {
        font-size: 25px;
      }

      .reverse-value.is-k {
        font-size: 20px;
      }

      .reverse-value.is-z {
        font-size: 17px;
      }

      .best-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
      }

      .best-strip .best-metric {
        font-size: 10px;
      }

      .svg-ref {
        font-size: 12.5px;
      }

      .svg-value {
        font-size: 10.5px;
      }

      .svg-port-label {
        font-size: 9.5px;
      }

      .table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
      }

      .rec-table,
      .rec-table.is-bridged {
        display: block;
        min-width: 0;
        border-collapse: separate;
      }

      .rec-table thead {
        display: none;
      }

      .rec-table tbody {
        display: grid;
        gap: 9px;
      }

      .rec-table tbody tr,
      .rec-table tbody tr.is-best,
      .rec-table tbody tr.is-best:hover,
      .rec-table tbody tr:hover {
        display: block;
        padding: 11px 12px;
        border: 1px solid var(--line);
        border-radius: 11px;
        background: #ffffff;
      }

      .rec-table tbody tr.is-best {
        border-color: #a5f3fc;
        background: #f7feff;
      }

      .rec-table td,
      .rec-table td:not(:first-child) {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 15px;
        padding: 5px 0;
        border: 0;
        text-align: right;
        white-space: normal;
      }

      .rec-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--muted-2);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.035em;
        text-align: left;
        text-transform: uppercase;
      }

      .rec-table td:first-child {
        display: block;
        padding: 0 0 7px;
        border-bottom: 1px solid #eef2f7;
      }

      .rec-table td:first-child::before {
        display: none;
      }

      .scheme-cell {
        justify-content: flex-start;
        min-width: 0;
      }

      .error-chip {
        min-width: 0;
      }

      .table-footnote {
        margin-top: 9px;
      }
    }

    @media (max-width: 360px) {
      .metric-grid {
        gap: 5px;
      }

      .metric {
        padding: 9px 6px 10px;
      }

      .metric-value {
        font-size: 13px;
      }

      .metric-value .unit {
        margin-left: 2px;
        font-size: 9px;
      }

      .dual-fields {
        gap: 7px;
      }

      .reverse-value.is-z {
        font-size: 15px;
      }

      .svg-value {
        display: none;
      }

      h1 {
        font-size: 19px;
      }

      .card-heading h2 {
        font-size: 16px;
      }

      .step-pill {
        display: none;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
      }
    }
