/* FrenchBriefs: newsprint and slate from the logo, and one yellow marker that follows the voice. */

:root {
  --paper: #f3f0e8;
  --surface: #fbfaf6;
  --ink: #22333b;
  --muted: #5f6a6d;
  --rule: #dcd6ca;
  --lake: #2b3f47;
  --lake-ink: #f3f0e8;
  --slate: #2b3f47;
  --news: #dfdacf;
  --marker: #f4cd4f;
  --marker-soft: rgba(244, 205, 79, 0.45);
  --danger: #a33a2c;

  --serif: 'Newsreader', 'Iowan Old Style', 'Georgia', serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --measure: 36rem;
  --gutter: clamp(1.1rem, 5vw, 2rem);

  color-scheme: light dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f2e35;
    --surface: #27383f;
    --ink: #ece7dc;
    --muted: #a7aeab;
    --rule: #364850;
    --lake: #dfdacf;
    --lake-ink: #22333b;
    --marker: #c9a634;
    --marker-soft: rgba(201, 166, 52, 0.38);
    --danger: #f08b7c;
  }
}

*, *::before, *::after { box-sizing: inherit; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
body.has-player { padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
body.has-journal { padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px)); }

#app {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 1.25rem var(--gutter) 3rem;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--lake); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.icon { display: inline-flex; width: 1.25em; height: 1.25em; flex: none; }
.icon svg { width: 100%; height: 100%; }

/* ---------- buttons ---------- */

.btn {
  font: 500 0.95rem/1 var(--sans);
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--lake); border-color: var(--lake); color: var(--lake-ink); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn .icon { width: 1.1em; height: 1.1em; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--muted);
  cursor: pointer;
}
.icon-btn .icon { width: 1.4rem; height: 1.4rem; }
.icon-btn.spinning .icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.text-btn { font: 500 0.85rem var(--sans); background: none; border: 0; padding: 0.5rem; color: var(--muted); cursor: pointer; }
.text-btn.danger { color: var(--danger); }

/* ---------- masthead ---------- */

.masthead { padding: 0.75rem 0 1.25rem; }
.mast-row { display: flex; align-items: center; justify-content: space-between; }
.mast-actions { display: flex; margin-right: -0.6rem; }
.hello {
  font: 500 2.6rem/1.05 var(--serif);
  font-variation-settings: 'opsz' 72;
  letter-spacing: -0.02em;
  margin: 0;
}
.date { font: 400 1.05rem var(--sans); color: var(--muted); margin: 0.35rem 0 0; }
.date::first-letter { text-transform: uppercase; }



/* ---------- feed ---------- */

.feed { display: flex; flex-direction: column; }

.story {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.story:first-child { border-top: 0; padding-top: 0; }
.story.lead { grid-template-columns: 1fr; }

.meta { font: 400 0.84rem/1.4 var(--sans); color: var(--muted); margin: 0 0 0.35rem; }

.headline {
  font: 600 1.3rem/1.22 var(--serif);
  font-variation-settings: 'opsz' 36;
  letter-spacing: -0.005em;
  margin: 0 0 0.4rem;
}
.lead .headline { font-size: 1.85rem; line-height: 1.12; font-variation-settings: 'opsz' 60; letter-spacing: -0.015em; }

.dek { font-size: 1.02rem; line-height: 1.5; color: var(--muted); margin: 0; }
.lead .dek { font-size: 1.1rem; color: var(--ink); }

.story.read .headline { color: var(--muted); font-weight: 500; }

.lead-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; margin-bottom: 0.3rem; background: var(--rule); }
.thumb { width: 5.5rem; height: 5.5rem; object-fit: cover; border-radius: 8px; background: var(--rule); margin-top: 1.6rem; }

.end { font: 400 0.9rem var(--sans); color: var(--muted); padding: 2rem 0; border-top: 1px solid var(--rule); margin: 0; }

.empty { padding: 2.5rem 0; font-size: 1.15rem; }
.empty p { margin: 0 0 1.25rem; max-width: 28rem; }

/* ---------- the marker: follows the voice ---------- */

.hl, .tapped {
  background-image: linear-gradient(var(--marker-soft), var(--marker-soft));
  background-repeat: no-repeat;
  background-position: 0 85%;
  background-size: 100% 72%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  border-radius: 2px;
}
.hl { animation: sweep 0.45s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
.tapped { background-image: linear-gradient(var(--marker), var(--marker)); color: #17222c; }
@keyframes sweep { from { background-size: 0% 72%; } }

/* ---------- reader ---------- */

.reader-nav { margin: 0 0 1.5rem -0.4rem; }
.back { display: inline-flex; align-items: center; gap: 0.2rem; font: 500 0.95rem var(--sans); color: var(--muted); text-decoration: none; padding: 0.5rem 0.4rem; }

.reader-title {
  font: 600 2.1rem/1.12 var(--serif);
  font-variation-settings: 'opsz' 60;
  letter-spacing: -0.015em;
  margin: 0.2rem 0 1.25rem;
}
.reader-fig { margin: 0 0 1.4rem; }
.reader-fig img { width: 100%; border-radius: 10px; max-height: 60vh; object-fit: cover; }
.reader-dek { font-size: 1.3rem; line-height: 1.45; margin: 0 0 1.5rem; font-style: italic; }
.reader-body p { margin: 0 0 1.15rem; line-height: 1.68; }

.w { cursor: pointer; border-radius: 2px; }
@media (hover: hover) { .w:hover { background: var(--marker-soft); } }

.note { font: 400 0.92rem/1.5 var(--sans); color: var(--muted); }
.original { display: inline-block; font: 500 0.95rem var(--sans); color: var(--lake); margin-top: 2rem; }

/* ---------- speak-back ---------- */

.retell { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--rule); }
.retell-q { font-size: 1.25rem; font-weight: 500; margin: 0 0 1rem; }
.retell-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.retell-write { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; margin-top: 0.8rem; }
.retell-write textarea { width: 100%; }
.btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.recording .icon { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

.retell-live {
  margin: 1.2rem 0 0; padding: 0 0 0 1rem;
  border-left: 3px solid var(--marker);
  font-style: italic; color: var(--muted);
}
.retell-out { margin-top: 1.2rem; display: flex; flex-direction: column; gap: 1.1rem; align-items: flex-start; }
.bubble { background: var(--surface); border-radius: 4px 16px 16px 16px; padding: 0.9rem 1.1rem; }
.bubble p, .said-better p { margin: 0 0 0.5rem; }
.small-label { font: 500 0.85rem var(--sans); color: var(--muted); margin: 0 0 0.25rem !important; }
.better { font-size: 1.15rem; }
.say { display: inline-flex; align-items: center; gap: 0.35rem; font: 500 0.85rem var(--sans); color: var(--lake); background: none; border: 0; padding: 0.3rem 0; cursor: pointer; }
.say .icon { width: 1.1rem; height: 1.1rem; }
.fixes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.fix-row { display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; }
.fix-row s { color: var(--muted); text-decoration-color: var(--danger); }
.fix-note { display: block; font: 400 0.85rem/1.4 var(--sans); color: var(--muted); }
.thinking .dots, .dots { font: 600 1.4rem var(--sans); color: var(--muted); animation: pulse 1s ease-in-out infinite; }

/* ---------- player bar ---------- */

#player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; align-items: center; gap: 0.75rem;
  padding: 0.75rem var(--gutter) calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--rule);
}
.play-btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font: 600 1rem var(--sans);
  padding: 0.8rem 1.6rem; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--paper); cursor: pointer;
}
.rate-btn { font: 500 0.9rem var(--sans); background: none; border: 1px solid var(--rule); color: var(--muted); border-radius: 999px; padding: 0.6rem 0.9rem; cursor: pointer; min-width: 4rem; }

/* ---------- word popover ---------- */

#pop {
  position: fixed; z-index: 20;
  max-width: min(18rem, calc(100vw - 20px));
  background: var(--ink); color: var(--paper);
  border-radius: 12px;
  padding: 0.65rem 0.9rem 0.75rem;
  box-shadow: 0 10px 30px -12px rgba(10, 20, 30, 0.55);
  animation: pop-in 0.14s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(4px); } }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.pop-word { font: 600 1.2rem/1.2 var(--serif); }
.pop-say { background: none; border: 0; color: var(--marker); padding: 0.25rem; margin: -0.25rem -0.3rem -0.25rem 0; cursor: pointer; display: inline-grid; }
.pop-say .icon { width: 1.35rem; height: 1.35rem; }
.pop-lemma { font: italic 400 0.95rem var(--serif); opacity: 0.7; }
.pop-en { font: 500 1rem/1.35 var(--sans); margin-top: 0.2rem; }

/* ---------- forms & settings ---------- */

input[type='text'], input[type='url'], input[type='password'], textarea, select {
  font: 400 1rem var(--sans);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  width: 100%;
}
textarea { font-family: var(--serif); font-size: 1.05rem; resize: vertical; }

.login { max-width: 22rem; margin: 18vh auto 0; display: flex; flex-direction: column; gap: 0.5rem; }
.login label { font: 500 0.95rem var(--sans); color: var(--muted); margin-top: 1rem; }
.login .btn { align-self: flex-start; }
.login-sub { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.5rem; }
.form-msg { font: 400 0.92rem/1.45 var(--sans); color: var(--muted); margin: 0; min-height: 1.2em; }

.settings-title { font: 500 2.2rem/1.1 var(--serif); letter-spacing: -0.015em; margin: 0 0 0.5rem; }
.settings section { padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.settings section:first-of-type { border-top: 0; }
.settings h2 { font: 600 1.2rem var(--serif); margin: 0 0 0.75rem; }
.hint { font: 400 0.92rem/1.5 var(--sans); color: var(--muted); margin: 0.6rem 0; }
.inline { display: flex; gap: 0.6rem; align-items: center; }
.inline input[type='url'] { flex: 1; }
.add-source .form-msg { margin-top: 0.6rem; }

.source-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.source-list li { padding: 0.85rem 0; border-top: 1px solid var(--rule); }
.source-row { display: flex; align-items: center; gap: 0.85rem; }
.source-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.source-title { font-weight: 500; line-height: 1.3; }
.source-meta { font: 400 0.82rem var(--sans); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.switch { position: relative; display: inline-block; flex: none; width: 2.6rem; height: 1.5rem; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; background: var(--rule); border-radius: 999px; transition: background 0.15s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: calc(1.5rem - 6px); height: calc(1.5rem - 6px); border-radius: 50%; background: var(--surface); transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.switch input:checked + .track { background: var(--lake); }
.switch input:checked + .track::after { transform: translateX(1.1rem); }
.switch input:focus-visible + .track { outline: 2px solid var(--lake); outline-offset: 2px; }

.segmented { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg { font: 500 0.95rem var(--sans); padding: 0.55rem 0.85rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; min-width: 3.2rem; }
.seg.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.check-row { display: flex; gap: 0.85rem; align-items: flex-start; font: 400 0.95rem/1.45 var(--sans); margin-top: 1rem; cursor: pointer; }
.check-row .switch { margin-top: 0.1rem; }

.voice { display: flex; flex-direction: column; gap: 0.9rem; align-items: flex-start; }
.voice input[type='range'] { flex: 1; accent-color: var(--lake); }
.voice .inline { width: 100%; }
.voice output { font: 500 0.9rem var(--sans); color: var(--muted); min-width: 3.2rem; text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .hl { animation: none; }
  #pop { animation: none; }
  .icon-btn.spinning .icon, .btn.recording .icon, .dots { animation: none; }
}

@media (min-width: 40rem) {
  .hello { font-size: 3rem; }
  .lead .headline { font-size: 2.2rem; }
  .reader-title { font-size: 2.5rem; }
  .thumb { width: 7rem; height: 7rem; }
}

/* ---------- tag filter ---------- */

.tagbar {
  display: flex; gap: 0.45rem;
  overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)) 1.5rem;
  padding: 0.15rem var(--gutter);
  scroll-padding-inline: var(--gutter);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
}
.tagbar::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  font: 500 0.92rem/1 var(--sans);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- journal player ---------- */

#player.journal { flex-direction: column; align-items: stretch; gap: 0.6rem; padding-top: 0.85rem; }
.jp-controls { display: flex; align-items: center; justify-content: center; gap: 0.6rem; }
.jp-main {
  display: inline-flex; align-items: center; gap: 0.65rem;
  min-width: 13.5rem; justify-content: center;
  font: 600 1rem/1.15 var(--sans);
  padding: 0.75rem 1.5rem; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--paper); cursor: pointer;
}
.jp-main .icon { width: 1.3rem; height: 1.3rem; }
.jp-label { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.jp-label small { font: 400 0.8rem var(--sans); opacity: 0.75; }
.jp-skip {
  display: inline-grid; place-items: center;
  width: 2.9rem; height: 2.9rem; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer;
}
.jp-skip .icon { width: 1.2rem; height: 1.2rem; }
.jp-stop { color: var(--muted); }
.jp-now { max-width: var(--measure); margin: 0 auto; width: 100%; }
.jp-where { font: 500 0.8rem var(--sans); color: var(--muted); margin: 0; }
.jp-caption {
  font: 400 1.05rem/1.4 var(--serif); margin: 0.15rem 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
}

.story.on-air { position: relative; }
.story.on-air::before {
  content: ''; position: absolute; left: calc(-1 * var(--gutter) + 0.35rem); top: 1.35rem; bottom: 1.35rem;
  width: 4px; border-radius: 4px; background: var(--marker);
}
.story.lead.on-air::before, .story.on-air:first-child::before { top: 0; }

/* ---------- tags on sources ---------- */

.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.55rem 0 0 3.45rem; }
.tag {
  display: inline-flex; align-items: center; gap: 0.1rem;
  font: 500 0.82rem var(--sans);
  padding: 0.2rem 0.25rem 0.2rem 0.65rem;
  border-radius: 999px; background: var(--marker-soft); color: var(--ink);
}
.tag-x { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border: 0; background: none; color: var(--muted); border-radius: 50%; cursor: pointer; }
.tag-x .icon { width: 0.85rem; height: 0.85rem; }
input.tag-input {
  font: 400 0.85rem var(--sans); width: 7rem;
  padding: 0.3rem 0.6rem; border-radius: 999px;
  border: 1px dashed var(--rule); background: transparent; color: var(--ink);
}
.add-source > input[type='text'] { margin-top: 0.6rem; }
.row-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ---------- admin ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.7rem; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border-radius: 12px; padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.15rem; }
.stat-value { font: 600 1.7rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.stat-label { font: 500 0.85rem/1.3 var(--sans); }
.stat-sub { font: 400 0.78rem/1.35 var(--sans); color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 0.3rem; height: 9rem; padding-top: 1.2rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 0.25rem; min-width: 0; }
.bar { width: 100%; min-height: 2px; background: var(--lake); border-radius: 4px 4px 1px 1px; }
.bar-n { font: 500 0.7rem var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-day { font: 500 0.72rem var(--sans); color: var(--muted); text-transform: uppercase; }

.plain-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.45rem 0; border-top: 1px solid var(--rule); font: 400 0.95rem var(--sans); overflow-wrap: anywhere; }
.admin input[type='email'] { flex: 1; }
.admin .small-label { margin-top: 1rem !important; }

.people { list-style: none; margin: 0; padding: 0; }
.people li { padding: 0.7rem 0; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 0.2rem; }
.person-main { display: flex; flex-direction: column; min-width: 0; }
.person-meta { font: 400 0.82rem var(--sans); color: var(--muted); }

/* ================= FrenchBriefs additions ================= */

.btn.small { padding: 0.5rem 0.85rem; font-size: 0.88rem; }
.btn.big { padding: 0.95rem 1.6rem; font-size: 1.05rem; }
a.btn { text-decoration: none; }
.badge { display: inline-flex; align-items: center; gap: 0.25rem; font: 600 0.72rem/1 var(--sans); letter-spacing: 0.02em; padding: 0.3rem 0.55rem; border-radius: 999px; background: var(--news); color: var(--slate); white-space: nowrap; margin-left: 0.4rem; vertical-align: middle; }
.badge.plan-free { background: var(--rule); color: var(--muted); }
.hint.small, .small { font-size: 0.8rem; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.25rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip.small { padding: 0.45rem 0.75rem; font-size: 0.85rem; }
.chip.muted { text-decoration: line-through; color: var(--muted); background: transparent; border-style: dashed; }

/* masthead mark */
.hello { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; font-size: clamp(1.9rem, 8vw, 2.6rem) !important; }
.mast-mark { width: 2.1rem; height: auto; flex: none; }

/* login */
.login-logo { width: min(18rem, 80%); height: auto; margin-bottom: 0.5rem; }
.login-links, .legal-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* story card: the link and a small "less like this" button */
.story { display: block; position: relative; }
.story-link { display: grid; grid-template-columns: 1fr auto; gap: 1rem; text-decoration: none; color: inherit; padding-right: 2.2rem; }
.story.lead .story-link { grid-template-columns: 1fr; padding-right: 0; }
.story.lead .story-text { padding-right: 2.2rem; }
.story-more { position: absolute; right: -0.55rem; bottom: 1rem; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 50%; cursor: pointer; }
.story-more .icon { width: 1.2rem; height: 1.2rem; }
.story.read .headline { color: var(--muted); font-weight: 500; }
.end-note { display: block; margin-top: 0.4rem; }

/* weather */
.weather-slot:empty { display: none; }
.weather { display: grid; grid-template-columns: auto 1fr auto; gap: 0.9rem; align-items: start; background: var(--surface); border-radius: 14px; padding: 0.9rem 1rem; margin: 0 0 1.4rem; }
.wx-now { display: flex; flex-direction: column; align-items: center; min-width: 3.2rem; }
.wx-glyph { font-size: 1.7rem; line-height: 1; }
.wx-temp { font: 600 1.35rem/1.2 var(--serif); }
.wx-text p { margin: 0; }
.wx-today { font-size: 1.02rem; line-height: 1.4; }
.wx-tomorrow { font-size: 0.95rem; color: var(--muted); margin-top: 0.2rem !important; }
.wx-credit { font: 400 0.7rem var(--sans); color: var(--muted); margin-top: 0.45rem !important; }
.wx-listen { border: 0; background: none; font-size: 1.15rem; cursor: pointer; padding: 0.2rem; }
.weather-cta { display: block; font: 500 0.92rem var(--sans); color: var(--muted); text-decoration: none; padding: 0.75rem 1rem; border: 1px dashed var(--rule); border-radius: 12px; margin-bottom: 1.4rem; }

/* sheet & toast */
.sheet-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(15, 25, 30, 0.45); display: flex; align-items: flex-end; justify-content: center; animation: fade-in 0.15s ease-out; }
@keyframes fade-in { from { opacity: 0; } }
.sheet { width: 100%; max-width: 34rem; background: var(--paper); border-radius: 18px 18px 0 0; padding: 1rem var(--gutter) calc(1.4rem + env(safe-area-inset-bottom, 0px)); animation: sheet-up 0.2s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0.6; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.sheet-head h2 { font: 600 1.25rem var(--serif); margin: 0; }
.sheet-section { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.toast { position: fixed; left: 50%; bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; background: var(--ink); color: var(--paper); font: 500 0.92rem var(--sans); padding: 0.7rem 1.1rem; border-radius: 999px; max-width: calc(100vw - 2rem); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5); animation: fade-in 0.15s ease-out; }

/* reader footer */
.reader-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.reader-foot .original { margin-top: 0; }
.retell-locked .btn { margin-top: 0.3rem; }
.retell-left { margin: -0.4rem 0 0.8rem; }

/* levels */
.seg.locked { color: var(--muted); border-style: dashed; display: inline-flex; align-items: center; gap: 0.3rem; }
.seg .icon { width: 0.8rem; height: 0.8rem; }

/* onboarding */
.onboarding { padding-bottom: 3rem; }
.onboarding section { padding: 1.3rem 0; border-top: 1px solid var(--rule); }
.onboarding h2 { font: 600 1.2rem var(--serif); margin: 0 0 0.8rem; }
.onb-logo { width: 5.5rem; height: auto; margin: 1rem 0 0.4rem; }
.level-cards { display: grid; gap: 0.5rem; }
.level-card { display: grid; grid-template-columns: 3.4rem 1fr; gap: 0.6rem; align-items: center; text-align: left; font: 400 0.95rem/1.35 var(--sans); padding: 0.8rem 0.9rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; }
.level-card strong { font: 600 1.05rem var(--serif); display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; }
.level-card .badge { margin: 0; }
.level-card.on { border-color: var(--slate); box-shadow: inset 0 0 0 1px var(--slate); background: var(--paper); }
.level-card.locked { opacity: 0.55; cursor: default; }
.onb-go { padding-top: 1rem; }

/* place picker */
.place-picker { display: flex; flex-direction: column; gap: 0.7rem; }
.place-picker input[type='text'] { flex: 1; }
.place-results { list-style: none; margin: 0; padding: 0; }
.place-option { text-align: left; color: var(--ink); padding: 0.5rem 0; font-size: 0.95rem; }

/* Pro */
.features { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.75rem; }
.features li { display: flex; flex-direction: column; padding-left: 1.6rem; position: relative; }
.features li::before { content: ''; position: absolute; left: 0.2rem; top: 0.45rem; width: 0.8rem; height: 0.8rem; border-radius: 3px; background: var(--marker); }
.features strong { font: 600 1.05rem var(--serif); }
.features span { font: 400 0.92rem/1.45 var(--sans); color: var(--muted); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.plan { background: var(--surface); border-radius: 16px; padding: 1.1rem 1.2rem 1.3rem; position: relative; border: 1px solid var(--rule); }
.plan.best { border-color: var(--slate); }
.plan .badge { position: absolute; top: -0.65rem; right: 1rem; background: var(--marker); color: #22333b; margin: 0; }
.plan h2 { font: 600 1.15rem var(--serif); margin: 0 0 0.3rem; }
.price { font: 600 2rem/1.1 var(--serif); margin: 0; }
.price small { font: 400 0.9rem var(--sans); color: var(--muted); }
.plan h2 { display: flex; align-items: center; gap: 0.5rem; }
.save { font: 700 0.75rem var(--sans); color: #22333b; background: var(--news); border-radius: 999px; padding: 0.2rem 0.5rem; }
.plan .btn { margin-top: 0.4rem; }
.pro-teaser { padding: 1.5rem 0; }

/* library */
.lib-list { list-style: none; margin: 0; padding: 0; }
.lib-list li { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.lib-info { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.lib-info .source-meta { white-space: normal; }
.lib-topics { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.2rem; }
.lib-topics .tag { padding: 0.15rem 0.55rem; }
.source-list li.paused .source-title { color: var(--muted); }

/* admin catalog */
.catalog-add { display: flex; flex-direction: column; gap: 0.6rem; align-items: stretch; }
.catalog-add .btn { align-self: flex-start; }
.check-row.small { font-size: 0.85rem; margin-top: 0.3rem; }
.admin h3 { font: 600 1.05rem var(--serif); margin: 1.5rem 0 0.6rem; }
.admin select { width: auto; padding: 0.45rem 0.6rem; }
