/* Targeted A redesign: existing brand, single-column layout, restrained motion. */
:root .app, :root .splash-screen { background: var(--bg); }
:root .app::after { opacity: .12; }
:root[data-theme="dark"] .app::before, :root[data-theme="dark"] .app::after { content: none; }
:root .panel, :root .journey-panel, :root .tool-panel-card, :root .user-popover .user-panel, :root .onboarding-dialog {
  color: var(--text); background: var(--paper); border-color: var(--line);
  border-radius: var(--radius-panel); box-shadow: var(--shadow);
}
:root :is(.journey-task, .task-config-row, .reading-tools, .volume-directory, .cloud-sync-card, .data-backup) {
  color: var(--text); background: var(--paper-soft); border-color: var(--line); box-shadow: none;
}
:root :is(.stage-desc, .journey-progress-note, .task-status, .target, .scripture-card-desc, .scripture-subtitle, .reading-mode-hint, .settings-link-desc, .task-settings-note, .tool-panel-note, .calendar-note, .calendar-legend, .meditation-hint, .date, .lunar-date, .cloud-sync-desc, .data-backup-desc, .task-config-target, .task-config-unit, .task-config-type, .source-link) { color: var(--muted); }
:root :is(.journey-task-title, .settings-link-title, .scripture-card-title, .stage-title, h1, h2) { color: var(--text); }
:root :is(.primary-btn, .secondary-btn, .plain-btn, .task-action-btn, .small-action, .mini-action, .reading-mode-btn, .volume-tab, .scripture-share-button, .scripture-reader-back) {
  min-height: 44px; border-radius: var(--radius-control); font-size: var(--ui-body); font-weight: 600; line-height: 1.5;
}
:root :is(.primary-btn, .plus-btn) { color: var(--on-action); background: var(--action); border-color: var(--action); box-shadow: none; }
:root :is(.secondary-btn, .task-action-btn, .small-action, .mini-action, .scripture-share-button) { color: var(--gold-dark); background: var(--paper); border: 1px solid var(--line); box-shadow: none; }
:root :is(.plain-btn, .scripture-reader-back) { color: var(--muted); background: transparent; box-shadow: none; }
:root :is(.reading-mode-btn.active, .volume-tab.active) { color: var(--text); background: var(--gold-soft); }
:root :is(.tools-pill, .theme-toggle-btn, .user-pill) { min-width: 44px; min-height: 44px; color: var(--text-soft); background: var(--paper); border-color: var(--line); }
:root :is(.primary-btn, .secondary-btn, .plain-btn, .task-action-btn, .small-action, .mini-action, .volume-tab, .reading-mode-btn, .scripture-share-button):hover { filter: brightness(.94); }
:root[data-theme="dark"] :is(.primary-btn, .secondary-btn, .task-action-btn):hover { filter: brightness(1.1); }
:root .tab { min-height: 52px; color: var(--muted); font-size: var(--ui-caption); }
:root .tab.active { color: var(--gold-dark); }
:root .tabbar { background: var(--paper); border-color: var(--line); }
:root .top { background: transparent; }
:root .brand { padding-right: 148px; white-space: nowrap; color: var(--text-soft); }
:root .tools-pill { right: 104px; }
:root .theme-toggle-btn { right: 52px; }
:root .user-pill { right: 0; }
:root .theme-toggle-icon { display: grid; place-items: center; line-height: 1; }
:root .theme-toggle-icon svg { display: block; width: 20px; height: 20px; stroke-width: 1.8; }
:root body:not(.is-subpage) .top { min-height: 0; padding-bottom: 20px; }
:root body:not(.is-subpage) h1 { margin-top: 20px; }
:root .date-context { margin-top: 10px; }
:root .date, :root .lunar-date { font-size: var(--ui-caption); }
:root .zhai-badge { color: var(--gold-dark); background: var(--gold-soft); font-size: var(--ui-caption); }
:root .journey-panel { padding: 24px; }
:root .journey-progress { display: flex; align-items: center; gap: 20px; margin: 0 0 24px; }
.progress-ring { width: 76px; height: 76px; flex: 0 0 76px; position: relative; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.progress-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 5; }
.progress-ring .ring-track { stroke: var(--line); }
.progress-ring .ring-value { stroke: var(--gold-dark); stroke-linecap: round; }
.progress-ring strong { color: var(--text); font: 600 22px/1 var(--sans); }
.progress-ring small { color: var(--muted); font-size: 14px; font-weight: 400; }
.progress-summary { min-width: 0; }
:root .progress-summary h2 { margin: 0; font: 600 21px/1.5 var(--serif); }
:root .journey-progress-note { margin-top: 4px; font-size: var(--ui-body); }
:root .journey-task-list { gap: 12px; }
:root .journey-task { padding: 16px; border-radius: var(--radius-control); }
:root .journey-task-title { font-size: max(17px, var(--ui-body)); }
:root .task-status { font-size: var(--ui-body); }
:root .journey-task:not([data-task-type="text"]) > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; }
:root .journey-task:not([data-task-type="text"]) .journey-task-title { grid-column: 1; overflow-wrap: anywhere; }
:root .journey-task:not([data-task-type="text"]) .task-status { grid-column: 1; margin: 0; }
:root .journey-task:not([data-task-type="text"]) .task-card-actions { grid-column: 2; grid-row: 1 / span 2; margin: 0; display: flex; flex-direction: column; gap: 4px; }
:root .journey-task:not([data-task-type="text"]) .task-type { display: none; }
:root .journey-task .mini-action { padding: 8px 10px; white-space: nowrap; }
.task-done-label { color: var(--success); font-size: var(--ui-caption); text-align: center; }
:root .task-type { color: var(--muted); background: transparent; font-size: var(--ui-caption); }
.daily-quote-v4 { margin: 0 0 20px; padding: 20px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: none; }
:root .daily-quote-v4 h2 { margin: 0 0 8px; font: 600 var(--ui-body)/1.6 var(--ui-serif); }
.daily-quote-v4 p { margin: 0; color: var(--text-soft); font: 400 max(17px, var(--ui-body))/1.85 var(--ui-serif); }
:root .splash-screen { min-height: 100dvh; }
:root .splash-enter { gap: 24px; min-height: auto; align-content: center; max-width: 100%; }
:root .splash-logo { width: min(240px, 62vw); height: auto; }
.splash-tagline { display: block; color: var(--text-soft); font: 18px/1.7 var(--serif); letter-spacing: .12em; margin-bottom: 24px; }
:root .splash-hint-small { color: var(--muted); font-size: var(--ui-body); }
:root .splash-hint-large { color: var(--gold-dark); font-size: 26px; }
:root body.is-lighting .splash-enter::before, :root body.is-lighting .splash-logo { animation-duration: 500ms; }
:root .settings-group-label { color: var(--muted); font-size: var(--ui-body); }
:root .settings-link-row { min-height: 76px; }
:root .settings-link-desc, :root .task-settings-note { font-size: var(--ui-body); }
.appearance-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.appearance-panel > div { min-width: 0; }
.appearance-panel h2 { font-size: 18px; margin: 0 0 4px; }
.appearance-panel p { margin: 0; color: var(--muted); font-size: var(--ui-body); }
#largeTextButton { width: auto; max-width: 100%; padding: 10px 16px; white-space: nowrap; }
#largeTextButton[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold-dark); }
:root .scripture-text, :root .scripture-text.is-phonetic { color: var(--reading-text); font-family: var(--ui-serif); font-size: var(--reader-size); }
:root .phonetic-pinyin { color: var(--reading-pinyin); }
:root .phonetic-pinyin, :root .phonetic-verse-phrase .phonetic-pinyin { font-size: max(12px, .5em); transform: none; }
:root .phonetic-hanzi { color: var(--reading-text); font-family: var(--ui-serif); font-size: 1em; }
:root .scripture-section-title { color: var(--reading-section); }
:root .volume-directory summary { min-height: 44px; display: flex; align-items: center; font-size: var(--ui-body); }
.reader-home { display: block; width: fit-content; margin: 20px auto 0; padding: 10px 16px; min-height: 44px; color: var(--gold-dark); font-size: var(--ui-body); text-underline-offset: 4px; }
.reset-dialog { width: min(420px, calc(100% - 32px)); padding: 24px; max-height: calc(100svh - 32px); overflow-y: auto; overscroll-behavior: contain; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-panel); box-shadow: var(--shadow); }
.reset-dialog::backdrop { background: rgba(20, 18, 14, .48); }
.reset-dialog h2 { font-size: 22px; }
.reset-dialog p { color: var(--muted); font-size: var(--ui-body); }
.reset-dialog .dialog-actions { display: flex; gap: 12px; margin-top: 24px; }
.reset-dialog .dialog-actions button { flex: 1; width: auto; margin: 0; }
:root #confirmResetButton { color: var(--danger); border-color: var(--danger); }
:root[data-large-text="true"] :is(.settings-link-title, .scripture-card-title, .reading-mode-btn, .volume-tab, .task-status, .journey-task-title, .scripture-card-desc, .task-config-input, .task-config-select, .onboarding-copy, .onboarding-detail, .stage-desc, .reflection-field textarea, .dedication-field input, .dedication-field textarea) { font-size: 18px; }
:root[data-large-text="true"] .scripture-card-desc { line-height: 1.6; }
:root .external-reading-label, :root .classic-group-indicator { font-size: var(--ui-caption); color: var(--muted); }
:root .scripture-reader-actions { flex-wrap: wrap; }
:root .reading-tools { display: flex; flex-wrap: wrap; justify-content: flex-start; width: fit-content; max-width: 100%; gap: 4px; margin: 12px 0 20px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
:root .reading-mode-btn { width: auto; min-width: 64px; min-height: 44px; padding: 6px 14px; border-radius: 8px; font-size: var(--ui-body); }
:root .reading-mode-hint { margin: 0; padding: 0; font-size: var(--ui-caption); white-space: normal; }
/* Complete system serif families prevent per-character fallback from the logo's subset font. */
:root :is(h1, h2, h3, #pageTitle, #meditationTitle, .meditation-name, .stage-title, .journey-task-title, .scripture-title, .scripture-section-title, .scripture-card-title, .settings-link-title, .settings-group-label, #scriptureLibrary .classic-group-label, .calendar-title, .cloud-sync-title, .data-backup-title, .dedication-title) { font-family: var(--ui-serif); font-weight: 600; }
:root :is(button, input, select, textarea, .date, .lunar-date, .classic-group-indicator, .scripture-card-desc, .settings-link-desc, .task-status, .task-config-type, .task-config-target, .task-config-unit, .count, .meditation-time) { font-family: var(--sans); }
:root #scriptureLibrary .classic-group-label { font-family: var(--ui-serif); }
:root .splash-tagline { font-family: var(--ui-serif); }
body.show-splash .skip-link, body:has(.onboarding-overlay:not([hidden])) .skip-link { display: none; }
@media (max-width: 390px) {
  .daily-quote-v4 { padding: 16px; }
  :root .journey-panel { padding: 16px; }
  :root .journey-progress { gap: 14px; }
  .progress-ring { width: 64px; height: 64px; flex-basis: 64px; }
  .appearance-panel { grid-template-columns: minmax(0, 1fr); }
  #largeTextButton { justify-self: start; }
  :root .journey-task { padding: 12px; }
  .splash-tagline { font-size: 16px; }
}
@media (max-width: 340px) {
  :root[data-large-text="true"] .journey-task:not([data-task-type="text"]) .task-status { grid-column: 1 / -1; }
  :root[data-large-text="true"] .journey-task:not([data-task-type="text"]) .task-card-actions { grid-row: 1; }
}
