/* Explore Schools fee tools (kit v3, prototype v5 styles). Shared by every Explore Schools page that carries the tools. Built on the guide's own tokens (--gold, --gold-dark, --ink, --slate, --mist, --cream-warm, --card, --border-soft).
     Layout: the guide page as built, with a "for your child" panel inside the fee section, a shortlist bar fixed to the bottom, and a full-screen compare sheet. */
  :root {
    --ok: var(--teal-accent);   /* the guide's teal accent, for a met condition */
    --ok-pale: #E6F0EE;
    --warn: #8A5300;        /* the guide's amber (#B86A00), darkened so small text on its tint reaches 4.5:1 */
    --warn-pale: #F7EBD6;
    --info: var(--slate);
    --info-pale: #EFEDE7;
    --hl: #FBF3DD;          /* highlighted tuition row */
    --sheet-shadow: 0 -12px 40px rgba(13,13,15,0.14);
  }
  .tnum { font-variant-numeric: tabular-nums; }
  .yc button, .yc select, .yc input, .sl-bar button, .sheet button, .sheet select, .sheet input, .sheet textarea, #find-schools button, #find-schools select { font-family: var(--font-body, 'DM Sans', sans-serif); }
  :focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 2px; }


  /* Your-child panel */
  .yc { background: var(--card); border: 1px solid var(--border-soft); border-top: 3px solid var(--gold); border-radius: 12px; padding: 34px 36px 30px; margin: 0 0 44px; }
  .yc-sup { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; margin-bottom: 10px; }
  .yc-title { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: 32px; line-height: 1.15; color: var(--obsidian); letter-spacing: -0.01em; text-wrap: balance; margin-bottom: 10px; }
  .yc-intro { font-size: 15px; line-height: 1.7; color: var(--slate); font-weight: 300; max-width: 640px; margin-bottom: 24px; }
  .yc-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 34px; align-items: start; }
  .field { display: grid; gap: 6px; margin-bottom: 16px; }
  .field-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate); font-weight: 600; }
  .field-note { font-size: 12px; line-height: 1.5; color: var(--slate); margin: 6px 0 0; max-width: 34ch; }   /* how a second currency counts in the filter */
  .select { appearance: none; -webkit-appearance: none; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A07820' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; border: 1px solid var(--border-soft); border-radius: 8px; padding: 11px 40px 11px 14px; font-size: 15px; color: var(--ink); width: 100%; max-width: 360px; }
  .select:hover { border-color: var(--gold); }
  .check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink); line-height: 1.5; margin: 4px 0 8px; cursor: pointer; }
  .check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold-dark); flex: none; }
  .check small { display: block; color: var(--slate); font-size: 12.5px; }

  .lines { width: 100%; border-collapse: collapse; font-size: 14.5px; }
  .lines td { padding: 9px 0; border-bottom: 1px solid var(--border-soft); vertical-align: top; color: var(--slate); }
  .lines td:last-child { text-align: right; white-space: nowrap; color: var(--ink); padding-left: 14px; font-variant-numeric: tabular-nums; }
  .lines .how { display: block; font-size: 12.5px; color: var(--slate); }
  .lines tr.total td { border-bottom: none; border-top: 2px solid var(--gold); padding-top: 14px; }
  .lines tr.total .t-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; }
  .lines tr.total .t-num { font-family: 'Cormorant Garamond', serif; font-size: 34px; line-height: 1; color: var(--obsidian); }
  .yc-workings { font-size: 12.5px; color: var(--slate); line-height: 1.6; margin-top: 12px; }
  .not-counted { margin-top: 12px; font-size: 13px; color: var(--slate); line-height: 1.6; }
  .not-counted-label { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate); font-weight: 600; margin-bottom: 4px; }
  .not-counted ul { margin: 0; padding-left: 18px; }
  .np { color: var(--slate); font-style: italic; }
  .np-block { background: var(--info-pale); border-radius: 10px; padding: 18px 20px; font-size: 14.5px; color: var(--slate); line-height: 1.65; }

  .side-card { border-left: 1px solid var(--border-soft); padding-left: 30px; }
  .rule-text { font-size: 14.5px; color: var(--slate); line-height: 1.6; margin: 6px 0 10px; }
  .badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; padding: 5px 11px; border-radius: 999px; line-height: 1.3; }
  .badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
  .badge.ok { background: var(--ok-pale); color: var(--ok); }
  .badge.warn { background: var(--warn-pale); color: var(--warn); }
  .badge.info { background: var(--info-pale); color: var(--info); }

  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--gold); background: transparent; color: var(--obsidian); padding: 12px 22px; font-size: 14px; letter-spacing: 0.02em; cursor: pointer; border-radius: 0; text-decoration: none; transition: background .2s; }
  .btn:hover { background: var(--gold-pale); }
  .btn-primary { background: var(--gold); border-color: var(--gold); color: var(--obsidian); font-weight: 500; }
  .btn-primary:hover { background: var(--gold-light); }
  .btn-quiet { border-color: var(--border-soft); color: var(--slate); padding: 8px 14px; font-size: 13px; }
  .btn[aria-pressed="true"] { background: var(--gold-pale); }
  .yc-actions { display: flex; gap: 12px 16px; align-items: center; flex-wrap: wrap; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border-soft); }
  .yc-actions .msg { font-size: 13.5px; color: var(--slate); }
  .linkish { background: none; border: none; padding: 0; color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }


  tr.yc-hl td, tr.yc-hl th { background: var(--hl); }
  tr.yc-hl td:first-child { box-shadow: inset 3px 0 0 var(--gold); }

  /* Shortlist bar */
  .sl-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: var(--obsidian); color: var(--cream); padding: 12px 60px calc(12px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--sheet-shadow); }
  .sl-bar-inner { max-width: 1080px; margin: 0 auto; display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; }
  .sl-bar-label { font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
  .sl-bar-names { flex: 1 1 260px; min-width: 0; font-size: 14px; color: rgba(248,245,239,0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sl-bar .btn-primary { padding: 10px 20px; }
  body.has-bar { padding-bottom: 76px; }

  /* Compare sheet */
  .sheet { position: fixed; inset: 0; z-index: 100; background: var(--cream-warm); overflow-y: auto; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
  .sheet-head { position: sticky; top: 0; z-index: 3; background: var(--white); border-bottom: 1px solid var(--border-soft); padding: 16px 60px; }
  .sheet-head-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
  .sheet-head h2 { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: 26px; color: var(--obsidian); flex: 1; min-width: 0; line-height: 1.2; }
  .sheet-head .where { display: block; font-family: 'DM Sans', sans-serif; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; margin-bottom: 2px; }
  .sheet-body { max-width: 1200px; margin: 0 auto; padding: 28px 60px 60px; }

  .cmp-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 20px; align-items: end; margin-bottom: 14px; }
  .cmp-controls .select { max-width: none; }
  .cmp-controls .field { margin-bottom: 0; }
  .cmp-toggles { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 4px 0 18px; }

  .cmp-wrap { position: relative; z-index: 0; scroll-margin-top: 96px; overflow: auto; max-height: calc(100vh - 110px); border: 1px solid var(--border-soft); border-radius: 12px; background: var(--card); }
  table.cmp { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 640px; }
  table.cmp th, table.cmp td { padding: 14px 16px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: top; font-size: 14px; line-height: 1.55; color: var(--slate); }
  table.cmp td { min-width: 200px; max-width: 280px; }
  table.cmp tbody th { position: sticky; left: 0; z-index: 1; background: var(--cream-warm); width: 168px; min-width: 150px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); font-weight: 600; border-right: 1px solid var(--border-soft); }
  table.cmp tbody th small { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--slate); font-size: 12px; margin-top: 3px; }
  table.cmp thead th { position: sticky; top: 0; z-index: 2; background: var(--white); border-bottom: 2px solid var(--gold); vertical-align: bottom; }
  table.cmp thead th:first-child { left: 0; z-index: 4; background: var(--white); border-right: 1px solid var(--border-soft); }
  .col-short { font-family: 'Cormorant Garamond', serif; font-size: 24px; color: var(--obsidian); line-height: 1.1; display: block; }
  .col-name { font-size: 12.5px; color: var(--slate); display: block; margin: 2px 0 8px; }
  .col-tools { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; }
  .col-tools a { color: var(--gold-dark); }
  .big { font-family: 'Cormorant Garamond', serif; font-size: 26px; color: var(--obsidian); line-height: 1.1; display: block; font-variant-numeric: tabular-nums; }
  .sub { display: block; font-size: 12.5px; color: var(--slate); margin-top: 3px; }
  .cell-note { display: block; font-size: 12.5px; color: var(--slate); margin-top: 6px; }
  .cmp a.maps { display: block; margin-top: 6px; color: var(--gold-dark); font-size: 13px; }
  tr.row-key th { color: var(--gold-dark); }

  .sheet-section { margin-top: 30px; }
  .sheet-section h3 { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: 24px; color: var(--obsidian); margin-bottom: 6px; }
  .sheet-section p { font-size: 14.5px; color: var(--slate); line-height: 1.65; max-width: 720px; }
  .chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
  .chip { border: 1px solid var(--border-soft); background: var(--white); border-radius: 999px; padding: 8px 14px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
  .chip:hover { border-color: var(--gold); }
  .chip span { color: var(--slate); margin-left: 6px; }

  .share-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
  .share-url { flex: 1 1 360px; min-width: 0; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; background: var(--white); border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px 12px; color: var(--slate); overflow-wrap: anywhere; }
  .send-box { background: var(--obsidian); color: var(--cream); border-radius: 12px; padding: 28px 30px; margin-top: 30px; }
  .send-box h3 { color: var(--cream); font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: 28px; line-height: 1.2; margin-bottom: 8px; }
  .send-box p { color: rgba(248,245,239,0.78); }
  .send-box .sup { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 8px; }
  .send-box textarea { width: 100%; min-height: 150px; margin-top: 14px; border-radius: 8px; border: 1px solid rgba(248,245,239,0.25); background: var(--ink); color: var(--cream); padding: 14px; font: 14px/1.6 'DM Sans', sans-serif; }
  .send-box .btn { color: var(--cream); border-color: rgba(248,245,239,0.35); }
  .send-box .btn:hover { background: rgba(201,168,76,0.12); }
  .send-box .btn-primary { color: var(--obsidian); }
  .send-box .addr { font-family: 'SF Mono', Menlo, Consolas, monospace; color: var(--gold-light); user-select: all; }
  .send-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
  .copied { font-size: 13px; color: var(--gold-light); }
  .empty { padding: 30px; text-align: center; color: var(--slate); }

  @media (max-width: 900px) {
    .sheet-body { padding: 22px 16px 50px; }
    .yc { padding: 26px 20px 22px; }
    .yc-title { font-size: 27px; }
    .yc-grid { grid-template-columns: 1fr; gap: 26px; }
    .side-card { border-left: none; padding-left: 0; border-top: 1px solid var(--border-soft); padding-top: 22px; }
    .cmp-controls { grid-template-columns: 1fr 1fr; }
    table.cmp tbody th { width: 120px; min-width: 110px; }
    table.cmp td { min-width: 180px; }
  }
  @media (max-width: 520px) {
    .cmp-controls { grid-template-columns: 1fr; }
    .sl-bar-names { display: none; }
    .sheet-head h2 { font-size: 22px; }
    .lines tr.total .t-num { font-size: 28px; }
  }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

  /* v2: three-control compare row, Taiwan list, events log */
  .cmp-controls-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chip[aria-pressed="true"] { background: var(--gold-pale); border: 2px solid var(--gold-dark); padding: 7px 13px; }
  .chip[aria-pressed="true"]::before { content: "\2713\00a0"; color: var(--gold-dark); font-weight: 600; }
  .curr-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 20px; }
  .curr-row .field-label { margin-right: 6px; }
  .hub-count { font-size: 14.5px; color: var(--slate); margin-bottom: 14px; }
  .hub-group { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: 24px; color: var(--obsidian); margin: 28px 0 10px; }
  /* the filter block on country and city pages: an on-page section with the guides' own spacing (prototype showed it in a sheet) */
  .find-schools { background: var(--cream-warm); padding: 72px 60px; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
  .find-schools-inner { max-width: 1080px; margin: 0 auto; }
  .find-schools-title { font-family: 'Cormorant Garamond', 'Noto Serif TC', serif; font-weight: 400; font-size: 34px; line-height: 1.2; letter-spacing: -0.01em; color: var(--obsidian); margin: 0 0 24px; }
  .find-schools .curr-row { margin-bottom: 8px; }
  .find-schools .hub-count { margin-top: 18px; }
  .find-schools .data-table-note { margin-top: 20px; }
  @media (max-width: 760px) { .find-schools { padding: 52px 20px; } .find-schools-title { font-size: 28px; } }
  .hub-list { display: grid; gap: 12px; }
  .hub-list.is-hidden .hub-card { border-style: dashed; background: var(--cream-warm); }
  .hub-card { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 14px 28px; align-items: center; background: var(--card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 18px 22px; }
  .hub-card h4 { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: 22px; color: var(--obsidian); line-height: 1.2; }
  .hub-place { font-size: 13px; color: var(--slate); margin-top: 2px; }
  .hub-why { font-size: 13px; color: var(--warn); margin-top: 6px; }
  .hub-pass { margin-top: 8px; }
  .hub-nums { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; }
  .hub-year { flex-basis: 100%; min-width: 0; font-size: 12px; color: var(--slate); }   /* wraps inside its column, so a long fee-year note never squeezes the school name */
  .hub-nums dt { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate); font-weight: 600; }
  .hub-nums dd { margin: 2px 0 0; font-family: 'Cormorant Garamond', serif; font-size: 22px; color: var(--obsidian); font-variant-numeric: tabular-nums; min-width: 110px; }
  .hub-nums dd .np { font-family: 'DM Sans', sans-serif; font-size: 13px; }
  .hub-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
  .hub-actions .btn { padding: 9px 16px; font-size: 13.5px; }
  .np.small { font-size: 12.5px; }
  .ev-note pre { margin: 8px 0 0; font: 12px/1.5 'SF Mono', Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--slate); }
  .ev-note { margin-top: 30px; }
  @media (max-width: 900px) {
    .cmp-controls-3 { grid-template-columns: 1fr 1fr; }
    .hub-card { grid-template-columns: 1fr; }
    .hub-actions { flex-direction: row; align-items: center; justify-content: space-between; }
  }
  @media (max-width: 520px) { .cmp-controls-3 { grid-template-columns: 1fr; } }

  /* v3: shared comparison and schools from other countries */
  .shared-note { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; background: var(--info-pale); border-radius: 10px; padding: 12px 16px; margin-bottom: 22px; }
  .shared-note p { font-size: 14.5px; color: var(--ink); margin: 0; flex: 1 1 260px; }
  .cmp-others p { font-size: 14px; color: var(--slate); line-height: 1.6; margin-top: 10px; }
  .cmp-others a { color: var(--gold-dark); }
  .cell-line { display: block; }
  .cell-line + .cell-line { margin-top: 6px; }
  .dd-sub { display: block; font-family: 'DM Sans', sans-serif; font-size: 11.5px; color: var(--slate); }
  #h-curr { display: inline-flex; flex-wrap: wrap; gap: 10px; }
  .chip:focus-visible, .btn:focus-visible, .linkish:focus-visible, .select:focus-visible, .check input:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { .sheet, .sl-bar { transition: none !important; animation: none !important; } }

  /* v4: the planning tool */
  .yc-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0 8px; align-items: start; }
  .yc-part { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border-soft); }
  .yc-part-title { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: 22px; color: var(--obsidian); margin: 0 0 12px; line-height: 1.3; }
  .opt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
  .opt-years { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate); }
  .select-sm { padding: 6px 30px 6px 10px; background-position: right 10px center; font-size: 13px; min-width: 0; width: auto; }
  .stale-note { background: var(--warn-pale); color: var(--warn); border-radius: 8px; padding: 10px 14px; font-size: 13.5px; line-height: 1.55; margin: 0 0 14px; }
  .multi { margin-top: 22px; }
  .multi .lines td { padding: 7px 0; }
  .entry-list { margin: 0; display: grid; gap: 0; }
  .entry-list > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
  .entry-list dt { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); font-weight: 600; padding-top: 2px; }
  .entry-list dd { margin: 0; font-size: 14.5px; color: var(--ink); line-height: 1.6; }
  .entry-warn { color: var(--warn); }
  .entry-badge { display: block; margin-top: 8px; }
  @media (max-width: 760px) {
    .yc-controls { grid-template-columns: 1fr; }
    .entry-list > div { grid-template-columns: 1fr; gap: 4px; }
  }

  /* the hidden attribute always wins inside the tools */
  .yc [hidden], .sheet [hidden], .sl-bar[hidden], .yc[hidden], .sheet[hidden] { display: none !important; }
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

  table.cmp tr.cap { display: none; }
  .cell-work summary { cursor: pointer; color: var(--slate); }
  .cell-work summary:hover { color: var(--gold-dark); }
  .work-line { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--slate); padding: 3px 0; border-bottom: 1px dotted var(--border-soft); }
  .work-line span:last-child { color: var(--ink); white-space: nowrap; }
  /* v5 (consultation pass): totals first, passport result by its control, choices, folding on a phone, print */
  .yc-summary { display: flex; flex-wrap: wrap; gap: 14px 36px; margin: 14px 0 0; padding: 18px 20px; background: var(--cream-warm); border-radius: 10px; }
  .sum-item { display: grid; gap: 4px; }
  .sum-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; }
  .sum-num { font-family: 'Cormorant Garamond', serif; font-size: 34px; line-height: 1; color: var(--obsidian); }
  .yc-summary + .yc-actions { border-top: none; padding-top: 0; margin-top: 16px; }
  .pass-result { font-size: 13px; color: var(--slate); line-height: 1.55; }
  .pass-rule { display: block; }
  .pass-rule-label { display: block; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--slate); margin-top: 4px; }
  .yc-choices:empty { display: none; }
  .yc-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 4px 0 0; }
  .choice-field .select { max-width: 560px; }
  .choice-note { font-size: 13px; color: var(--slate); line-height: 1.55; margin: 2px 0 0; }
  .col-choice { margin: 0 0 10px; gap: 4px; }
  .col-choice .field-label { font-size: 10px; }
  .col-choice .select-sm { max-width: 240px; width: 100%; white-space: normal; }
  .yc-details { margin-top: 6px; }
  .yc-details-sum { cursor: pointer; font-size: 13.5px; color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; margin: 6px 0 10px; }
  .yc-details[open] > .yc-details-sum { margin-bottom: 4px; }
  .cell-head { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--slate); margin-bottom: 2px; }
  .cell-note .cell-line + .cell-line { margin-top: 2px; }
  .cmp-ctl { margin: 0 0 14px; }
  .cmp-ctl-sum { cursor: pointer; font-size: 14px; color: var(--ink); padding: 8px 0 12px; }
  .cmp-ctl-sum::marker { color: var(--gold-dark); }
  .storage-note { font-size: 13px !important; margin-top: 10px; }
  .clear-row { margin-top: 26px; font-size: 14px; color: var(--slate); }
  .clear-note { color: var(--slate); margin-left: 10px; }
  .hub-toggle-row { margin: -8px 0 14px; font-size: 14px; }
  .hub-toggle-row:empty { display: none; }
  @media (max-width: 760px) { .sum-num { font-size: 30px; } }
  @media (max-width: 520px) {
    .yc-summary { padding: 14px 16px; gap: 12px 24px; }
    .sum-num { font-size: 27px; }
    .cmp-wrap { max-height: none; overflow-y: visible; }
    table.cmp { min-width: 0; }
    table.cmp th, table.cmp td { padding: 12px 10px; }
    table.cmp tbody th[scope="row"], table.cmp thead th:first-child { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
    table.cmp tr.cap { display: table-row; }
    table.cmp tr.cap td { padding: 12px 0 2px; border-bottom: none; background: var(--cream-warm); }
    table.cmp tr.cap span { position: sticky; left: 10px; display: inline-block; padding: 0 10px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--ink); }
    table.cmp tr.cap.row-key span { color: var(--gold-dark); }
    table.cmp tr.cap small { display: inline; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--slate); margin-left: 6px; font-size: 11.5px; }
    table.cmp td { min-width: 150px; max-width: 190px; }
    .col-short { font-size: 20px; }
    .big { font-size: 22px; }
  }
  @media print {
    .sl-bar, .sheet-head .sheet-close, .cmp-ctl, .sheet-section, .send-box, .clear-row, .yc-actions, #yc-opts, .yc-details-sum, .shared-note { display: none !important; }
    body.has-bar { padding-bottom: 0; }
    html { overflow: visible !important; }
    body.es-printing-sheet > *:not(#sheet) { display: none !important; }
    .sheet { position: static; overflow: visible; background: #fff; }
    .sheet-head { position: static; padding: 0 0 8px; }
    .sheet-body { padding: 0; max-width: none; }
    .cmp-wrap { overflow: visible; max-height: none; border: none; }
    table.cmp { min-width: 0; font-size: 11px; }
    table.cmp th, table.cmp td { padding: 6px 8px; }
    table.cmp thead th, table.cmp tbody th { position: static; }
    .print-line { display: block !important; font-size: 12px; color: var(--slate); margin: 0 0 10px; }
    .yc-details:not([open]) > *:not(summary) { display: block; }
    .yc { break-inside: avoid-page; }
  }
  .print-line { display: none; }

  /* v5: "On this page" carries a marked link to the tool, and wraps on a phone so every link shows */
  .page-index .page-index-inner a.page-index-plan { border: 1px solid var(--gold); border-left: 1px solid var(--gold); border-radius: 999px; background: var(--gold-pale); color: var(--obsidian); font-weight: 500; padding: 6px 16px; margin-right: 14px; }
  .page-index .page-index-inner a.page-index-plan:hover { background: var(--gold-light); color: var(--obsidian); }
  .page-index .page-index-inner a.page-index-plan + a { border-left: none; padding-left: 4px; }
  #yc { scroll-margin-top: 88px; }
  @media (max-width: 520px) {
    .page-index-inner { flex-wrap: wrap; white-space: normal; row-gap: 8px; overflow-x: visible; }
    .page-index-label { flex-basis: 100%; padding-right: 0; }
    .page-index .page-index-inner a { border-left: none; padding: 4px 18px 4px 0; }
    .page-index .page-index-inner a.page-index-plan { flex-basis: 100%; text-align: center; margin: 2px 0 4px; padding: 9px 16px; }
    .page-index .page-index-inner a.page-index-plan + a { padding-left: 0; }
  }
