/* Newslytter — one stylesheet for every page.
   Look: Material 3 (Flutter's default design language), phone first, built with ui-ux-pro-max.
   Colours: a Material 3 scheme from one seed, blue #0b57d0 (ColorScheme.fromSeed), on neutral grey
   surfaces, light and dark. Type: Roboto, kept on this site so the installed app needs nothing from outside; the
   Material type scale (headline / title / body / label). Shapes: cards 12px, dialogs 28px, FAB
   16px, buttons fully round, text fields 4px. Frame: top app bar (64px), a navigation bar at the
   bottom on phones (80px) that becomes a navigation rail on the left from 600px, one floating
   action button per screen. Spacing on a 4/8px rhythm; touch targets 48px; a ripple on every
   tappable thing (app.js). Window classes: compact < 600, medium 600-839, expanded >= 840. */

@font-face {
  font-family: "Roboto";
  src: url("/assets/fonts/roboto-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Colours: Material 3, seed blue #0b57d0, neutral grey surfaces (no tinted surfaces). */
:root {
  --primary: #0b57d0;            --on-primary: #ffffff;
  --primary-container: #d3e3fd;  --on-primary-container: #041e49;
  --secondary: #5b6170;          --on-secondary: #ffffff;
  --secondary-container: #dde3ee; --on-secondary-container: #171c24;
  --tertiary-container: #ffdea8; --on-tertiary-container: #2a1800;
  --error: #b3261e;              --on-error: #ffffff;
  --error-container: #f9dedc;    --on-error-container: #410e0b;
  --success: #146c2e;            --success-container: #c4eed0; --on-success-container: #072711;
  --surface: #f8f9fb;            --on-surface: #1b1c1f;  --on-surface-variant: #44474e;
  --surface-lowest: #ffffff;     --surface-low: #ffffff;  --surface-container: #eef1f5;
  --surface-high: #e9ecf1;       --surface-highest: #e1e4ea;
  --outline: #74777f;            --outline-variant: #d3d6dc;
  --data-muted: #8a8d95;         /* a chart mark that is data but not the highlight: 3:1 on cards */
  --inverse-surface: #2f3033;    --inverse-on-surface: #f1f0f4; --inverse-primary: #a8c7fa;
  --scrim: rgba(0, 0, 0, .4);
  --elev-1: 0 1px 2px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
  --elev-2: 0 2px 4px rgba(16, 24, 40, .1), 0 4px 10px rgba(16, 24, 40, .08);
  --elev-3: 0 4px 8px rgba(16, 24, 40, .12), 0 8px 20px rgba(16, 24, 40, .1);
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --appbar: 64px;
  --navbar: 80px;
  --rail: 72px;
  --gutter: 16px;
  --tf-bg: var(--surface);
  --ease: cubic-bezier(.2, 0, 0, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #a8c7fa;            --on-primary: #062e6f;
    --primary-container: #0842a0;  --on-primary-container: #d3e3fd;
    --secondary: #c2c7d2;          --on-secondary: #2c313a;
    --secondary-container: #3a404b; --on-secondary-container: #dde3ee;
    --tertiary-container: #5c4300; --on-tertiary-container: #ffdea8;
    --error: #f2b8b5;              --on-error: #601410;
    --error-container: #8c1d18;    --on-error-container: #f9dedc;
    --success: #8bd8a0;            --success-container: #0f5223; --on-success-container: #c4eed0;
    --surface: #121316;            --on-surface: #e3e2e6;  --on-surface-variant: #c4c6d0;
    --surface-lowest: #0d0e11;     --surface-low: #1a1b1f;  --surface-container: #1e1f23;
    --surface-high: #282a2e;       --surface-highest: #333539;
    --outline: #8e9099;            --outline-variant: #3d4048;
    --data-muted: #6c6f77;
    --inverse-surface: #e3e2e6;    --inverse-on-surface: #2f3033; --inverse-primary: #0b57d0;
    --scrim: rgba(0, 0, 0, .6);
    --elev-1: none;
    color-scheme: dark;
  }
}

/* ---- base ------------------------------------------------------------------------------------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--on-surface); font: 400 16px/24px var(--font); letter-spacing: .01em; min-height: 100vh; }
a { color: var(--primary); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h2 { font-size: 16px; line-height: 24px; font-weight: 500; }
p { margin: 0 0 12px; }
[hidden] { display: none !important; }
/* Read by screen readers, not shown: live messages, and words a mark stands for ("Done:"). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.ic { flex: none; display: block; }
/* The mark's lines take the colour that reads on --primary: white in light mode, dark navy on the light blue of dark mode. */
.mark rect + rect { fill: var(--on-primary); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--on-surface-variant); }
.small { font-size: 14px; line-height: 20px; }

/* ---- the frame -------------------------------------------------------------------------------- */
.practice { background: var(--tertiary-container); color: var(--on-tertiary-container); text-align: center; font-size: 12px; line-height: 16px; padding: 6px 16px; }
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px; height: var(--appbar); padding: 0 4px;
  background: var(--surface); transition: background-color .2s var(--ease); }
.appbar.is-scrolled { background: var(--surface-low); box-shadow: 0 1px 0 var(--outline-variant); }
.appbar-brand { display: grid; place-items: center; width: 48px; height: 48px; color: var(--primary); flex: none; }
.appbar-title { flex: 1; min-width: 0; font-size: 22px; line-height: 28px; font-weight: 400; margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-actions { display: flex; align-items: center; position: relative; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; overflow: hidden; background: var(--secondary-container); }
.progress span { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--primary); animation: indet 1.4s var(--ease) infinite; }
/* Moved with transform (no layout each frame): -100% of its own 40% width to 250% of it = the bar's far edge. */
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.icon-btn { position: relative; overflow: hidden; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: transparent;
  color: var(--on-surface-variant); cursor: pointer; text-decoration: none; flex: none; }
.icon-btn::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: currentColor; opacity: 0; transition: opacity .15s; }
.icon-btn:hover::before { opacity: .08; }
.initial { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-container); color: var(--on-primary-container); display: grid; place-items: center;
  font-size: 14px; font-weight: 500; }

.navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--navbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: var(--surface-low); border-top: 1px solid var(--outline-variant); }
.nav-item { position: relative; overflow: hidden; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--on-surface-variant); text-decoration: none; min-height: 48px; }
.nav-pill { display: grid; place-items: center; width: 64px; height: 32px; border-radius: 16px; transition: background-color .2s var(--ease); }
.nav-item:hover .nav-pill { background: color-mix(in srgb, var(--on-surface) 8%, transparent); }
.nav-item[aria-current="page"] { color: var(--on-surface); }
.nav-item[aria-current="page"] .nav-pill { background: var(--secondary-container); color: var(--on-secondary-container); }
.nav-label { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .04em; }
.nav-item[aria-current="page"] .nav-label { font-weight: 700; }
.nav-fab { position: fixed; right: 16px; bottom: calc(var(--navbar) + 16px + env(safe-area-inset-bottom)); z-index: 31; }
.nav-fab:empty { display: none; }
body.has-nav { padding-bottom: calc(var(--navbar) + env(safe-area-inset-bottom)); }
body.has-fab main { padding-bottom: 96px; }

.fab { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px 0 16px; border: 0; border-radius: 16px;
  background: var(--primary-container); color: var(--on-primary-container); font: 500 14px/20px var(--font); letter-spacing: .01em; cursor: pointer; box-shadow: var(--elev-3); }
.fab::before { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity .15s; }
.fab:hover::before { opacity: .08; }

main { width: 100%; max-width: 840px; margin: 0 auto; padding: 8px var(--gutter) 32px; }

/* medium and expanded windows: the navigation bar becomes a compact rail on the left (72px, 48px button) */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  body.has-nav { padding-bottom: 0; padding-left: var(--rail); }
  .navbar { top: 0; right: auto; width: var(--rail); height: auto; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 8px 0 0; border-top: 0; border-right: 1px solid var(--outline-variant); }
  .nav-item { flex: none; height: 52px; gap: 2px; }
  .nav-pill { width: 52px; height: 28px; border-radius: 14px; }
  .nav-fab { position: static; display: flex; justify-content: center; margin: 4px 0 12px; }
  .nav-fab:empty { display: flex; height: 48px; }
  .fab { width: 48px; height: 48px; border-radius: 14px; padding: 0; justify-content: center; box-shadow: var(--elev-1); }
  .fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  body.has-fab main { padding-bottom: 32px; }
  .appbar { padding: 0 12px 0 8px; }
}
@media (min-width: 840px) {
  main { padding: 8px 24px 48px; }
}

/* ---- cards ------------------------------------------------------------------------------------ */
.card { background: var(--surface-low); border: 1px solid var(--outline-variant); border-radius: 12px; padding: 16px; --tf-bg: var(--surface-low); }
.card-filled { background: var(--surface-container); border-color: transparent; }
.card-outlined { background: var(--surface); border: 1px solid var(--outline-variant); box-shadow: none; --tf-bg: var(--surface); }
.card-tonal { background: var(--primary-container); color: var(--on-primary-container); border-color: transparent; }
.card-error { background: var(--error-container); color: var(--on-error-container); border-color: transparent; }
.card-link { position: relative; overflow: hidden; display: block; color: inherit; text-decoration: none; }
.card-link::before { content: ""; position: absolute; inset: 0; background: var(--on-surface); opacity: 0; transition: opacity .15s; pointer-events: none; }
.card-link:hover::before { opacity: .08; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.section-head h2 { flex: 1; }
.count { color: var(--on-surface-variant); font-size: 14px; font-weight: 400; margin-left: 6px; }
.stack { display: grid; gap: 8px; }

/* ---- lists ------------------------------------------------------------------------------------ */
.list { list-style: none; margin: 0; padding: 0; }
.list-card { background: var(--surface-low); border: 1px solid var(--outline-variant); border-radius: 12px; overflow: hidden; }
.list-item { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 8px 16px; color: inherit; text-decoration: none; }
a.list-item, button.list-item { cursor: pointer; }
button.list-item { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; }
a.list-item::before, button.list-item::before { content: ""; position: absolute; inset: 0; background: var(--on-surface); opacity: 0; transition: opacity .15s; pointer-events: none; }
a.list-item:hover::before, button.list-item:hover::before { opacity: .08; }
.list > li + li { border-top: 1px solid var(--outline-variant); }
.li-main { flex: 1; min-width: 0; }
.li-head { display: block; font-size: 16px; line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { display: block; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.li-trail { flex: none; color: var(--on-surface-variant); font-size: 12px; line-height: 16px; font-weight: 500; text-align: right; display: flex; align-items: center; gap: 4px; }
.empty { color: var(--on-surface-variant); padding: 24px 16px; text-align: center; font-size: 14px; line-height: 20px; }

/* ---- chips and badges ------------------------------------------------------------------------- */
.chip { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--outline-variant);
  background: transparent; color: var(--on-surface-variant); font: 500 14px/20px var(--font); white-space: nowrap; flex: none; }
.tag { display: inline-flex; align-items: center; flex: none; white-space: nowrap; height: 24px; padding: 0 10px; border-radius: 8px;
  font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .04em; background: var(--surface-highest); color: var(--on-surface-variant); }
.tag.ok { background: var(--success-container); color: var(--on-success-container); }
.tag.warn { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.tag.bad { background: var(--error-container); color: var(--on-error-container); }
.tag.accent { background: var(--primary-container); color: var(--on-primary-container); }

/* ---- avatars ---------------------------------------------------------------------------------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-highest); display: block; flex: none; }
.avatar-lg { width: 96px; height: 96px; }
.faces { display: flex; padding-left: 10px; flex: none; }
.faces .avatar, .faces .face-more, .faces .face-none { width: 40px; height: 40px; margin-left: -10px; box-shadow: 0 0 0 2px var(--surface-low); border-radius: 50%; }
.faces img { max-width: none; }
.faces .face-more { display: grid; place-items: center; background: var(--secondary-container); color: var(--on-secondary-container); font-size: 12px; font-weight: 500; }
.faces .face-none { background: var(--surface-highest); }
.is-removed .avatar { filter: grayscale(1); opacity: .6; }

/* ---- buttons ---------------------------------------------------------------------------------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-width: 48px; padding: 0 24px;
  border-radius: 20px; border: 0; background: var(--primary); color: var(--on-primary); font: 500 14px/20px var(--font); letter-spacing: .01em;
  cursor: pointer; text-decoration: none; white-space: nowrap; flex: none; }
.btn::before { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity .15s; pointer-events: none; }
.btn:hover::before { opacity: .08; }
.btn:active::before { opacity: .12; }
.btn.tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn.outlined { background: transparent; color: var(--primary); border: 1px solid var(--outline); }
.btn.quiet, .btn.text { background: transparent; color: var(--primary); padding: 0 12px; }
.btn.danger { background: transparent; color: var(--error); padding: 0 12px; }
.btn.small { height: 36px; padding: 0 16px; }
.btn.wide { width: 100%; }
.btn[disabled] { background: color-mix(in srgb, var(--on-surface) 12%, transparent); color: color-mix(in srgb, var(--on-surface) 50%, transparent); border-color: transparent; cursor: default; }
.btn.quiet[disabled], .btn.text[disabled] { background: transparent; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .18; transform: scale(0); animation: ripple .55s var(--ease) forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
/* Reading screens: room under the last card, so it scrolls clear of the message bar (Undo) and its buttons stay reachable. */
main.room-below { padding-bottom: 120px; }
/* A button whose work is under way (Summarize again). */
.icon-btn.spin .ic, .btn.spin .ic { animation: spin 1.1s linear infinite; }
/* Summarize again, under the email (issue.html), and its result line. */
.redo-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 16px 0; }
.redo-note { margin: 0; max-width: 560px; text-align: center; font-size: 13px; line-height: 18px; color: var(--on-surface-variant); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- text fields (outlined, floating label) --------------------------------------------------- */
.tf { position: relative; margin: 8px 0 0; }
.tf input { width: 100%; height: 56px; padding: 16px; font: 400 16px/24px var(--font); color: var(--on-surface); background: transparent;
  border: 1px solid var(--outline); border-radius: 4px; outline: 0; }
.tf input:hover { border-color: var(--on-surface); }
.tf input:focus { border: 2px solid var(--primary); padding: 15px; }
.tf label { position: absolute; left: 12px; top: 16px; padding: 0 4px; font-size: 16px; line-height: 24px; color: var(--on-surface-variant); background: var(--tf-bg);
  pointer-events: none; transition: top .15s var(--ease), font-size .15s var(--ease), color .15s; }
.tf input:focus + label, .tf input:not(:placeholder-shown) + label { top: -9px; font-size: 12px; line-height: 16px; }
.tf input:focus + label { color: var(--primary); }
.tf input::placeholder { color: transparent; }
.tf input:focus::placeholder { color: var(--on-surface-variant); }
.tf input[aria-invalid=true] { border-color: var(--error); }
.tf input[aria-invalid=true] + label { color: var(--error); }
.tf-help { font-size: 12px; line-height: 16px; color: var(--on-surface-variant); margin: 4px 16px 0; }
.tf-error { font-size: 12px; line-height: 16px; color: var(--error); margin: 4px 16px 0; }
.tf .code { font-variant-numeric: tabular-nums; font-size: 24px; letter-spacing: .4em; text-align: center; }

/* ---- messages --------------------------------------------------------------------------------- */
.note { border-radius: 12px; padding: 12px 16px; background: var(--surface-highest); margin: 0 0 16px; font-size: 14px; line-height: 20px; }
.note.bad { background: var(--error-container); color: var(--on-error-container); }
.note.ok { background: var(--success-container); color: var(--on-success-container); }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 14px 16px; border-radius: 4px; background: var(--inverse-surface); color: var(--inverse-on-surface); font-size: 14px; line-height: 20px; box-shadow: var(--elev-3); }
body.has-nav .toast { bottom: calc(var(--navbar) + 16px + env(safe-area-inset-bottom)); }
body.has-fab .toast { bottom: calc(var(--navbar) + 88px + env(safe-area-inset-bottom)); }
.toast .btn { background: transparent; color: var(--inverse-primary); padding: 0 8px; margin-left: auto !important; }
@media (min-width: 600px) { .toast, body.has-nav .toast, body.has-fab .toast { left: calc(var(--rail) + 24px); right: auto; max-width: 560px; bottom: 24px; } }

/* ---- dialogs and menus ------------------------------------------------------------------------ */
dialog { --tf-bg: var(--surface-high); border: 0; border-radius: 28px; padding: 0; width: min(560px, calc(100% - 48px)); background: var(--surface-high); color: var(--on-surface); box-shadow: var(--elev-3); }
dialog::backdrop { background: var(--scrim); }
.dlg { padding: 24px; }
.dlg h2 { font-size: 24px; line-height: 32px; font-weight: 400; margin-bottom: 16px; }
.dlg-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.dlg-head h2 { margin: 0; }
.dlg p.desc { font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.dlg .btns { margin-top: 24px; justify-content: flex-end; }
.menu { position: absolute; right: 0; top: 48px; z-index: 40; min-width: 220px; padding: 8px 0; border-radius: 4px; background: var(--surface-container); box-shadow: var(--elev-2); }
.menu-item { position: relative; overflow: hidden; display: flex; align-items: center; width: 100%; height: 48px; padding: 0 16px; border: 0; background: transparent;
  color: var(--on-surface); font: 400 14px/20px var(--font); text-align: left; cursor: pointer; }
.menu-item::before { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity .15s; }
.menu-item:hover::before, .menu-item:focus-visible::before { opacity: .08; }
.menu-item.is-danger { color: var(--error); }

/* ---- tabs ------------------------------------------------------------------------------------- */
/* Material 3 scrollable tabs: tabs share the row while they fit; past that the row scrolls sideways
   (never the page), and the chosen tab is scrolled into view (newsletter.html). */
.tabs { position: sticky; top: var(--appbar); z-index: 20; display: flex; background: var(--surface); border-bottom: 1px solid var(--surface-highest); margin: 0 calc(-1 * var(--gutter));
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.tabs::-webkit-scrollbar { display: none; }
/* A tab row with arrows (newsletter.html): the bar is what sticks; a fade plus an arrow shows on whichever side has
   more tabs out of view (data-more-left / data-more-right, set by the page). No scrollbar anywhere. */
.tabbar { position: sticky; top: var(--appbar); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--surface-highest); margin: 0 calc(-1 * var(--gutter)); }
.tabbar .tabs { position: static; border-bottom: 0; margin: 0; }
.tabs-arrow { position: absolute; top: 0; bottom: 0; z-index: 1; width: 56px; display: none; align-items: center; padding: 0 8px; border: 0; color: var(--on-surface-variant); cursor: pointer; }
.tabs-arrow.left { left: 0; justify-content: flex-start; background: linear-gradient(to right, var(--surface) 50%, transparent); }
.tabs-arrow.right { right: 0; justify-content: flex-end; background: linear-gradient(to left, var(--surface) 50%, transparent); }
.tabs-arrow.left .ic { transform: scaleX(-1); }
.tabs-arrow:hover { color: var(--on-surface); }
.tabbar[data-more-left] .tabs-arrow.left, .tabbar[data-more-right] .tabs-arrow.right { display: flex; }
/* On touch screens the row is swiped: the edge stays a fade only, so a tap lands on the tab under it. */
@media (hover: none) { .tabs-arrow { width: 32px; pointer-events: none; } .tabs-arrow .ic { display: none; } }
.tab { position: relative; overflow: hidden; flex: 1 0 auto; height: 48px; padding: 0 16px; border: 0; background: transparent; color: var(--on-surface-variant); font: 500 14px/20px var(--font); white-space: nowrap; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--primary); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 56px; height: 3px; margin-left: -28px; border-radius: 3px 3px 0 0; background: var(--primary); }
.tab .count { font-weight: 400; margin-left: 2px; color: inherit; }
@media (min-width: 600px) { .tabs, .tabbar { margin: 0; } .tab { padding: 0 16px; } }
.tabpanel { padding-top: 16px; }

/* ---- home ------------------------------------------------------------------------------------- */
.hello { margin: 8px 0 16px; }
.hello h2 { font-size: 28px; line-height: 36px; font-weight: 400; }
.finding { display: flex; gap: 16px; align-items: flex-start; }
.finding p { margin: 0; font-size: 14px; line-height: 20px; }
.finding strong { font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.stat { border-radius: 12px; padding: 16px; background: var(--surface-low); border: 1px solid var(--outline-variant); }
.stat-value { font-size: 32px; line-height: 40px; font-weight: 400; margin: 0; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 14px; line-height: 20px; color: var(--on-surface-variant); margin: 0; }
.stat.is-lead { background: var(--primary-container); color: var(--on-primary-container); border-color: transparent; }
.stat.is-lead .stat-label { color: var(--on-primary-container); }
@media (min-width: 840px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Home starts with the newsletters: no gap above the first section. */
#home > .section:first-child { margin-top: 0; }
.nl-top { display: flex; align-items: center; gap: 16px; }
.nl-week { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
/* A newsletter's description (written from its channels) and its most off-topic channel, under its name. */
.nl-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 12px; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.nl-fit { display: block; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.nl-fit strong { font-weight: 500; color: var(--on-surface); }
/* Home's search (search-newsletters): the bar under the heading, then where each card matched, one line each. */
.nl-find { display: flex; margin: 0 0 12px; max-width: 560px; }
.nl-find .search { flex: 1 1 auto; }
.nl-why { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; line-height: 18px; color: var(--on-surface-variant); min-width: 0; }
.nl-why .ic { color: var(--primary); }
.nl-why-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-why-label { font-weight: 500; color: var(--on-surface); }
.nl-why-more { flex: none; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; flex: 1; max-width: 240px; }
.week i { display: block; height: 8px; border-radius: 4px; background: transparent; box-shadow: inset 0 0 0 1px var(--outline); font-style: normal; }
.week i.sent { background: var(--primary); box-shadow: none; }
.week i.nil { background: var(--data-muted); box-shadow: none; }
.week i.failed { background: var(--error); box-shadow: none; }
.nl-week .li-trail { margin-left: auto; }
/* A newsletter card: the top opens the newsletter, the footer opens Read and the notebook. */
.nl-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.nl-card > .nl-link { padding: 16px 16px 12px; flex: 1; }
.nl-acts { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 12px 12px; }
.nl-acts .btn { gap: 6px; padding: 0 14px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--on-surface-variant); font-size: 12px; line-height: 16px; margin: 0 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 16px; height: 8px; border-radius: 4px; display: inline-block; }
.swatch.sent { background: var(--primary); }
.swatch.nil { background: var(--data-muted); }
.swatch.failed { background: var(--error); }
.st-ok { color: var(--success); }
.st-bad { color: var(--error); }
/* minmax(0, 1fr): the column is the screen's width, never the widest card's content (that made phones scroll sideways). */
.nl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 840px) { .nl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.skel { height: 112px; border-radius: 12px; background: var(--surface-container); }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; font-size: 14px; line-height: 20px; }
.kv li + li { border-top: 1px solid var(--outline-variant); }
.kv span:first-child { color: var(--on-surface-variant); }

/* ---- one newsletter --------------------------------------------------------------------------- */
.summary { margin: 8px 0 16px; }
.summary p { margin: 0; font-size: 14px; line-height: 20px; }
.danger-zone { margin-top: 32px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.danger-zone p { margin: 0; color: var(--on-surface-variant); font-size: 14px; line-height: 20px; flex: 1 1 240px; }

/* ---- settings --------------------------------------------------------------------------------- */
.set-group { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--primary); margin: 24px 16px 8px; }
.set-card { background: var(--surface-low); border: 1px solid var(--outline-variant); border-radius: 12px; padding: 16px; --tf-bg: var(--surface-low); }
.set-card > :last-child { margin-bottom: 0; }

/* ---- one email -------------------------------------------------------------------------------- */
.reader { width: 100%; min-height: 72vh; border: 0; background: var(--surface-container); display: block; }
/* clip, not hidden: hidden would make the frame a scroll box, and the answers kept at the screen's bottom
   (issue.html, position: sticky) would stop sticking. Browsers without clip keep hidden. */
.reader-frame { margin-top: 8px; border-radius: 12px; overflow: hidden; overflow: clip; background: var(--surface-container); }

/* ---- sign in, set-up (no frame) --------------------------------------------------------------- */
.solo { max-width: 440px; padding: 48px 16px; }
.solo .brand { display: inline-flex; color: var(--primary); margin-bottom: 24px; }
.solo .brand .mark { width: 48px; height: 48px; }
.solo h1 { font-size: 28px; line-height: 36px; font-weight: 400; }
.solo .lead { color: var(--on-surface-variant); font-size: 14px; line-height: 20px; margin: 8px 0 24px; }
.solo .foot { color: var(--on-surface-variant); font-size: 14px; line-height: 20px; margin: 16px 0 0; text-align: center; }
.steps { margin: 0; padding-left: 20px; }
.steps > li { margin-bottom: 24px; }
.steps > li:last-child { margin-bottom: 0; }

/* ---- channel page: numbers, search, filters, a reading panel ------------------------------------ */
main.wide { max-width: 1360px; }
.ch-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 8px 0 20px; }
.ch-head .avatar { width: 72px; height: 72px; }
.ch-id { flex: 1 1 320px; min-width: 0; }
.ch-id .ch-name { font-size: 28px; line-height: 36px; font-weight: 400; }
.ch-id .sub { margin: 2px 0 0; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.ch-id .desc { margin: 6px 0 0; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); max-width: 80ch; }
.ch-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; position: relative; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 840px) { .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kpi { border-radius: 12px; padding: 14px 16px; background: var(--surface-low); border: 1px solid var(--outline-variant); min-width: 0; }
.kpi-label { margin: 0; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--on-surface-variant); }
.kpi-value { margin: 2px 0; font-size: 28px; line-height: 36px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { margin: 0; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.insights { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.insights .card { flex: 1 1 380px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.card-head span { font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.hours { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; align-items: end; height: 96px; margin-top: 16px; }
.hours i { display: block; min-height: 2px; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--primary) 62%, var(--surface-low)); }
.hours i.on { background: var(--primary); }
.hours-axis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); font-size: 11px; line-height: 16px; color: var(--on-surface-variant); margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--outline-variant); }
.insight-note { margin: 10px 0 0; font-size: 13px; line-height: 18px; color: var(--on-surface-variant); }
.insight-note strong { color: var(--on-surface); font-weight: 500; }
.topics { display: grid; gap: 2px; margin-top: 10px; }
.topic { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 32px; align-items: center; gap: 12px; min-height: 36px;
  padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--on-surface); font: 500 13px/18px var(--font); text-align: left; cursor: pointer; }
.topic:hover { background: var(--surface-container); }
.topic[aria-pressed="true"] { background: var(--primary-container); color: var(--on-primary-container); }
.topic .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic .bar { height: 8px; border-radius: 4px; background: var(--surface-container); overflow: hidden; }
.topic .bar b { display: block; height: 8px; border-radius: 4px; background: var(--primary); }
.topic .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--on-surface-variant); }
.filters { margin-top: 8px; display: grid; gap: 12px; }
.f-row { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 320px; min-width: 0; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 16px; border-radius: 24px; background: var(--surface-container); color: var(--on-surface-variant); }
.search:focus-within { outline: 2px solid var(--primary); outline-offset: 0; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--on-surface); font: 400 15px/20px var(--font); }
.search input::-webkit-search-cancel-button { display: none; }
.search .icon-btn { width: 40px; height: 40px; }
/* Material 3 segmented buttons: each segment carries its own border, so the ripple and the rounded ends stay clean. */
.seg { display: inline-flex; flex: none; }
.seg button { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 14px; margin-left: -1px;
  border: 1px solid var(--outline); border-radius: 0; background: transparent; color: var(--on-surface); font: 500 13px/18px var(--font); white-space: nowrap; cursor: pointer; }
.seg button:first-child { margin-left: 0; border-radius: 20px 0 0 20px; padding-left: 16px; }
.seg button:last-child { border-radius: 0 20px 20px 0; padding-right: 16px; }
.seg button:hover { background: color-mix(in srgb, var(--on-surface) 6%, transparent); }
.seg button[aria-pressed="true"] { background: var(--secondary-container); color: var(--on-secondary-container); }
.select { height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--outline); background: var(--surface-low); color: var(--on-surface); font: 400 14px/20px var(--font); }
.f-tools { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
.f-sort { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.chip-strip { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; }
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.f-label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--on-surface-variant); min-width: 64px; }
button.chip { cursor: pointer; }
button.chip:hover { background: var(--surface-container); }
.chip[aria-pressed="true"] { background: var(--secondary-container); color: var(--on-secondary-container); border-color: transparent; }
/* (?): NL.help(text). One word on show, the explanation on tap. */
.hlp { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -6px 0; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--on-surface-variant); cursor: pointer; flex: none; vertical-align: middle; }
.hlp:hover, .hlp[aria-expanded="true"] { background: var(--surface-container); color: var(--primary); }
.hlp-pop { position: absolute; z-index: 60; padding: 10px 12px; border-radius: 8px; background: var(--inverse-surface); color: var(--inverse-on-surface);
  font: 400 13px/18px var(--font); box-shadow: var(--elev-2); }
/* Icon + one word, for the layout picker and the shape card. */
.seg.ico button { flex-direction: column; height: 56px; gap: 2px; padding: 0 14px; font-size: 12px; line-height: 16px; }
.seg.ico button .ic { width: 20px; height: 20px; }
.chip .n { font-weight: 400; font-variant-numeric: tabular-nums; opacity: .8; }
.f-sep { width: 1px; height: 24px; background: var(--outline-variant); margin: 0 4px; flex: none; }
.f-foot { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--outline-variant); }
.f-foot p { margin: 0; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.f-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.results { display: flex; gap: 16px; align-items: flex-start; margin-top: 16px; }
.vlist { flex: 1 1 0; min-width: 0; display: grid; gap: 8px; align-content: start; }
.vcard { position: relative; display: flex; gap: 16px; padding: 12px; border-radius: 12px; background: var(--surface-low); border: 1px solid var(--outline-variant); cursor: pointer; }
.vcard:hover { border-color: var(--outline); }
.vcard.is-sel { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.vthumb { position: relative; flex: none; width: 176px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--surface-highest); align-self: flex-start; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vbody { flex: 1; min-width: 0; display: grid; gap: 6px; align-content: start; }
.vmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.vtitle { margin: 0; font-size: 16px; line-height: 22px; font-weight: 500; }
.vtitle button { all: unset; cursor: pointer; }
.vtitle button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.vgist { margin: 0; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.vhit { display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 18px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--tertiary-container) 45%, transparent); }
.vhit .where { font-weight: 500; color: var(--on-surface); }
.vacts { display: flex; gap: 0 4px; flex-wrap: wrap; align-items: center; margin-left: -8px; }
.vacts .btn { height: 32px; padding: 0 8px; font-size: 13px; }
.vacts .n { margin-left: auto; font-size: 12px; color: var(--on-surface-variant); }
mark { background: var(--tertiary-container); color: var(--on-tertiary-container); border-radius: 3px; padding: 0 1px; }
.ts { flex: none; display: inline-block; min-width: 40px; text-align: center; font-size: 12px; font-weight: 500; line-height: 20px; padding: 0 6px; border-radius: 6px;
  background: var(--primary-container); color: var(--on-primary-container); text-decoration: none; font-variant-numeric: tabular-nums; }
.ts:hover { text-decoration: underline; }
.vtable-wrap { background: var(--surface-low); border: 1px solid var(--outline-variant); border-radius: 12px; overflow-x: auto; }
.vtable { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.vtable th { text-align: left; font-size: 12px; font-weight: 500; color: var(--on-surface-variant); padding: 10px 12px; border-bottom: 1px solid var(--outline-variant); white-space: nowrap; }
.vtable td { padding: 8px 12px; border-bottom: 1px solid var(--outline-variant); vertical-align: middle; }
.vtable tr:last-child td { border-bottom: 0; }
.vtable tbody tr { cursor: pointer; }
.vtable tbody tr:hover { background: var(--surface-container); }
.vtable tr.is-sel { background: color-mix(in srgb, var(--primary-container) 55%, transparent); }
.vtable .r { text-align: right; font-variant-numeric: tabular-nums; }
.vtable .when { white-space: nowrap; color: var(--on-surface-variant); font-variant-numeric: tabular-nums; }
.vtable .icon-btn { width: 40px; height: 40px; display: inline-grid; }
.vt-open { all: unset; cursor: pointer; font-weight: 500; }
.vt-open:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.panel { flex: 0 0 420px; min-width: 0; position: sticky; top: calc(var(--appbar) + 8px); max-height: calc(100vh - var(--appbar) - 16px); overflow-y: auto;
  background: var(--surface-low); border: 1px solid var(--outline-variant); border-radius: 12px; }
.panel-close { display: none; }
.p-thumb { display: block; position: relative; aspect-ratio: 16 / 9; background: var(--surface-highest); }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-thumb .play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .6); display: grid; place-items: center; color: #fff; }
.p-head { padding: 16px 16px 0; display: grid; gap: 6px; }
.p-head h2 { font-size: 18px; line-height: 24px; font-weight: 500; }
.p-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; position: relative; }
.p-acts .btn { height: 36px; padding: 0 14px; }
.panel .tabs { position: static; margin: 12px 0 0; }
.panel .tab { flex: 1; padding: 0; }
.p-body { padding: 16px; }
.p-gist { margin: 0 0 14px; font-size: 15px; line-height: 22px; }
.p-moments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.p-moments li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; line-height: 20px; }
.tr-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--outline-variant); }
.tr-tools .search { height: 40px; flex: 1 1 180px; }
.tr-tools .count { margin: 0; font-size: 12px; }
.tr-lines { list-style: none; margin: 0; padding: 8px; display: grid; gap: 2px; }
.tr-lines li { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 8px; font-size: 14px; line-height: 21px; }
.tr-lines li.hit { background: color-mix(in srgb, var(--tertiary-container) 45%, transparent); }
.tr-lines li span { flex: 1; min-width: 0; }
.tr-lines .icon-btn { width: 32px; height: 32px; align-self: center; opacity: .55; }
.tr-lines li:hover .icon-btn, .tr-lines .icon-btn:focus-visible { opacity: 1; }
.tr-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--outline-variant); position: sticky; bottom: 0; background: var(--surface-low); }
.tr-foot label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-surface-variant); min-height: 40px; cursor: pointer; margin-right: auto; }
.tr-foot input { width: 18px; height: 18px; accent-color: var(--primary); }
.tr-foot .btn { height: 36px; padding: 0 14px; }
.skel-line { height: 12px; border-radius: 6px; background: var(--surface-container); margin: 14px 16px; }
.menu .menu-item { gap: 12px; text-decoration: none; }
.menu-head { margin: 0; padding: 6px 16px 8px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--on-surface-variant); }
.menu-sep { height: 1px; background: var(--outline-variant); margin: 8px 0; }
.share-menu { top: 44px; min-width: 300px; border-radius: 12px; }
/* Up to 1099px the reading panel is a sheet over the page, opened by choosing a video. */
@media (max-width: 1099px) {
  .panel { position: fixed; inset: 0; z-index: 45; max-height: none; border: 0; border-radius: 0; flex: none; display: none; padding-bottom: env(safe-area-inset-bottom); }
  .panel.is-open { display: block; }
  .panel-close { display: grid; position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(0, 0, 0, .55); color: #fff; }
  body.sheet-open { overflow: hidden; }
}
/* Phones: search on top; "search in" and sort share one line; the status and date chips are one row that
   scrolls sideways (labels go to screen readers only); cards only; the footer is the count plus two icon buttons. */
@media (max-width: 599px) {
  .vcard { flex-direction: column; gap: 10px; }
  .vthumb { width: 100%; }
  .ch-head { gap: 12px; }
  .ch-head .avatar { width: 56px; height: 56px; }
  .ch-id .ch-name { font-size: 24px; line-height: 32px; }
  .ch-actions { width: 100%; flex-wrap: nowrap; }
  .ch-actions .btn { flex: 1 1 0; min-width: 0; padding: 0 12px; }
  .kpi:last-child:nth-child(odd) { grid-column: span 2; }
  .wide-only { display: none; }
  .filters { padding: 12px; gap: 12px; }
  .filters .f-row { gap: 12px; }
  .search { flex-basis: 100%; }
  .f-tools { width: 100%; flex-wrap: nowrap; }
  .f-tools .seg { flex: none; }
  .f-sort { flex: 1; min-width: 0; }
  .f-sort .select { width: 100%; min-width: 0; }
  .f-view { display: none; }
  .chip-strip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px;
    scroll-padding-inline: 12px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
  .chip-strip::-webkit-scrollbar { display: none; }
  .chip-group { flex-wrap: nowrap; }
  .chip-strip .f-label { display: none; }
  .chip-strip .chip { padding: 0 12px; }
  .chip-strip > :last-child { padding-right: 24px; }
  .f-foot { flex-wrap: nowrap; gap: 8px; padding-top: 10px; }
  .f-foot p { flex: 1; min-width: 0; font-size: 13px; line-height: 18px; }
  .f-acts { flex-wrap: nowrap; gap: 4px; }
  .f-acts .lbl { display: none; }
  .f-acts .btn.outlined { width: 40px; height: 40px; min-width: 40px; padding: 0; border-radius: 50%; }
  .f-acts .btn.text { padding: 0 8px; }
}
.args { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--surface-container); border-radius: 8px; padding: 12px; margin: 8px 0 0; white-space: pre-wrap; }
.args:empty { display: none; }

/* Touch screens: the compact controls grow to a finger's size (44px or more); a mouse keeps the dense layout.
   Chips that are only labels stay 40px; the ones you tap (switches) get the full 44. */
@media (pointer: coarse) {
  .btn { height: 44px; }
  .chip { height: 40px; }
  button.chip { height: 44px; }
  .vacts .btn, .p-acts .btn, .tr-foot .btn, .btn.small { height: 44px; }
  .tr-lines .icon-btn { width: 44px; height: 44px; opacity: 1; }
  .search .icon-btn, .vtable .icon-btn { width: 44px; height: 44px; }
  .topic { min-height: 44px; }
  .seg button, .select { height: 44px; }
  .ts { line-height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  /* The loading bar still says "busy" without moving: it spans the width and fades in and out. */
  .progress span { left: 0; width: 100%; animation: busy-fade 1.6s ease-in-out infinite !important; }
}
@keyframes busy-fade { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ---- the Share dialog (app.js shareDialog) ---------------------------------------------------- */
/* Card (video + its words, Edit in the corner) -> moments -> six places in their own colours -> the link with Copy.
   On a phone it rises from the bottom as a sheet. */
.shr-dlg .grow { flex: 1; }
.shr-dlg .dlg-head { margin-bottom: 12px; }
.shr-dlg .dlg-head .icon-btn { margin: -8px -12px -8px 0; }
.shr-body { min-height: 120px; }
.shr-card { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; padding: 12px 44px 12px 12px; border-radius: 16px; background: var(--surface-lowest); border: 1px solid var(--outline-variant); }
.shr-card.no-pic { grid-template-columns: 1fr; padding-left: 16px; }
.shr-card img { width: 120px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--surface-highest); }
.shr-txt { display: grid; gap: 4px; min-width: 0; font-size: 14px; line-height: 20px; }
.shr-txt b { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shr-txt span { color: var(--on-surface-variant); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.shr-edit { position: absolute; top: 2px; right: 2px; width: 40px; height: 40px; color: var(--on-surface-variant); }
.shr-edit:hover { color: var(--primary); }
.shr-at { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.shr-at .chip { cursor: pointer; font-variant-numeric: tabular-nums; padding: 0 14px; }
.shr-at .chip:hover { background: color-mix(in srgb, var(--on-surface) 6%, transparent); }
.shr-at .chip[aria-checked="true"] { background: var(--secondary-container); color: var(--on-secondary-container); border-color: transparent; }
.shr-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 20px -8px 0; padding-top: 16px; border-top: 1px solid var(--outline-variant); }
.shr-go { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 8px; padding: 8px 2px 10px; border: 0; border-radius: 16px; background: transparent;
  color: var(--on-surface); font: 500 12px/16px var(--font); text-decoration: none; cursor: pointer; min-width: 0; }
.shr-go > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shr-go::before { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity .15s; }
.shr-go:hover::before, .shr-go:focus-visible::before { opacity: .06; }
.shr-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; transition: transform .15s var(--ease); }
.shr-go:hover .shr-ic { transform: translateY(-1px); }
.shr-ic .ic { color: inherit; }
.shr-glyph { font: 700 26px/1 var(--font); letter-spacing: -.02em; transform: translateY(1px); }
.shr-glyph.sm { font-size: 19px; letter-spacing: -.03em; }
.shr-ic-whatsapp { background: #1fa855; }
.shr-ic-facebook { background: #1877f2; }
.shr-ic-x { background: #0f1419; }
.shr-ic-linkedin { background: #0a66c2; }
.shr-ic-telegram { background: #229ed9; }
.shr-ic-email { background: var(--secondary-container); color: var(--on-secondary-container); }
.shr-link { display: flex; align-items: center; gap: 4px; margin-top: 16px; padding: 4px 4px 4px 16px; border-radius: 24px; background: var(--surface-container); }
.shr-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); }
.shr-link .icon-btn { width: 40px; height: 40px; color: var(--on-surface-variant); }
.shr-link .btn { margin-left: 4px; }
/* Matches (list-connections): who else said what this video says, each with an eye to hide a wrong one */
.shr-cx { margin-top: 12px; }
.shr-cx summary { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 500; color: var(--on-surface-variant); }
.shr-cx summary::-webkit-details-marker { display: none; }
.shr-cx summary .n { font-weight: 400; font-variant-numeric: tabular-nums; opacity: .8; }
.shr-cx ul { list-style: none; margin: 4px 0 0; padding: 0; }
.shr-cx li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--outline-variant); }
.shr-cx li.off .cx-rel, .shr-cx li.off .cx-t { opacity: .45; }
.cx-rel { margin-top: 1px; padding: 2px 8px; border-radius: 6px; font-size: 12px; line-height: 16px; font-weight: 500; background: var(--secondary-container); color: var(--on-secondary-container); }
.cx-rel.adds { background: transparent; box-shadow: inset 0 0 0 1px var(--outline-variant); color: var(--on-surface-variant); }
.cx-rel.disputes { background: transparent; box-shadow: inset 0 0 0 1px var(--error); color: var(--error); }
.cx-t { display: grid; gap: 2px; min-width: 0; font-size: 14px; line-height: 20px; }
.cx-t b { font-weight: 500; }
.cx-t span { color: var(--on-surface); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cx-t small { color: var(--on-surface-variant); font-size: 12px; line-height: 16px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.shr-cx .icon-btn { width: 40px; height: 40px; margin: -8px -8px 0 0; color: var(--on-surface-variant); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .shr-ic-x { background: #000; box-shadow: inset 0 0 0 1px var(--outline-variant); } }
:root[data-theme="dark"] .shr-ic-x { background: #000; box-shadow: inset 0 0 0 1px var(--outline-variant); }
@media (max-width: 599px) {
  .shr-dlg { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 28px 28px 0 0; overflow-y: auto; }
  .shr-dlg .dlg { padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); }
  .shr-dlg .dlg::before { content: ""; display: block; width: 32px; height: 4px; margin: 0 auto 12px; border-radius: 2px; background: var(--outline-variant); }
  .shr-dlg[open] { animation: sheet-up .25s var(--ease); }
  .shr-card { grid-template-columns: 96px 1fr; gap: 12px; }
  .shr-card img { width: 96px; }
  .shr-grid { grid-template-columns: repeat(3, 1fr); row-gap: 8px; margin-inline: -4px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
/* The post before it is shared (app.js previewStep): the places as small round tabs, then a stand-in of that app's
   screen in its own light colours (fixed, not themed: it shows how the app draws it), then Back and Share on … */
.shr-tabs { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.shr-tab { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.shr-tab .shr-ic { width: 36px; height: 36px; opacity: .45; transition: opacity .15s, box-shadow .15s; }
.shr-tab .shr-ic .ic { width: 18px; height: 18px; }
.shr-tab .shr-glyph { font-size: 20px; }
.shr-tab .shr-glyph.sm { font-size: 15px; }
.shr-tab:hover .shr-ic { opacity: .8; }
.shr-tab[aria-checked="true"] .shr-ic { opacity: 1; box-shadow: 0 0 0 2px var(--surface-high), 0 0 0 4px var(--primary); }
.shr-step { margin-top: 16px; }
.pv { margin-top: 12px; padding: 16px 12px; border-radius: 16px; font: 400 14px/19px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #111b21; overflow: hidden;
  min-height: 220px; display: flex; flex-direction: column; justify-content: center; }
.pv b { font-weight: 600; }
.pv img { display: block; width: 100%; height: auto; aspect-ratio: 1.91 / 1; object-fit: cover; background: #ccd; }
.pv-a { color: #027eb5; word-break: break-all; }
.pv-av { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: #c9d2dc; color: #334; font: 600 16px/1 system-ui, sans-serif; }
.pv-post { background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); padding: 12px; }
.pv-head { display: flex; align-items: center; gap: 8px; }
.pv-head small, .x-who small, .x-from { display: block; color: #65676b; font-size: 12px; line-height: 16px; }
.pv-say { margin: 10px 0; color: #8a8d91; font-size: 15px; }
.pv span, .pv small, .pv b { overflow-wrap: anywhere; }
/* The words, typed right in the post: a faint dashed box says "you can write here"; solid while typing. */
.pv-w { display: block; width: 100%; margin: 0 0 6px; padding: 4px 6px; border: 1px dashed rgba(17, 27, 33, .32); border-radius: 6px; background: rgba(255, 255, 255, .45);
  color: inherit; font: inherit; resize: none; overflow: hidden; min-height: 30px; cursor: text; transition: border-color .15s, background-color .15s; }
.pv-w:hover { border-color: rgba(17, 27, 33, .55); }
.pv-w:focus { outline: 0; border: 1px solid #0b57d0; background: #fff; box-shadow: 0 0 0 2px rgba(11, 87, 208, .18); }
.pv-w::placeholder { color: #8a8d91; }
.pv-w.pv-say { margin: 10px 0; font-size: 15px; line-height: 20px; color: #1c1e21; }
.x-t .pv-w { font-size: 15px; line-height: 20px; }
.x-count { display: block; text-align: right; font-size: 12px; color: #536471; font-variant-numeric: tabular-nums; }
.x-count.over { color: #f4212e; font-weight: 600; }
/* WhatsApp: an outgoing bubble on the chat wallpaper, the link's card on top. */
.pv-whatsapp { background: #efeae2; align-items: flex-end; }
.wa-b { max-width: 88%; background: #d9fdd3; border-radius: 8px 0 8px 8px; padding: 3px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.wa-card { background: rgba(11, 20, 26, .05); border-radius: 6px; overflow: hidden; }
.wa-card img { aspect-ratio: 16 / 9; }
.wa-cx { display: grid; gap: 2px; padding: 6px 10px 8px; }
.wa-cx b { font-size: 13px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wa-cx span { font-size: 12px; line-height: 16px; color: #54656f; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wa-cx small { font-size: 12px; color: #8696a0; }
.wa-t { padding: 6px 7px 2px; }
.wa-time { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -2px 10px; font-size: 11px; color: #667781; }
/* Facebook: a post with an empty "say something" and the link's card. */
.pv-facebook { background: #f0f2f5; }
.fb-card { margin: 0 -12px -12px; border-top: 1px solid #dadde1; }
.fb-cx { display: grid; gap: 2px; padding: 8px 12px 10px; background: #f0f2f5; border-radius: 0 0 10px 10px; }
.fb-cx small { color: #65676b; font-size: 12px; letter-spacing: .02em; }
.fb-cx b { font-size: 16px; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fb-cx span { color: #65676b; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* X: the post with its cut words, the large card with the title on the picture. */
.pv-x { background: #fff; border: 1px solid #eff3f4; color: #0f1419; }
.pv-x .pv-a { color: #1d9bf0; word-break: normal; }
.x-post { display: flex; gap: 10px; box-shadow: none; padding: 0; }
.x-main { flex: 1; min-width: 0; }
.x-who { display: flex; align-items: baseline; gap: 6px; }
.x-who small { display: inline; }
.x-t { margin: 2px 0 10px; font-size: 15px; line-height: 20px; }
.x-card { position: relative; border: 1px solid #cfd9de; border-radius: 16px; overflow: hidden; }
.x-ttl { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, .77); color: #fff; font-size: 13px; line-height: 18px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-card:not(:has(img)) { padding: 12px; }
.x-card:not(:has(img)) .x-ttl { position: static; background: none; color: #0f1419; padding: 0; }
.x-from { margin-top: 4px; }
/* LinkedIn */
.pv-linkedin { background: #f4f2ee; }
.li-card { margin: 0 -12px -12px; }
.li-cx { display: grid; gap: 2px; padding: 8px 12px 10px; background: #eef3f8; border-radius: 0 0 10px 10px; }
.li-cx b { font-size: 14px; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li-cx small { color: #666; font-size: 12px; }
/* Telegram: an outgoing bubble, the link, then the card with its blue bar. */
.pv-telegram { background: #a7c6a1 linear-gradient(135deg, #b5d0a6, #8fb8a8); align-items: flex-end; }
.tg-b { max-width: 88%; background: #effdde; border-radius: 12px 12px 4px 12px; padding: 6px 10px 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.tg-card { display: grid; gap: 2px; margin: 6px 0 2px; padding: 2px 0 2px 9px; border-left: 3px solid #4fae4e; }
.tg-card b { font-size: 13px; line-height: 18px; }
.tg-card .tg-site { color: #3a9a3a; }
.tg-card span { font-size: 13px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tg-card img { margin-top: 6px; border-radius: 6px; aspect-ratio: 16 / 9; }
.pv-telegram .pv-a { color: #3a9a3a; }
.tg-time { display: block; text-align: right; font-size: 11px; color: #5fa85b; }
/* Email: what the mail app opens with. */
.pv-email { background: var(--surface-container); }
.pv-post.em { padding: 0; }
.em-row { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border-bottom: 1px solid #e6e8eb; }
.em-row small { flex: none; width: 52px; color: #5f6368; font-size: 13px; }
.em-row b { font-weight: 500; }
.em-body { padding: 12px; min-height: 96px; }
/* The Shares card on the Subscribers tab */
.sh-rows { display: grid; gap: 0; margin-top: 8px; }
.sh-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--outline-variant); font-size: 14px; line-height: 20px; }
.sh-row b { min-width: 96px; font-weight: 500; }
.sh-row span { color: var(--on-surface-variant); font-variant-numeric: tabular-nums; }
/* The Edit dialog (app.js editDialog) */
.edit-dlg { width: min(720px, calc(100% - 32px)); max-width: none; }
.edit-dlg .grow { flex: 1; }
.edit-dlg .dlg-head { margin-bottom: 4px; }
.edit-dlg .dlg-head .icon-btn { margin: -8px -12px -8px 0; }
.ed-of { margin: 0 0 22px; font-size: 14px; line-height: 20px; color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-dlg .dlg-head + .ed-body { margin-top: 12px; }
.ed-body .tf + .tf { margin-top: 20px; }
.ed-warn { margin: 0 0 16px; }
/* An outlined text field with more than one line (the summary): same look and floating label as .tf input. */
.tf textarea { display: block; width: 100%; padding: 16px; font: 400 15px/22px var(--font); color: var(--on-surface); background: transparent;
  border: 1px solid var(--outline); border-radius: 4px; outline: 0; resize: vertical; }
.tf textarea:hover { border-color: var(--on-surface); }
.tf textarea:focus { border: 2px solid var(--primary); padding: 15px; }
.tf textarea:focus + label, .tf textarea:not(:placeholder-shown) + label { top: -9px; font-size: 12px; line-height: 16px; }
.tf textarea:focus + label { color: var(--primary); }
.tf textarea::placeholder { color: transparent; }
.edit-dlg textarea { height: min(50vh, 440px); min-height: 200px; }
@media (max-width: 599px) {
  .edit-dlg .dlg { padding: 20px 16px 16px; }
  .edit-dlg textarea { height: 46vh; font-size: 16px; line-height: 24px; }
}
.icon-btn.earn-on { color: var(--primary); }
