
  /* Alt / Summrizei Design System (Swiss Modernism & Calm Ambient Interface)
     Canvas: Warm Linen Paper (#F7F7F4), Dark: Engine Container (#09090B)
     Surfaces: 1px Crisp Rules (#E4E4E7 / rgba(0,0,0,0.08)), Dark (#27272A)
     Brand Accent: Safety Orange (#FF5600), Subtle (rgba(255,86,0,0.08))
     Typography: Sans (IBM Plex Sans KR), Editorial Serif (Hedvig Letters Serif), Tech Mono (Geist Mono) */
  :root {
    --paper: #ffffff;
    --paper-card: #ffffff;
    --ground: #F7F7F4;
    --ink: #18181B;
    --ash: #71717A;
    --faint: #A1A1AA;
    --rule: rgba(0, 0, 0, 0.08);
    --rule-solid: #E4E4E7;
    --rule-subtle: rgba(0, 0, 0, 0.05);
    --sunk: #F1F1EE;
    --sunk-input: #ECECE9;

    /* Brand Accent */
    --brand: #FF5600;
    --brand-subtle: rgba(255, 86, 0, 0.08);
    --brand-highlight: rgba(255, 86, 0, 0.18);   /* 형광펜 — subtle 보다 진해야 칠한 자리가 보인다 */
    --brand-glow: rgba(255, 86, 0, 0.35);

    /* Radii */
    --r-sm: 4px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --r-full: 9999px;

    /* Elevation & Shadows */
    --lift-1: none;                                              /* resting surfaces: 1px rule only */
    --lift-2: 0 20px 40px -15px rgba(0, 0, 0, 0.05);             /* overlays only (shadow-glass) */
    --inset: inset 0 1px 2px rgba(0, 0, 0, 0.04);

    /* Primary CTA Button (Dark Carbon) */
    --btn-face: #18181B;
    --btn-face-hover: #27272A;
    --btn-text: #FAFAFA;
    --btn-edge: inset 0 1px 0 rgba(255, 255, 255, 0.15);

    /* Typography */
    --font-sans: "IBM Plex Sans KR", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: "Hedvig Letters Serif", Georgia, serif;
    --font-mono: "Geist Mono", Menlo, Monaco, Consolas, monospace;

    color-scheme: light;
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #18181B;
    --paper-card: #18181B;
    --ground: #09090B;
    --ink: #F4F4F5;
    --ash: rgba(255, 255, 255, 0.6);
    --faint: #71717A;
    --rule: rgba(255, 255, 255, 0.1);
    --rule-solid: #27272A;
    --rule-subtle: rgba(255, 255, 255, 0.05);
    --sunk: #121214;
    --sunk-input: #202022;

    /* Brand Accent in Dark */
    --brand: #FF5600;
    --brand-subtle: rgba(255, 86, 0, 0.15);
    --brand-highlight: rgba(255, 86, 0, 0.28);
    --brand-glow: rgba(255, 86, 0, 0.5);

    /* Dark Elevations */
    --lift-1: none;
    --lift-2: 0 20px 40px -15px rgba(0, 0, 0, 0.8);
    --inset: inset 0 1px 3px rgba(0, 0, 0, 0.4);

    /* Primary Button (Inverted Carbon) */
    --btn-face: #F4F4F5;
    --btn-face-hover: #FFFFFF;
    --btn-text: #18181B;
    --btn-edge: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }

  /* Critical invariant: lib/panel.test.js enforces [hidden]{display:none!important} */
  [hidden] { display: none !important; }

  * { box-sizing: border-box; }

  body {
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.6;
    margin: 0;
    padding: 18px 16px;
    color: var(--ink);
    background: var(--ground);
    display: flex;
    flex-direction: column;
    gap: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  /* ── Topbar & Brand ─────────────────────────────────────────── */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  /* Wordmark — must stay identical to landing .brand (landing/landing.css) */
  h1 {
    font: 500 22px/1 var(--font-serif);
    letter-spacing: -0.025em;
    margin: 0;
    color: var(--ink);
  }
  h1 span:not(.brand-dot) { font-style: italic; }
  .brand-caption {
    margin: 3px 0 0;
    color: var(--ash);
    font-size: 11.5px;
    letter-spacing: -0.01em;
  }

  /* ── Swiss Connected Stage Steps ───────────────────────────── */
  .stage-steps {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    background: var(--paper);
    overflow: hidden;
    box-shadow: var(--lift-1);
  }
  .stage-steps span {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--faint);
    padding: 7px 4px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: color 140ms ease, background-color 140ms ease;
  }
  .stage-steps span.active {
    color: var(--ink);
    font-weight: 600;
    background: var(--sunk);
  }
  .stage-steps span.active::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand);
  }
  .stage-steps i {
    width: 1px;
    background: var(--rule);
    align-self: stretch;
  }

  /* ── Stage Containers & Intros ─────────────────────────────── */
  #stageReady, #stageLive, #stageDone {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .intro h2 {
    font-size: 20px;
    line-height: 1.35;
    letter-spacing: -0.03em;
    margin: 0 0 6px;
    font-weight: 650;
    color: var(--ink);
  }
  .eyebrow {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--brand);
    margin: 0 0 6px;
  }
  .detail {
    font-size: 12px;
    color: var(--ash);
    line-height: 1.55;
    margin: 0;
  }

  /* ── Buttons ───────────────────────────────────────────────── */
  button {
    font: inherit;
    font-size: 13px;
    padding: 8px 12px;
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    box-shadow: var(--lift-1);
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
  }
  button:hover:not(:disabled) {
    background: var(--sunk);
    border-color: var(--rule-solid);
  }
  button:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
  }
  button.primary {
    font-weight: 600;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: var(--r-lg);
    background: var(--btn-face);
    color: var(--btn-text);
    border-color: transparent;
    box-shadow: var(--btn-edge);
  }
  button.primary:hover:not(:disabled) {
    background: var(--btn-face-hover);
  }
  button.danger {
    font-weight: 600;
    width: 100%;
    padding: 12px 16px;
    font-size: 13.5px;
    border-radius: var(--r-lg);
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--ink);
    box-shadow: var(--lift-1);
  }
  button.danger:hover:not(:disabled) {
    background: var(--sunk);
  }
  button.link {
    border: 0;
    background: none;
    color: var(--ash);
    font-weight: 500;
    padding: 2px 4px;
    font-size: 12px;
    box-shadow: none;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  button.link:hover:not(:disabled) {
    color: var(--ink);
    transform: none;
    box-shadow: none;
  }
  button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
  }
  #refreshTabsBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    min-width: 36px;
    min-height: 36px;
    border-radius: var(--r-md);
    flex-shrink: 0;
  }
  #refreshTabsBtn svg {
    transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  #refreshTabsBtn:hover:not(:disabled) svg {
    transform: rotate(180deg);
  }
  .btnrow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .btnrow button {
    width: 100%;
    font-size: 12.5px;
    font-weight: 500;
    padding: 10px 6px;
    text-align: center;
  }

  /* ── Form Controls ─────────────────────────────────────────── */
  select, textarea, input[type="text"] {
    font: inherit;
    font-size: 12.5px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--r-md);
    border: 1px solid var(--rule);
    background: var(--sunk);
    color: var(--ink);
    box-shadow: var(--inset);
    transition: border-color 140ms ease, box-shadow 140ms ease;
  }
  select:focus-visible, textarea:focus-visible, input[type="text"]:focus-visible {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.08);
  }
  [data-theme="dark"] select:focus-visible, [data-theme="dark"] textarea:focus-visible, [data-theme="dark"] input[type="text"]:focus-visible {
    box-shadow: 0 0 0 2px rgba(244, 244, 245, 0.15);
  }
  label {
    font-size: 12px;
    font-weight: 500;
    color: var(--ash);
    display: block;
    margin-bottom: 5px;
  }
  .field + .field {
    margin-top: 14px;
  }
  .checkline {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12.5px;
    cursor: pointer;
  }
  .checkline input {
    margin-top: 3px;
    accent-color: var(--brand);
    width: 14px;
    height: 14px;
    cursor: pointer;
  }

  /* ── Stage Ready Components ────────────────────────────────── */
  .readycard {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    box-shadow: var(--lift-1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .checkrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--rule-subtle);
  }
  .checkrow:last-child {
    border-bottom: none;
  }
  .checkrow .mark {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    background: var(--ink);
    color: var(--paper);
    transition: all 140ms ease;
  }
  .checkrow .mark.warn {
    background: var(--brand-subtle);
    color: var(--brand);
    border: 1px solid var(--brand);
  }
  .checkrow .mark.off {
    background: var(--sunk);
    color: var(--faint);
    border: 1px solid var(--rule);
  }
  .checkrow .what {
    flex: 1;
    font-weight: 500;
    color: var(--ink);
  }
  .checkrow .val {
    font-family: var(--font-mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--ash);
    text-align: right;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .checkrow .tab-select-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 58%;
    min-width: 0;
    justify-content: flex-end;
  }
  .checkrow select.tab-select {
    font-family: var(--font-mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    background: var(--sunk);
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    padding: 3px 6px;
    max-width: 100%;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    outline: none;
    transition: border-color 140ms ease, background-color 140ms ease;
  }
  .checkrow select.tab-select:hover {
    border-color: var(--ash);
  }
  .checkrow select.tab-select:focus {
    border-color: var(--brand);
  }
  .checkrow button.tab-refresh-btn {
    background: none;
    border: 1px solid transparent;
    padding: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ash);
    cursor: pointer;
    border-radius: var(--r-sm);
    flex-shrink: 0;
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
  }
  .checkrow button.tab-refresh-btn:hover {
    color: var(--ink);
    background: var(--sunk);
    border-color: var(--rule);
  }

  .settingbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    padding: 10px 13px;
    font-size: 12px;
    box-shadow: var(--lift-1);
  }
  .settingbar .summary {
    color: var(--ash);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #settingsDrawer {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-xl);
    padding: 18px 16px;
    box-shadow: var(--lift-2);
  }

  /* ── Stage Live Components ─────────────────────────────────── */
  .statusline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: var(--r-full);
    font-size: 11.5px;
    font-weight: 600;
  }
  .pill.live {
    background: var(--brand-subtle);
    color: var(--brand);
    border: 1px solid rgba(255, 86, 0, 0.2);
  }
  .pill.ok {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--rule);
    box-shadow: var(--lift-1);
  }
  .pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 8px var(--brand-glow);
    animation: blink 1.4s ease-in-out infinite;
  }
  @keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    .pulse { animation: none !important; }
    button:hover:not(:disabled) { transform: none !important; }
  }
  .sub {
    font-family: var(--font-mono);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--ash);
  }

  /* Swiss connected counter grid */
  .counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--rule);
    gap: 1px;
    box-shadow: var(--lift-1);
  }
  .counter {
    background: var(--paper);
    padding: 13px 8px;
    text-align: center;
  }
  .counter b {
    display: block;
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    color: var(--ink);
  }
  .counter span {
    font-size: 11px;
    color: var(--ash);
    font-weight: 500;
    margin-top: 3px;
    display: block;
  }

  /* Feed card */
  .feed {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    padding: 15px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--lift-1);
  }
  .feed .head {
    font-size: 11px;
    font-weight: 600;
    color: var(--faint);
    display: flex;
    justify-content: space-between;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--rule-subtle);
    padding-bottom: 8px;
  }
  #feedLines {
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 12.5px;
    line-height: 1.6;
    overflow-wrap: anywhere;
  }
  #feedLines div {
    display: flex;
    gap: 8px;
    color: var(--ash);
    align-items: baseline;
  }
  #feedLines div:last-child {
    color: var(--ink);
    font-weight: 500;
  }
  #feedLines .t {
    font-family: var(--font-mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    color: var(--faint);
  }

  /* ── Alerts ────────────────────────────────────────────────── */
  .alert {
    border-radius: var(--r-md);
    padding: 11px 13px;
    font-size: 12.5px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-left: 1px solid var(--brand);
    color: var(--ink);
    box-shadow: var(--lift-1);
  }
  .alert b { font-weight: 600; }

  /* ── Stage Done Components ─────────────────────────────────── */
  #stageDone { gap: 12px; }
  #stageDone .result-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.035em;
    margin: 0;
    color: var(--ink);
  }
  #stageDone .result-help {
    border-left: 1px solid var(--brand);
    padding-left: 10px;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--ash);
    margin: 0;
  }

  #stageDone .note-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 2px 0 -2px;
  }
  #stageDone .note-modes {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    padding: 2px;
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    background: var(--sunk);
  }
  #stageDone .note-modes button,
  #stageDone .note-copy {
    height: 34px;
    min-height: 34px;
    min-width: 56px;
    padding: 0 12px;
    line-height: 1;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    box-shadow: none;
    color: var(--ash);
    font-size: 13px;
    font-weight: 600;
  }
  #stageDone .note-modes button[aria-pressed="true"] {
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  }
  #stageDone .note-modes button:hover:not(:disabled),
  #stageDone .note-copy:hover:not(:disabled) {
    background: var(--paper);
    color: var(--ink);
    transform: none;
  }
  #stageDone .note-copy {
    border: 1px solid var(--rule);
    background: transparent;
    flex-shrink: 0;
    color: var(--ink);
  }

  /* Keep the product panel's rendered/raw and copy actions aligned with the landing demo. */
  #stageDone .note-view-tabs .tab-pill,
  #stageDone .export-row button {
    height: 34px;
    min-height: 34px;
    padding-block: 0;
    line-height: 1;
  }

  #stageDone .note-surface {
    width: 100%;
    max-height: clamp(360px, 62vh, 650px);
    min-height: 360px;
    overflow: auto;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    background: var(--ground);
    color: var(--ink);
    scroll-padding-block: 16px;
  }
  #stageDone .note-surface::-webkit-scrollbar { width: 6px; height: 6px; }
  #stageDone .note-surface::-webkit-scrollbar-thumb { background: var(--rule-solid); border-radius: var(--r-full); }
  #stageDone .note-document {
    max-width: 720px;
    margin: 0 auto;
    padding: 4px 2px 20px;
    outline: none;
    font-size: 15px;
    line-height: 1.85;
    overflow-wrap: anywhere;
  }
  /* 읽기 탭은 sandbox.html iframe이 담당한다(수식·다이어그램 렌더링).
     타이포그래피는 iframe 내부 문서가 갖고, 여기선 상자만 잡아준다. */
  #stageDone iframe.note-document {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color-scheme: normal;
  }
  #stageDone .note-document:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 5px;
  }
  #stageDone .note-document > :first-child { margin-top: 0; }
  #stageDone .note-document > :last-child { margin-bottom: 0; }
  #stageDone .note-task { list-style: none; }
  #stageDone .note-empty { color: var(--ash); }
  #stageDone .note-surface:has(.note-document:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
  #stageDone .note-document h1,
  #stageDone .note-document h2,
  #stageDone .note-document h3 {
    color: var(--ink);
    letter-spacing: -0.03em;
    line-height: 1.3;
  }
  #stageDone .note-document h1 {
    margin: 1.5em 0 0.55em;
    font-size: 25px;
    font-weight: 700;
  }
  #stageDone .note-document h2 {
    margin: 1.55em 0 0.45em;
    font-size: 22px;
    font-weight: 700;
  }
  #stageDone .note-document h3 {
    margin: 1.4em 0 0.35em;
    font-size: 18px;
    font-weight: 700;
  }
  #stageDone .note-document p { margin: 0 0 1em; }
  #stageDone .note-document ul,
  #stageDone .note-document ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
  }
  #stageDone .note-document li { padding-left: 0.2em; }
  #stageDone .note-document li + li { margin-top: 0.25em; }
  #stageDone .note-document ul ul,
  #stageDone .note-document ol ol,
  #stageDone .note-document ul ol,
  #stageDone .note-document ol ul { margin-top: 0.25em; margin-bottom: 0.25em; }
  /* 콜아웃 상자. 노트에서 인용(>)을 내는 건 핵심 결론(sidepanel.js noteText)과 ⚠ 경고(lib/summary.js) 둘뿐이다. */
  #stageDone .note-document blockquote {
    margin: 1.1em 0;
    padding: 0.8em 1.1em;
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--r-md) var(--r-md) 0;
    background: var(--brand-subtle);
    color: var(--ink);
  }
  #stageDone .note-document blockquote > :last-child { margin-bottom: 0; }
  /* 형광펜. 노트에서 critical 로 표시된 곳에만 붙는다(sidepanel.js noteText). */
  #stageDone .note-document mark {
    padding: 0.1em 0.25em;
    border-radius: var(--r-sm);
    background: var(--brand-highlight);
    color: inherit;
  }
  #stageDone .note-document hr {
    margin: 1.7em 0;
    border: 0;
    border-top: 1px solid var(--rule-solid);
  }
  #stageDone .note-document a {
    color: var(--ink);
    text-decoration-color: var(--brand);
    text-decoration-thickness: 1px;
  }
  #stageDone .note-document code {
    padding: 0.12em 0.35em;
    border-radius: var(--r-sm);
    background: var(--sunk);
    font-family: var(--font-mono);
    font-size: 0.86em;
  }
  #stageDone .note-document pre {
    margin: 1.1em 0;
    padding: 12px 14px;
    overflow: auto;
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    background: var(--sunk);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
  }
  #stageDone .note-document pre code { padding: 0; background: none; }
  #stageDone .note-document .note-table-scroll {
    max-width: 100%;
    margin: 1.1em 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }
  #stageDone .note-document table {
    min-width: 320px;
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.55;
  }
  #stageDone .note-document th,
  #stageDone .note-document td {
    min-width: 96px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--rule-solid);
    text-align: left;
    vertical-align: top;
  }
  #stageDone .note-document th {
    color: var(--ash);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
  #stageDone .note-document input[type="checkbox"] {
    accent-color: var(--brand);
    margin: 0 0.45em 0 0;
    opacity: 0.65;
    pointer-events: none;
  }
  #stageDone .note-document[data-kind="timeline"] h2 {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 1.1em;
    font-size: 18px;
  }
  #stageDone .note-document[data-kind="timeline"] h2 time {
    flex: 0 0 auto;
    padding: 2px 6px;
    border: 1px solid var(--brand-subtle);
    border-radius: var(--r-sm);
    background: var(--brand-subtle);
    color: var(--brand);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
  }
  #stageDone .note-document[data-kind="timeline"] h2::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--brand);
  }

  #stageDone #result {
    width: 100%;
    min-height: 360px;
    height: 100%;
    padding: 16px;
    background: var(--sunk-input);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink);
    resize: vertical;
    box-shadow: var(--inset);
  }

  @media (max-width: 420px) {
    #stageDone .result-title { font-size: 24px; }
    #stageDone .note-toolbar { align-items: flex-start; }
    #stageDone .note-document { padding-inline: 0; }
  }

  @media (prefers-reduced-motion: reduce) {
    #stageDone .note-modes button,
    #stageDone .note-copy { transition: none; }
  }

  .optional-api {
    padding: 12px 14px;
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    background: var(--paper);
    box-shadow: var(--lift-1);
  }
  .optional-api p { margin: 8px 0 10px; }
  .optional-api summary { color: var(--ink); font-weight: 600; cursor: pointer; }

  /* ── Disclosures & Details ─────────────────────────────────── */
  details { font-size: 12px; }
  details summary { cursor: pointer; color: var(--ash); font-weight: 500; }
  details pre {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    background: var(--sunk);
    padding: 10px;
    border-radius: var(--r-md);
    border: 1px solid var(--rule);
    margin: 7px 0 0;
    box-shadow: var(--inset);
    color: var(--ash);
  }

  /* ── Footer ────────────────────────────────────────────────── */
  footer {
    border-top: 1px solid var(--rule);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
  }
  footer p { margin: 0; }
  a { color: var(--ink); text-underline-offset: 3px; }
  #status:empty { display: none; }
  #status {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--ash);
    font-variant-numeric: tabular-nums;
  }
  #cropRow { flex-direction: column; align-items: flex-start; gap: 6px; }
  #planLine {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
  }
  #planName { font-weight: 600; color: var(--ink); }
  #planUse {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ash);
    font-variant-numeric: tabular-nums;
  }
  #tokenUsage {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--faint);
    font-variant-numeric: tabular-nums;
    white-space: pre-wrap;
  }
  .legal { font-size: 11.5px; color: var(--faint); line-height: 1.5; }

  /* ── Crop Overlay ──────────────────────────────────────────── */
  #cropWrap {
    position: relative;
    display: none;
    margin-top: 10px;
    user-select: none;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--rule);
  }
  #cropWrap img { width: 100%; display: block; }
  #cropBox {
    position: absolute;
    border: 1px solid var(--brand);
    background: var(--brand-subtle);
    display: none;
  }

  /* ── Onboarding ────────────────────────────────────────────── */
  #onboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-xl);
    padding: 20px 18px;
    box-shadow: var(--lift-2);
  }
  .step {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 12px;
    align-items: start;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rule-subtle);
  }
  .step:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
  }
  .step .n {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--brand);
    background: var(--brand-subtle);
    width: 20px;
    height: 20px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .step .c { display: flex; flex-direction: column; gap: 6px; }
  .step b { font-size: 13px; font-weight: 600; color: var(--ink); }
  .step .why { font-size: 12px; color: var(--ash); line-height: 1.5; }

  /* ── Subtle Scrollbar ──────────────────────────────────────── */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--rule-solid);
    border-radius: 3px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--faint);
  }
