/* Layout: an app shell that uses the whole window. Search, navigation, topics and
   the account sit in a left column, the feed fills the middle as a stack of cards,
   site activity sits on the right. Slate ink on a soft grey ground, one honey accent
   for lifts and progress. */
:root {
  --warn: #c0281f;
  --warn-soft: #fbe9e7;
  --shadow: 0 1px 2px rgb(10 10 20 / 0.06), 0 12px 32px rgb(10 10 20 / 0.08);
  --display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px;
}
:root { --bg: #f6f7f9; --surface: #ffffff; --ink: #171a21; --muted: #5f6675; --faint: #6b7283; --line: #e8eaee; --chip: #f1f2f5; --accent: #171a21; --accent-hover: #2c313c; --accent-ink: #ffffff; --accent-soft: #fff4d6; --accent-text: #171a21; --fold: #f5bd41; --honey: #f5bd41; --honey-ink: #171a21; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --bg: #0e1116; --surface: #171c25; --ink: #eef0f4; --muted: #a2a9b8; --faint: #8b93a3; --line: #252b37; --chip: #1d2330; --accent: #f5bd41; --accent-hover: #f8cd6b; --accent-ink: #0e1116; --accent-soft: #3a2f10; --accent-text: #f5bd41; --fold: #c9962b; --honey: #f5bd41; --honey-ink: #0e1116; --warn: #ff9a8c; --warn-soft: #3a1a15; --shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 12px 32px rgb(0 0 0 / 0.5); color-scheme: dark; } }
:root[data-theme='dark'] { --bg: #0e1116; --surface: #171c25; --ink: #eef0f4; --muted: #a2a9b8; --faint: #8b93a3; --line: #252b37; --chip: #1d2330; --accent: #f5bd41; --accent-hover: #f8cd6b; --accent-ink: #0e1116; --accent-soft: #3a2f10; --accent-text: #f5bd41; --fold: #c9962b; --honey: #f5bd41; --honey-ink: #0e1116; --warn: #ff9a8c; --warn-soft: #3a1a15; --shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 12px 32px rgb(0 0 0 / 0.5); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 14px/1.5 var(--body); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
kbd { font: 600 11px/1 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; background: var(--surface); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* links inside running text */
.prose a, .lede a, .fine a, .empty a, .note a, .evt a, .sub a { font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover, .lede a:hover, .fine a:hover, .empty a:hover, .note a:hover, .evt a:hover { text-decoration-color: var(--ink); }

/* shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.nav { position: sticky; top: env(safe-area-inset-top, 0px); align-self: start; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 22px 16px 20px; border-right: 1px solid var(--line); background: var(--surface); }
.content { min-width: 0; display: flex; flex-direction: column; }

.logo { display: inline-flex; align-items: center; gap: 11px; }
.mark { position: relative; display: inline-block; background: var(--accent); color: var(--accent-ink); font: 800 17px/1 var(--display); letter-spacing: 0.01em; padding: 9px 15px 9px 10px; border-radius: 7px; clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%); }
.mark::after { content: ''; position: absolute; top: 0; right: 0; width: 11px; height: 11px; background: var(--fold); border-bottom-left-radius: 4px; }
.lname { font: 700 12.5px/1.2 var(--display); letter-spacing: 0.01em; color: var(--ink); }
.nav .logo { margin: 0 0 16px 6px; }
.navtop { display: grid; gap: 8px; margin-bottom: 14px; }
.navtop .btn { height: 40px; border-radius: 12px; }
.nav .search { flex: none; }
.nav .search input { height: 40px; border-radius: 12px; background: var(--bg); }

.pnav, .topics { display: flex; flex-direction: column; gap: 2px; }
.pnav a, .topics a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; color: var(--muted); font-weight: 500; font-size: 14px; }
.pnav a { color: var(--ink); font-weight: 600; }
.pnav a svg { color: var(--muted); }
.pnav a:hover, .topics a:hover { background: var(--chip); color: var(--ink); }
.pnav a.on, .topics a.on { background: var(--chip); color: var(--ink); font-weight: 700; }
.topics a::before { content: ''; flex: none; width: 8px; height: 8px; margin: 0 5px; border-radius: 3px; background: var(--faint); }
.topics a[href$='-technology']::before { background: #3f74d9; }
.topics a[href$='-science']::before { background: #1f9a80; }
.topics a[href$='-world']::before { background: #c98a1e; }
.topics a[href$='-gaming']::before { background: #8a63db; }
.topics a[href$='-entertainment']::before { background: #db5c93; }
.topics a[href$='-sports']::before { background: #d8623b; }
.topics a[href$='-lifestyle']::before { background: #6da83a; }
.topics a[href$='-offbeat']::before { background: #778091; }
.pnav a.on svg { color: var(--ink); }
.pnav em { margin-left: auto; font: 600 12px/1 var(--body); font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.navlabel { margin: 22px 0 6px 10px; font: 600 11px/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.navacct { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.navacct .me, .navacct .plainlink { flex: 1; min-width: 0; }
.navacct > .plain:not(.icon) { height: 36px; padding: 0 10px; border-radius: 10px; font-size: 13px; }
.navacct > .plain:not(.icon):hover { background: var(--chip); }
.navfoot { padding: 6px 10px 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.navfoot a:hover { color: var(--ink); }
.livedot { width: 8px; height: 8px; margin: 0 5px; border-radius: 50%; background: var(--honey); box-shadow: 0 0 0 0 var(--honey); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* top bar */
.bar { display: none; align-items: center; gap: 12px; padding-block: 14px; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.bar .logo { display: none; }
.search { position: relative; flex: 0 1 260px; min-width: 0; }
.search svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--faint); pointer-events: none; }
.search input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px 0 34px; background: var(--surface); font-size: 14px; }
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--ink); outline: 0; }
.usernav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.me { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 6px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.me:hover { background: var(--chip); }
.me .av { width: 24px; height: 24px; font-size: 11px; }
.plain { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 600; }
.plain:hover { color: var(--ink); }
.plain[aria-pressed='true'] { color: var(--accent-text); }
.plainlink, .usernav > .plain:not(.icon) { white-space: nowrap; height: 36px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.plainlink:hover, .usernav > .plain:hover { background: var(--chip); color: var(--ink); }
.plain.icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); }
.warnink { color: var(--warn); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 0 14px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn[disabled] { opacity: 0.4; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* phone navigation (hidden on wide screens) */
.mnav { display: none; }

/* page */
.cols { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; width: 100%; max-width: 1440px; padding-block: 22px 64px; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.cols.single { grid-template-columns: minmax(0, 680px); }
#main { min-width: 0; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-bottom: 6px; }
.h { font: 800 24px/1.2 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.hcat { color: var(--faint); margin-left: 12px; }
.sub, .lede { color: var(--muted); margin-top: 2px; max-width: 62ch; }
.sorts { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs.small { margin-top: 28px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--line); }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(21 20 15 / 0.12); }

/* stories */
.story { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; margin-top: 8px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgb(23 26 33 / 0.04); }
.story.sel { border-color: var(--honey); box-shadow: 0 0 0 2px var(--honey); }
.liftbtn { width: 48px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); transition: border-color 0.15s, background 0.15s, transform 0.1s; }
.liftbtn svg { color: var(--faint); transition: transform 0.15s, color 0.15s; }
.liftbtn strong { font: 800 14px/1 var(--display); font-variant-numeric: tabular-nums; }
.liftbtn:hover { border-color: var(--ink); }
.liftbtn:hover svg { color: var(--ink); transform: translateY(-2px); }
.liftbtn:active { transform: scale(0.95); }
.story.lifted .liftbtn { background: var(--honey); border-color: var(--honey); color: var(--honey-ink); }
.story.lifted .liftbtn svg { color: var(--honey-ink); }
.badge.bump .liftbtn strong { animation: bump 0.5s ease-out; }
@keyframes bump { 30% { transform: translateY(-5px) scale(1.15); } }
.kicker { display: flex; align-items: center; gap: 2px 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.domain { font-weight: 600; color: var(--ink); }
.chip { color: var(--muted); white-space: nowrap; }
.chip::before { content: '·'; margin-right: 10px; color: var(--faint); }
a.chip:hover { color: var(--ink); }
.chip.hot { color: var(--accent-text); font-weight: 600; }
.title { font: 700 16px/1.3 var(--display); letter-spacing: -0.012em; text-wrap: pretty; max-width: 46em; margin-top: 2px; }
.title a:hover { text-decoration: underline; text-decoration-color: var(--honey); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.title a:visited { color: var(--muted); }
.desc { margin-top: 2px; max-width: 80ch; font-size: 13.5px; color: var(--muted); }
.story.full { margin-top: 0; padding: 20px; }
.story.full .title { font-size: 24px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.story.full .title a:visited { color: var(--ink); }
.story.full .desc { color: var(--ink); font-size: 15px; margin-top: 8px; }
.user { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); vertical-align: bottom; }
.user:hover { text-decoration: underline; }
.av { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font: 700 10px/1 var(--body); flex: none; }
.av.big { width: 72px; height: 72px; font-size: 30px; }
.prog { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.meter { width: 170px; max-width: 100%; height: 6px; border-radius: 999px; background: var(--chip); overflow: hidden; flex: none; }
.meter i { display: block; height: 100%; background: var(--honey); border-radius: 999px; transition: width 0.4s; }
.note { margin-top: 8px; font-size: 13px; color: var(--muted); background: var(--chip); border-radius: 9px; padding: 7px 12px; display: inline-block; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.tools > a, .tools > .plain, .menu summary { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.tools > a:hover, .tools > .plain:hover, .menu summary:hover { color: var(--ink); }
.tools .plain[aria-pressed='true'] { color: var(--accent-text); font-weight: 600; }
.tools .by { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; }
.menu summary.warnink { color: var(--warn); }
.menu summary::-webkit-details-marker { display: none; }
.pop { position: absolute; z-index: 5; right: 0; top: 26px; width: 210px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.pop b { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 8px 6px; }
.pop .plain { color: var(--ink); text-align: left; padding: 7px 8px; border-radius: 7px; font-weight: 500; }
.pop .plain:hover { background: var(--warn-soft); color: var(--warn); }
.empty { padding: 72px 12px; text-align: center; color: var(--muted); }
.empty h2 { font: 700 22px/1.25 var(--display); letter-spacing: -0.02em; color: var(--ink); margin-bottom: 8px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; color: var(--muted); font-size: 14px; }

/* story page */
.why { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 24px; margin-top: 8px; }
.why h2, .comments h2, .box h2 { font: 600 11px/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.verdict { margin-top: 10px; font: 700 18px/1.3 var(--display); letter-spacing: -0.01em; }
.verdict.buried { color: var(--warn); }
.score { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.score div { background: var(--bg); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.score .total { background: var(--accent-soft); }
.score dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.score dd { font: 800 28px/1.2 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.score dd.x { font: 400 13px/1.35 var(--body); letter-spacing: 0; color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); margin-top: 14px; }
.lifters { display: flex; align-items: center; flex-wrap: wrap; margin-top: 16px; font-size: 13px; color: var(--muted); }
.lifters span { margin-right: 14px; }
.lifters a { margin-left: -5px; }
.lifters .av { width: 26px; height: 26px; font-size: 11px; border: 2px solid var(--surface); }

.comments { margin-top: 40px; }
.chd { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cform textarea, .form input, .form textarea, .form select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; background: var(--surface); }
.form input, .form select { height: 42px; padding-block: 0; }
.cform textarea:focus, .form input:focus, .form textarea:focus, .form select:focus { border-color: var(--ink); outline: 0; }
.cform textarea, .form textarea { resize: vertical; display: block; }
.frow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.comment { margin-top: 22px; }
.comment .comment { margin-left: 9px; padding-left: 18px; border-left: 2px solid var(--line); }
.comment.flat { margin-left: 0 !important; padding-left: 0 !important; border-left: 0 !important; }
.chead { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13.5px; }
.chead > a:not(.user) { font-weight: 600; }
.when { color: var(--muted); font-size: 13px; }
.cscore { font-weight: 600; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctext { margin-top: 5px; max-width: 68ch; overflow-wrap: anywhere; white-space: pre-wrap; }
.ctools { display: flex; gap: 16px; margin-top: 6px; font-size: 13px; }
.ctools .plain { font-weight: 500; }
.ctools .plain[aria-pressed='true'] { color: var(--accent-text); font-weight: 600; }
.low summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.cform { margin-top: 8px; }

/* profile, forms, prose */
.profile { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile .btn { margin-top: 10px; }
.modmenu { margin-top: 10px; font-size: 13px; }
.modmenu .pop { right: auto; left: 0; width: 270px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; margin-top: 24px; border-block: 1px solid var(--line); }
.stats div { padding: 16px 16px 16px 0; }
.stats strong { display: block; font: 800 26px/1.2 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 13px; color: var(--muted); }
.form { display: flex; flex-direction: column; margin-top: 24px; }
.form.narrow { max-width: 400px; }
.form label { font-weight: 600; font-size: 14px; margin: 18px 0 6px; }
.form label:first-child { margin-top: 0; }
.opt { font-weight: 400; color: var(--muted); }
.form .frow { margin-top: 24px; }
.prose { max-width: 64ch; }
.prose h2 { font: 700 21px/1.25 var(--display); letter-spacing: -0.02em; margin: 34px 0 8px; }
.prose p { margin-top: 10px; }
.prose ul { list-style: disc; padding-left: 20px; margin-top: 8px; display: grid; gap: 8px; }

/* live */
.events { margin-top: 6px; }
.ev { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tag { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.ev.promote .tag { color: var(--accent-text); }
.ev.bury .tag, .ev.buried .tag { color: var(--warn); }
.evt { overflow-wrap: anywhere; }

/* right column */
#side { display: grid; gap: 12px; min-width: 0; }
.box { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.box h2 { font: 800 14.5px/1.3 var(--display); letter-spacing: -0.01em; text-transform: none; color: var(--ink); }
.box .seg { margin-top: 12px; }
.box.demo { background: var(--accent-soft); border-color: transparent; }
.box.demo h2 { color: var(--accent-text); }
.box.demo p { font-size: 13px; margin: 8px 0 12px; }
.bigstat { display: flex; align-items: baseline; gap: 9px; margin-top: 10px; }
.bigstat strong { font: 800 30px/1 var(--display); letter-spacing: -0.03em; }
.bigstat span { color: var(--muted); }
.box .fine { margin-top: 8px; }
.mini { margin-top: 12px; display: grid; gap: 11px; }
.mini li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; align-items: start; font-size: 13.5px; line-height: 1.35; }
.mini a { font-weight: 600; }
.mini a:hover { text-decoration: underline; text-decoration-color: var(--honey); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mc { font: 700 13px/1.45 var(--display); color: var(--accent-text); font-variant-numeric: tabular-nums; }
.mini .meter { grid-column: 2; width: 100%; height: 3px; margin-top: 2px; }

.foot { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-block: 18px 28px; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); display: flex; gap: 6px 20px; flex-wrap: wrap; }
.foot a { font-weight: 600; }
.foot a:hover { color: var(--ink); }
.keys { margin-left: auto; }

.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 20; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--warn); color: var(--surface); }

@media (min-width: 1000px) {
  :root { --gutter: 40px; }
}
@media (max-width: 1180px) {
  .cols { gap: 36px; grid-template-columns: minmax(0, 1fr) 280px; }
}
.acct { margin-top: 14px; max-width: 420px; }
.acct > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.acct > summary:hover { color: var(--ink); }
.acct .form { margin-top: 16px; }
.acct .form.danger { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.acct .form.danger label { color: var(--warn); }
.acct .form.danger .fine { margin: 0 0 10px; }
.warnbtn { border-color: var(--warn); color: var(--warn); }
.code { font: 600 14px/1 ui-monospace, Menlo, Consolas, monospace; user-select: all; }
#main > .fine { max-width: 400px; }
.tabbar, .sheet, .sheetback, .topicbtn { display: none; }
@media (max-width: 999px) {
  .shell { display: block; }
  .nav, .mnav { display: none; }
  .bar { display: flex; justify-content: space-between; background: var(--bg); padding-block: 12px 4px; }
  .bar .logo { display: inline-flex; }
  .bar .mark { font-size: 14px; padding: 7px 12px 7px 8px; }
  .usernav { margin-left: auto; }
  .cols, .cols.single { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 12px; padding-bottom: 32px; }
  .keys { display: none; }
  .content { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

  /* sections live in a bar under the thumb; topics and search in a sheet */
  .tabbar { position: fixed; z-index: 12; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar > a, .tabbar > button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; border: 0; background: none; color: var(--faint); font: 600 10.5px/1 var(--body); }
  .tabbar > .on { color: var(--ink); }
  .tabbar .tabadd { justify-self: center; width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 15px; background: var(--accent); color: var(--accent-ink); }
  .topicbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; }
  .pagehead .sub { display: none; }
  .pagehead { align-items: center; }
  .sheetback { display: block; position: fixed; inset: 0; z-index: 13; background: rgb(10 12 16 / 0.45); }
  .sheet { display: block; position: fixed; z-index: 14; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow); animation: sheetup 0.22s ease-out; }
  @keyframes sheetup { from { transform: translateY(40px); opacity: 0; } }
  .grab { width: 38px; height: 4px; margin: 0 auto 14px; border-radius: 99px; background: var(--line); }
  .sheet .search { display: block; }
  .sheet .search input { height: 44px; font-size: 16px; }
  .sheet .navlabel { margin: 18px 0 8px 2px; }
  .sheettopics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sheettopics a { padding: 12px 14px; border-radius: 12px; background: var(--chip); font-weight: 600; font-size: 14px; }
  .sheettopics a.on { background: var(--accent); color: var(--accent-ink); }
  .sheetrow { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--muted); }
  .sheetrow .plain { font-size: 14px; }
}
@media (max-width: 560px) {
  .me > span:not(.av), .bar .lname { display: none; }
  .me { padding: 0 6px; }
  .me .av { width: 30px; height: 30px; font-size: 13px; }
  .h { font-size: 24px; }
  .hcat { display: none; }

  /* quiet cards: source, headline, one line of facts */
  .story { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 12px 14px 10px 12px; border-radius: 14px; }
  .liftbtn { width: 40px; padding: 7px 0 6px; border-radius: 11px; }
  .title { font-size: 15.5px; line-height: 1.28; margin-top: 3px; }
  .kicker { flex-wrap: nowrap; overflow: hidden; }
  .kicker .domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .story:not(.full) .desc, .story:not(.full) .chip.hot, .story:not(.full) .xtra, .story:not(.full) .tools .menu, .story:not(.full) .lbl, .story:not(.full) .by .av { display: none; }
  .story:not(.full) .tools { flex-wrap: nowrap; gap: 14px; margin-top: 6px; }
  .story:not(.full) .by { min-width: 0; gap: 6px; white-space: nowrap; overflow: hidden; }
  .story:not(.full) .by .user { font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
  .story:not(.full) .tools > a, .story:not(.full) .tools > .plain { flex: none; padding: 4px 0; }
  .story:not(.full) .prog { margin-top: 6px; font-size: 12px; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
  .story:not(.full) .meter { width: 72px; height: 5px; }
  .story.full { padding: 16px; }
  .story.full .title { font-size: 21px; }
  .why { padding: 18px; }
  .score { grid-template-columns: 1fr; }
  .pop { right: auto; left: 0; }
  .ev { grid-template-columns: 66px minmax(0, 1fr); }
  .ev .when { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* share menu */
.menu.share .pop { width: 190px; }
.sharepop a { color: var(--ink); padding: 7px 8px; border-radius: 7px; font-weight: 500; }
.sharepop a:hover, .sharepop .plain:hover { background: var(--chip); color: var(--ink); }
.sharepop .plain[data-act='copylink'] { font-weight: 600; }
/* Phones hide the other story menus in lists, but sharing stays. */
.story:not(.full) .tools .menu.share { display: block; flex: none; }
.menu.share summary { padding: 4px 0; }
