/* =====================================================================
   TTL · "Minimal" theme (mobile-first). Loaded on every page; does nothing
   unless the Worker renders <html data-theme="minimal">.
   Same HTML as e-ink: this file only overrides the token names from
   tokens.css (--c-*, --fs-*, --sp-*, --radius-*) plus a few layout rules.
   Light/dark: data-mode="light|dark" from theme.js, else the OS setting.
   Breakpoints: < 840px bottom tab bar · 840–1199px 72px rail · ≥ 1200px sidebar.
   ===================================================================== */

/* ---- 1. Tokens --------------------------------------------------------- */
:root[data-theme="minimal"] {
  color-scheme: light;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Tamil", "Tamil Sangam MN", "Nirmala UI", Latha, sans-serif;
  --font-serif: "Literata", Georgia, "Noto Serif Tamil", "Tamil Sangam MN", "Nirmala UI", Latha, serif; /* reader body only */

  --fs-2xs: .75rem; --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem;
  --fs-xl: 1.25rem; --fs-2xl: 1.5rem; --fs-3xl: 1.875rem; --fs-4xl: 2.25rem; --fs-read: 1.125rem;
  --lh-tight: 1.25; --lh-ui: 1.5; --lh-read: 1.65;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600;
  --tracking-label: .02em;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px; --sp-10: 64px;
  --radius-xs: 6px; --radius-sm: 10px; --radius-md: 14px; --radius-round: 999px;

  --tap: 48px;
  --topbar-h: 56px; --tabbar-h: 56px; --rail-w: 72px; --sidebar-w: 240px;
  --content-max: 1200px;
  --dur: 180ms;

  --c-paper: #FFFFFF; --c-surface: #F6F7F9; --c-sunken: #EEF0F3;
  --c-ink: #111827; --c-ink-muted: #5B6472;
  --c-border: #E3E6EB; --c-border-strong: #C9CED6;
  --c-accent: #2563EB; --c-accent-hover: #1D4ED8; --c-accent-soft: #E8F0FE; --c-on-accent: #FFFFFF;
  --c-focus: #2563EB; --c-danger: #C2261D; --c-success: #15803D; --c-scrim: rgb(17 24 39 / .45);
  --shadow-1: 0 1px 2px rgb(17 24 39 / .06), 0 1px 3px rgb(17 24 39 / .08);
}
:root[data-theme="minimal"][data-mode="dark"] {
  color-scheme: dark;
  --c-paper: #0F1115; --c-surface: #171A21; --c-sunken: #1E222B;
  --c-ink: #E7E9EE; --c-ink-muted: #9AA3B2;
  --c-border: #272C36; --c-border-strong: #3A414E;
  --c-accent: #7AA7FF; --c-accent-hover: #9BBCFF; --c-accent-soft: #1B2740; --c-on-accent: #0F1115;
  --c-focus: #9BBCFF; --c-danger: #FF7A70; --c-success: #4ADE80; --c-scrim: rgb(0 0 0 / .6);
  --shadow-1: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="minimal"]:not([data-mode="light"]) {
    color-scheme: dark;
    --c-paper: #0F1115; --c-surface: #171A21; --c-sunken: #1E222B;
    --c-ink: #E7E9EE; --c-ink-muted: #9AA3B2;
    --c-border: #272C36; --c-border-strong: #3A414E;
    --c-accent: #7AA7FF; --c-accent-hover: #9BBCFF; --c-accent-soft: #1B2740; --c-on-accent: #0F1115;
    --c-focus: #9BBCFF; --c-danger: #FF7A70; --c-success: #4ADE80; --c-scrim: rgb(0 0 0 / .6);
    --shadow-1: none;
  }
}

/* ---- 2. Base ----------------------------------------------------------- */
[data-theme="minimal"] body { -webkit-tap-highlight-color: transparent; }
/* UI is sans everywhere; book covers and the reader text keep their serif. */
[data-theme="minimal"] :is(h1, h2, h3, .serif, .logo, .book .title, .pubcard .meta .title, .maglist .li b,
  .price, .step-n, .rtop .rtitle b, .plan h2, .topic-title, .article-title, .ext .hd .grow, .empty .glyph) {
  font-family: var(--font-sans);
  letter-spacing: -.01em;
}
[data-theme="minimal"] h1 { font-size: var(--fs-2xl); }
[data-theme="minimal"] .label,
[data-theme="minimal"] .overline,
[data-theme="minimal"] .card > h2.overline { text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); }
/* Inputs at 16px so iOS does not zoom on focus. */
[data-theme="minimal"] :is(.input, select.input, textarea.input, input, select, textarea) { font-size: max(16px, 1rem); }
[data-theme="minimal"] .input,
[data-theme="minimal"] select.input { min-height: 44px; border-color: var(--c-border-strong); border-radius: var(--radius-sm); background: var(--c-paper); }
[data-theme="minimal"] .btn { min-height: 44px; border-radius: var(--radius-sm); border-color: var(--c-border-strong); font-weight: var(--fw-medium); transition: background-color var(--dur), border-color var(--dur); }
[data-theme="minimal"] .btn.small { min-height: 36px; }
[data-theme="minimal"] .btn.icon { width: 44px; }
[data-theme="minimal"] .btn:not(.primary):not(.ghost) { background: var(--c-paper); }
[data-theme="minimal"] .card { border-radius: var(--radius-md); border-color: var(--c-border); background: var(--c-paper); box-shadow: var(--shadow-1); }
[data-theme="minimal"] .menu,
[data-theme="minimal"] .modal { border-color: var(--c-border); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgb(17 24 39 / .14); }
[data-theme="minimal"][data-mode="dark"] :is(.menu, .modal) { box-shadow: none; border-color: var(--c-border-strong); }
[data-theme="minimal"] .menu a,
[data-theme="minimal"] .menu button { min-height: 44px; border-radius: var(--radius-sm); }
[data-theme="minimal"] .tag { min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--radius-round); border-color: var(--c-border); }
[data-theme="minimal"] .seg { border-radius: var(--radius-round); border-color: var(--c-border-strong); }
[data-theme="minimal"] .seg button,
[data-theme="minimal"] .seg a { min-height: 40px; padding: 0 var(--sp-4); }
[data-theme="minimal"] .bar { height: 4px; border-radius: var(--radius-round); outline: none; }
[data-theme="minimal"] .empty { border-style: solid; border-color: var(--c-border); }
[data-theme="minimal"] .toast,
[data-theme="minimal"] .status-message { border-radius: var(--radius-round); }
/* Focus rings stay visible in both themes: 2px + 2px offset. */
[data-theme="minimal"] :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: var(--focus-width) solid var(--c-focus);
  outline-offset: var(--focus-offset);
}
@media (hover: hover) {
  [data-theme="minimal"] .btn:not(.primary):not([disabled]):hover { background: var(--c-surface); border-color: var(--c-border-strong); }
  [data-theme="minimal"] .book:hover .cover { outline: none; box-shadow: 0 0 0 2px var(--c-accent); }
}
@media (hover: none) {
  [data-theme="minimal"] .book:hover .cover { outline: none; }
}
@media (prefers-reduced-motion: reduce) {
  :root[data-theme="minimal"] { --dur: 0ms; }
}

/* ---- 3. App frame: mobile first (< 840px) ------------------------------ */
[data-theme="minimal"] .app {
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
}
[data-theme="minimal"] .app > .side { display: none; }
[data-theme="minimal"] .nav-toggle,
[data-theme="minimal"] .scrim { display: none !important; }
[data-theme="minimal"] .app > .top,
[data-theme="minimal"] .app > .main { grid-column: 1; }
[data-theme="minimal"] .top {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: var(--topbar-h);
  padding: env(safe-area-inset-top, 0px) max(var(--sp-4), env(safe-area-inset-right, 0px)) 0 max(var(--sp-4), env(safe-area-inset-left, 0px));
  gap: var(--sp-2);
  background: var(--c-paper);
  border-bottom: var(--line) solid var(--c-border);
}
[data-theme="minimal"] .top .searchbox { max-width: 640px; }
[data-theme="minimal"] .top .searchbox .input { border-radius: var(--radius-round); min-height: 44px; background: var(--c-surface); border-color: transparent; }
[data-theme="minimal"] .top .searchbox .input:focus { border-color: var(--c-accent); background: var(--c-paper); }
[data-theme="minimal"] .top .kbd,
[data-theme="minimal"] .top .add-label,
[data-theme="minimal"] .top .theme-label { display: none; }
[data-theme="minimal"] .top [data-theme-toggle] { width: 44px; min-height: 44px; padding: 0; border-color: transparent; background: transparent; }
[data-theme="minimal"] .top [data-theme-toggle] .theme-icon.moon { display: block; }
[data-theme="minimal"] .top [data-theme-toggle][aria-pressed="true"] .theme-icon.moon { display: none; }
[data-theme="minimal"] .top [data-theme-toggle][aria-pressed="true"] .theme-icon.sun { display: block; }
[data-theme="minimal"] .top .btn.primary.add-btn { width: 44px; padding: 0; border-radius: var(--radius-round); }
[data-theme="minimal"] .av { width: 36px; height: 36px; }
[data-theme="minimal"] .top .dd > summary { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
[data-theme="minimal"] .app > .main {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-4) max(var(--sp-4), env(safe-area-inset-right, 0px)) calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + var(--sp-6)) max(var(--sp-4), env(safe-area-inset-left, 0px));
  gap: var(--sp-4);
}
[data-theme="minimal"] .status-message,
[data-theme="minimal"] .toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + var(--sp-3)); }

/* Bottom tab bar: Library · News · Articles · Settings. */
[data-theme="minimal"] .tabbar {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--c-paper);
  border-top: var(--line) solid var(--c-border);
}
[data-theme="minimal"] .tabbar .tab-eink,
[data-theme="minimal"] .tabbar .tl-eink { display: none; }
[data-theme="minimal"] .tabbar .tab-min { display: flex; }
[data-theme="minimal"] .tabbar .tl-min { display: inline; }
[data-theme="minimal"] .tabbar .tab-library { order: 1; }
[data-theme="minimal"] .tabbar .tab-news { order: 2; }
[data-theme="minimal"] .tabbar .tab-mags { order: 3; }
[data-theme="minimal"] .tabbar .tab-settings { order: 4; }
[data-theme="minimal"] .tabbar > a {
  min-height: var(--tabbar-h);
  gap: 2px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--c-ink-muted);
  letter-spacing: 0;
}
[data-theme="minimal"] .tabbar > a .i {
  width: 24px;
  height: 24px;
  padding: 0;
  box-sizing: content-box;
  border-radius: var(--radius-round);
  transition: background-color var(--dur);
}
[data-theme="minimal"] .tabbar > a[aria-current="page"] { color: var(--c-accent); font-weight: var(--fw-semibold); }
/* Active pill behind the icon. */
[data-theme="minimal"] .tabbar > a[aria-current="page"] .i { background: var(--c-accent-soft); padding: 3px 18px; margin: -3px 0; }
/* Hide the tab bar while typing (keyboard open). */
[data-theme="minimal"] body:has(.top input:focus) .tabbar,
[data-theme="minimal"] body:has(.main :is(input, textarea):focus) .tabbar { display: none; }

/* Page heads and library ---------------------------------------------- */
[data-theme="minimal"] .pagehead { gap: var(--sp-2); }
[data-theme="minimal"] .pagehead h1 { flex-basis: 100%; }
[data-theme="minimal"] .books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-3); }
[data-theme="minimal"] .book .title { font-size: var(--fs-md); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
[data-theme="minimal"] .book .by { font-size: var(--fs-sm); }
[data-theme="minimal"] .book .cover { border-radius: var(--radius-xs); box-shadow: var(--shadow-1); }

/* List view on phones: a single-column row list (cover · title · author ·
   progress), not a wide table. Same table HTML, restyled. */
@media (max-width: 839px) {
  [data-theme="minimal"] #list-wrap { overflow: visible; }
  [data-theme="minimal"] .library-table,
  [data-theme="minimal"] .library-table tbody { display: block; width: 100%; border: 0; }
  [data-theme="minimal"] .library-table thead { display: none; }
  [data-theme="minimal"] .library-table tr {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas: "cover title title" "cover author author" "cover progress actions";
    align-items: center;
    column-gap: var(--sp-3);
    row-gap: 2px;
    padding: var(--sp-3) 0;
    border-bottom: var(--line) solid var(--c-border);
    min-height: 88px;
  }
  [data-theme="minimal"] .library-table td { display: block; padding: 0; border: 0; min-width: 0; }
  [data-theme="minimal"] .library-table td:nth-child(1),
  [data-theme="minimal"] .library-table td:nth-child(4),
  [data-theme="minimal"] .library-table td:nth-child(5),
  [data-theme="minimal"] .library-table td:nth-child(7) { display: none; }
  /* Cover and title become grid items of the row; the link still wraps both. */
  [data-theme="minimal"] .library-table td:nth-child(2),
  [data-theme="minimal"] .library-table .title-cell { display: contents; }
  [data-theme="minimal"] .library-table .title-cell .cover.mini { grid-area: cover; width: 48px; height: 72px; padding: 4px; border-radius: var(--radius-xs); align-self: start; }
  [data-theme="minimal"] .library-table .title-cell b { grid-area: title; font-weight: var(--fw-semibold); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  [data-theme="minimal"] .library-table td:nth-child(3) { grid-area: author; font-size: var(--fs-sm); color: var(--c-ink-muted); }
  [data-theme="minimal"] .library-table td:nth-child(6) { grid-area: progress; width: auto !important; }
  [data-theme="minimal"] .library-table td:nth-child(8) { grid-area: actions; justify-content: flex-end; }
}

/* ---- 4. Tablet portrait (600–839px): 3-column grid -------------------- */
@media (min-width: 600px) {
  [data-theme="minimal"] .books { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- 5. ≥ 840px: left rail, desktop content --------------------------- */
@media (min-width: 840px) {
  [data-theme="minimal"] .app {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  }
  [data-theme="minimal"] .app > .side {
    display: flex;
    position: sticky;
    top: 0;
    grid-row: 1 / span 2;
    height: 100vh;
    height: 100dvh;
    width: var(--rail-w);
    padding: var(--sp-3) var(--sp-1);
    background: var(--c-paper);
    border-right: var(--line) solid var(--c-border);
    overflow-y: auto;
    align-items: stretch;
  }
  [data-theme="minimal"] .app > .top,
  [data-theme="minimal"] .app > .main { grid-column: 2; }
  [data-theme="minimal"] .app > .main { padding: var(--sp-6) var(--sp-7) var(--sp-8); }
  [data-theme="minimal"] .side .logo { font-size: 0; justify-content: center; margin: 0 0 var(--sp-4); }
  [data-theme="minimal"] .side .logo br { display: none; }
  [data-theme="minimal"] .side .card,
  [data-theme="minimal"] .side .spacer + .card,
  [data-theme="minimal"] .side #storage-card { display: none; }
  [data-theme="minimal"] .side .nav { gap: var(--sp-1); }
  [data-theme="minimal"] .side .nav a {
    flex-direction: column;
    gap: 4px;
    padding: var(--sp-2) 2px;
    min-height: 56px;
    justify-content: center;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    font-weight: var(--fw-medium);
    color: var(--c-ink-muted);
    border-radius: var(--radius-sm);
  }
  [data-theme="minimal"] .side .nav a .i { width: 24px; height: 24px; padding: 2px 14px; box-sizing: content-box; border-radius: var(--radius-round); }
  [data-theme="minimal"] .side .nav a[aria-current="page"] { background: transparent; color: var(--c-accent); font-weight: var(--fw-semibold); }
  [data-theme="minimal"] .side .nav a[aria-current="page"]::before { display: none; }
  [data-theme="minimal"] .side .nav a[aria-current="page"] .i { background: var(--c-accent-soft); color: var(--c-accent); }
  [data-theme="minimal"] .tabbar { display: none; }
  [data-theme="minimal"] .status-message,
  [data-theme="minimal"] .toast { bottom: var(--sp-6); }
  [data-theme="minimal"] .books { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  [data-theme="minimal"] .pagehead h1 { flex-basis: auto; }
}
@media (min-width: 840px) and (hover: hover) {
  [data-theme="minimal"] .side .nav a:hover { background: var(--c-surface); color: var(--c-ink); }
}

/* ---- 6. ≥ 1200px: full sidebar with text labels ----------------------- */
@media (min-width: 1200px) {
  [data-theme="minimal"] .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  [data-theme="minimal"] .app > .side { width: var(--sidebar-w); padding: var(--sp-4) var(--sp-3); }
  [data-theme="minimal"] .side .logo { font-size: 16px; justify-content: flex-start; margin: 2px var(--sp-2) var(--sp-5); }
  [data-theme="minimal"] .side .nav a {
    flex-direction: row;
    gap: var(--sp-3);
    min-height: 44px;
    padding: 0 var(--sp-3);
    justify-content: flex-start;
    text-align: left;
    font-size: var(--fs-md);
  }
  [data-theme="minimal"] .side .nav a .i { padding: 0; width: 22px; height: 22px; background: transparent !important; }
  [data-theme="minimal"] .side .nav a[aria-current="page"] { background: var(--c-accent-soft); }
  [data-theme="minimal"] .side #storage-card,
  [data-theme="minimal"] .side .spacer + .card { display: block; }
}

/* ---- 7. Public pages (login, signup, pricing) -------------------------- */
[data-theme="minimal"] .pub-top {
  padding: max(var(--sp-3), env(safe-area-inset-top, 0px)) max(var(--sp-4), env(safe-area-inset-right, 0px)) var(--sp-3) max(var(--sp-4), env(safe-area-inset-left, 0px));
  background: var(--c-paper);
  gap: var(--sp-4);
}
[data-theme="minimal"] .auth-main { min-height: calc(100dvh - 72px); }
[data-theme="minimal"] .authbox { padding: var(--sp-6); }

/* ---- 8. Reader chrome (layout, gestures and gutters unchanged) -------- */
[data-theme="minimal"] .reader-app .rtop,
[data-theme="minimal"] .reader-app .rbottom {
  background: var(--c-surface);
  border-color: var(--c-border);
  transition: opacity var(--dur);
}
[data-theme="minimal"] .reader-app .rtop { gap: var(--sp-1); }
[data-theme="minimal"] .reader-app .rtop .rtitle b { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
[data-theme="minimal"] .reader-app .ricon { min-height: 44px; min-width: 44px; justify-content: center; border-radius: var(--radius-sm); }
[data-theme="minimal"] .reader-app .rbottom { gap: var(--sp-2); padding-top: var(--sp-2); }
[data-theme="minimal"] .reader-app .rbottom .row { font-size: var(--fs-xs); }
[data-theme="minimal"] .reader-app .font-panel { border-radius: var(--radius-md) var(--radius-md) 0 0; }
@media (min-width: 600px) {
  [data-theme="minimal"] .reader-app .font-panel { border-radius: var(--radius-md); }
}
[data-theme="minimal"] .reader-app .font-panel .seg { border-radius: var(--radius-sm); }
[data-theme="minimal"] .reader-app .toc-panel { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
/* Paged view on touch screens: centre third toggles the chrome (iOS WebKit
   does not deliver taps inside the book iframe, so this sits in the parent
   hitbox next to the existing 30% edge zones). Desktop keeps chrome visible. */
@media (hover: none) and (pointer: coarse) {
  [data-theme="minimal"] .paged-turn-menu { display: block; width: 40%; }
}

/* ---- 9. Phone declutter (PR-A), Minimal below 840px only ---------------- */
[data-theme="minimal"] .tl-eink { display: none; }
[data-theme="minimal"] .tl-min { display: inline; }
@media (max-width: 839px) {
  /* Guard: nothing may push the page wider than the screen. */
  [data-theme="minimal"] .main { overflow-x: clip; }

  /* App bar: search · +. Mode and account live in Settings. */
  [data-theme="minimal"] .top [data-theme-toggle],
  [data-theme="minimal"] .top .dd:has(> summary.av) { display: none; }
  [data-theme="minimal"] .menu .min-only:not([hidden]) { display: flex !important; }
  [data-theme="minimal"] .appearance-extra.min-only { display: flex !important; }

  /* Library page head: keep sort, layout and upload on the page (filters are gone). */
  [data-theme="minimal"] #view-library > .pagehead { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-3); }
  [data-theme="minimal"] #view-library > .pagehead h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  [data-theme="minimal"] #view-library > .pagehead .selectwrap { width: auto !important; flex: 1; min-width: 10rem; }
  [data-theme="minimal"] .folder-section > summary { min-height: 48px; }
  [data-theme="minimal"] .folder-section-actions .btn { min-height: 44px; }

  /* Book rows: tap opens the book; everything else is behind ⋮. */
  [data-theme="minimal"] .library-table tr { grid-template-columns: 48px minmax(0, 1fr) 44px; grid-template-areas: "cover title more" "cover author more" "cover progress more"; cursor: pointer; }
  [data-theme="minimal"] .library-table td:nth-child(8) { display: none; }
  [data-theme="minimal"] .library-table td.row-more { display: flex; grid-area: more; align-items: center; justify-content: center; }
  [data-theme="minimal"] .library-table .row-more .btn.icon { width: 44px; min-height: 44px; border-color: transparent; background: transparent; }
  [data-theme="minimal"] .library-table .row-more .i { width: 20px; height: 20px; }

  /* Sheets slide up from the bottom. */
  [data-theme="minimal"] .sheet-overlay { align-items: flex-end; }
  [data-theme="minimal"] .sheet-overlay .modal.sheet { width: 100%; max-height: 85dvh; overflow-y: auto; border-radius: var(--radius-md) var(--radius-md) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  [data-theme="minimal"] .sheet .mh h2 { font-size: var(--fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  [data-theme="minimal"] .sheet .mh .btn.icon { width: 44px; min-height: 44px; }
  [data-theme="minimal"] .sheet .mf .btn { min-height: 44px; flex: 1; }
  [data-theme="minimal"] .sheet-slot .selectwrap,
  [data-theme="minimal"] .sheet-slot select { width: 100% !important; min-height: 44px; }
  [data-theme="minimal"] .sheet-slot .seg { display: flex; width: 100%; }
  [data-theme="minimal"] .sheet-slot .seg > * { flex: 1; min-height: 44px; }
  [data-theme="minimal"] .sheet-slot fieldset { border: 0; margin: 0; padding: 0; }
  [data-theme="minimal"] .sheet-slot label { min-height: 44px; }
  [data-theme="minimal"] .sheet-list { gap: 0; padding: var(--sp-2) 0; }
  [data-theme="minimal"] .sheet-item { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: 0 var(--sp-5); width: 100%; border: 0; background: none; color: var(--c-ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
  [data-theme="minimal"] .sheet-item.danger { color: var(--c-danger, #b42318); }
  [data-theme="minimal"] .sheet-item .i { width: 20px; height: 20px; color: var(--c-ink-muted); }

  /* News editions: stacked rows instead of a 4-column table. */
  [data-theme="minimal"] table.t.stack,
  [data-theme="minimal"] table.t.stack tbody { display: block; width: 100%; }
  [data-theme="minimal"] table.t.stack thead { display: none; }
  [data-theme="minimal"] table.t.stack tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--sp-2); row-gap: 2px; padding: var(--sp-3) 0; border-bottom: var(--line) solid var(--c-border); }
  [data-theme="minimal"] table.t.stack td { display: block; padding: 0; border: 0; min-width: 0; }
  [data-theme="minimal"] table.t.stack td.primary { flex: 1 0 100%; font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
  [data-theme="minimal"] table.t.stack td.meta { font-size: var(--fs-xs); color: var(--c-ink-muted); }
  [data-theme="minimal"] table.t.stack td.meta.size::before { content: "· "; }
  [data-theme="minimal"] table.t.stack td.act { margin-left: auto; display: flex; gap: var(--sp-2); }
  [data-theme="minimal"] table.t.stack td.act .btn { min-height: 44px; }

  /* Reader top bar: no Zen on phones; the mode button shows its icon. */
  [data-theme="minimal"] .reader-app #reader-zen-btn { display: none; }
}
@media (max-width: 800px) {
  [data-theme="minimal"] .reader-app .rtop [data-theme-toggle] { width: 44px; min-width: 44px; min-height: 44px; border-color: transparent; background: transparent; }
  [data-theme="minimal"] .reader-app .rtop [data-theme-toggle] .theme-icon.moon { display: block; }
  [data-theme="minimal"] .reader-app .rtop [data-theme-toggle][aria-pressed="true"] .theme-icon.moon { display: none; }
  [data-theme="minimal"] .reader-app .rtop [data-theme-toggle][aria-pressed="true"] .theme-icon.sun { display: block; }
}
@media (max-width: 839px) {
  [data-theme="minimal"] .appearance-extra.min-only { flex-direction: column; }
  [data-theme="minimal"] .appearance-extra .btn { min-height: 44px; }
}
