/* ============ Rounds — editorial reader ============ */
:root {
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 10px;
  --maxw: 1240px;
}
[data-theme='paper'] {
  --bg: #fbf9f5; --bg-2: #f3efe8; --card: #ffffff; --ink: #161412; --ink-2: #4a4540; --ink-3: #8a837b;
  --line: #e7e1d8; --accent: #c8372d; --accent-ink: #fff; --shadow: 0 1px 2px rgba(30,20,10,.05), 0 6px 24px -12px rgba(30,20,10,.18);
}
[data-theme='sepia'] {
  --bg: #f4ecdd; --bg-2: #ebe1cd; --card: #faf4e8; --ink: #2b2118; --ink-2: #5a4a3a; --ink-3: #8f7d69;
  --line: #ddd0b8; --accent: #b23a26; --accent-ink: #fff; --shadow: 0 1px 2px rgba(60,40,10,.06), 0 6px 24px -12px rgba(60,40,10,.2);
}
[data-theme='dark'] {
  --bg: #121110; --bg-2: #1b1a18; --card: #1d1c1a; --ink: #eeeae4; --ink-2: #b9b2a8; --ink-3: #7f786f;
  --line: #2e2c29; --accent: #ef6a5b; --accent-ink: #161412; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px -12px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; transition: background .2s, color .2s; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--ink); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; margin: 28px 0; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; flex: none; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 62px; display: flex; align-items: center; gap: 28px; }
.logo { font: 700 27px/1 var(--serif); letter-spacing: -.02em; }
.logo i { color: var(--accent); font-style: normal; }
.logo.big { font-size: 44px; }
.nav { display: flex; gap: 4px; flex: none; }
.nav a { white-space: nowrap; padding: 8px 12px; border-radius: 8px; font-weight: 500; color: var(--ink-2); font-size: 14px; position: relative; }
.nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav a.on { color: var(--ink); }
.nav a.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 2px; background: var(--accent); }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid transparent; border-radius: 999px; padding: 0 14px; height: 38px; width: min(340px, 30vw); min-width: 140px; flex: 0 1 auto; color: var(--ink-3); transition: border-color .15s, background .15s; }
.search:focus-within { border-color: var(--line); background: var(--card); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 14px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn.on { color: var(--accent); }
.save-btn.on .ic { fill: currentColor; }
.is-onboarding .topbar, .is-onboarding .footer { display: none; }

/* ---------- page + briefing header ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 64px; }
.page.narrow { max-width: 760px; }
.briefing { padding: 18px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.briefing .date { text-transform: uppercase; letter-spacing: .14em; font-size: 11.5px; font-weight: 600; color: var(--accent); }
.briefing h1 { font: 600 clamp(34px, 4.6vw, 54px)/1.04 var(--serif); letter-spacing: -.025em; margin: 8px 0 10px; }
.lede { font: 400 19px/1.45 var(--serif); color: var(--ink-2); max-width: 760px; margin: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pills.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.pill { white-space: nowrap; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13.5px; font-weight: 500; color: var(--ink-2); background: var(--card); }
.pill:hover { border-color: var(--ink-3); color: var(--ink); }
.pill.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill-add { border-style: dashed; background: transparent; }
.section-title { font: 600 24px/1.2 var(--serif); letter-spacing: -.01em; margin: 48px 0 18px; padding-top: 14px; border-top: 3px solid var(--ink); }
.section-title a { color: var(--accent); }
.count { color: var(--ink-3); font-size: 13px; margin: 0 0 16px; }
.row-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- buttons, segmented ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; }
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .35; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); opacity: 1; }
.btn-on { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 15px; }
.danger { color: var(--accent); }
.seg { display: inline-flex; background: var(--bg-2); padding: 4px; border-radius: 999px; gap: 2px; margin: 0 0 24px; }
.briefing .seg { margin: 18px 0 0; }
.seg button, .seg a { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.seg .on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- score badge ---------- */
.score { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.score i { font-style: normal; font-weight: 600; }
.score-lg { height: 28px; padding: 0 10px; font-size: 13px; }
.score-landmark { background: #1f1a14; color: #f4c95d; }
[data-theme='dark'] .score-landmark { background: #f4c95d; color: #1f1a14; }
.score-high { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.score-notable { background: color-mix(in srgb, #2c7a5b 15%, transparent); color: #2c7a5b; }
[data-theme='dark'] .score-notable { color: #6fcf9f; }
.score-standard { background: var(--bg-2); color: var(--ink-3); }

/* ---------- cards ---------- */
.mag-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px; margin-bottom: 8px; }
.mag-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-content: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px 26px; margin-top: 28px; }
.mag .grid { padding-top: 28px; border-top: 1px solid var(--line); }
.card { display: flex; flex-direction: column; min-width: 0; }
.card-art { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg-2); }
.card-art .art { width: 100%; height: 100%; display: block; transition: transform .5s ease; }
.card:hover .card-art .art { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; flex: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kicker { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); min-width: 0; }
.kicker .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.kicker { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; }
.kicker .dot { display: inline-block; margin-right: 7px; vertical-align: 1px; }
.card-title { font: 600 20px/1.22 var(--serif); letter-spacing: -.01em; }
.card-title:hover { color: var(--accent); }
.card-abstract { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.byline { font-size: 13px; color: var(--ink-2); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--ink-3); }
.meta .ic { width: 14px; height: 14px; }
.journal-name { font-weight: 600; color: var(--ink-2); font-style: italic; font-family: var(--serif); font-size: 14px; }
.tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 4px; background: var(--bg-2); color: var(--ink-2); }
.tag-oa { background: color-mix(in srgb, #2c7a5b 14%, transparent); color: #2c7a5b; }
[data-theme='dark'] .tag-oa { color: #6fcf9f; }
/* The save button sits on the journal/date line, so it stays next to its paper however tall the row is. */
.card-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-foot .meta { flex: 1; min-width: 0; padding-top: 6px; }
.reason { font-size: 12.5px; color: var(--accent); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reason .ic { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.card-foot .save-btn { margin-left: auto; margin-right: -8px; }

.card-lead .card-art { aspect-ratio: 16 / 8.5; }
.card-lead .card-title { font-size: clamp(28px, 3vw, 38px); line-height: 1.1; letter-spacing: -.02em; }
.card-lead .card-abstract { font: 400 17px/1.5 var(--serif); -webkit-line-clamp: 4; }
.card-feature { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; }
.card-feature .card-art { aspect-ratio: 1; }
.card-feature .card-body { padding-top: 0; }
.card-feature .card-title { font-size: 18px; }
.card-feature .card-abstract { -webkit-line-clamp: 2; font-size: 13.5px; }
.card-compact { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-compact .card-body { padding: 0; }
.card-compact .card-title { font-size: 17px; }

.row-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-card:last-child { border-bottom: 0; }
.row-link { flex: 1; min-width: 0; }
.row-title { font: 500 15.5px/1.3 var(--serif); }
.row-link:hover .row-title { color: var(--accent); }
.row-meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.row-why { font-size: 12px; color: var(--accent); margin-top: 3px; font-weight: 500; }
.rows.two-col { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }

/* ---------- skeletons, empty, error ---------- */
.sk, .sk-art, .sk-line, .sk-title { background: linear-gradient(90deg, var(--bg-2) 25%, color-mix(in srgb, var(--bg-2) 50%, var(--bg)) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
.card.sk { background: none; animation: none; gap: 10px; }
.sk-art { aspect-ratio: 16/9; border-radius: var(--radius); }
.sk-line { height: 12px; margin: 10px 0; }
.sk-title { height: 34px; margin: 14px 0; }
.w40 { width: 40%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h3 { font: 600 24px var(--serif); margin: 0 0 8px; }
.empty p { color: var(--ink-2); margin: 0 0 18px; }
.error-box { display: flex; gap: 14px; padding: 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.error-box .ic { color: var(--accent); width: 22px; height: 22px; }
.error-box p { margin: 4px 0 12px; color: var(--ink-2); }

/* ---------- newsstand ---------- */
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 26px 22px; }
.cover { position: relative; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 14px 30px -14px rgba(0,0,0,.45); transition: transform .25s, box-shadow .25s; }
.cover:not(.sk):hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 4px 8px rgba(0,0,0,.1), 0 24px 40px -16px rgba(0,0,0,.5); }
.cover-art, .cover-art .art { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover-inner { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 16px; background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, transparent 35%, transparent 55%, rgba(0,0,0,.72) 100%); }
.cover-top { display: flex; justify-content: space-between; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; opacity: .9; }
.cover-follow { background: #fff; color: #111; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; }
.cover-follow .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.cover-name { font: 700 23px/1.06 var(--serif); letter-spacing: -.015em; margin-top: 12px; text-wrap: balance; text-shadow: 0 1px 12px rgba(0,0,0,.3); }
.cover-pub { font-size: 11.5px; opacity: .8; margin-top: auto; }
.cover-stats { display: flex; gap: 10px; align-items: center; font-size: 12px; margin-top: 6px; opacity: .95; }
.cover-stats .tag-oa { background: rgba(255,255,255,.2); color: #fff; }

.masthead { position: relative; color: #fff; min-height: 300px; display: flex; align-items: flex-end; overflow: hidden; }
.masthead-art, .masthead-art .art { position: absolute; inset: 0; width: 100%; height: 100%; }
.masthead::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.65)); }
.masthead-inner { position: relative; z-index: 1; max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 40px 24px 32px; }
.masthead h1 { font: 700 clamp(36px, 5.5vw, 64px)/1 var(--serif); letter-spacing: -.03em; margin: 6px 0 16px; }
.masthead-pub { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; opacity: .85; }
.masthead-stats { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; opacity: .92; }
.masthead-actions { display: flex; gap: 10px; margin-top: 20px; }
.masthead .btn { background: #fff; color: #111; border-color: #fff; }
.masthead .btn-on, .masthead .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }

/* ---------- feeds ---------- */
.feed-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.feed-tile { display: flex; flex-direction: column; gap: 4px; padding: 0 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.feed-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feed-tile b { font: 600 19px/1.25 var(--serif); padding: 10px 16px 0; }
.feed-tile small { color: var(--ink-3); padding: 0 16px; font-size: 12.5px; }
.feed-art { height: 90px; }
.feed-art .art { width: 100%; height: 100%; display: block; }
.feed-tile.new { align-items: center; justify-content: center; min-height: 180px; border-style: dashed; background: transparent; text-align: center; padding: 20px; }
.feed-tile.new span { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.feed-tile.new b { padding: 8px 0 0; }
.ideas { margin-top: 36px; }
.ideas h3 { font: 600 18px var(--serif); }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.editor-form { display: grid; gap: 22px; }
.editor-preview { position: sticky; top: 86px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; max-height: calc(100vh - 110px); overflow: auto; }
.editor-preview h3 { margin: 0 0 12px; font: 600 18px var(--serif); }
.grid-tight { grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.grid-tight .card-title { font-size: 16px; }
.grid-tight .card-abstract { display: none; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
.field input:not([type=range]), .field select, .inline-form input { height: 42px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); outline: none; }
.field input:focus, .field select:focus, .inline-form input:focus { border-color: var(--ink-3); }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
input[type=range] { accent-color: var(--accent); width: 100%; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.static { cursor: default; }
.chip small { color: var(--ink-3); }
.chip-group { display: inline-flex; }
.chip-group .chip { border-radius: 999px 0 0 999px; }
.chip-follow { border: 1px solid var(--line); border-left: 0; border-radius: 0 999px 999px 0; background: var(--card); padding: 0 8px; color: var(--ink-3); }
.chip-follow .ic { width: 14px; height: 14px; }
.chip-follow.on { color: var(--accent); }
.kws { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; }
.kw { font-size: 12.5px; color: var(--ink-3); }
.kw::before { content: '#'; opacity: .6; }
.kw:hover { color: var(--accent); }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.tokens:empty { display: none; }
.token { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13px; }
.token button { border: 0; background: transparent; color: inherit; padding: 2px; display: grid; }
.token .ic { width: 14px; height: 14px; }
.typeahead { position: relative; }
.typeahead input { width: 100%; }
.ta-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.ta-list:empty { display: none; }
.ta-list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ta-list button:hover { background: var(--bg-2); }
.ta-list b { display: block; font-weight: 500; font-size: 14px; }
.ta-list small, .ta-empty { color: var(--ink-3); font-size: 12px; }
.ta-empty { padding: 10px 14px; }

/* ---------- onboarding ---------- */
.onboard { max-width: 1000px; margin: 0 auto; padding: 56px 24px 140px; }
.onboard-head { text-align: center; margin-bottom: 40px; }
.onboard-head h1 { font: 600 clamp(36px, 5vw, 56px)/1.05 var(--serif); letter-spacing: -.025em; margin: 22px 0 12px; }
.onboard-head p { font: 400 19px/1.5 var(--serif); color: var(--ink-2); max-width: 560px; margin: 0 auto; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; transition: opacity .3s; }
.sp-grid.collapsed { display: none; }
.sp { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-align: left; transition: border-color .15s, transform .15s; }
.sp:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.sp-mono { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font: 700 16px var(--serif); color: #fff; background: hsl(var(--h) 45% 38%); flex: none; }
.sp-name { font-size: 14px; font-weight: 500; line-height: 1.2; }
.sp > .ic { position: absolute; top: 8px; right: 8px; width: 16px; height: 16px; opacity: 0; color: var(--accent); stroke-width: 2.6; }
.sp.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sp.on > .ic { opacity: 1; }
#topic-step h2 { font: 600 30px var(--serif); margin: 48px 0 6px; }
#topic-step h2 small { font-size: 17px; color: var(--ink-3); font-weight: 400; }
.topic-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 24px 0 10px; }
.onboard-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center; gap: 20px; padding: 16px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.onboard-bar span { color: var(--ink-3); font-size: 14px; }

/* ---------- reader ---------- */
.progress { position: fixed; top: 62px; left: 0; right: 0; height: 3px; z-index: 49; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.reader { max-width: 1320px; margin: 0 auto; padding: 8px 24px 80px; display: grid; grid-template-columns: 200px minmax(0, 700px) 330px; gap: 48px; justify-content: center; }
.reader-toc { position: sticky; top: 90px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; padding-top: 70px; font-size: 13px; display: grid; gap: 2px; visibility: hidden; }
.reader-toc.has-items { visibility: visible; }
.toc-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); margin-bottom: 8px; }
.reader-toc a { padding: 5px 0 5px 12px; border-left: 2px solid var(--line); color: var(--ink-2); line-height: 1.3; }
.reader-toc a:hover { color: var(--ink); border-color: var(--accent); }
.reader-toc a.lvl3 { padding-left: 24px; font-size: 12.5px; color: var(--ink-3); }
.reader-tools { position: sticky; top: 62px; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 10px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.tools-right { display: flex; align-items: center; gap: 2px; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.reader-head { padding: 26px 0 28px; border-bottom: 1px solid var(--line); }
.reader-art { height: 110px; border-radius: var(--radius); overflow: hidden; margin-bottom: 26px; }
.reader-art .art { width: 100%; height: 100%; display: block; }
.reader-kicker { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.reader-kicker a { color: var(--accent); }
.reader-title { font: 600 clamp(30px, 3.6vw, 44px)/1.1 var(--serif); letter-spacing: -.022em; margin: 14px 0 18px; text-wrap: pretty; }
.reader-authors { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.reader-inst { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.reader-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 18px; font-size: 13.5px; color: var(--ink-3); }
.reader-meta a:hover { color: var(--accent); }
.reader-body { font-family: var(--serif); line-height: 1.68; padding-top: 10px; }
.reader-body h2 { font: 600 1.45em/1.25 var(--serif); letter-spacing: -.01em; margin: 1.9em 0 .6em; scroll-margin-top: 130px; }
.reader-body h3 { font: 600 1.15em/1.3 var(--serif); margin: 1.6em 0 .5em; scroll-margin-top: 130px; }
.reader-body h4 { font: 600 1em/1.3 var(--sans); margin: 1.4em 0 .4em; }
.reader-body p { margin: 0 0 1.05em; }
.reader-body a { color: var(--accent); }
.abstract { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 28px 14px; margin-top: 22px; }
.abstract h2 { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin: 18px 0 10px; }
.abs-head { font-family: var(--sans); font-size: .78em; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.ft-status { color: var(--ink-3); font: 14px var(--sans); margin: 30px 0; }
.ft-badge { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--sans); color: #2c7a5b; background: color-mix(in srgb, #2c7a5b 12%, transparent); padding: 5px 10px; border-radius: 999px; margin: 30px 0 0; }
[data-theme='dark'] .ft-badge { color: #6fcf9f; }
.ft-cta { margin: 36px 0; padding: 28px; border-radius: var(--radius); background: var(--bg-2); font-family: var(--sans); }
.ft-cta h3 { font: 600 22px var(--serif); margin: 0 0 8px; }
.ft-cta p { color: var(--ink-2); margin: 0 0 18px; font-size: 15px; line-height: 1.55; }
.ft-links { display: flex; flex-wrap: wrap; gap: 10px; }
.ft-links a { color: inherit; }
.ft-links .btn { color: var(--bg); }
.ft-links .btn-ghost { color: var(--ink); }
.ft figure { margin: 2em 0; font-family: var(--sans); }
.ft figure img { max-width: 100%; border-radius: 8px; background: #fff; display: block; margin: 0 auto; }
.ft figcaption { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); margin-top: 10px; }
.ft figcaption p { margin: 0 0 .5em; }
.fig-missing { display: block; padding: 18px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; font-size: 13px; }
.table-scroll { overflow-x: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
.ft table { border-collapse: collapse; font-size: 13px; width: 100%; }
.ft th, .ft td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ft th { background: var(--bg-2); font-weight: 600; }
.table-foot { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.ft blockquote, .ft .boxed { margin: 1.4em 0; padding: 1em 1.3em; background: var(--bg-2); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.ft .formula { font-family: ui-monospace, monospace; font-size: .85em; color: var(--ink-2); }
.ft div.formula { display: block; margin: 1em 0; overflow-x: auto; }
.ft .label { font-weight: 600; }
.ft .fn { font-size: 13px; color: var(--ink-3); }
.cite-ref { font-family: var(--sans); font-size: .7em; vertical-align: super; line-height: 0; padding: 0 1px; font-weight: 600; }
.ft-refs { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--line); }
.ft-refs ol { font: 13.5px/1.5 var(--sans); color: var(--ink-2); padding-left: 1.6em; }
.ft-refs li { margin-bottom: 10px; padding: 4px 6px; border-radius: 6px; transition: background .4s; scroll-margin-top: 140px; }
.ft-refs li.flash { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.ref-open { white-space: nowrap; font-weight: 600; font-size: 12.5px; }

.reader-rail { padding-top: 70px; display: grid; gap: 18px; align-content: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.panel h3 { font: 600 16px var(--serif); margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.small-link { font-size: 12px; color: var(--accent); font-weight: 500; }
.impact-row { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.ring { width: 92px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.ring-dial { position: relative; width: 78px; height: 78px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--bg-2); stroke-width: 6; }
.ring-val { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring b { font: 700 26px/1 var(--serif); }
.ring span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.impact-facts { display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.impact-facts b { color: var(--ink); font-size: 15px; }
.hint { font-size: 10.5px; border-bottom: 1px dotted; cursor: help; color: var(--ink-3); }
.badge-top { display: inline-block; margin-top: 2px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: #1f1a14; color: #f4c95d; justify-self: start; }
.mbar { margin-top: 10px; }
.mbar-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }
.mbar-track { height: 5px; background: var(--bg-2); border-radius: 3px; margin: 5px 0 3px; overflow: hidden; }
.mbar-track i { display: block; height: 100%; background: hsl(var(--rh) 55% 45%); border-radius: 3px; }
.mbar small { font-size: 11.5px; color: var(--ink-3); }
.note { font-size: 12px; color: var(--ink-3); background: var(--bg-2); padding: 8px 10px; border-radius: 6px; margin: 12px 0 0; }
.tabs { display: flex; gap: 2px; margin: -4px 0 6px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-color: var(--accent); }
.map { width: 100%; height: auto; display: block; }
.map-node { cursor: pointer; stroke: var(--card); stroke-width: 1.5; transition: r .15s; }
.map-node:hover { stroke: var(--ink); stroke-width: 2; }
.map-me { fill: var(--bg); font: 700 9px var(--sans); }
.map-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--ink-2); }
.map-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.journal-panel { display: flex; gap: 14px; align-items: center; }
.jp-cover { width: 70px; aspect-ratio: 3/4; flex: none; border-radius: 4px; padding: 7px; font: 700 10px/1.1 var(--serif); color: #fff; background: hsl(var(--h) 38% 26%); overflow: hidden; box-shadow: 0 6px 14px -8px rgba(0,0,0,.5); }
.jp-pub { font-size: 12px; color: var(--ink-3); }
.jp-stats { font-size: 13px; color: var(--ink-2); margin: 2px 0 10px; }
.reader-loading { max-width: 700px; margin: 60px auto; padding: 0 24px; }

/* ---------- settings / about ---------- */
.page.narrow .panel { margin-bottom: 18px; }
.page.narrow .panel h3 { font-size: 19px; }
.page.narrow .field { margin-top: 16px; }
.inline-form { display: flex; gap: 8px; margin: 10px 0; }
.inline-form input { flex: 1; }
.prose h3 { font: 600 22px var(--serif); margin: 30px 0 8px; }
.prose p { font: 400 17.5px/1.65 var(--serif); color: var(--ink-2); margin: 0 0 12px; }
.prose p b { color: var(--ink); }
.tiers td { padding: 6px 14px 6px 0; font-size: 15px; }

/* ---------- footer + toast ---------- */
.footer { max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-3); }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .reader { grid-template-columns: minmax(0, 700px) 300px; gap: 36px; }
  .reader-toc { display: none; }
}
@media (max-width: 920px) {
  .topbar { backdrop-filter: none; background: var(--bg); }
  .topbar-inner { gap: 14px; padding: 0 16px; }
  .search { width: auto; flex: 1; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; justify-content: space-around; background: var(--bg); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 60; }
  .nav a.on::after { bottom: auto; top: -7px; }
  body { padding-bottom: 60px; }
  .mag-top, .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-preview { position: static; max-height: none; }
  .reader { grid-template-columns: minmax(0, 1fr); padding: 0 16px 60px; }
  .reader-rail { padding-top: 20px; }
  .page { padding: 20px 16px 48px; }
  .rows.two-col { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .card-feature { grid-template-columns: 100px minmax(0, 1fr); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .covers { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cover-name { font-size: 18px; }
  .logo { font-size: 23px; }
  .reader-tools .sep, .reader-tools [data-font] { display: none; }
  .grid-tight { grid-template-columns: 1fr; }
}

/* ============ Newsstand landing ============ */
.briefing.slim { padding-bottom: 20px; margin-bottom: 26px; }
.cover-line { font: 500 13px/1.3 var(--serif); margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.35); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.cover-line + .cover-pub { margin-top: 8px; }

.hero { position: relative; border-radius: 16px; overflow: hidden; color: #fff; min-height: 380px; margin-bottom: 12px; }
.sk-hero { background: var(--bg-2); animation: none; }
.hero-bg, .hero-bg .art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.25) 45%, rgba(0,0,0,.6)); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 44px; padding: 40px 48px; align-items: center; }
.hero-cover .cover { display: block; width: 230px; transform: rotate(-2deg); box-shadow: 0 24px 50px -16px rgba(0,0,0,.7); }
.hero-cover .cover:hover { transform: rotate(0) translateY(-4px); }
.hero-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 11.5px; font-weight: 600; opacity: .85; }
.hero-text h2 { font: 700 clamp(30px, 4vw, 48px)/1.03 var(--serif); letter-spacing: -.025em; margin: 8px 0 10px; }
.hero-stats { font-size: 14px; opacity: .9; }
.hero-stats a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.4); }
.hero-issue { margin: 22px 0 24px; max-width: 640px; }
.hero-issue-title { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; opacity: .75; margin-bottom: 6px; }
.hero-line { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.2); font: 500 17px/1.3 var(--serif); }
.hero-line:hover span { text-decoration: underline; text-underline-offset: 3px; }
.hero .sk-line { background: rgba(255,255,255,.18); animation: none; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-light { background: #fff; color: #111; border-color: #fff; }
.btn-ghost.light { color: #fff; border-color: rgba(255,255,255,.55); background: transparent; }
.hero-nav { position: absolute; z-index: 2; right: 22px; bottom: 18px; display: flex; align-items: center; gap: 7px; }
.hero-nav i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); }
.hero-nav i.on { background: #fff; width: 20px; border-radius: 4px; }
.hero-nav button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.45); background: rgba(0,0,0,.2); color: #fff; display: grid; place-items: center; }
.hero-nav button:last-child .ic { transform: rotate(180deg); }

.shelf { margin-top: 44px; }
.shelf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-top: 14px; border-top: 3px solid var(--ink); margin-bottom: 18px; }
.shelf-head h2 { font: 600 26px/1.15 var(--serif); letter-spacing: -.01em; margin: 0; }
.shelf-head p { margin: 3px 0 0; color: var(--ink-3); font-size: 13.5px; }
.see-all { font-size: 13.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.shelf-body { position: relative; }
.shelf-track { display: grid; grid-auto-flow: column; grid-auto-columns: 180px; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 22px; scrollbar-width: none; }
.shelf-track::-webkit-scrollbar { display: none; }
.shelf-track .cover { scroll-snap-align: start; }
.shelf-track .cover-name { font-size: 19px; }
.shelf-arrow { position: absolute; top: calc(50% - 30px); z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.shelf-body:hover .shelf-arrow { opacity: 1; }
.shelf-arrow.left { left: -14px; }
.shelf-arrow.right { right: -14px; }
.shelf-arrow.right .ic { transform: rotate(180deg); }

.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.pub-tile { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); min-height: 76px; transition: box-shadow .2s, transform .2s; }
.pub-tile:not(.sk):hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pub-tile.sk { border: 0; }
.pub-mono { width: 48px; height: 48px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font: 700 17px var(--serif); background: hsl(var(--h) 38% 30%); }
.pub-tile b { display: block; font: 600 16px/1.25 var(--serif); }
.pub-tile small { color: var(--ink-3); font-size: 12.5px; }
.masthead-pub a:hover { text-decoration: underline; }
.section-title.first { margin-top: 0; }

@media (max-width: 920px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); padding: 28px 22px 64px; gap: 24px; }
  .hero-cover { display: none; }
  .shelf-track { grid-auto-columns: 150px; gap: 14px; }
  .shelf-arrow { display: none; }
}
.hero .score { background: rgba(255,255,255,.92); color: #1a1a1a; }

/* ============ Highlights (teasers) ============ */
.teaser { position: relative; padding: 2px 0 2px 14px; border-left: 3px solid var(--tc, var(--accent)); }
.teaser-question { --tc: hsl(212 60% 48%); }
.teaser-finding { --tc: hsl(150 45% 38%); }
.teaser-number { --tc: hsl(32 80% 48%); }
.teaser-standout { --tc: hsl(275 45% 52%); }
[data-theme='dark'] .teaser-question { --tc: hsl(212 70% 65%); }
[data-theme='dark'] .teaser-finding { --tc: hsl(150 45% 58%); }
[data-theme='dark'] .teaser-number { --tc: hsl(32 85% 62%); }
[data-theme='dark'] .teaser-standout { --tc: hsl(275 55% 70%); }
.teaser-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--tc); }
.teaser-label i { font-style: normal; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--tc); color: #fff; font-size: 10.5px; }
[data-theme='dark'] .teaser-label i { color: #111; }
.teaser p { margin: 4px 0 0; font: 400 15px/1.45 var(--serif); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.teaser p b { font-weight: 700; color: var(--tc); }
.card-lead .teaser p { font-size: 18px; -webkit-line-clamp: 5; }
.card-feature .teaser p { font-size: 14px; -webkit-line-clamp: 3; }
.teaser-standout p { font-family: var(--sans); font-size: 13.5px; font-weight: 500; }

.glance { margin-top: 22px; padding: 20px 22px; border-radius: var(--radius); background: var(--bg-2); }
.glance-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.glance-head h2 { font: 700 12px var(--sans) !important; text-transform: uppercase; letter-spacing: .14em; margin: 0 !important; color: var(--ink); }
.glance-head span { font: 12px var(--sans); color: var(--ink-3); }
.glance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 22px; }
.glance .teaser p { font-size: .9em; -webkit-line-clamp: unset; display: block; }

/* ============ Welcome + doors ============ */
.welcome-head { text-align: center; padding: 40px 0 34px; }
.welcome-head .date { text-transform: uppercase; letter-spacing: .14em; font-size: 11.5px; font-weight: 600; color: var(--accent); }
.welcome-head h1 { font: 600 clamp(38px, 5.6vw, 66px)/1.02 var(--serif); letter-spacing: -.03em; margin: 12px 0 14px; }
.welcome-head .lede { margin: 0 auto; max-width: 620px; }
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 920px; margin: 0 auto; }
.door { display: flex; flex-direction: column; gap: 8px; padding: 28px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); transition: transform .2s, box-shadow .2s, border-color .2s; }
.door:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ink-3); }
.door b { font: 600 26px/1.15 var(--serif); letter-spacing: -.01em; }
.door small { font-size: 13.5px; line-height: 1.5; color: var(--ink-3); max-width: 340px; }
.door-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); margin-bottom: 8px; }
.door-icon .ic { width: 22px; height: 22px; }
.door-go { margin-top: 12px; font-weight: 600; font-size: 14px; color: var(--accent); }
.door-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.door-primary small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.door-primary .door-icon { background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); }
.door-primary .door-icon .ic { fill: currentColor; stroke: none; }
.door-primary .door-go { color: var(--bg); }

.briefing.with-actions { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.head-actions .ic { width: 16px; height: 16px; }

.shelf-track.papers { grid-auto-columns: 300px; }
.shelf-track.papers .card-art { aspect-ratio: 16 / 7; }
.covers.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.covers.compact .cover-name { font-size: 17px; }

/* ============ Onboarding v2 ============ */
.steps { display: inline-flex; gap: 6px; list-style: none; padding: 0; margin: 18px 0 0; counter-reset: s; }
.steps li { counter-increment: s; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--bg-2); }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; margin-right: 6px; background: var(--line); color: var(--ink-2); font-size: 11px; }
.steps li.on { color: var(--ink); }
.steps li.on::before { background: var(--accent); color: #fff; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.area { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--card); transition: transform .15s, box-shadow .15s, border-color .15s; }
.area:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.area-art { height: 92px; }
.area-art .art { width: 100%; height: 100%; display: block; }
.area-text { padding: 14px 16px 16px; display: grid; gap: 4px; }
.area-text b { font: 600 18px/1.2 var(--serif); }
.area-text small { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.area-check { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.9); color: #111; opacity: 0; transform: scale(.8); transition: all .15s; }
.area-check .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.area.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.area.on .area-check { opacity: 1; transform: none; }
.area-grid.small .area-art { height: 64px; }
.onboard-bar { gap: 16px; }
.onboard-bar #ob-count { min-width: 150px; text-align: center; }
.covers.pick .cover { border: 0; padding: 0; cursor: pointer; text-align: left; }
.covers.pick .cover-follow { opacity: 0; transition: opacity .15s; }
.covers.pick .cover.on { outline: 3px solid var(--accent); outline-offset: 3px; }
.covers.pick .cover.on .cover-follow { opacity: 1; }

/* ============ Nudge ============ */
.nudge { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: 0 12px 34px -10px rgba(0,0,0,.45); font-size: 14px; max-width: calc(100vw - 32px); animation: nudgeIn .35s ease; }
.nudge .ic { width: 15px; height: 15px; fill: currentColor; stroke: none; vertical-align: -2px; }
.nudge .icon-btn { color: var(--bg); min-width: 30px; height: 30px; }
.nudge .icon-btn .ic { fill: none; stroke: currentColor; }
@keyframes nudgeIn { from { opacity: 0; transform: translate(-50%, 12px); } }

@media (max-width: 920px) {
  .doors { grid-template-columns: minmax(0, 1fr); }
  .nudge { bottom: 76px; border-radius: 16px; }
  .shelf-track.papers { grid-auto-columns: 260px; }
}

/* ============ Evidence & methods ============ */
:root { --ev1: #1f6f4a; --ev2: #2f8a5a; --ev3: #6b9a3a; --ev4: #b8892a; --ev5: #c0692b; --ev6: #8f8a83; }
[data-theme='dark'] { --ev1: #5fd096; --ev2: #74c98f; --ev3: #a8c86a; --ev4: #e0b45a; --ev5: #e89460; --ev6: #9b958c; }
.badges { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.ev { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 4px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--evc, var(--ink-2)); background: color-mix(in srgb, var(--evc, var(--ink-3)) 12%, transparent); }
.ev i { font-style: normal; display: inline-grid; place-items: center; width: 17px; height: 15px; padding-top: 3px; font-size: 9.5px; font-weight: 800; color: #fff; background: var(--evc); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
[data-theme='dark'] .ev i { color: #111; }
.ev-none { padding: 0 8px; --evc: var(--ink-3); }
.ev-l1 { --evc: var(--ev1); } .ev-l2 { --evc: var(--ev2); } .ev-l3 { --evc: var(--ev3); } .ev-l4 { --evc: var(--ev4); } .ev-l5 { --evc: var(--ev5); } .ev-l6 { --evc: var(--ev6); }
.ev-xs { height: 18px; font-size: 10.5px; margin-right: 6px; vertical-align: 1px; }
.ev-xs i { width: 14px; height: 12px; font-size: 8px; }
.ev-lg { height: 28px; font-size: 13px; padding-right: 10px; }
.ev-lg i { width: 20px; height: 17px; font-size: 10.5px; }
.card-top { min-width: 0; }
.card-top .kicker { flex: 1; min-width: 0; }
.teaser-method { --tc: var(--ev2); }
.teaser-method p { font-family: var(--sans); font-size: 13.5px; font-weight: 500; }

.ev-panel .ev-scheme { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; margin: -4px 0 12px; }
.ev-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.ev-head b { display: block; font: 600 16px/1.25 var(--serif); }
.ev-head span { font-size: 12.5px; color: var(--ink-3); }
.ev-level { flex: none; width: 52px; height: 46px; display: grid; place-items: center; align-content: center; padding-top: 10px; color: #fff; font: 800 18px/1 var(--sans); background: var(--evc, var(--ink-3)); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ev-level small { font-size: 8px; font-weight: 700; opacity: .85; margin-top: 1px; }
[data-theme='dark'] .ev-level { color: #111; }
.ev-level.ev-none { --evc: var(--line); color: var(--ink-3); }
.pyramid { width: 100%; height: auto; display: block; margin: 4px 0 10px; }
.pyr-band { fill: var(--bg-2); stroke: var(--card); stroke-width: 1; transition: fill .2s; }
.pyr-band.on.pyr-l1 { fill: var(--ev1); } .pyr-band.on.pyr-l2 { fill: var(--ev2); } .pyr-band.on.pyr-l3 { fill: var(--ev3); }
.pyr-band.on.pyr-l4 { fill: var(--ev4); } .pyr-band.on.pyr-l5 { fill: var(--ev5); } .pyr-band.on.pyr-l6 { fill: var(--ev6); }
.pyr-label { font: 500 9.5px var(--sans); fill: var(--ink-3); }
.pyr-label.on { fill: var(--ink); font-weight: 700; }
.ev-facts { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ev-facts li { font-size: 12px; font-weight: 500; padding: 4px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }
.ev-how { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); margin: 0 0 8px; }
.ev-how b { color: var(--ink); font-weight: 600; }
.about-h2 { font: 600 30px var(--serif); margin: 44px 0 10px; padding-top: 14px; border-top: 3px solid var(--ink); }
.about-pyramids { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; margin: 18px 0; }
.about-pyramids figure { margin: 0; padding: 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.about-pyramids figcaption { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.about-pyramids .pyr-band { fill: color-mix(in srgb, var(--ink-3) 25%, var(--bg-2)); }
.about-pyramids .pyr-l1 { fill: var(--ev1); } .about-pyramids .pyr-l2 { fill: var(--ev2); } .about-pyramids .pyr-l3 { fill: var(--ev3); }
.about-pyramids .pyr-l4 { fill: var(--ev4); } .about-pyramids .pyr-l5 { fill: var(--ev5); } .about-pyramids .pyr-l6 { fill: var(--ev6); }
.about-pyramids .pyr-label { fill: var(--ink-2); font-size: 10px; }
/* pyramid + readable level list (rows line up with the bands) */
.pyr { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; margin: 4px 0 12px; }
.pyr .pyramid { width: 64px; height: 168px; margin: 0; }
.pyr-levels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-rows: repeat(6, 28px); }
.pyr-levels li { display: flex; align-items: center; gap: 7px; font-size: 11.5px; line-height: 1.2; color: var(--ink-3); }
.pyr-levels li b { flex: none; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 9.5px; background: var(--bg-2); color: var(--ink-3); }
.pyr-levels li.on { color: var(--ink); font-weight: 700; }
.pyr-levels li.on b { background: var(--evc); color: #fff; }
[data-theme='dark'] .pyr-levels li.on b { color: #111; }
.pyr-t1 { --evc: var(--ev1); } .pyr-t2 { --evc: var(--ev2); } .pyr-t3 { --evc: var(--ev3); } .pyr-t4 { --evc: var(--ev4); } .pyr-t5 { --evc: var(--ev5); } .pyr-t6 { --evc: var(--ev6); }
.about-pyramids .pyr-levels li { color: var(--ink-2); font-size: 12.5px; }
.about-pyramids .pyr-levels li b { background: var(--evc); color: #fff; }

/* ============ accounts ============ */
.account-link { font-size: 13px; font-weight: 600; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; height: 34px; padding: 0 14px; display: inline-flex; align-items: center; white-space: nowrap; }
.account-link:hover { border-color: var(--ink-3); }
.account-link.signed-in { border: 0; padding: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.acct-form { display: grid; gap: 18px; padding: 24px; }
.acct-form .inline-form { display: flex; gap: 8px; }
.acct-form .inline-form input { flex: 1; min-width: 0; }
.acct-google { width: 100%; justify-content: center; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.acct-sent { padding: 14px 16px; border-radius: 10px; background: color-mix(in srgb, #2c7a5b 12%, transparent); font-size: 14px; line-height: 1.5; }
.acct-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 22px; }
.acct-stats b { display: block; font: 600 30px var(--serif); }
.acct-stats span { font-size: 12.5px; color: var(--ink-3); }
.acct-status { margin: 14px 0; min-height: 1em; }
@media (max-width: 560px) { .acct-form .inline-form { flex-direction: column; } }

/* ============ access: full text / free at source / abstract only ============ */
.access { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px 2px 5px; border-radius: 4px; white-space: nowrap; }
.access .ic { width: 13px !important; height: 13px !important; stroke-width: 2; }
.access-full { background: color-mix(in srgb, #2c7a5b 14%, transparent); color: #2c7a5b; }
.access-free { background: color-mix(in srgb, #2f6fb0 12%, transparent); color: #2f6fb0; }
.access-abs { background: var(--bg-2); color: var(--ink-3); }
[data-theme='dark'] .access-full { color: #6fcf9f; }
[data-theme='dark'] .access-free { color: #8ab8ea; }
.row-meta .access { margin-left: 4px; vertical-align: 1px; }
@media (max-width: 920px) {
  .nav a { padding: 8px 6px; font-size: 13px; }
  .nav a.on::after { left: 6px; right: 6px; }
}
@media (max-width: 560px) {
  .acct-form .inline-form input { flex: none; height: 44px; }
  .account-link { padding: 0 10px; }
}

/* ============ reading progress ============ */
.readstate { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.readstate:hover { text-decoration: underline; }
.readstate .rbar { flex: 0 0 64px; height: 4px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.readstate .rbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.readstate.done { color: #2c7a5b; }
.readstate.done .ic { width: 14px; height: 14px; stroke-width: 2.4; }
[data-theme='dark'] .readstate.done { color: #6fcf9f; }
.row-card { flex-wrap: wrap; }
.row-card > .readstate { flex-basis: 100%; order: 3; padding-top: 4px; }
.lib-tabs small { color: var(--ink-3); font-weight: 500; margin-left: 3px; }
.lib-tabs { flex-wrap: wrap; }

/* ============ profile ============ */
.profile-head { display: flex; align-items: center; gap: 18px; padding: 36px 0 24px; }
.profile-head h1 { font: 600 34px/1.1 var(--serif); margin: 0 0 4px; }
.profile-head p { margin: 0; }
.profile-head .btn { margin-left: auto; }
.avatar-lg { width: 68px; height: 68px; font-size: 28px; flex: none; }
.acct-stats { grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.acct-stats a:hover b { color: var(--accent); }
.panel .mt { margin-top: 18px; }
.panel .row-actions { margin-top: 14px; }
.role-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; cursor: pointer; }
.chip-radio input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-radio input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) {
  .acct-stats { grid-template-columns: repeat(3, 1fr); row-gap: 16px; }
  .profile-head { flex-wrap: wrap; }
}

/* ============ suggestions ============ */
.keep-reading { max-width: 100%; }
.keep-reading .section-title { margin-top: 44px; }
.suggest { position: fixed; right: 22px; bottom: 22px; width: 372px; max-width: calc(100vw - 32px); max-height: min(78vh, 620px); display: flex; flex-direction: column; z-index: 75; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px -12px rgba(0,0,0,.35); animation: suggestIn .3s ease; }
@keyframes suggestIn { from { opacity: 0; transform: translateY(24px); } }
@media (prefers-reduced-motion: reduce) { .suggest { animation: none; } }
.suggest header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.suggest header b { font: 600 17px var(--serif); }
.suggest header b .ic { width: 15px; height: 15px; fill: var(--accent); stroke: none; vertical-align: -1px; }
.suggest header small { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.suggest-body { overflow-y: auto; }
.suggest-item { display: grid; gap: 4px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
a.suggest-item:hover { background: var(--bg-2); }
.suggest-item > b { font: 600 15.5px/1.28 var(--serif); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.suggest-why { font-size: 11.5px; font-weight: 600; color: var(--accent); }
.suggest-meta { font-size: 12.5px; color: var(--ink-3); }
.suggest-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.suggest-journal { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.suggest-journal > a { display: flex; align-items: center; gap: 12px; min-width: 0; }
.suggest-journal .btn { flex: none; }
.suggest-journal b { display: block; font: 600 15px/1.25 var(--serif); }
.suggest-journal small { color: var(--ink-3); font-size: 12px; }
.suggest .swatch { flex: none; width: 28px; height: 38px; border-radius: 4px; background: hsl(var(--h) 45% 32%); }
.suggest footer { padding: 8px 18px 10px; text-align: right; }
.suggest footer button { border: 0; background: none; color: var(--ink-3); font-size: 12px; cursor: pointer; padding: 4px 0; }
.suggest footer button:hover { color: var(--ink); text-decoration: underline; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
@media (max-width: 920px) { .suggest { right: 16px; bottom: 72px; max-height: 46vh; } }
.acct-sent.bad { background: color-mix(in srgb, var(--accent) 12%, transparent); }
#google-box { display: grid; gap: 18px; }
#google-box[hidden] { display: none; }

.ft-open { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 32px 0; font-family: var(--sans); }
.ft-open small { color: var(--ink-3); font-size: 13px; }
.ft-open .ic { width: 18px; height: 18px; }
@media (max-width: 560px) { .ft-open .btn { width: 100%; justify-content: center; } }

/* ============ figures ============ */
.fig-strip { font-family: var(--sans); }
.fig-strip h2 { font: 600 20px var(--serif); margin: 30px 0 12px; }
.fig-strip h2 small { color: var(--ink-3); font: 500 14px var(--sans); }
.fig-track { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.fig-thumb { flex: 0 0 230px; scroll-snap-align: start; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink-2); overflow: hidden; cursor: zoom-in; font: 12.5px/1.45 var(--sans); }
.fig-thumb:hover { border-color: var(--ink-3); }
.fig-thumb img { display: block; color: transparent; width: 100%; height: 160px; object-fit: contain; background: #fff; padding: 8px; box-sizing: border-box; }
.fig-thumb span { display: block; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.fig-thumb b { color: var(--ink); }
.fig-license { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 0; }
.fig-license a, .fig-cap a { color: inherit; text-decoration: underline; }
.fig-view { margin: auto; width: min(1100px, 100vw - 24px); max-width: none; max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 16px; background: var(--card); color: var(--ink); font-family: var(--sans); }
.fig-view[open] { display: flex; flex-direction: column; }
.fig-view::backdrop { background: rgba(0,0,0,.72); }
.fig-view header { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--line); font-size: 15px; }
.fig-view header small { color: var(--ink-3); font-weight: 500; margin-left: 6px; }
.fig-stage { position: relative; background: #fff; flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; align-items: center; overflow: auto; }
.fig-stage a { display: block; max-width: 100%; }
.fig-stage img { display: block; max-width: 100%; max-height: 62dvh; object-fit: contain; padding: 12px; box-sizing: border-box; cursor: zoom-in; }
.fig-view header span { display: flex; }
.fig-next .ic { transform: rotate(180deg); }
.fig-cap { padding: 14px 20px 18px; overflow-y: auto; max-height: 24dvh; font-size: 14px; line-height: 1.5; flex: none; }
.fig-cap p { margin: 0 0 8px; }
.fig-cap small { color: var(--ink-3); }

/* ============ full text from OpenAlex ============ */
.ft-extracted { font: 13.5px/1.55 var(--sans); color: var(--ink-2); background: var(--bg-2); border-radius: 10px; padding: 12px 16px; margin: 0 0 24px; }
.ft-extracted .btn { margin: 8px 0 0; display: flex; width: fit-content; }
.pdf-pages { display: grid; gap: 14px; margin: 0 0 24px; }
.pdf-page { position: relative; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-bad::after { content: 'This page could not be shown'; position: absolute; inset: 0; display: grid; place-items: center; color: #777; font: 14px var(--sans); }
.cite-ref.cite-name { vertical-align: baseline; font-size: inherit; font-family: inherit; font-weight: inherit; line-height: inherit; }

/* ============ installed app (iPhone edges) ============ */
@supports (padding: max(0px)) {
  .topbar { padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  @media (max-width: 920px) {
    .suggest { bottom: calc(72px + env(safe-area-inset-bottom)); }
    .nudge { bottom: calc(76px + env(safe-area-inset-bottom)); }
  }
}

/* ============ phones and tablets ============ */
.search-toggle { display: none; }
.nav a .ic { display: none; }
@media (max-width: 920px) {
  :root { --bar: 54px; --dock: calc(58px + env(safe-area-inset-bottom)); }
  html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
  body { padding-bottom: var(--dock); -webkit-tap-highlight-color: transparent; }
  .topbar-inner { height: var(--bar); gap: 6px; flex-wrap: nowrap; }
  .logo { margin-right: auto; }
  .account-link { margin: 0 4px; }
  .icon-btn { min-width: 42px; height: 42px; }
  .btn-sm { height: 38px; }
  .chip, .pill { min-height: 38px; }
  .chip-follow { min-width: 40px; }

  /* search: a button that opens a full-width box */
  .search-toggle { display: inline-flex; }
  .topbar .search { display: none; position: absolute; top: calc(var(--bar) + env(safe-area-inset-top)); left: 0; right: 0; width: auto; height: 56px; margin: 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); background: var(--bg); padding: 0 18px; }
  body.searching .topbar .search { display: flex; }
  body.searching main { padding-top: 56px; }
  body.searching.is-reading .reader-tools { top: calc(var(--bar) + 56px + env(safe-area-inset-top)); }
  /* 16px keeps iPhones from zooming in when a box is tapped */
  input:not([type=range]):not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
  .field input:not([type=range]), .field select, .inline-form input { height: 46px; min-width: 0; width: 100%; box-sizing: border-box; }
  .field input[type=checkbox], .field input[type=radio] { width: auto; height: auto; }

  /* bottom menu with icons */
  .nav { height: 58px; padding: 0 2px env(safe-area-inset-bottom); box-sizing: content-box; gap: 0; align-items: stretch; }
  .nav a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; font-size: 10.5px; border-radius: 0; }
  .nav a .ic { display: block; width: 23px; height: 23px; }
  .nav a:hover { background: none; }
  .nav a.on { color: var(--accent); font-weight: 600; }
  .nav a.on::after { display: none; }
  .is-onboarding .nav { display: none; }
  .onboard-bar { padding-bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 70; }
  #nl-badge-frame { bottom: calc(var(--dock) + 8px) !important; }

  /* reading */
  .progress { top: calc(var(--bar) + env(safe-area-inset-top)); }
  .reader-tools { top: calc(var(--bar) + env(safe-area-inset-top)); padding: 3px 0; }
  .reader { padding-top: 0; }
  .reader-title { font-size: clamp(26px, 7.2vw, 36px); }
  .reader-head { padding: 18px 0 22px; }
  .reader-art { height: 84px; margin-bottom: 18px; }
  .reader-body { overflow-wrap: anywhere; line-height: 1.6; }
  .abstract { padding: 4px 18px 10px; }
  .reader-body h2, .reader-body h3, .ft [id], .ft-refs [id] { scroll-margin-top: calc(var(--bar) + 70px); }
  .fig-track { margin: 0 -16px; padding: 0 16px 8px; scrollbar-width: none; }
  .fig-track::-webkit-scrollbar { display: none; }
  .fig-thumb { flex-basis: min(250px, 72vw); }
  .table-scroll { -webkit-overflow-scrolling: touch; }

  /* tabs and filters slide sideways on one line */
  .seg { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; border-radius: 14px; }
  .seg::-webkit-scrollbar, .pills.scroll::-webkit-scrollbar { display: none; }
  .seg a, .seg button { flex: 1 0 auto; white-space: nowrap; text-align: center; padding: 9px 14px; border-radius: 11px; }
  .pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 6px; }
  .pills::-webkit-scrollbar { display: none; }
  .pill { flex: none; }
  .shelf-track { margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding-left: 16px; }
  .briefing.with-actions { flex-wrap: wrap; }
  .head-actions { display: flex; width: 100%; gap: 8px; }
  .head-actions .btn { flex: 1; justify-content: center; padding: 0 10px; white-space: nowrap; }

  /* forms and grids never run off the side */
  .editor-grid > *, .field, .field-row > *, .typeahead, .chips { min-width: 0; max-width: 100%; }
  .field { grid-template-columns: minmax(0, 1fr); }
  .row-actions { flex-wrap: wrap; }
  .footer { flex-wrap: wrap; padding: 24px 16px 28px; }

  /* pop-ups as panels above the menu */
  .suggest { left: 10px; right: 10px; width: auto; max-width: none; bottom: calc(var(--dock) + 8px); max-height: 46dvh; }
  .nudge { left: 10px; right: 10px; transform: none; max-width: none; bottom: calc(var(--dock) + 8px); border-radius: 16px; padding: 10px 8px 10px 16px; animation: none; }
  .nudge > span { flex: 1; min-width: 0; line-height: 1.4; }
  .nudge .btn, .nudge .icon-btn { flex: none; }
  .toast { bottom: calc(var(--dock) + 14px); max-width: calc(100vw - 32px); width: max-content; box-sizing: border-box; text-align: center; border-radius: 16px; }
}
@media (max-width: 560px) {
  .card-art { aspect-ratio: 16 / 7; }
  .card-lead .card-art { aspect-ratio: 16 / 8; }
  .card-feature .card-art { aspect-ratio: 1; }
  .grid { gap: 30px; margin-top: 20px; }
  .doors { gap: 12px; }
  .masthead-inner { padding-left: 16px; padding-right: 16px; }
  .fig-view { width: 100vw; max-height: 100dvh; border-radius: 16px; }
}
@media (max-width: 350px) { .account-link { font-size: 12px; padding: 0 8px; } .icon-btn { min-width: 36px; } }
