/* StepText — bolder, branded reading product.
   Type: Fraunces (display/wordmark), Inter (UI), Newsreader (reading).
   Self-hosted woff2 in /fonts. Mobile-first; theme: light default, dark via
   system preference OR explicit [data-theme] override. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/fraunces-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/fraunces-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/newsreader-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/newsreader-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/newsreader-latin-400-italic.woff2") format("woff2");
}

:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  --font-read: "Newsreader", Georgia, "Times New Roman", serif;

  --bg: #f5f1e8;
  --bg-elev: #fbf8f1;
  --panel: #fffefb;
  --ink: #1b1916;
  --muted: #6f6a61;
  --line: #e7e1d4;
  --accent: #0d9488;
  --accent-ink: #ffffff;
  --accent-strong: #0a6a60;
  --accent-soft: #d3efe9;
  --practice: #b4541f;
  --practice-soft: #f6e3d4;
  --known: #2f7d46;
  --known-soft: #dcefe0;

  --shadow-card: 0 1px 2px rgba(40, 34, 26, 0.05), 0 12px 34px rgba(40, 34, 26, 0.07);
  --shadow-sheet: 0 -10px 44px rgba(40, 34, 26, 0.2);
  --radius: 16px;
  --radius-sm: 11px;
  --tap: 48px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #100f0d;
  --bg-elev: #1a1815;
  --panel: #1c1a16;
  --ink: #ece6db;
  --muted: #a39c8f;
  --line: #36332c;
  --accent: #2dd4bf;
  --accent-ink: #04302b;
  --accent-strong: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.15);
  --practice: #e7a877;
  --practice-soft: rgba(231, 168, 119, 0.16);
  --known: #86cf95;
  --known-soft: rgba(134, 207, 149, 0.16);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 34px rgba(0, 0, 0, 0.4);
  --shadow-sheet: 0 -10px 44px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100f0d;
    --bg-elev: #1a1815;
    --panel: #1c1a16;
    --ink: #ece6db;
    --muted: #a39c8f;
    --line: #36332c;
    --accent: #2dd4bf;
    --accent-ink: #04302b;
    --accent-strong: #5eead4;
    --accent-soft: rgba(45, 212, 191, 0.15);
    --practice: #e7a877;
    --practice-soft: rgba(231, 168, 119, 0.16);
    --known: #86cf95;
    --known-soft: rgba(134, 207, 149, 0.16);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 34px rgba(0, 0, 0, 0.4);
    --shadow-sheet: 0 -10px 44px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --- reading progress bar (fixed, fills with scroll) ---------------------- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 40;
  transition: width 0.1s linear;
}

/* --- shell + header -------------------------------------------------------- */

.app-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: inline-flex;
  width: 30px;
  height: 30px;
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.32rem;
  letter-spacing: -0.005em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.icon-button:active {
  background: var(--accent-soft);
}

.icon-button.is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.install-button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.install-button[hidden] {
  display: none;
}

.ios-hint {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 0.88rem;
}

.ios-hint[hidden] {
  display: none;
}

/* --- layout ---------------------------------------------------------------- */

.reader-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.reader-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

/* --- merged top row: day stepper · context pill · blend ------------------- */

.day-stepper {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
}

.step-btn {
  min-width: 30px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.step-btn:disabled {
  color: var(--muted);
  opacity: 0.4;
  cursor: default;
}

.day-current {
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
}

.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex-shrink: 1;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.context-pill:active {
  background: var(--accent-soft);
}

.context-pill #context-direction {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-caret {
  color: var(--muted);
  flex-shrink: 0;
}

/* --- lesson head + reading surface ---------------------------------------- */

.lesson-head {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.topic,
.sheet-label,
.rail-title {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 6vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.lesson-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.lesson-text {
  margin: 0;
  padding: 4px 2px 6px;
  max-width: 40rem;
  font-family: var(--font-read);
  font-size: clamp(1.2rem, 4.4vw, 1.5rem);
  line-height: 1.78;
  hyphens: auto;
}

.learn-span {
  display: inline;
  border: 0;
  border-radius: 5px;
  padding: 0.04em 0.2em;
  margin: 0 -0.02em;
  font-family: inherit;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: inset 0 -0.16em 0 color-mix(in srgb, var(--accent) 34%, transparent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.12s ease, transform 0.06s ease;
  /* So a highlighted whole sentence wraps cleanly across lines. */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.learn-span:active {
  background: color-mix(in srgb, var(--accent) 22%, var(--accent-soft));
}

.learn-span.is-known {
  color: var(--known);
  background: var(--known-soft);
  box-shadow: inset 0 -0.16em 0 color-mix(in srgb, var(--known) 40%, transparent);
}

.learn-span.needs-practice {
  color: var(--practice);
  background: var(--practice-soft);
  box-shadow: inset 0 -0.16em 0 color-mix(in srgb, var(--practice) 45%, transparent);
}

/* --- recap ----------------------------------------------------------------- */

.recap {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.recap[hidden] {
  display: none;
}

.recap h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.recap-word {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.recap-word:active {
  background: var(--accent-soft);
}

.recap-target {
  font-family: var(--font-read);
  font-weight: 600;
  color: var(--accent-strong);
}

.recap-word.is-known .recap-target {
  color: var(--known);
}

.recap-word.needs-practice .recap-target {
  color: var(--practice);
}

.recap-meaning {
  color: var(--muted);
  font-size: 0.92rem;
}

.recap-footer {
  margin-top: 14px;
}

.recap-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* --- progress rail --------------------------------------------------------- */

.progress-rail {
  display: block;
}

.rail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

.rail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 14px;
}

.rail-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
}

.rail-stats strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rail-stats span {
  color: var(--muted);
  font-size: 0.78rem;
}

.rail-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.btn-primary,
.review-cta,
.recap-footer .btn-primary,
.review-show,
.review-judge .btn-primary,
.review-done .btn-primary,
#account-form .btn-primary {
  min-height: var(--tap);
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
}

.review-cta {
  width: 100%;
}

.review-cta:disabled {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  cursor: default;
}

.btn-primary:active,
.review-cta:not(:disabled):active,
.recap-footer .btn-primary:active,
.review-show:active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

/* --- controls (inside settings sheet) ------------------------------------- */

.control {
  display: block;
  margin-bottom: 12px;
}

.control span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

select {
  width: 100%;
  min-height: var(--tap);
  font-size: 1rem;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--bg-elev);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-strong);
  white-space: nowrap;
}

.chip-soft {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* --- scrim + bottom sheets ------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: rgba(20, 18, 15, 0.44);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.scrim.show {
  opacity: 1;
}

.scrim[hidden] {
  display: none;
}

.action-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  margin: 0 auto;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 18px calc(18px + env(safe-area-inset-bottom));
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-sheet);
  transform: translateY(110%);
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.action-sheet.open {
  transform: translateY(0);
}

.action-sheet.dragging {
  transition: none;
}

.action-sheet[hidden] {
  display: none;
}

.sheet-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  margin-bottom: 2px;
  cursor: grab;
  touch-action: none;
}

.sheet-handle::before {
  content: "";
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.sheet-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.15;
}

.span-details {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.span-details div {
  display: grid;
  gap: 3px;
}

.span-details dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.span-details dd {
  margin: 0;
  font-size: 1.02rem;
}

/* Target-language terms inside a note (base-language text around them). */
.note-term {
  font-style: italic;
  font-weight: 600;
  color: var(--accent-strong);
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sheet-actions button {
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
}

.sheet-actions button:active {
  background: var(--accent-soft);
}

.sheet-actions .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* --- readings sheet: level segmented control ------------------------------ */

.level-seg {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
}

.level-seg button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.level-seg button.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

/* --- blend control --------------------------------------------------------- */

/* Top row: context pill + day stepper, with the compact blend pushed right.
   Stays on one line; the context pill shrinks (ellipsis) as the last resort so
   the row never overflows the viewport. Sizes are trimmed on phones below. */
.reader-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 16px;
}

.blend {
  margin-left: auto;
  flex-shrink: 0;
}

.blend-seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
}

.blend-seg button {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.blend-seg button.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}


/* --- review mode ----------------------------------------------------------- */

body.review-open {
  overflow: hidden;
}

.review {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.review[hidden] {
  display: none;
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-progress {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.review-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.review-stage[hidden] {
  display: none;
}

.review-card {
  text-align: center;
}

.review-card .sheet-label {
  display: block;
  text-align: center;
}

.review-target {
  margin: 6px 0 16px;
  font-family: var(--font-read);
  font-size: clamp(2.2rem, 10vw, 3.2rem);
  line-height: 1.12;
}

.review-listen {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.review-listen:active {
  background: var(--accent-soft);
}

.review-reveal {
  max-width: 420px;
  margin: 22px auto 0;
  text-align: left;
}

.review-reveal[hidden] {
  display: none;
}

.review-actions {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.review-judge {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.review-judge button {
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.review-judge .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.review-judge button:active {
  background: var(--accent-soft);
}

.review:not(.revealed) .review-judge {
  display: none;
}

.review.revealed .review-show {
  display: none;
}

.review-done {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.review-done[hidden] {
  display: none;
}

.review-done h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

.review-done .btn-primary {
  padding: 0 28px;
}

/* --- account modal -------------------------------------------------------- */

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 20;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 28px));
  max-height: 86vh;
  overflow-y: auto;
  padding: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sheet);
}

.modal[hidden] {
  display: none;
}

.account-blurb {
  margin: 12px 0 14px;
  color: var(--muted);
}

#account-form {
  display: grid;
  gap: 10px;
}

#account-email {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
}

.account-status {
  margin: 12px 0 0;
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.account-status[hidden] {
  display: none;
}

.account-signout {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.account-signout:active {
  background: var(--accent-soft);
}

#account-signedin[hidden],
#account-signedout[hidden] {
  display: none;
}

.reminder-prefs {
  display: grid;
  gap: 8px;
  margin: 4px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reminder-row input[type="time"] {
  min-height: 40px;
  padding: 0 10px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--ink);
}

.reminder-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.reminder-status {
  margin: 2px 0 0;
  color: var(--accent-strong);
  font-size: 0.86rem;
}

.reminder-status[hidden] {
  display: none;
}

/* --- responsive ------------------------------------------------------------ */

/* Phones: compact the top row so pair pill + day stepper + blend share one
   line. The pair pill shrinks (ellipsis) before anything overflows. */
@media (max-width: 560px) {
  .reader-top {
    gap: 6px;
  }

  .context-pill {
    padding: 0 8px;
    font-size: 0.8rem;
  }

  .step-btn {
    min-width: 26px;
    font-size: 1rem;
  }

  .day-current {
    padding: 0 2px;
    font-size: 0.8rem;
  }

  .blend-seg button {
    padding: 0 7px;
    font-size: 0.75rem;
  }
}

@media (min-width: 860px) {
  .app-shell {
    padding-top: 24px;
  }

  .reader-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 18px;
  }

  .reader-panel {
    padding: 28px 32px;
  }

  .progress-rail {
    position: sticky;
    top: 18px;
  }

  .action-sheet {
    bottom: 22px;
    width: min(520px, calc(100% - 28px));
    border: 1px solid var(--line);
    border-radius: 18px;
  }

  .sheet-actions {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scrim,
  .action-sheet,
  .learn-span,
  .reading-progress {
    transition: none;
  }
}
