/* Layout: single reading column. Screens: the brief (sections driven by the reader's saved preferences), Customize (Home · Sports · Business · Review), and the reader-menu pages (Following, Past editions, Feedback, Invite, About). */
  :root {
    --bg: #f6f7f9; --surface: #ffffff; --fg: #16202b; --muted: #5d6b7a; --rule: #d9dee5;
    --accent: #0f5c6e; --accent-ink: #ffffff; --accent-soft: #e4eff2;
    --lean-left: #2f63c7; --lean-center: #6b7684; --lean-right: #c2423a;
    --up: #1f7a4d; --down: #a3322b; --scrim: rgba(22,32,43,.45);
    --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --body: "Newsreader", Georgia, "Times New Roman", serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0f151b; --surface: #171f27; --fg: #e8edf2; --muted: #9aa8b6; --rule: #2a3542;
      --accent: #5fc4d6; --accent-ink: #0f151b; --accent-soft: #15303a;
      --lean-left: #7aa3ee; --lean-center: #9aa8b6; --lean-right: #ee8a82; --up: #5fcf8f; --down: #ee8a82; --scrim: rgba(0,0,0,.6);
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #0f151b; --surface: #171f27; --fg: #e8edf2; --muted: #9aa8b6; --rule: #2a3542;
    --accent: #5fc4d6; --accent-ink: #0f151b; --accent-soft: #15303a;
    --lean-left: #7aa3ee; --lean-center: #9aa8b6; --lean-right: #ee8a82; --up: #5fcf8f; --down: #ee8a82; --scrim: rgba(0,0,0,.6);
    color-scheme: dark;
  }

  * { box-sizing: border-box; }
  body {
    margin: 0; background: var(--bg); color: var(--fg);
    font-family: var(--body); font-size: 17px; line-height: 1.5;
    padding-block: 0 48px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  a { color: inherit; }
  a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  button { font: inherit; color: inherit; }
  .wrap { max-width: 680px; margin: 0 auto; }

  .masthead { padding-block: 28px 16px; border-bottom: 3px solid var(--fg); }
  .masthead .kicker, .kicker {
    font-family: var(--display); font-weight: 500; font-size: 12px; letter-spacing: .12em;
    text-transform: uppercase; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap;
  }
  .kicker .lc { text-transform: none; letter-spacing: 0; }
  .masthead .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: nowrap; }
  .masthead .row h1 { min-width: 0; }
  .masthead h1 {
    font-family: var(--display); font-weight: 800; font-size: clamp(34px, 8vw, 48px);
    letter-spacing: -.02em; line-height: 1; margin: 8px 0 10px; text-wrap: balance;
  }
  .masthead .dateline { font-family: var(--mono); font-size: 13px; color: var(--muted); }
  .masthead .dateline b { color: var(--fg); font-weight: 600; }

  .btn {
    font-family: var(--display); font-weight: 700; font-size: 14px; min-height: 44px; padding: 0 16px;
    border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .btn.ghost { background: var(--surface); color: var(--accent); }
  .btn:hover { filter: brightness(1.06); }
  .link { background: none; border: 0; padding: 4px 6px; min-height: 32px; font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--accent); cursor: pointer; }

  .tag { font-family: var(--display); font-size: 12px; font-weight: 500; padding: 4px 9px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); display: inline-flex; align-items: center; gap: 6px; }
  .tag i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

  nav.chips {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 2;
    background: var(--bg); padding-block: 10px; margin-inline: -4px;
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  }
  nav.chips::-webkit-scrollbar { display: none; }
  nav.chips a {
    flex: 0 0 auto; font-family: var(--display); font-weight: 700; font-size: 13px;
    text-decoration: none; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px;
    background: var(--surface); color: var(--fg); white-space: nowrap;
  }
  nav.chips a:hover { border-color: var(--accent); color: var(--accent); }

  section.beat { padding-block: 22px 8px; scroll-margin-top: 64px; }
  section.beat h2 {
    font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.01em;
    margin: 0 0 4px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  }
  section.beat h2.sub { font-size: 18px; margin-top: 16px; }
  section.beat h2 .n { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); }

  .story { padding-block: 16px; border-top: 1px solid var(--rule); min-width: 0; }
  .story.first { border-top: 2px solid var(--fg); }
  .story .tagline { font-family: var(--display); font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 4px; letter-spacing: .04em; text-transform: uppercase; }
  .story h3 {
    font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.25;
    margin: 0 0 6px; text-wrap: balance; letter-spacing: -.005em;
  }
  .story h3 a { text-decoration: none; }
  .story h3 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
  .story p { margin: 0 0 10px; max-width: 65ch; }
  .sources { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
  .src {
    font-family: var(--display); font-size: 12.5px; font-weight: 500; text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px;
    border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--fg);
  }
  .src:hover { border-color: var(--accent); }
  .src .lean { font-weight: 800; font-size: 10.5px; width: 16px; height: 16px; border-radius: 3px; display: inline-grid; place-items: center; color: #fff; }
  .src .lean.left { background: var(--lean-left); } .src .lean.center { background: var(--lean-center); } .src .lean.right { background: var(--lean-right); }
  .src .arrow { color: var(--muted); font-size: 11px; }
  .legend { font-family: var(--display); font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin: 2px 0 10px; }
  .legend span { display: inline-flex; align-items: center; gap: 5px; }
  .legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
  .empty { border: 1px dashed var(--rule); border-radius: 10px; padding: 14px 16px; color: var(--muted); font-size: 15px; background: var(--surface); margin-top: 12px; }

  .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0 14px; }
  .tile { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; min-width: 0; }
  .tile .v { font-family: var(--display); font-weight: 800; font-size: 19px; }
  .tile .d, .q .d { font-family: var(--display); font-size: 13px; font-weight: 700; }
  .d.up { color: var(--up); } .d.down { color: var(--down); } .d.flat { color: var(--muted); font-weight: 500; }
  .watch { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
  .q { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--rule); font-family: var(--display); font-size: 14px; }
  .q:first-child { border-top: 0; }
  .q .sym { font-family: var(--mono); font-weight: 600; width: 64px; }
  .q .nm { flex: 1; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .q .px { font-family: var(--mono); }
  .q .d { width: 64px; text-align: right; }
  .note { font-size: 13px; color: var(--muted); margin: 6px 0 0; font-family: var(--display); }

  /* Customize */
  .setup .head { padding: 28px 0 12px; display: flex; flex-direction: column; gap: 6px; }
  .setup h1 { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 6vw, 34px); letter-spacing: -.02em; line-height: 1.05; margin: 0; }
  .lead { font-size: 15px; color: var(--muted); margin: 0; }
  .steps { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px 0 18px; border-bottom: 1px solid var(--rule); }
  .step { font-family: var(--display); font-weight: 700; font-size: 13px; padding: 10px 12px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
  .step.on { background: var(--surface); border-color: var(--rule); color: var(--fg); }
  .step.done { color: var(--accent); }
  .step .n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-grid; place-items: center; font-size: 11px; }
  .step.on .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .col { display: flex; flex-direction: column; gap: 22px; padding-top: 18px; }
  .rowh { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
  .grp { font-family: var(--display); font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip { font-family: var(--display); font-weight: 700; font-size: 13px; line-height: 1.2; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--fg); cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 7px; text-align: left; }
  .chip:hover { border-color: var(--accent); color: var(--accent); }
  .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .chip .sub { font-weight: 500; font-size: 11px; opacity: .78; }
  .chip .x { font-weight: 800; opacity: .7; margin-left: 2px; }
  .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  @media (max-width: 420px) { .cards { grid-template-columns: 1fr; } }
  .chip.card { border-radius: 10px; justify-content: flex-start; padding: 10px 14px; }
  .chip.card .stack { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
  input.search { font-family: var(--display); font-size: 15px; min-height: 44px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--fg); width: 100%; }
  .sugg { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
  .sugg button { font-family: var(--display); font-size: 14px; text-align: left; background: transparent; border: 0; border-radius: 6px; padding: 10px 12px; min-height: 44px; cursor: pointer; display: flex; gap: 10px; align-items: center; width: 100%; }
  .sugg button:hover { background: var(--accent-soft); }
  .sugg .sym { font-family: var(--mono); font-weight: 600; width: 60px; }
  .sugg .ex { font-size: 12px; color: var(--muted); }
  .review { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
  .actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--rule); }
  .banner { font-family: var(--display); font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; margin-top: 14px; }
  .toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); font-family: var(--display); font-size: 14px; padding: 12px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); }
  .toast.show { opacity: 1; }
  .totop { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(24px, env(safe-area-inset-bottom, 0px)); z-index: 3; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--accent); background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.12); cursor: pointer; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .totop.show { opacity: 1; visibility: visible; }
  .totop:hover { border-color: var(--accent); }

  footer { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
  footer p { margin: 0 0 6px; }
  @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
/* Sign-in gate */
.gate-head{border-bottom-width:3px}
.gate{padding:22px 0 8px;display:flex;flex-direction:column;gap:16px}
.gate-lead{font-size:18px;line-height:1.5;margin:0;max-width:60ch}
.gate-lead em{font-style:italic}
.gate-form{background:var(--surface);border:1px solid var(--rule);border-radius:12px;padding:16px 18px}
.gate-card{background:var(--surface);border:1px solid var(--rule);border-radius:12px;padding:16px 18px;font-size:16px}
.btn:disabled,input:disabled{opacity:.6;cursor:default}

/* Reader menu: avatar in the masthead, dropdown on wide screens, bottom sheet on phones */
.masthead { position: relative; }
.masthead .tools { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; flex: 0 0 auto; }
.avatar { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--rule); background: var(--surface); color: var(--fg); font-family: var(--display); font-weight: 800; font-size: 15px; display: inline-grid; place-items: center; cursor: pointer; padding: 0; flex: 0 0 auto; }
.avatar:hover, .avatar[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.avatar.me { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); cursor: default; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 5; }
.menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 6; width: min(340px, 100%); max-height: calc(100vh - 180px); overflow: auto; background: var(--surface); color: var(--fg); border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); font-family: var(--display); }
.menu .who { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--rule); }
.menu .min0 { min-width: 0; }
.menu .who .nm { font-weight: 700; font-size: 15px; line-height: 1.2; }
.menu .who .em { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.menu .grp { padding: 6px; border-bottom: 1px solid var(--rule); }
.menu .grp .lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px 4px; }
.mi { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 10px; min-height: 44px; cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--fg); }
.mi:hover { background: var(--accent-soft); }
.mi.static { cursor: default; }
.mi.static:hover { background: transparent; }
.mi svg { flex: 0 0 auto; color: var(--muted); }
.mi .t { flex: 1; min-width: 0; }
.mi .t small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.mi .badge { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 7px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; margin-left: auto; }
.seg button { background: transparent; border: 0; padding: 6px 10px; min-height: 32px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.menu .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px 10px; font-size: 12px; color: var(--muted); }
body.menu-open { overflow: hidden; }
@media (max-width: 560px) {
  .menu { position: fixed; top: auto; right: 0; left: 0; bottom: 0; width: 100%; border-radius: 16px 16px 0 0; max-height: 88vh; overflow: auto; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .menu::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--rule); margin: 8px auto 0; }
}
@media (prefers-reduced-motion: no-preference) { .menu { animation: menu-in .16s ease-out; } .menu.still { animation: none; } @keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } } }

/* Reading an older edition */
.viewing { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--display); font-size: 13.5px; color: var(--fg); background: var(--accent-soft); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; margin-top: 14px; }
.viewing .link { padding: 0; min-height: 0; }

/* Menu pages (Following, Past editions, Feedback, Invite, About) */
.setup.page .pagebar { padding-top: 18px; }
.link.back { display: inline-flex; align-items: center; gap: 6px; padding-left: 0; }
.btn .back { margin-right: 2px; }
.soon { font-family: var(--display); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-left: 6px; }
.plist { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.prow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; min-height: 48px; border: 0; border-top: 1px solid var(--rule); background: transparent; color: var(--fg); font-family: var(--display); font-size: 14px; cursor: pointer; flex-wrap: wrap; }
.prow:first-child { border-top: 0; }
.prow:hover { background: var(--accent-soft); }
.prow.static, .prow.static:hover { cursor: default; background: transparent; }
.prow.on .pd { color: var(--accent); }
.prow:disabled { opacity: .6; cursor: default; }
.prow .pd { font-weight: 700; flex: 1 1 200px; min-width: 0; }
.prow .pn { font-family: var(--mono); font-size: 12px; color: var(--muted); }
textarea.ta { font-family: var(--body); font-size: 16px; line-height: 1.5; padding: 10px 14px; min-height: 140px; resize: vertical; width: 100%; }
.copy { font-size: 16px; line-height: 1.5; margin: 0; background: var(--bg); border: 1px dashed var(--rule); border-radius: 8px; padding: 12px 14px; user-select: all; -webkit-user-select: all; }
.about h3 { font-family: var(--display); font-weight: 700; font-size: 17px; margin: 0 0 4px; letter-spacing: -.005em; }
.about p { margin: 0; max-width: 65ch; }

/* Story actions, continuing marker, rating card, saved list, section order, large text */
.acts { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; }
.act { font-family: var(--display); font-size: 12px; font-weight: 700; color: var(--muted); background: transparent; border: 0; border-radius: 6px; padding: 6px 6px; min-height: 32px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.act:hover { color: var(--accent); background: var(--accent-soft); }
.act.on { color: var(--accent); }
.act.on svg { fill: currentColor; }
.cont { font-family: var(--display); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border-radius: 4px; padding: 1px 6px; margin-right: 8px; }
.rate { margin-top: 26px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; }
.rate .note { margin-top: 10px; }
h2.sub.savedh { font-family: var(--display); font-weight: 800; font-size: 18px; margin: 18px 0 4px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
h2.sub.savedh .n { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); }
.orow .obtns { display: inline-flex; gap: 2px; margin-left: auto; }
.orow .obtns .link { min-width: 40px; min-height: 40px; font-size: 14px; }
.orow .obtns .link:disabled { opacity: .3; cursor: default; }
:root[data-text="large"] body { font-size: 19px; }
:root[data-text="large"] .story h3 { font-size: 20px; }
:root[data-text="large"] .story p { max-width: 62ch; }
:root[data-text="large"] .gate-lead, :root[data-text="large"] .lead { font-size: 17px; }

/* Listen mode: player bar and the story being read */
.link.inline { padding: 0; min-height: 0; font-size: 13px; font-family: var(--mono); font-weight: 600; }
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 6px; background: var(--surface); border-top: 1px solid var(--rule); box-shadow: 0 -6px 24px rgba(0,0,0,.12); font-family: var(--display); padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.player[hidden] { display: none; }
.pbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--surface); color: var(--fg); display: inline-grid; place-items: center; cursor: pointer; padding: 0; flex: 0 0 auto; }
.pbtn:hover { border-color: var(--accent); color: var(--accent); }
.pbtn.main { width: 46px; height: 46px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pbtn.main .i-play { display: none; } .pbtn.main.paused .i-play { display: block; } .pbtn.main.paused .i-pause { display: none; }
.plabel { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.plabel b { color: var(--fg); font-weight: 700; }
.prate { font-family: var(--mono); font-weight: 600; font-size: 12.5px; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--fg); cursor: pointer; flex: 0 0 auto; }
.prate:hover { border-color: var(--accent); color: var(--accent); }
#p-voice { font-family: var(--display); font-size: 12.5px; min-height: 36px; max-width: 130px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--fg); padding: 0 6px; flex: 0 1 auto; }
@media (max-width: 560px) { #p-voice { display: none; } }
.story.reading { background: var(--accent-soft); box-shadow: 0 0 0 10px var(--accent-soft); border-radius: 4px; }
body.listening { padding-bottom: 96px; }
body.listening .totop { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
body.listening .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

/* Customize: browse selections (region, sector) look different from follow selections */
.chip.sel.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.scrollbox { max-height: 300px; overflow: auto; border: 1px solid var(--rule); border-radius: 10px; padding: 8px; background: var(--surface); margin-top: 8px; }

/* Sign-in code */
input.search.code { font-family: var(--mono); font-size: 20px; letter-spacing: .18em; text-align: center; min-height: 50px; flex: 1; min-width: 160px; }
.code-form { margin: 4px 0 10px; }

/* ---- stocks: watchlist rows + the per-symbol history page (v2.5) ---- */
.q.row { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; -webkit-appearance: none; appearance: none; }
.q.row:first-child { border-top: 0; }
.q.row:hover { background: var(--accent-soft); }
.q.row:focus-visible { outline-offset: -2px; }
.q .go { color: var(--muted); font-size: 18px; line-height: 1; margin-left: -4px; }
.spark { flex: 0 0 auto; color: var(--muted); opacity: .9; }
.spark.up { color: var(--up); } .spark.down { color: var(--down); }
.q.row .d { width: auto; min-width: 64px; white-space: nowrap; }
@media (max-width: 420px) { .q.row { gap: 8px; padding-inline: 12px; } .spark { width: 44px; height: 20px; } .q.row .sym { width: 52px; } }
.stock h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.stock h1 .tkr { font-family: var(--mono); letter-spacing: 0; }
.stock h1 .co { font-family: var(--display); font-weight: 500; font-size: clamp(16px, 4vw, 20px); color: var(--muted); }
.stock-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 18px 0 10px; }
.stock-price .big { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 9vw, 44px); letter-spacing: -.02em; line-height: 1; }
.stock-price .d { font-size: 16px; }
.stock-price .note { flex-basis: 100%; margin: 2px 0 0; }
.ranges { gap: 6px; margin: 6px 0 10px; }
.ranges .chip { min-height: 36px; padding: 6px 12px; font-family: var(--mono); font-size: 12.5px; }
.chart-wrap { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 10px 6px 4px; }
.chart { display: block; width: 100%; height: auto; touch-action: pan-y; color: var(--accent); }
.chart.up { color: var(--up); } .chart.down { color: var(--down); }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .ax { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.chart .ax.start { text-anchor: start; } .chart .ax.mid { text-anchor: middle; } .chart .ax.end { text-anchor: end; }
.chart .area { fill: url(#cg); }
.chart .line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .xhl { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: currentColor; stroke: var(--surface); stroke-width: 2; }
.chart-wrap .tip { position: absolute; top: 8px; left: 0; pointer-events: none; background: var(--fg); color: var(--bg); font-family: var(--display); font-size: 13px; line-height: 1.35; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.chart-wrap .tip .d.up { color: #8be0b0; } .chart-wrap .tip .d.down { color: #ffb3ab; } .chart-wrap .tip .d.flat { color: inherit; }
.chart-wrap .tip .muted { opacity: .75; }
.range-sum { font-family: var(--display); font-size: 14px; margin: 10px 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.range-sum .muted, .muted { color: var(--muted); }
.stock-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
@media (min-width: 560px) { .stock-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stock-stats .tile .v { font-size: 16px; font-family: var(--mono); font-weight: 600; }
.stock-stats .tile .d { font-size: 14px; }
.sub-h { font-family: var(--display); font-weight: 800; font-size: 18px; margin: 22px 0 8px; }
table.closes { width: 100%; border-collapse: collapse; font-family: var(--display); font-size: 14px; }
table.closes th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
table.closes td { padding: 9px 12px; border-top: 1px solid var(--rule); }
table.closes td:first-child { white-space: nowrap; }
table.closes tr:first-child td { border-top: 0; }
table.closes .num, table.closes th:not(:first-child) { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.closes .d { font-size: 13px; }

/* ---- Customize v2 (3.0): sport tabs and league cards, players with alert bells, ZIP and metro cards, segmented controls ---- */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding: 4px 4px 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .chip { flex: 0 0 auto; }
.lcard { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; margin-top: 8px; }
.lcard.open { border-color: var(--accent); }
.lcard .lhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lcard .lname { font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: -.01em; flex: 1 1 160px; min-width: 0; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 40px; justify-content: center; }
.lcard .lname small { font-family: var(--display); font-weight: 500; font-size: 12.5px; color: var(--muted); }
.lcard .lname .n { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--accent); }
.sw { font-family: var(--display); font-weight: 700; font-size: 12.5px; min-height: 36px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sw i { width: 28px; height: 16px; border-radius: 8px; background: var(--rule); position: relative; transition: background .15s; }
.sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); transition: left .15s; }
.sw.on { color: var(--accent); border-color: var(--accent); }
.sw.on i { background: var(--accent); }
.sw.on i::after { left: 14px; }
.lcard .lbody { padding-top: 10px; }
.lcard .grp:first-child { margin-top: 0; }
.chip.near { border-style: dashed; }
.chip.on.near { border-style: solid; }
.tray { position: sticky; bottom: 0; z-index: 3; margin-top: 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 13px; box-shadow: 0 -4px 20px rgba(0,0,0,.08); }
.tray b { font-weight: 800; }
.tray .muted { flex: 1; min-width: 0; }
input.zip { font-family: var(--mono); font-size: 22px; letter-spacing: .14em; min-height: 52px; width: 160px; text-align: center; }
.ziprow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.place { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; margin-top: 10px; }
.place .pl { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.place .pm { font-family: var(--display); font-size: 13px; color: var(--muted); margin-top: 2px; }
.srcs { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-family: var(--display); font-size: 13.5px; margin-top: 10px; }
.srcs dt { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; }
.srcs dd { margin: 0; }
@media (max-width: 420px) { .srcs { grid-template-columns: 1fr; gap: 2px; } .srcs dd { margin-bottom: 6px; } }
.seg.big { margin-left: 0; flex-wrap: wrap; }
.seg.big button { min-height: 44px; padding: 8px 14px; font-size: 13px; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.seg.big button small { font-weight: 500; font-size: 11px; opacity: .8; }
.seg.big button.on small { opacity: .9; }
.cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pill-n { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.chips.wrap-sm { gap: 6px; }
.lead.step { max-width: 62ch; }
.hint { font-family: var(--display); font-size: 12.5px; color: var(--muted); }
.tags-by { display: flex; flex-direction: column; gap: 8px; }
.tags-by .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.tags-by .row .lbl { font-family: var(--display); font-size: 12px; font-weight: 700; color: var(--muted); min-width: 110px; }

/* Players: chip with a separate alert bell; rosters inside league cards; metro counties line */
.pchip { display: inline-flex; align-items: stretch; border-radius: 999px; overflow: hidden; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.pchip .pname { font-family: var(--display); font-weight: 700; font-size: 13px; line-height: 1.2; padding: 10px 10px 10px 14px; min-height: 44px; background: transparent; border: 0; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; text-align: left; }
.pchip .pname .sub { font-weight: 500; font-size: 11px; opacity: .78; }
.pchip .pname .x { font-weight: 800; opacity: .7; }
.pchip .bell { background: transparent; border: 0; border-left: 1px solid rgba(255,255,255,.35); color: inherit; opacity: .55; padding: 0 12px 0 10px; min-width: 40px; cursor: pointer; display: inline-grid; place-items: center; }
.pchip .bell.on { opacity: 1; background: rgba(255,255,255,.18); }
.pchip .bell.on svg { fill: currentColor; }
:root[data-theme="dark"] .pchip .bell, :root:not([data-theme="light"]) .pchip .bell { border-left-color: rgba(0,0,0,.25); }
.roster { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--rule); border-radius: 10px; }
.tag.alert { border-color: var(--accent); color: var(--accent); }
.tag.alert svg { width: 12px; height: 12px; }
.metro-counties { font-size: 12.5px; line-height: 1.45; margin-top: 4px; }
.lcard .lbody .grp:first-child { margin-top: 0; }

/* Invite banner: a dismissable bar at the bottom of the brief */
.invite-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 3; width: min(680px, calc(100vw - 32px)); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.16); font-family: var(--display); font-size: 13.5px; }
.invite-banner .t { flex: 1; min-width: 0; line-height: 1.35; }
.invite-banner .t b { font-weight: 800; }
.invite-banner .btn { flex: 0 0 auto; min-height: 40px; padding: 0 14px; }
.invite-banner .x { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 20px; font-weight: 800; cursor: pointer; display: inline-grid; place-items: center; }
.invite-banner .x:hover { background: var(--accent-soft); color: var(--accent); }
body.invite-banner-on { padding-bottom: 120px; }
body.invite-banner-on .totop { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
body.invite-banner-on .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
body.listening .invite-banner { display: none; }
@media (max-width: 480px) { .invite-banner { flex-wrap: wrap; padding: 10px 8px 10px 14px; } .invite-banner .t { flex-basis: calc(100% - 46px); } .invite-banner .btn { margin-left: 0; } }

/* Quick Start, first-brief welcome and the Home Screen explainer (growth plan, Workstream B, Oct 28, 2026) */
.welcome { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-top: 14px; background: var(--accent-soft); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 10px 12px 16px; font-family: var(--display); font-size: 14px; line-height: 1.4; }
.welcome .t { flex: 1 1 240px; min-width: 0; }
.welcome .chips { flex-basis: 100%; gap: 6px; margin: 0; }
.welcome .chips .chip { min-height: 36px; padding: 6px 12px; background: var(--surface); }
.welcome .x { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 20px; font-weight: 800; cursor: pointer; display: inline-grid; place-items: center; margin-left: auto; }
.welcome .x:hover { background: var(--surface); color: var(--accent); }
.quick .place { margin-top: 10px; }
.quick .actions .btn { flex: 1 1 200px; justify-content: center; }
.tag.soonish { border-color: var(--accent); color: var(--accent); }
.prow .link { margin-left: auto; }

/* Invite links (growth plan, Workstream C, Oct 28, 2026) */
.copy.mono { font-family: var(--mono); font-size: 14px; word-break: break-all; }
.linkcard .chips { gap: 8px; }
.linkcard .chips .btn { flex: 1 1 110px; justify-content: center; text-decoration: none; }
.invite-land .gate-form { padding: 0; border: 0; background: transparent; }
.invite-land .gate-lead b { font-weight: 700; }

/* Public front door (growth plan, Workstream D, Oct 28, 2026) */
.landing-head .row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.landing-head .row .link { padding: 0; min-height: 0; font-weight: 700; }
.hero { padding: 22px 0 10px; display: flex; flex-direction: column; gap: 14px; }
.tagline { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 5.6vw, 30px); letter-spacing: -.02em; line-height: 1.12; color: var(--accent); margin: 0; max-width: 20ch; }
.sample { margin-top: 18px; padding-top: 6px; border-top: 3px solid var(--fg); }
.sample .dateline { font-family: var(--display); font-size: 13.5px; color: var(--muted); padding: 10px 0 2px; }
.sample .dateline b { color: var(--fg); }
.sample .dateline em { font-style: italic; }
.how, .keep { margin-top: 28px; }
.hcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.hcard { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; }
.hcard h3 { font-family: var(--display); font-weight: 700; font-size: 15px; margin: 0 0 6px; letter-spacing: -.005em; }
.hcard p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.keep p { margin: 8px 0 0; max-width: 65ch; }

.invite-banner.ask .btn.ghost { margin-left: 0; }
@media (max-width: 480px) { .invite-banner.ask { gap: 8px; } .invite-banner.ask .t { flex-basis: 100%; } }

/* Stock page: hop between watchlist symbols without going back (v3.5.3) */
.stock .hop { gap: 6px; margin: 4px 0 -6px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.stock .hop::-webkit-scrollbar { display: none; }
.stock .hop .chip { flex: 0 0 auto; min-height: 34px; padding: 6px 12px; font-family: var(--mono); font-size: 12.5px; }
