:root {
  --bg: #d9c28f;
  --ink: #24211d;
  --muted: #6f6048;
  --line: #b99f70;
  --soft: #ead9af;
  --brand: #315d41;
  --paper: #f7edcf;
  --focus: #efe0b4;
  --reader-font-size: 18px;
  --reader-line-height: 1.8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.22), transparent 24%),
    radial-gradient(circle at 78% 12%, rgba(104, 72, 30, 0.1), transparent 22%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(92, 59, 24, 0.12)),
    var(--bg);
  color: var(--ink);
  font-family: ui-serif, "Songti SC", "Noto Serif CJK SC", Georgia, serif;
}

body.theme-night {
  --bg: #161711;
  --ink: #f1ead7;
  --muted: #b9aa8a;
  --line: #574c35;
  --soft: #272417;
  --brand: #9ec09d;
  --paper: #211f16;
  --focus: #2b281b;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 9px;
  padding: 10px 16px 12px;
  background: rgba(247, 237, 207, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.app-header p,
.section-title {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.15;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mode-tab {
  min-height: 34px;
  color: var(--brand);
  font-weight: 700;
  white-space: nowrap;
}

.mode-tab[data-app-mode="recovery"] {
  grid-column: auto;
  justify-self: stretch;
  min-width: 0;
}

.mode-tab.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

main {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 10px 16px 98px;
}

body.unauthenticated .app-header,
body.unauthenticated main,
body.unauthenticated .bottom-nav {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
}

.mode-hidden {
  display: none !important;
}

.reader-mode .app-header,
.reader-mode .summary,
.reader-mode .bar,
.reader-mode .focus-section,
.reader-mode .plan-list,
.reader-mode .list-toolbar,
.reader-mode .recent,
.outline-page-mode .app-header,
.outline-page-mode .summary,
.outline-page-mode .bar,
.outline-page-mode .focus-section,
.outline-page-mode .plan-list,
.outline-page-mode .list-toolbar,
.outline-page-mode .recent {
  display: none;
}

.reader-mode main,
.outline-page-mode main {
  padding-top: 0;
}

.reader-mode main {
  padding-bottom: 348px;
}

.reader-mode.voice-panel-collapsed main {
  padding-bottom: 176px;
}

button,
input,
select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

button {
  padding: 0 12px;
  cursor: pointer;
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.summary-dashboard {
  grid-template-columns: minmax(122px, 0.72fr) minmax(0, 1.28fr);
  align-items: stretch;
  gap: 10px;
}

.summary-gauge-card,
.summary-metric {
  border: 1px solid rgba(185, 159, 112, 0.62);
  background:
    linear-gradient(145deg, rgba(255, 252, 240, 0.78), rgba(235, 216, 172, 0.48));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 4px 12px rgba(92, 59, 24, 0.08);
}

.summary-gauge-card {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 126px;
  padding: 8px 6px;
}

.summary-gauge-title {
  margin: 0;
  color: #5a4b34;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.summary-gauge {
  --old-progress: 0deg;
  --new-progress: 0deg;
  --old-ring: #2f80ed;
  --new-ring: #23845f;
  --ring-track: rgba(185, 159, 112, 0.28);
  position: relative;
  width: 86px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, rgba(247, 237, 207, 0.98) 58%, transparent 59%),
    conic-gradient(var(--old-ring) 0deg var(--old-progress), var(--ring-track) var(--old-progress) 360deg);
  box-shadow:
    inset 0 0 0 1px rgba(49, 93, 65, 0.1),
    0 5px 14px rgba(47, 128, 237, 0.12);
}

.summary-gauge::before {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, rgba(247, 237, 207, 0.98) 56%, transparent 57%),
    conic-gradient(var(--new-ring) 0deg var(--new-progress), rgba(185, 159, 112, 0.22) var(--new-progress) 360deg);
  content: "";
}

.summary-gauge-inner {
  position: absolute;
  inset: 23px;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 38%, rgba(255, 252, 240, 0.98), rgba(239, 224, 180, 0.86));
  text-align: center;
}

.summary-gauge-legend {
  display: flex;
  gap: 9px;
  justify-content: center;
  line-height: 1;
}

.summary-gauge-legend span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 11px;
}

.summary-gauge-legend span::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  content: "";
}

.summary-gauge-legend .old::before {
  background: #2f80ed;
}

.summary-gauge-legend .new::before {
  background: #23845f;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.summary-metric {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  min-height: 58px;
  padding: 7px 8px;
  overflow: hidden;
}

.summary-metric::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(49, 93, 65, 0.34);
  content: "";
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0;
  border: 1px solid rgba(49, 93, 65, 0.16);
  border-radius: 8px;
  background: rgba(49, 93, 65, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.summary-icon.is-done {
  border-color: rgba(47, 128, 237, 0.22);
  background: rgba(47, 128, 237, 0.13);
  color: #1d5fbf;
}

.summary-icon.is-start {
  border-color: rgba(151, 105, 39, 0.22);
  background: rgba(151, 105, 39, 0.12);
  color: #7a5420;
}

.summary-icon.is-target {
  border-color: rgba(35, 132, 95, 0.22);
  background: rgba(35, 132, 95, 0.13);
  color: #1f6d50;
}

.summary-icon.is-delta {
  border-color: rgba(138, 47, 31, 0.18);
  background: rgba(138, 47, 31, 0.1);
  color: #7f2f22;
}

.summary span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}

.summary strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary strong span {
  display: block;
  margin: 0;
  color: inherit;
  font-size: 12px;
}

.summary strong span.stat-old {
  color: #1d5fbf;
  font-weight: 850;
}

.summary strong span.stat-new {
  color: #1f6d50;
  font-weight: 850;
}

.summary-gauge-inner strong {
  overflow: visible;
  font-size: 13px;
  line-height: 1.12;
  white-space: normal;
}

.summary-gauge-inner strong span {
  font-size: 11px;
}

.summary .is-behind {
  color: #8a2f1f;
}

.summary .is-ahead {
  color: var(--brand);
}

.summary strong span.is-behind {
  color: #8a2f1f;
}

.summary strong span.is-ahead {
  color: #1f6d50;
}

.summary-action {
  min-height: 42px;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
}

.recent {
  margin-top: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(185, 159, 112, 0.55);
  border-bottom: 1px solid rgba(185, 159, 112, 0.55);
}

.recent-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.recent-panel {
  min-width: 0;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid rgba(185, 159, 112, 0.55);
  border-radius: 8px;
  background: rgba(255, 252, 241, 0.45);
}

.recent-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.recent-panel-title,
.recent-empty {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.recent-panel strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.recent-date {
  margin: 2px 0 5px;
}

.recent-panel-head .recent-date {
  margin: 0;
  font-size: 13px;
}

.recent-items {
  display: grid;
  gap: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.recent-items span {
  display: block;
  overflow-wrap: anywhere;
}

.recent-completion-groups {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.recent-testament-group {
  display: grid;
  align-items: stretch;
  min-width: 0;
}

.recent-scroll {
  display: grid;
  align-items: start;
  grid-auto-columns: minmax(112px, 88%);
  grid-auto-flow: column;
  gap: 7px;
  margin: 0 -2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 2px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.recent-scroll:has(.recent-entry-card:only-child) {
  grid-auto-columns: 100%;
}

.recent-entry-card {
  display: grid;
  align-content: start;
  gap: 2px;
  height: 86px;
  min-width: 0;
  overflow-y: auto;
  padding: 6px 7px;
  border: 1px solid rgba(185, 159, 112, 0.45);
  border-radius: 6px;
  background: rgba(255, 252, 241, 0.55);
  font-size: 12px;
  line-height: 1.35;
  scroll-snap-align: start;
}

.recent-entry-card span {
  display: block;
  overflow-wrap: anywhere;
}

.recent-entry-empty {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.recent .status-day {
  font-weight: 700;
}

.recent .status-time {
  padding-left: 1em;
  color: #332a20;
}

.bar {
  height: 4px;
  margin: 8px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

#progressBar {
  height: 100%;
  width: 0%;
  background: var(--brand);
}

#lifeProgressBar {
  height: 100%;
  width: 0%;
  background: var(--brand);
}

.focus-section {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(49, 93, 65, 0.28);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: var(--focus);
  box-shadow: 0 2px 10px rgba(74, 51, 19, 0.08);
}

.focus-section .day {
  padding: 8px 0 0;
  border-bottom: 0;
}

.arrangement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.arrangement-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(185, 159, 112, 0.65);
  background: rgba(255, 252, 241, 0.64);
}

.arrangement-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.arrangement-card strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.arrangement-status.is-behind strong {
  color: #8a2f1f;
}

.arrangement-status.is-ahead strong,
.arrangement-status.is-normal strong {
  color: var(--brand);
}

.next-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.continue-card {
  display: grid;
  width: 100%;
  gap: 3px;
  margin: 6px 0 8px;
  padding: 10px;
  border: 1px solid rgba(49, 93, 65, 0.34);
  background: rgba(255, 252, 241, 0.86);
  text-align: left;
}

.continue-card span,
.continue-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.continue-card strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.life-next-title {
  margin: 10px 0 6px;
}

.catch-up-note {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
  color: #6d3824;
  font-size: 13px;
  line-height: 1.45;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0 2px;
}

.list-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  flex: 1;
  gap: 4px;
}

.list-toolbar button,
.list-tab {
  min-height: 30px;
  padding: 0 10px;
  color: var(--brand);
}

.list-toolbar select {
  min-height: 30px;
  width: 72px;
  padding: 0 6px;
}

.list-tab.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.filters {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
}

.filters input {
  min-width: 0;
  flex: 1;
  padding: 0 10px;
}

.search-button {
  min-width: 64px;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.day {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.day-head {
  margin-bottom: 10px;
}

.day h2 {
  font-size: 21px;
}

.compact-day {
  padding: 10px 0;
}

.compact-day h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.compact-readings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.simple-day-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  position: relative;
  gap: 16px;
  padding: 12px 0;
}

.simple-day-grid::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(49, 93, 65, 0.34) 8%,
    rgba(185, 159, 112, 0.58) 50%,
    rgba(49, 93, 65, 0.34) 92%,
    transparent
  );
  content: "";
  transform: translateX(-50%);
}

.simple-day-column {
  min-width: 0;
  position: relative;
}

.simple-day-column h2 {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 18px;
}

.simple-day-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 6px;
}

.simple-day-chip {
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid rgba(185, 159, 112, 0.65);
  background: rgba(247, 237, 207, 0.46);
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  text-align: center;
}

.simple-day-chip.is-complete {
  border-color: rgba(37, 99, 235, 0.38);
  background: rgba(219, 234, 254, 0.62);
  color: #1e4f9a;
  font-weight: 700;
}

.compact-readings:has(.compact-side:only-child),
.readings:has(.testament:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.compact-side {
  display: grid;
  min-height: 0;
  padding: 8px;
  border: 1px solid rgba(185, 159, 112, 0.65);
  background: rgba(247, 237, 207, 0.46);
  text-align: left;
}

.compact-side.is-complete {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(219, 234, 254, 0.52);
}

.compact-side.is-complete span,
.compact-side.is-complete strong {
  color: #1e3f73;
}

.compact-side span {
  color: var(--muted);
  font-size: 12px;
}

.compact-side strong {
  overflow: hidden;
  margin: 2px 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.compact-side em {
  color: #9a3a25;
  font-size: 12px;
  font-style: normal;
}

.compact-side.is-complete em {
  color: #2563eb;
}

.life-card {
  display: grid;
  width: 100%;
  min-height: 0;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(185, 159, 112, 0.65);
  background: rgba(247, 237, 207, 0.46);
  text-align: left;
}

.life-card span,
.life-card small {
  color: var(--muted);
  font-size: 12px;
}

.life-card strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.life-card em {
  color: #332a20;
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
}

.compact-day.is-done .life-card {
  border-color: rgba(37, 99, 235, 0.42);
  background:
    linear-gradient(135deg, rgba(225, 238, 255, 0.88), rgba(220, 241, 232, 0.72));
  box-shadow:
    inset 4px 0 0 rgba(37, 99, 235, 0.68),
    0 4px 12px rgba(37, 99, 235, 0.08);
}

.compact-day.is-done .life-card strong {
  color: #1f3f5b;
}

.is-done .life-card small {
  color: #1b6d52;
  font-weight: 700;
}

.book-column {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.group-head h2,
.book-column h2 {
  font-size: 19px;
}

.group-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.book-list {
  display: grid;
  gap: 4px;
}

.book-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 0 4px;
}

.book-switch button {
  min-height: 34px;
}

.book-switch .is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.book-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid rgba(185, 159, 112, 0.45);
}

.book-row strong {
  font-size: 14px;
}

.book-name {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.book-name span {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.life-book-row {
  grid-template-columns: 86px 1fr;
}

.book-outline-btn {
  min-height: 24px;
  margin-top: 4px;
  padding: 0 7px;
  border-color: rgba(49, 93, 65, 0.35);
  background: transparent;
  color: var(--brand);
  font-size: 12px;
}

.outline-body {
  color: #17130f;
  line-height: 1.55;
}

.outline-body p {
  margin: 8px 0;
}

.outline-body .O1 {
  padding-left: 8px;
}

.outline-body .O2 {
  padding-left: 16px;
}

.outline-body .O3,
.outline-body .O4,
.outline-body .O5 {
  padding-left: 24px;
  color: var(--muted);
}

.outline-body .O0.is-read {
  color: #1d4ed8;
  font-weight: 800;
}

.outline-body .O1.is-read {
  color: #2563eb;
  font-weight: 700;
}

.outline-body .O2.is-read {
  color: #3b82f6;
  font-weight: 700;
}

.outline-body .O3.is-read,
.outline-body .O4.is-read,
.outline-body .O5.is-read {
  color: #0284c7;
  font-weight: 700;
}

.day-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 6px;
  align-items: start;
}

.day-chip {
  width: 100%;
  min-height: 30px;
  padding: 0 6px;
  border-color: rgba(49, 93, 65, 0.35);
  color: var(--brand);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.day-chip.is-complete {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.readings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.testament h3 {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
}

.testament-time {
  display: block;
  min-height: 0;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #332a20;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
}

.testament-time.is-clickable {
  color: var(--brand);
  cursor: pointer;
}

.reading {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px 8px;
  padding: 5px 0;
}

.book {
  font-weight: 700;
}

.passage {
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topic {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.empty {
  margin: 0;
  padding: 18px 0;
  color: var(--muted);
  text-align: center;
}

.reader {
  margin: 14px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 72px;
}

.reader[hidden] {
  display: none;
}

.reader.outline-only .verse,
.reader.outline-only .notes,
.recovery-reader.outline-only .verse,
.recovery-reader.outline-only .notes {
  display: none;
}

.reader-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.reader-day-nav {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.reader-day-nav button {
  min-height: 34px;
  padding: 0 8px;
  border-color: rgba(49, 93, 65, 0.34);
  color: var(--brand);
  font-size: 14px;
  white-space: nowrap;
}

.reader-day-nav button:disabled {
  border-color: rgba(127, 111, 80, 0.25);
  color: rgba(79, 63, 39, 0.42);
}

.reader-day-nav-bottom {
  margin: 14px 0 8px;
}

#readerTitle {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 0;
  max-width: 100%;
  text-align: center;
}

.reader-head-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.reader-head-actions button {
  min-width: 42px;
  padding: 0 9px;
}

.reader-mode .reader-head {
  padding-right: 76px;
}

.reader-mode .reader-head-actions {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: 16px;
  z-index: 70;
  padding: 4px;
  border: 1px solid rgba(185, 159, 112, 0.45);
  border-radius: 10px;
  background: rgba(247, 237, 207, 0.9);
  box-shadow: 0 6px 18px rgba(79, 55, 18, 0.16);
  backdrop-filter: blur(12px);
}

.reader-mode .reader-head-actions button {
  min-width: 44px;
  min-height: 38px;
}

.life-mode.reader-mode #lifeReader .reader-head {
  padding-right: 0;
}

.life-mode.reader-mode #lifeReader .reader-head-actions {
  position: static;
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: 8px;
}

.recovery-mode.reader-mode #recoveryReader .reader-head {
  padding-right: 0;
}

.recovery-mode.reader-mode #recoveryReader .reader-head-actions {
  position: static;
  justify-self: end;
}

.reader-head-actions .reader-mark-btn {
  min-width: 74px;
  padding: 0 10px;
}

.reader-head-actions .reader-mark-btn[hidden] {
  display: none;
}

.reading-settings {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid rgba(185, 159, 112, 0.58);
  border-radius: 8px;
  background: rgba(247, 237, 207, 0.72);
  touch-action: pan-y;
}

.reader-mode .reading-settings {
  position: fixed;
  top: calc(60px + env(safe-area-inset-top));
  right: 16px;
  z-index: 70;
  width: min(320px, calc(100vw - 32px));
  margin: 0;
  background: rgba(247, 237, 207, 0.94);
  box-shadow: 0 8px 24px rgba(79, 55, 18, 0.18);
  backdrop-filter: blur(12px);
}

.reading-settings[hidden] {
  display: none;
}

.theme-night .reading-settings {
  background: rgba(33, 31, 22, 0.82);
}

.reading-settings label {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.reading-settings input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--brand);
  touch-action: none;
}

.reading-settings input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid rgba(49, 93, 65, 0.2);
  border-radius: 999px;
  background: rgba(255, 251, 237, 0.85);
}

.reading-settings input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border: 3px solid rgba(255, 251, 237, 0.95);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(36, 33, 29, 0.22);
}

.reading-settings input[type="range"]::-moz-range-track {
  height: 8px;
  border: 1px solid rgba(49, 93, 65, 0.2);
  border-radius: 999px;
  background: rgba(255, 251, 237, 0.85);
}

.reading-settings input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 251, 237, 0.95);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(36, 33, 29, 0.22);
}

.reading-settings strong {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.reading-settings .setting-toggle {
  grid-template-columns: 42px auto;
  justify-content: start;
}

.reading-settings input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
}

.reading-settings-close {
  justify-self: end;
  min-height: 30px;
  padding: 0 14px;
  border-color: rgba(49, 93, 65, 0.38);
  background: rgba(255, 251, 237, 0.72);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.reader-head p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13px;
}

.reader-head h2 {
  font-size: 20px;
  line-height: 1.3;
}

.passage-block {
  padding: 8px 0 4px;
}

.passage-block h3 {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 16px;
}

.passage-topic {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.scripture-heading {
  margin: 14px 0 8px;
  color: var(--brand);
  line-height: 1.45;
}

.scripture-heading.chapter {
  margin-top: 18px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.scripture-heading.outline {
  font-size: 15px;
  font-weight: 700;
}

.scripture-heading.O1 {
  padding-left: 10px;
}

.scripture-heading.O2 {
  padding-left: 20px;
}

.scripture-heading.O3,
.scripture-heading.O4,
.scripture-heading.O5 {
  padding-left: 30px;
  color: var(--muted);
  font-size: 14px;
}

.verse {
  margin-bottom: 14px;
  scroll-margin-top: 10px;
}

.verse.voice-playing {
  background: transparent;
}

.verse.voice-playing > p {
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.16);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22);
}

.has-notes {
  cursor: pointer;
}

.has-notes p {
  text-decoration: none;
}

.reader-body p {
  color: var(--ink);
  font-size: var(--reader-font-size);
  margin: 0 0 12px;
  line-height: var(--reader-line-height);
}

.reader-body sup {
  color: var(--brand);
  font-weight: 700;
  margin-right: 5px;
}

.verse-ref {
  color: var(--ink);
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  vertical-align: baseline;
}

.verse-ref[data-voice-verse-key] {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.verse-voice-menu {
  position: absolute;
  z-index: 80;
  display: grid;
  gap: 4px;
  min-width: 136px;
  padding: 6px;
  border: 1px solid rgba(95, 75, 48, 0.22);
  border-radius: 8px;
  background: rgba(255, 248, 226, 0.98);
  box-shadow: 0 14px 34px rgba(50, 39, 20, 0.22);
}

.note-voice-menu {
  min-width: 158px;
}

.verse-voice-menu button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
}

.verse-voice-menu button:active,
.verse-voice-menu button:hover {
  background: rgba(21, 128, 97, 0.12);
  color: var(--brand);
}

.reader-body .note-mark {
  color: #2563eb;
  margin: 0 2px;
  font-size: 11px;
  line-height: 0;
  vertical-align: super;
}

.notes {
  margin: 6px 0 14px;
  padding: 10px 12px 8px;
  border: 1px solid rgba(37, 99, 235, 0.32);
  border-left: 4px solid rgba(37, 99, 235, 0.72);
  border-radius: 8px;
  background: rgba(236, 244, 255, 0.38);
  color: var(--ink);
  font-size: calc(var(--reader-font-size) - 2px);
  line-height: calc(var(--reader-line-height) - 0.1);
}

.notes[hidden] {
  display: none;
}

.theme-night .notes {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(147, 197, 253, 0.3);
  border-left-color: rgba(147, 197, 253, 0.72);
}

.theme-night .verse.voice-playing > p {
  background: rgba(245, 158, 11, 0.18);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.28);
}

.theme-night .verse-voice-menu {
  background: rgba(42, 38, 30, 0.98);
  border-color: rgba(255, 255, 255, 0.14);
}

.reader-body .notes-title {
  margin: 0 0 5px;
  color: #2563eb;
  font-weight: 700;
}

.notes-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.note-speaker-btn {
  display: inline-grid;
  width: 34px;
  min-height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, 0.26);
  border-radius: 50%;
  background: rgba(236, 244, 255, 0.76);
  color: #2563eb;
  font-size: 18px;
  line-height: 1;
}

.note-number-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(34px, 1fr));
  gap: 4px;
}

.note-number-grid button {
  text-align: center;
}

.notes ol {
  margin: 6px 0 0;
  padding-left: 20px;
}

.notes li {
  margin-bottom: 6px;
}

.notes li[data-voice-note-key] {
  cursor: pointer;
}

.note-sentence {
  text-decoration: none;
}

.notes-title.voice-note-playing,
.notes li.voice-note-playing {
  background: rgba(37, 99, 235, 0.12);
  border-radius: 6px;
}

.reader-bookmark-flag {
  position: absolute;
  z-index: 6;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid rgba(180, 120, 12, 0.38);
  border-radius: 50% 50% 50% 8px;
  background: #facc15;
  color: #7c4a03;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(92, 65, 8, 0.22);
  cursor: grab;
  touch-action: none;
}

.reader-bookmark-flag.is-dragging {
  cursor: grabbing;
  opacity: 0.88;
}

.reader-bookmark-flag.is-fixed {
  background: #fde68a;
  border-color: rgba(22, 101, 52, 0.42);
  color: #166534;
  cursor: pointer;
}

.reader-bookmark-menu {
  min-width: 132px;
}

.reader-note-marker {
  position: absolute;
  z-index: 20;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px;
  min-width: 48px;
  min-height: 38px;
  padding: 4px 7px;
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: 0 8px 18px rgba(30, 64, 175, 0.18);
  cursor: grab;
  touch-action: none;
}

.reader-note-marker span {
  font-size: 20px;
  line-height: 1;
}

.reader-note-marker strong {
  min-width: 18px;
  color: #1e3a8a;
  font: 700 13px/1 ui-sans-serif, system-ui, sans-serif;
}

.reader-note-marker.is-dragging {
  cursor: grabbing;
  opacity: 0.88;
}

.reader-note-marker.is-fixed {
  border-color: rgba(22, 101, 52, 0.38);
  background: #dcfce7;
  color: #166534;
  cursor: pointer;
}

.reader-note-menu {
  min-width: 168px;
}

.reader-note-list-menu {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: min(390px, calc(100vw - 24px));
  max-width: min(390px, calc(100vw - 24px));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.reader-note-add-btn,
.reader-note-list-card {
  flex: 0 0 124px;
  scroll-snap-align: start;
}

.reader-note-add-btn {
  min-height: 86px;
  justify-content: center;
  color: #166534;
  font-weight: 700;
}

.reader-note-list-card {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 8px;
  border: 1px solid rgba(95, 75, 48, 0.18);
  border-radius: 8px;
  background: rgba(255, 252, 239, 0.92);
}

.reader-note-list-go {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f2937;
  text-align: left;
}

.reader-note-list-go strong,
.reader-note-list-go small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-note-list-go small {
  color: #6b5a3a;
  font-size: 12px;
}

.reader-note-list-delete {
  min-height: 30px;
  padding: 0 10px;
  border-color: rgba(153, 27, 27, 0.28);
  color: #991b1b;
}

.reader-note-paper {
  z-index: 50;
  display: block;
  width: min(360px, calc(100vw - 24px));
  padding: 10px;
  border-color: rgba(180, 83, 9, 0.28);
  background: rgba(255, 248, 211, 0.98);
}

.reader-note-paper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.reader-note-paper-head strong {
  min-width: 0;
  overflow: hidden;
  color: #1f2937;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-note-paper-head button {
  flex: 0 0 auto;
  min-height: 34px;
}

.reader-note-audio-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid rgba(185, 159, 112, 0.36);
  border-radius: 8px;
  background: rgba(255, 252, 239, 0.82);
}

.reader-note-audio-title,
.reader-note-audio-actions,
.reader-note-tool-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reader-note-audio-title {
  justify-content: space-between;
  color: #6b4f1d;
  font-weight: 700;
}

.reader-note-audio-bars {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 22px;
}

.reader-note-audio-bars span {
  width: 5px;
  height: 7px;
  border-radius: 999px;
  background: rgba(22, 101, 52, 0.35);
}

.reader-note-paper.is-recording .reader-note-audio-bars span {
  background: #059669;
  transition: height 80ms linear, opacity 80ms linear;
}

.reader-note-audio-actions,
.reader-note-tool-row {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.reader-note-file-btn,
.reader-note-audio-actions button,
.reader-note-tool-row button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.reader-note-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(95, 75, 48, 0.22);
  border-radius: 8px;
  background: rgba(255, 248, 226, 0.92);
  color: inherit;
  cursor: pointer;
}

.reader-note-file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.reader-note-textarea {
  width: 100%;
  min-height: 132px;
  max-height: min(240px, 34vh);
  padding: 10px;
  border: 1px solid rgba(95, 75, 48, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 239, 0.96);
  color: #1f2937;
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.reader-action {
  padding-top: 8px;
}

.reader-action-top {
  display: none;
}

.voice-dock {
  position: fixed;
  right: 0;
  left: 0;
  bottom: calc(69px + env(safe-area-inset-bottom));
  z-index: 60;
  display: none;
  padding: 0;
  background: transparent;
}

.voice-dock:not([hidden]) {
  display: grid;
  justify-items: stretch;
}

.voice-dock[hidden] {
  display: none;
}

.reader-voice-controls {
  display: block;
  margin-bottom: 10px;
}

.voice-dock .reader-voice-controls {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.reader-voice-status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.reader-voice-panel {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 9px 14px 10px;
  border: 1px solid rgba(185, 159, 112, 0.42);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: rgba(255, 248, 225, 0.96);
  box-shadow: 0 -8px 28px rgba(79, 55, 18, 0.18);
  backdrop-filter: blur(16px);
  transition: transform 160ms ease;
  will-change: transform;
}

.reader-voice-panel.is-swiping {
  transition: none;
}

.voice-panel-grip {
  position: relative;
  display: block;
  width: 96px;
  min-height: 26px;
  height: 26px;
  margin: -8px auto 2px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.voice-panel-grip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 6px;
  border-radius: 999px;
  background: rgba(185, 159, 112, 0.6);
  transform: translate(-50%, -50%);
}

.voice-panel-head,
.voice-collapsed-row,
.voice-main-row,
.voice-quick-row {
  display: grid;
  align-items: center;
}

.voice-panel-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}

.voice-panel-title {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.voice-panel-head strong,
.voice-panel-title strong {
  display: block;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-settings-btn {
  min-height: 36px;
  padding: 0 10px;
  border-color: rgba(185, 159, 112, 0.38);
  border-radius: 18px;
  background: rgba(255, 251, 237, 0.88);
  font-size: 13px;
  font-weight: 700;
}

.voice-collapsed-row {
  display: none;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 8px;
}

.voice-collapsed-stop {
  display: grid;
  width: 46px;
  min-height: 46px;
  padding: 0;
  place-items: center;
  border-color: rgba(185, 159, 112, 0.38);
  border-radius: 50%;
  background: rgba(255, 251, 237, 0.88);
  color: #e7355f;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
}

.reader-voice-panel.is-collapsed {
  display: inline-grid;
  width: auto;
  min-width: 0;
  grid-template-columns: auto;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.reader-voice-panel.is-collapsed .voice-panel-grip {
  display: none;
}

.reader-voice-panel.is-collapsed .voice-panel-head {
  display: none;
}

.reader-voice-panel.is-collapsed .voice-settings-btn,
.reader-voice-panel.is-collapsed .voice-main-row,
.reader-voice-panel.is-collapsed .voice-quick-row {
  display: none;
}

.reader-voice-panel.is-collapsed .voice-collapsed-row {
  display: grid;
  grid-column: 1;
}

.voice-float-play {
  display: grid;
  width: 58px;
  min-height: 58px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #279263, #146a45);
  color: #fff;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(25, 113, 73, 0.22);
  touch-action: none;
  cursor: grab;
}

.voice-float-play:active {
  cursor: grabbing;
}

.voice-main-row {
  grid-template-columns: minmax(0, 1fr) 152px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 10px;
}

.voice-mode-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px 10px;
  border-color: rgba(185, 159, 112, 0.38);
  border-radius: 10px;
  background: rgba(255, 251, 237, 0.82);
  text-align: left;
}

.voice-card-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  line-height: 1;
}

.voice-card-icon.book {
  background: #20865a;
}

.voice-card-icon.note {
  background: #2f7be8;
}

.voice-mode-card strong,
.voice-quick-btn strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-mode-card small,
.voice-quick-btn small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-transport {
  display: grid;
  grid-template-columns: 40px 64px 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.voice-skip,
.voice-play {
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  color: #111;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.voice-skip {
  min-height: 40px;
  background: transparent;
  font-size: 24px;
}

.voice-play {
  width: 64px;
  min-height: 64px;
  border-radius: 50%;
  background: linear-gradient(180deg, #279263, #146a45);
  color: #fff;
  font-size: 28px;
  box-shadow: 0 8px 16px rgba(25, 113, 73, 0.28);
}

.voice-quick-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.voice-quick-btn {
  display: grid;
  justify-items: center;
  overflow: hidden;
  min-height: 76px;
  padding: 9px 6px;
  border-color: rgba(185, 159, 112, 0.38);
  border-radius: 10px;
  background: rgba(255, 251, 237, 0.78);
  text-align: center;
}

.voice-quick-btn > span {
  display: block;
  max-width: 100%;
  height: 24px;
  margin-bottom: 5px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 24px;
  line-height: 1;
}

.voice-quick-btn.loop > span {
  color: #7c3aed;
}

.voice-quick-btn.bookmark > span {
  color: #f97316;
}

.voice-quick-btn.speed > span {
  color: #2685e8;
}

.voice-quick-btn.notes > span {
  color: #2563eb;
}

.voice-quick-btn.stop > span {
  color: #e7355f;
}

.voice-quick-btn.is-empty {
  opacity: 0;
  pointer-events: none;
}

.verse-voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.verse-voice-btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.reader-mark-btn {
  width: 100%;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.reader-done-time {
  margin: 10px 0 0;
  color: #332a20;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.auth-gate,
.account-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(36, 33, 29, 0.42);
  backdrop-filter: blur(10px);
}

.auth-gate[hidden],
.account-panel[hidden] {
  display: none;
}

[hidden] {
  display: none !important;
}

.auth-card,
.account-sheet {
  width: min(420px, 100%);
  border: 1px solid rgba(185, 159, 112, 0.85);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 50px rgba(36, 33, 29, 0.28);
}

.auth-card {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.auth-card h2 {
  font-size: 24px;
}

.auth-card label,
.account-box label {
  display: grid;
  gap: 5px;
}

.auth-card label span,
.account-box label span {
  color: var(--muted);
  font-size: 12px;
}

.auth-card input,
.account-box input {
  width: 100%;
  padding: 0 10px;
}

.primary-btn {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.form-message.is-error {
  color: #8a2f1f;
  font-weight: 700;
}

.form-message.is-success {
  color: var(--brand);
  font-weight: 700;
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.account-panel {
  align-items: end;
  padding: 12px;
}

.account-sheet {
  width: min(760px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  padding: 14px;
}

.account-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.account-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(185, 159, 112, 0.65);
  border-radius: 8px;
  background: rgba(255, 250, 235, 0.48);
}

.account-box h3 {
  font-size: 18px;
}

.account-note {
  margin: 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  line-height: 1.45;
}

.reset-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#accountInfo {
  display: grid;
  gap: 2px;
  margin: 0;
}

#accountInfo span,
.user-row span {
  color: var(--muted);
  font-size: 12px;
}

.user-list {
  display: grid;
  gap: 8px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(185, 159, 112, 0.55);
  border-radius: 6px;
  background: rgba(247, 237, 207, 0.7);
}

.user-row > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-actions {
  display: flex;
  gap: 6px;
}

.user-actions button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(247, 237, 207, 0.97);
  backdrop-filter: blur(10px);
}

.bottom-nav #bottomNotes,
.bottom-nav #bottomOutline {
  display: none;
}

.bottom-nav button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  min-height: 40px;
  padding: 0 3px;
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.reader-mode .bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(185, 159, 112, 0.38);
  border-radius: 18px 18px 0 0;
  background: rgba(255, 248, 225, 0.97);
  box-shadow: 0 -4px 18px rgba(79, 55, 18, 0.12);
}

.reader-mode .bottom-nav button {
  min-height: 54px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
}

.reader-mode #bottomNotes,
.reader-mode #bottomOutline {
  display: grid;
}

.reader-mode .bottom-nav button::before {
  display: block;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

.reader-mode #bottomOld::before {
  content: "▶";
}

.reader-mode #bottomNew::before {
  content: "注";
}

.reader-mode #bottomNotes::before {
  display: none;
  content: "";
}

.reader-mode #bottomNotes {
  align-content: center;
  gap: 3px;
}

.reader-mode #bottomNotes.is-done {
  color: var(--brand);
}

.reader-mode #bottomNotes.is-pending {
  color: #b42318;
}

.bottom-done-time {
  display: block;
  min-height: 25px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 25px;
  text-align: center;
}

.bottom-done-time.is-empty {
  visibility: hidden;
}

.reader-mode #bottomOutline::before {
  content: "☰";
}

.reader-mode #bottomHome::before {
  content: "⌂";
}

.reader-mode #bottomOld {
  color: #16865a;
}

.reader-mode #bottomAccount {
  display: none;
}

.life-mode .bottom-nav,
.morning-mode .bottom-nav,
.hymns-mode .bottom-nav,
.books-mode .bottom-nav,
.history-mode .bottom-nav {
  grid-template-columns: 1fr 1fr;
}

.recovery-mode .bottom-nav {
  grid-template-columns: 1fr 1fr 1fr;
}

.recovery-mode.reader-mode .bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.life-mode.reader-mode .bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.life-mode #bottomOld,
.life-mode #bottomNew,
.life-mode #bottomNotes,
.life-mode #bottomOutline,
.morning-mode #bottomOld,
.morning-mode #bottomNew,
.morning-mode #bottomNotes,
.morning-mode #bottomOutline,
.hymns-mode #bottomOld,
.hymns-mode #bottomNew,
.hymns-mode #bottomNotes,
.hymns-mode #bottomOutline,
.books-mode #bottomOld,
.books-mode #bottomNew,
.books-mode #bottomNotes,
.books-mode #bottomOutline,
.history-mode #bottomOld,
.history-mode #bottomNew,
.history-mode #bottomNotes,
.history-mode #bottomOutline,
.recovery-mode #bottomNew,
.recovery-mode #bottomNotes,
.recovery-mode #bottomOutline {
  display: none;
}

.recovery-mode.reader-mode #bottomNew,
.recovery-mode.reader-mode #bottomNotes,
.recovery-mode.reader-mode #bottomOutline {
  display: grid;
}

.life-mode.reader-mode #bottomOld,
.life-mode.reader-mode #bottomNew,
.life-mode.reader-mode #bottomNotes,
.life-mode.reader-mode #bottomOutline {
  display: grid;
}

.life-mode.reader-mode #bottomNew::before {
  content: "⚑";
}

.life-mode.reader-mode #bottomOld::before {
  content: "⚙";
}

.life-mode.reader-mode #bottomNotes::before {
  display: block;
  content: "📖";
  font-size: 21px;
}

.life-mode.reader-mode #bottomOutline::before {
  content: "▶";
}

.life-mode.reader-mode #bottomOutline.is-playing::before {
  content: "Ⅱ";
}

.recovery-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}

.recovery-toolbar input {
  min-height: 42px;
}

.recovery-testament-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.recovery-testament-tabs button {
  min-height: 38px;
  color: var(--brand);
  font-weight: 700;
}

.recovery-testament-tabs button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.recovery-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
}

.recovery-book-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-height: 36px;
  padding: 5px 7px;
  border: 1px solid rgba(185, 159, 112, 0.48);
  border-radius: 8px;
  background: rgba(247, 237, 207, 0.78);
  color: var(--ink);
  text-align: left;
}

.recovery-book-chip.is-active {
  border-color: var(--brand);
  background: rgba(49, 93, 65, 0.16);
}

.recovery-book-chip span {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.72);
  color: var(--muted);
  font-size: 10px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.recovery-book-chip strong {
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
}

.recovery-picker {
  margin: 0 0 10px;
}

.recovery-picker-title {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.recovery-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recovery-chip-grid button {
  min-width: 42px;
  min-height: 34px;
  padding: 0 10px;
  border-color: rgba(185, 159, 112, 0.5);
  background: rgba(255, 248, 225, 0.72);
  color: var(--brand);
  font-weight: 700;
}

.recovery-chip-grid button.is-read {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(191, 219, 254, 0.8);
  color: #1d4ed8;
}

.recovery-reader {
  display: grid;
  gap: 12px;
}

.recovery-reader-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.recovery-reader-nav button,
.recovery-reader-action button {
  min-height: 40px;
  font-weight: 700;
}

.recovery-reader-action {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.recovery-reader-nav-bottom {
  margin: 0 0 24px;
}

.recovery-status {
  display: grid;
  gap: 12px;
}

.recovery-status-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.recovery-status-tabs button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.recovery-status-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.recovery-status-group,
.recovery-status-date {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(185, 159, 112, 0.42);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.52);
}

.recovery-status-group h3,
.recovery-status-date h3 {
  margin: 0;
  color: var(--brand);
  font-size: 18px;
}

.recovery-status-book {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding-top: 8px;
  border-top: 1px solid rgba(185, 159, 112, 0.26);
}

.recovery-status-book strong {
  font-size: 15px;
}

.recovery-status-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.recovery-status-chapters span {
  display: inline-grid;
  min-width: 28px;
  min-height: 28px;
  place-items: center;
  border: 1px solid rgba(185, 159, 112, 0.38);
  border-radius: 7px;
  background: rgba(255, 248, 225, 0.76);
  color: var(--muted);
  font-size: 12px;
}

.recovery-status-chapters span.is-read {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(191, 219, 254, 0.82);
  color: #1d4ed8;
  font-weight: 700;
}

.recovery-status-date article {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(185, 159, 112, 0.34);
  border-radius: 8px;
  background: rgba(255, 252, 240, 0.75);
}

.recovery-status-date span,
.recovery-status-date small {
  color: var(--muted);
}

@media (max-width: 380px) {
  .recovery-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.recovery-body {
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
}

.recovery-body h2,
.recovery-body h3 {
  margin: 18px 0 12px;
}

.recovery-body p,
.recovery-body div {
  margin: 0 0 14px;
}

.recovery-body a {
  color: #0f766e;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.recovery-body sup {
  color: #2563eb;
  font-size: 0.68em;
  line-height: 0;
}

.recovery-body .chapter {
  display: inline-flex;
  min-width: 42px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  margin: 0 4px 6px 0;
  border: 1px solid rgba(185, 159, 112, 0.44);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.74);
  text-decoration: none;
}

.recovery-body .note {
  padding-left: 12px;
  border-left: 3px solid rgba(49, 93, 65, 0.42);
}

.recovery-body .O0,
.recovery-body .O1,
.recovery-body .O2,
.recovery-body .O3,
.recovery-body .O4,
.recovery-body .O5 {
  color: #4f422b;
  font-weight: 700;
}

.hymn-shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 4px 0 14px;
}

.hymn-book-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-height: 242px;
  padding: 16px 12px;
  border: 1px solid rgba(185, 159, 112, 0.55);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 248, 225, 0.88), rgba(235, 213, 164, 0.62));
  color: var(--ink);
  text-align: center;
  box-shadow: 0 8px 18px rgba(76, 57, 26, 0.08);
}

.hymn-book-card:active {
  transform: translateY(1px);
}

.hymn-book-cover {
  display: grid;
  width: min(128px, 100%);
  aspect-ratio: 0.72;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(107, 83, 44, 0.34);
  border-radius: 6px;
  background: #f7edcf;
  box-shadow: 8px 8px 0 rgba(49, 93, 65, 0.14);
}

.hymn-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hymn-book-cover span {
  padding: 10px;
  color: var(--brand);
  font-weight: 800;
}

.hymn-book-card strong {
  font-size: 20px;
  line-height: 1.2;
}

.hymn-book-card small {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
}

.hymn-reader {
  display: grid;
  gap: 12px;
}

.hymn-reader-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.hymn-reader-head .reader-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hymn-reader-head h2 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.16;
}

.hymn-toc {
  padding: 10px;
  border: 1px solid rgba(185, 159, 112, 0.46);
  border-radius: 8px;
  background: rgba(247, 237, 207, 0.64);
}

.hymn-toc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 2px;
}

.hymn-toc-grid button {
  min-height: 40px;
  padding: 7px 9px;
  border-color: rgba(185, 159, 112, 0.5);
  background: rgba(255, 248, 225, 0.78);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.22;
  text-align: left;
}

.hymn-toc-grid button.is-active {
  border-color: var(--brand);
  background: rgba(49, 93, 65, 0.16);
  color: var(--brand);
  font-weight: 800;
}

.hymn-body {
  padding: 12px 0 24px;
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
}

.hymn-body h1,
.hymn-body h2,
.hymn-body h3 {
  margin: 18px 0 12px;
  line-height: 1.22;
}

.hymn-body p,
.hymn-body div {
  margin: 0 0 13px;
}

.hymn-body img {
  max-width: 100%;
  height: auto;
}

.hymn-body a {
  color: #0f766e;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.life-bookshelf {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.life-shelf-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.life-shelf-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.life-shelf-book-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 118px;
  padding: 10px;
  border: 1px solid rgba(185, 159, 112, 0.55);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.78);
  color: var(--ink);
  text-align: left;
}

.life-shelf-book-card .hymn-book-cover {
  width: 64px;
  box-shadow: 5px 5px 0 rgba(49, 93, 65, 0.12);
}

.life-shelf-book-card strong,
.life-shelf-book-card small {
  display: block;
}

.life-shelf-book-card strong {
  margin-bottom: 5px;
  font-size: 17px;
  line-height: 1.2;
}

.life-shelf-book-card small {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.25;
}

.life-shelf-reader {
  display: grid;
  gap: 12px;
}

.life-shelf-body {
  padding-bottom: 70px;
}

.life-single-app {
  display: grid;
  gap: 14px;
}

.life-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.life-view-tabs button {
  min-height: 48px;
  border: 1px solid rgba(185, 159, 112, 0.72);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.72);
  color: var(--brand);
  font-size: 18px;
  font-weight: 900;
}

.life-view-tabs button.is-active {
  background: var(--brand);
  color: #fff;
}

.life-daily-app {
  display: grid;
  gap: 12px;
}

.life-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.life-progress-track {
  margin-top: -4px;
}

.life-list-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.life-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.life-single-head {
  display: grid;
  gap: 4px;
  padding: 2px 0 6px;
}

.life-single-head h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.life-single-toc {
  display: grid;
  gap: 12px;
}

.life-single-toc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.life-single-toc-grid button {
  min-height: 48px;
  justify-content: flex-start;
  padding: 9px 11px;
  border-color: rgba(185, 159, 112, 0.55);
  background: rgba(255, 248, 225, 0.76);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  text-align: left;
}

.life-single-toc-grid button.is-active {
  border-color: var(--brand);
  background: rgba(49, 93, 65, 0.16);
  color: var(--brand);
  font-weight: 800;
}

.life-single-reader {
  display: grid;
  gap: 12px;
}

.life-single-body {
  padding-bottom: 72px;
}

.life-single-voice-block.voice-playing,
.life-single-voice-block.voice-playing > p {
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.16);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22);
}

.life-single-body [class],
.life-single-body span {
  max-width: 100%;
}

.library-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.library-stats article {
  min-height: 94px;
  padding: 12px;
  border: 1px solid rgba(185, 159, 112, 0.55);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.74);
}

.library-stats span,
.library-stats small {
  display: block;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.library-stats strong {
  display: block;
  margin: 7px 0 5px;
  color: var(--brand);
  font-size: 21px;
  line-height: 1.2;
}

.library-upload-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
}

.library-upload-btn {
  display: inline-grid;
  min-height: 48px;
  place-items: center;
  padding: 8px 18px;
  border: 1px solid rgba(185, 159, 112, 0.74);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.78);
  color: var(--brand);
  font-weight: 800;
  cursor: pointer;
}

.library-upload-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.library-shelf,
.library-reading-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.library-reading-shelf {
  margin-bottom: 14px;
}

.library-book-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 188px;
  padding: 10px 8px;
  border: 1px solid rgba(185, 159, 112, 0.55);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.7);
  color: var(--ink);
  text-align: center;
}

.library-book-card.is-reading {
  border-color: rgba(49, 93, 65, 0.45);
  background: rgba(49, 93, 65, 0.1);
}

.library-book-card .hymn-book-cover {
  width: min(82px, 100%);
  box-shadow: 5px 5px 0 rgba(49, 93, 65, 0.12);
}

.library-book-card strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--brand);
  font-size: 16px;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-book-card small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-reader {
  display: grid;
  gap: 12px;
}

.library-reader-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.library-reader-body {
  padding-bottom: 72px;
}

.history-app {
  display: grid;
  gap: 10px;
}

.history-detail,
.history-calendar {
  padding: 10px;
  border: 1px solid rgba(185, 159, 112, 0.5);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.58);
}

.history-detail {
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.history-detail h2 {
  margin: 2px 0 8px;
  font-size: 22px;
  line-height: 1.16;
}

.history-detail-groups {
  display: grid;
  gap: 8px;
}

.history-detail-group {
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(185, 159, 112, 0.44);
  border-radius: 8px;
  background: rgba(255, 252, 240, 0.48);
}

.history-detail-group h3 {
  margin: 0;
  color: var(--brand);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.history-entry-list {
  display: grid;
  gap: 6px;
}

.history-entry-card {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(185, 159, 112, 0.5);
  border-radius: 8px;
  background: rgba(255, 252, 240, 0.72);
}

.history-entry-old {
  background: rgba(219, 234, 254, 0.54);
}

.history-entry-new {
  background: rgba(238, 242, 255, 0.54);
}

.history-entry-life {
  background: rgba(220, 252, 231, 0.46);
}

.history-entry-card span,
.history-entry-card small {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
}

.history-entry-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.history-empty-line {
  margin: 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

.history-calendar-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.history-calendar-head h2 {
  margin: 0;
  color: var(--brand);
  font-size: 23px;
  line-height: 1.2;
  text-align: center;
}

.history-title-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 6px;
  align-items: center;
}

.history-title-picker select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(185, 159, 112, 0.72);
  border-radius: 8px;
  background: rgba(255, 248, 225, 0.9);
  color: var(--brand);
  font: 800 19px/1.1 ui-sans-serif, system-ui, sans-serif;
  text-align: center;
}

.history-calendar-head button {
  min-height: 40px;
  padding: 6px 12px;
  font-size: 15px;
}

.history-year-toggle {
  width: 100%;
  min-height: 38px;
  margin: 0 0 12px;
  border: 1px solid rgba(185, 159, 112, 0.6);
  border-radius: 8px;
  background: rgba(255, 252, 240, 0.6);
  color: var(--brand);
  font-size: 16px;
  font-weight: 800;
}

.history-year-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 8px;
  margin-bottom: 0;
}

.history-year-grid[hidden] {
  display: none;
}

.history-mini-month {
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(185, 159, 112, 0.42);
  border-radius: 8px;
  background: rgba(255, 252, 240, 0.48);
}

.history-mini-month-title {
  min-height: 30px;
  padding: 2px 6px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 15px;
  font-weight: 900;
}

.history-mini-weekdays,
.history-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px 3px;
  justify-items: center;
}

.history-mini-weekdays {
  align-items: center;
  color: var(--muted);
  font: 10px/1 ui-sans-serif, system-ui, sans-serif;
}

.history-mini-weekdays span {
  display: grid;
  width: 20px;
  height: 16px;
  place-items: center;
}

.history-mini-grid span,
.history-mini-grid button {
  display: grid;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 12px/1 ui-sans-serif, system-ui, sans-serif;
  text-align: center;
}

.history-mini-grid button.has-reading {
  background: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
  font-weight: 900;
}

.history-mini-grid button.is-selected {
  background: #2f80ed;
  color: #fff;
}

.history-calendar.is-year-open .history-weekdays,
.history-calendar.is-year-open .history-calendar-grid {
  display: none;
}

.history-weekdays,
.history-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.history-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  text-align: center;
}

.history-day-cell {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(185, 159, 112, 0.36);
  border-radius: 999px;
  background: rgba(255, 252, 240, 0.52);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
}

.history-day-cell.is-empty {
  border-color: transparent;
  background: transparent;
}

.history-day-cell.has-reading {
  border-color: rgba(36, 99, 235, 0.5);
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
  font-weight: 800;
}

.history-day-cell.is-selected {
  border-color: #1d4ed8;
  background: #2f80ed;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.18);
}

@media (min-width: 680px) {
  .summary {
    grid-template-columns: repeat(5, 1fr);
  }

  .summary-dashboard {
    grid-template-columns: minmax(132px, 0.64fr) minmax(0, 1.36fr);
  }

  .readings {
    gap: 24px;
  }
}

@media (max-width: 679px) {
  .reader-mode .reader-action:not(.reader-action-top) {
    display: none;
  }

  .reader-voice-panel {
    padding: 8px 12px 9px;
    border-radius: 24px 24px 0 0;
  }

  .reader-voice-panel.is-collapsed {
    padding: 0;
    border-radius: 999px;
  }

  .voice-float-play {
    width: 54px;
    min-height: 54px;
    font-size: 24px;
  }

  .voice-main-row {
    grid-template-columns: minmax(0, 1fr) 124px minmax(0, 1fr);
    gap: 8px;
  }

  .voice-mode-card {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 58px;
    padding: 7px 8px;
  }

  .voice-card-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .voice-transport {
    grid-template-columns: 32px 52px 32px;
    gap: 5px;
  }

  .voice-play {
    width: 52px;
    min-height: 52px;
    font-size: 23px;
  }

  .voice-skip {
    min-height: 34px;
    font-size: 21px;
  }

  .voice-mode-card strong,
  .voice-quick-btn strong {
    font-size: 13px;
  }

  .voice-mode-card small,
  .voice-quick-btn small {
    font-size: 11px;
  }

  .voice-quick-row {
    gap: 6px;
  }

  .voice-quick-btn {
    min-height: 68px;
    padding: 7px 4px;
  }

  .voice-quick-btn > span {
    height: 20px;
    margin-bottom: 4px;
    font-size: 20px;
  }
}
