/* The web reader: Home, Feeds and Settings behind a bottom bar, like the app. Tokens come from style.css.
   House Apple rules: 8 point grid, 20 side margin, 680 reading column, 44 to 48 point controls, one radius set
   (groups 20, controls round, images 12), inset hairlines, liquid glass on what floats. */
body { font-size: 16px; line-height: 22px; }   /* a step under the landing: Bugle Sans reads larger than SF at the same size */
.screen { max-width: 680px; margin: 0 auto; padding: var(--sp-6) 20px 128px; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.screen[hidden] { display: none; }
.head { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; margin-bottom: var(--sp-4); }
.head h1 { font-size: 34px; line-height: 41px; letter-spacing: -.022em; flex: 1; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r-pill); border: 0; background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s ease; }
.icon-btn:hover { background: color-mix(in srgb, var(--text) 8%, var(--surface)); }
.icon-btn svg { width: 20px; height: 20px; }

/* inset grouped lists: rows 12 by 16, a hairline between rows inset 16 from the start, no borders */
.group { background: var(--surface); border-radius: var(--r-group); overflow: hidden; }
.group + .label, .note + .label { margin-top: var(--sp-5); }
.label { font-size: 13px; line-height: 18px; color: var(--sub); margin: 0 var(--sp-4) var(--sp-2); }
.note { font-size: 13px; line-height: 18px; color: var(--sub); margin: var(--sp-2) var(--sp-4) 0; }
ul.rows { list-style: none; }
ul.rows li + li { background: linear-gradient(var(--line), var(--line)) 16px 0 / calc(100% - 16px) 1px no-repeat; }
.row { display: flex; gap: var(--sp-3); align-items: center; width: 100%; min-height: 48px; text-align: left;
  background: none; border: 0; padding: var(--sp-3) var(--sp-4); font: inherit; color: var(--text); transition: background .2s ease; }
button.row { cursor: pointer; }
button.row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.row .txt { flex: 1; min-width: 0; }
.row b { display: block; font-size: 16px; line-height: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row b.title { white-space: normal; max-height: 44px; }   /* two lines, like Apple News; fitTitles picks a cut that fits */
.row small { display: block; color: var(--sub); font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .thumb { flex: 0 0 56px; width: 56px; height: 56px; object-fit: cover; border-radius: 12px; background: var(--line); }
.row .mono { --o: var(--c, var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; color: var(--o);
  background: color-mix(in srgb, var(--o) 12%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .row .mono { --o: var(--cd, var(--accent)); } }
:root[data-theme="dark"] .row .mono { --o: var(--cd, var(--accent)); }
.row .chev { color: var(--sub); flex: none; font-size: 20px; }
a.row { text-decoration: none; }
a.row:hover { text-decoration: none; background: color-mix(in srgb, var(--text) 4%, transparent); }
.act { flex: none; min-height: 44px; background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0 var(--sp-2); }
.row a { color: var(--accent); }
.add { display: flex; gap: var(--sp-2); padding: 0 var(--sp-2) 0 var(--sp-4); align-items: center; min-height: 48px; }
.add input { flex: 1; min-width: 0; height: 48px; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); }
.add input:focus-visible { outline: none; }
.add:focus-within { box-shadow: 0 0 0 4px var(--ring); border-radius: var(--r-group); }
.muted { color: var(--sub); padding: var(--sp-4); }

.story-bar { display: flex; justify-content: space-between; margin-bottom: var(--sp-3); }
.back-btn { min-height: 44px; background: none; border: 0; color: var(--accent); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; padding: 0; }
.article { font-size: var(--read-size, 17px); line-height: 1.5; }
.article h2 { font-family: var(--display); text-transform: none; letter-spacing: -.02em; font-size: 26px; line-height: 32px; margin-bottom: var(--sp-2); }
.article .meta { color: var(--sub); font-size: 13px; line-height: 18px; margin-bottom: var(--sp-5); }
.article p { margin-bottom: var(--sp-4); }
.article img { max-width: 100%; height: auto; max-height: 50vh; object-fit: cover; border-radius: 12px; }
.article pre, .article table { display: block; overflow-x: auto; }
.stepper { display: flex; gap: var(--sp-2); }
.stepper button { min-width: 56px; height: 44px; border-radius: var(--r-pill); border: 0; background: var(--bg); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; transition: background .2s ease; }
.stepper button:hover { background: color-mix(in srgb, var(--text) 8%, var(--bg)); }

/* liquid glass: translucent so the list shows through, a bright top edge, a soft shadow */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(var(--sp-4), env(safe-area-inset-bottom));
  display: flex; gap: var(--sp-1); padding: var(--sp-1); border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .26); backdrop-filter: blur(30px) saturate(190%) brightness(1.3); -webkit-backdrop-filter: blur(30px) saturate(190%) brightness(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 .5px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .12); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 72px; min-height: 48px;
  padding: 0 var(--sp-3); border-radius: var(--r-pill); color: var(--text); font-size: 0; line-height: 0;   /* glyphs only; the label stays for screen readers */ transition: background .2s ease, color .2s ease; }
.tabbar a:hover { text-decoration: none; }
/* taps land at once: no double-tap zoom wait, no gray flash */
.tabbar a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a[aria-current="page"] { color: var(--accent); background: rgba(255, 255, 255, .5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar { background: rgba(28, 28, 30, .34); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 .5px rgba(255, 255, 255, .08), 0 8px 24px rgba(0, 0, 0, .4); }
  :root:not([data-theme="light"]) .tabbar a[aria-current="page"] { background: rgba(255, 255, 255, .12); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Home, Saved and History are plain lists, flush with the view: no card, rows edge to edge, hairlines inset to
   the text. News-app rows (Mobbin study): outlet and time above the headline, picture on the right. */
#home { padding-top: max(var(--sp-2), env(safe-area-inset-top)); }
.plain { padding-left: 0; padding-right: 0; }
.plain > .head, .plain > .back-btn, .plain > .story-bar { padding: 0 20px; }
.plain .group { background: none; border-radius: 0; }
.plain .row { padding: var(--sp-3) 20px; }
.plain ul.rows li + li { background: linear-gradient(var(--line), var(--line)) 20px 0 / calc(100% - 40px) 1px no-repeat; }
.kick { display: block; font-size: 13px; line-height: 18px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.kick .src { font-weight: 600; }
/* An outlet's name in its own color (Coverage.paint sets --c and --cd): above headlines and in Feeds. */
.oc, .kick .src { color: var(--c, var(--accent)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .oc, :root:not([data-theme="light"]) .kick .src { color: var(--cd, var(--accent)); } }
:root[data-theme="dark"] .oc, :root[data-theme="dark"] .kick .src { color: var(--cd, var(--accent)); }
/* Every story on Home from one outlet (one feed followed, or a search for it): the whole reader takes its color. */
:root[data-outlet] { --accent: var(--c); }
@media (prefers-color-scheme: dark) { :root[data-outlet]:not([data-theme="light"]) { --accent: var(--cd); } }
:root[data-outlet][data-theme="dark"] { --accent: var(--cd); }
.kick .saved { color: var(--accent); }
.row.read .title { color: var(--sub); }
.hero.read h3 { color: rgba(255, 255, 255, .7); }
.row.read .thumb { opacity: .6; }
.row .thumb.icon { object-fit: contain; padding: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* The top story as an App Store Today card: the photo fills a 28 point card, and the outlet and headline sit on
   liquid glass (blur, saturation, a dark tint) that fades in from the top so the photo has no hard edge. */
.hero { position: relative; display: block; width: calc(100% - 40px); margin: var(--sp-2) 20px var(--sp-4); padding: 0; aspect-ratio: 4 / 3; max-height: 480px;
  border: 0; border-radius: 28px; overflow: hidden; isolation: isolate; text-align: left; background: #1c1c1e; font: inherit; color: #fff; cursor: pointer; }   /* dark under the photo, so white type reads while it loads */
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .glass { position: absolute; left: 0; right: 0; bottom: 0; display: block; padding: 48px 20px var(--sp-4);
  background: rgba(0, 0, 0, .34); backdrop-filter: blur(30px) saturate(190%); -webkit-backdrop-filter: blur(30px) saturate(190%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%); mask-image: linear-gradient(to bottom, transparent, #000 45%); }
.hero h3 { font-family: var(--display); font-size: 20px; line-height: 26px; letter-spacing: -.02em; font-weight: 700; color: #fff; }
.hero .kick { color: rgba(255, 255, 255, .75); }
.hero .kick .src { color: var(--cd, #fff); }   /* each outlet's light-on-dark color, on any photo */
.hero.noimg { aspect-ratio: auto; background: var(--surface); }
.hero.noimg .glass { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; -webkit-mask-image: none; mask-image: none; }
.hero.noimg h3 { color: var(--text); }
.hero.noimg .kick { color: var(--sub); }
@media (min-width: 700px) { .hero { aspect-ratio: 16 / 9; } }
.hero-item + li { background: none; }   /* the card has its own edge; no hairline under it */
.pull { height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; transition: height .2s ease; }
.pull .spin { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); opacity: .5; }
.pull.ready .spin { opacity: 1; }
.pull.busy { height: 48px; }
.pull.busy .spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* account fields sit in the grouped list like Settings rows in the app */
.acct input { flex: 1; min-width: 0; height: 44px; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); }
.acct input:focus-visible { outline: none; }
.acct .row:focus-within { box-shadow: inset 0 0 0 4px var(--ring); }
.act:disabled { opacity: .4; cursor: default; }
.act.danger { color: #d70015; }
/* swipe to remove: the row slides over a red action, which only shows while it moves */
li.swipe { position: relative; overflow: hidden; }
li.swipe > .row { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
li.swipe > .row:focus-visible { outline: none; box-shadow: inset 0 0 0 4px var(--ring); }
li.swiping > .row { background: var(--surface); }
.swipe-del { position: absolute; top: 0; right: 0; bottom: 0; width: 88px; border: 0; background: #d70015; color: #fff; font: inherit; font-weight: 600; cursor: pointer; visibility: hidden; }
li.swiping > .swipe-del { visibility: visible; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .swipe-del { background: #ff453a; } }
:root[data-theme="dark"] .swipe-del { background: #ff453a; }
/* sign in: a filled capsule, create account a tinted one, both full width and 48 points (house controls) */
.acct-btns { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4) var(--sp-2); }
.btn { height: 48px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-pill); background: var(--accent); color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn.quiet { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.btn:disabled { opacity: .4; cursor: default; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.acct-btns .act { align-self: center; font-weight: 400; font-size: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .act.danger { color: #ff6961; } }

/* capsule search, 44 points, leading magnifier (house Apple rules) */
.search { display: flex; align-items: center; gap: var(--sp-2); height: 44px; margin: var(--sp-2) 20px var(--sp-2); padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); color: var(--sub); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); height: 44px; }
.search input:focus-visible { outline: none; }
/* the city picker: plain text with a drawn chevron, house rules */
#region { appearance: none; -webkit-appearance: none; border: 0; background: none; font: inherit; color: var(--accent); padding-right: 18px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 6px center, right 1px center; background-size: 5px 5px; background-repeat: no-repeat; }
#region:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); border-radius: 8px; }
/* the story toolbar: liquid glass buttons, 48 points, glyphs not words (the app's, on the web) */
.story-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--sp-3); padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.story-bar .txt { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* glass behind the bar once the page scrolls under it, fading out at its lower edge so there is no hard band */
#story .story-bar { margin: 0 -20px var(--sp-3); padding: var(--sp-2) 20px var(--sp-4);
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.glass-btn { display: flex; align-items: center; height: 48px; border: 0; border-radius: var(--r-pill); color: var(--text);
  background: rgba(255, 255, 255, .62); backdrop-filter: blur(30px) saturate(190%); -webkit-backdrop-filter: blur(30px) saturate(190%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 .5px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .08); cursor: pointer; }
.glass-btn.round { width: 48px; justify-content: center; flex: none; }
.glass-btn.group { flex: none; padding: 0 var(--sp-1); }
.glass-btn.group > * { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; background: none; color: var(--accent); cursor: pointer; }
.glass-btn svg { width: 22px; height: 22px; }
#save[aria-pressed="true"] svg { fill: currentColor; }
#listen[aria-pressed="true"] svg path:first-child { fill: currentColor; }
.glass-btn button:focus-visible, .glass-btn a:focus-visible, .glass-btn.round:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); border-radius: var(--r-pill); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .glass-btn { background: rgba(44, 44, 46, .62); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 .5px rgba(255, 255, 255, .08), 0 8px 24px rgba(0, 0, 0, .4); } }
:root[data-theme="dark"] .glass-btn { background: rgba(44, 44, 46, .62); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 .5px rgba(255, 255, 255, .08), 0 8px 24px rgba(0, 0, 0, .4); }
.article img.lead { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; margin: 0 0 var(--sp-4); background: var(--surface); }
.search:focus-within { box-shadow: 0 0 0 4px var(--ring); }
/* followed topics: one scrolling row of capsules under the search */
.topics { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; margin: 0 0 var(--sp-2); padding: 0 20px; }
.topics::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"], .chip.follow { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chip:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }

/* coverage: lean bar and every outlet's headline by side (Ground News style) */
.leanbar { width: 100%; }
.leanbar .track { display: flex; gap: 2px; height: 8px; border-radius: var(--r-pill); overflow: hidden; background: var(--line); }
.leanbar .track.empty { opacity: .4; }
.leanbar .track span { flex-basis: 6px; }
.leanbar .left { background: #0074D9; } .leanbar .center { background: color-mix(in srgb, var(--sub) 60%, transparent); } .leanbar .right { background: #d70015; }
.leanbar .legend { display: flex; justify-content: space-between; font-size: 13px; line-height: 18px; color: var(--sub); margin-top: var(--sp-2); }
.coverage { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.coverage h3 { font-family: var(--display); font-size: 22px; line-height: 28px; letter-spacing: -.02em; margin-bottom: var(--sp-3); }
.coverage .note-line { font-size: 13px; line-height: 18px; color: var(--sub); margin: var(--sp-2) 0 0; }
.coverage .label { margin: var(--sp-5) var(--sp-4) var(--sp-2); }
.coverage .group { background: var(--surface); border-radius: var(--r-group); overflow: hidden; }
.coverage .cov-title { display: block; font-size: 16px; line-height: 22px; color: var(--text); }
