:root {
  --bg: #f6f1e8;
  --surface: #fffdf9;
  --surface-2: #efe7da;
  --ink: #2a221c;
  --muted: #6f6257;
  --line: #e3d8c7;
  --accent: #7a3b2e;
  --accent-ink: #fffaf3;
  --gold: #a87a26;
  --ok: #3f7a4a;
  --danger: #a63a2e;
  --hl-yellow: #fbe8a6;
  --hl-green: #cfe8c4;
  --hl-blue: #cfe0f3;
  --hl-pink: #f5d0d8;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .06);
  --reader-size: 19px;
  /* Android app sets --safe-area-inset-*; browsers use env() */
  --inset-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --inset-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  /* System fonts only: nothing is downloaded, so the app works offline and makes no third-party requests */
  --serif: "Noto Serif", Georgia, Cambria, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f; --surface: #1f1a16; --surface-2: #2a241e; --ink: #efe6d8; --muted: #a99a8a;
    --line: #372f27; --accent: #dd8f73; --accent-ink: #1b1411; --gold: #d9ab52; --ok: #7fbf8a; --danger: #ef8a7c;
    --hl-yellow: #5a4a17; --hl-green: #2f4a2a; --hl-blue: #253c55; --hl-pink: #572d38;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120f; --surface: #1f1a16; --surface-2: #2a241e; --ink: #efe6d8; --muted: #a99a8a;
  --line: #372f27; --accent: #dd8f73; --accent-ink: #1b1411; --gold: #d9ab52; --ok: #7fbf8a; --danger: #ef8a7c;
  --hl-yellow: #5a4a17; --hl-green: #2f4a2a; --hl-blue: #253c55; --hl-pink: #572d38;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + var(--inset-bottom));
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .35em; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .75em; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
main { max-width: 720px; margin: 0 auto; padding: 20px 16px 24px; }
.view { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}
details.card > summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details.card[open] > summary { margin-bottom: 12px; }
details.card[open] > summary::after { transform: rotate(180deg); }

.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; }
.center { text-align: center; }

.eyebrow { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.lead { font-size: 1.05rem; color: var(--muted); margin-bottom: 18px; }
.greeting { margin-bottom: 18px; }
.count { background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 0 8px; font-size: .8rem; font-weight: 500; }
.pill { background: var(--surface-2); border-radius: 99px; padding: 4px 10px; font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.notice { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin: 12px 0 0; }

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: 10px; padding: 9px 16px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .06s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: .86rem; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { background: none; border: 0; color: var(--ink); cursor: pointer; width: 40px; height: 40px; border-radius: 10px; font-size: 1.6rem; line-height: 1; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }

input:not([type=checkbox]):not([type=range]), select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 0;
}
textarea { resize: vertical; font-family: var(--serif); line-height: 1.6; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-grid label { display: grid; gap: 4px; font-size: .86rem; color: var(--muted); font-weight: 500; }
.span-2 { grid-column: span 2; }
.switch-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }

.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s; border-radius: inherit; }

/* ---------- scripture ---------- */
.scripture { font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; margin: 0 0 12px; }
.scripture.small { font-size: 1rem; color: var(--muted); font-style: italic; }
.verse-card { background: linear-gradient(160deg, var(--surface) 55%, color-mix(in srgb, var(--gold) 12%, var(--surface))); }

/* ---------- bible ---------- */
.bible-controls { display: grid; gap: 10px; margin-bottom: 14px; }
.search { display: flex; gap: 8px; }
.reader-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 4px; }
.reader-head h1 { margin: 0; text-align: center; }
.reader {
  font-family: var(--serif); font-size: var(--reader-size); line-height: 1.8;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 10px;
  min-height: 200px;
}
.verse { border-radius: 4px; cursor: pointer; padding: 1px 0; transition: background .2s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.verse:hover { background: var(--surface-2); }
.verse sup { font-family: var(--sans); font-size: .62em; font-weight: 600; color: var(--gold); margin-right: 3px; }
.verse.hl-yellow { background: var(--hl-yellow); }
.verse.hl-green { background: var(--hl-green); }
.verse.hl-blue { background: var(--hl-blue); }
.verse.hl-pink { background: var(--hl-pink); }
.verse.bookmarked sup::before { content: "🔖"; font-size: .9em; margin-right: 2px; }
.verse.focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.loading, .error { font-family: var(--sans); font-size: .95rem; color: var(--muted); text-align: center; padding: 40px 0; }
.error { color: var(--danger); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .snippet { display: block; font-family: var(--serif); color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1px solid var(--line); }

/* ---------- sharing ---------- */
#shareSheet form { max-height: 92vh; overflow-y: auto; }
#shareCanvas { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto 10px; border-radius: 14px; box-shadow: var(--shadow); }
.swatch-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.card-style { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); font-family: var(--serif); font-weight: 700; cursor: pointer; }
.card-style[aria-checked="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.share-text { white-space: pre-wrap; word-break: break-word; font-family: var(--sans); font-size: .9rem; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; max-height: 40vh; overflow-y: auto; margin: 6px 0 14px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.whatsapp { background: #25d366; border-color: #25d366; color: #0b2e17; }
.read-together .code, .join-code input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.join-code h2 { margin-bottom: 2px; }

/* ---------- audio bible ---------- */
.listen-row { display: flex; justify-content: center; margin: 2px 0 10px; }
.verse.speaking { background: color-mix(in srgb, var(--gold) 22%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent); }
.player {
  position: fixed; left: 8px; right: 8px; bottom: calc(70px + var(--inset-bottom)); z-index: 29;
  display: flex; align-items: center; gap: 4px; padding: 6px 8px;
  background: var(--ink); color: var(--bg); border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.pl-btn { flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: inherit; font-size: 1.05rem; cursor: pointer; }
.pl-btn:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); }
.pl-main { background: var(--gold); color: #1b1411; font-size: 1.15rem; }
.pl-main:hover { background: var(--gold); filter: brightness(1.08); }
.pl-rate { width: auto; padding: 0 8px; font-size: .85rem; font-weight: 700; }
.pl-info { flex: 1; min-width: 0; display: grid; text-align: left; background: none; border: 0; color: inherit; cursor: pointer; padding: 0 6px; line-height: 1.25; }
.pl-info strong { font-family: var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-info span { font-size: .78rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.has-player { padding-bottom: calc(140px + var(--inset-bottom)); }
body.has-player .toast { bottom: calc(150px + var(--inset-bottom)); }
@media (min-width: 760px) {
  .player { left: 50%; right: auto; width: 540px; transform: translateX(-50%); bottom: calc(86px + var(--inset-bottom)); }
}

/* ---------- reading plan ---------- */
.back-link { display: inline-block; margin-bottom: 10px; text-decoration: none; }
.reading-list, .day-list { list-style: none; margin: 8px 0; padding: 0; }
.reading-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.reading-list li:first-child { border-top: 0; }
.reading-link { background: none; border: 0; padding: 0; font-family: var(--serif); font-size: 1.1rem; color: var(--ink); cursor: pointer; text-align: left; }
.reading-link:hover { color: var(--accent); }
li.read .reading-link { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.check { position: relative; width: 26px; height: 26px; flex: none; }
.check input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.check span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); transition: background .15s, border-color .15s; }
.check input:checked + span { background: var(--ok); border-color: var(--ok); }
.check input:checked + span::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 700; }
.check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.day-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.day-list li:first-child { border-top: 0; }
.day-list .day-num { flex: none; width: 64px; font-size: .78rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .04em; }
.day-list.all { max-height: 60vh; overflow-y: auto; }
.day-list.all li.focus { background: color-mix(in srgb, var(--gold) 10%, transparent); border-radius: 8px; }
.day-list .reading-link { font-size: .98rem; }
.big-number { font-family: var(--serif); font-size: 2.2rem; font-weight: 600; line-height: 1; margin: 0 0 4px; }
.plan-option h2 { margin-bottom: 2px; }
.book-plan { border: 2px solid var(--gold); }
.book-plan .form-grid { margin-top: 12px; }
.reminder-row { align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.reminder-row input[type=time] { width: auto; max-width: 140px; }
.reminder-row input[type=time]:disabled { opacity: .5; }
.section-title { font-size: 1.1rem; margin: 26px 0 12px; }
.plan-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; border-left: 4px solid var(--gold); }
.plan-bar .eyebrow { margin-bottom: 2px; }
.plan-bar-title { font-family: var(--serif); font-size: 1.15rem; margin: 0; }

/* ---------- commentary ---------- */
.commentary { font-family: var(--serif); font-size: calc(var(--reader-size) * .86); line-height: 1.7; }
.commentary p { margin: 0 0 .8em; }
.commentary strong { color: var(--accent); font-weight: 600; }
.commentary .ref { font-family: var(--sans); font-size: .82em; font-weight: 600; text-decoration-thickness: 1px; }
.commentary .note { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; scroll-margin-top: 80px; }
.commentary .note h4 { margin: 0 0 6px; }
.commentary .verse-jump {
  font-family: var(--sans); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface-2); color: var(--gold); border: 0; border-radius: 99px; padding: 3px 10px; cursor: pointer;
}
.commentary .chapter-intro { background: var(--surface-2); border-radius: 12px; padding: 12px 14px 2px; margin-bottom: 4px; }
.commentary details.intro { margin-bottom: 12px; }
.commentary details.intro summary { font-family: var(--sans); font-weight: 600; cursor: pointer; color: var(--accent); margin-bottom: 8px; }
.commentary .credit { font-family: var(--sans); margin: 16px 0 0; }
.commentary.scroll { max-height: min(58vh, 520px); overflow-y: auto; margin: 8px 0 16px; padding-right: 4px; overscroll-behavior: contain; }

/* ---------- study ---------- */
.steps { list-style: none; padding: 0; margin: 0 0 14px; counter-reset: step; }
.steps li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 14px 58px; margin-bottom: 12px; box-shadow: var(--shadow); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 16px; top: 15px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--accent); font-weight: 600; font-size: .9rem;
}
.steps li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.steps h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.steps ol { padding-left: 1.2em; margin: 0; }
.steps ol li { all: unset; display: list-item; margin-bottom: 6px; }
.steps ol li::before { content: none; }
.steps label.done-toggle { font-family: var(--sans); font-size: .8rem; font-weight: 500; color: var(--muted); display: flex; gap: 6px; align-items: center; cursor: pointer; white-space: nowrap; }

/* ---------- fasting ---------- */
.fast-status h2 { margin-bottom: 4px; }
.big-count { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; letter-spacing: .01em; margin: 6px 0; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 500; font-size: .9rem; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checklist input { margin-top: 3px; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 14px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold); }
.timeline li.now::before { background: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent); }
.timeline time { font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.bullets { margin: 0; padding-left: 1.2em; }
.bullets li { margin-bottom: 8px; }

/* ---------- alarms ---------- */
.alarm-list { list-style: none; margin: 0 0 14px; padding: 0; }
.alarm {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.alarm.off { opacity: .55; }
.alarm .time { font-family: var(--serif); font-size: 1.8rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.alarm .meta { color: var(--muted); font-size: .86rem; }
.alarm .actions { display: flex; gap: 6px; align-items: center; grid-row: span 2; }
.tag { font-size: .72rem; font-weight: 600; border-radius: 6px; padding: 1px 6px; background: var(--surface-2); color: var(--muted); margin-left: 6px; vertical-align: middle; }
.toggle { position: relative; width: 44px; height: 26px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: relative; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(18px); }
.days { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.days legend { font-size: .86rem; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.day-btn { position: relative; }
.day-btn input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.day-btn span { display: grid; place-items: center; width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line); font-weight: 600; font-size: .85rem; color: var(--muted); }
.day-btn input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day-btn input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + var(--inset-bottom));
}
.tabbar button {
  background: none; border: 0; display: grid; justify-items: center; gap: 2px; padding: 6px 0; cursor: pointer;
  color: var(--muted); font-size: .72rem; font-weight: 600; border-radius: 10px;
}
.tabbar .ti { font-size: 1.25rem; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.tabbar button.active { color: var(--accent); }
.tabbar button.active .ti { filter: none; opacity: 1; }
@media (min-width: 760px) {
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 560px; bottom: 14px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 6px 8px; }
}

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: 100vw; }
dialog::backdrop { background: rgba(20, 12, 6, .45); backdrop-filter: blur(2px); }
.sheet form { background: var(--surface); border-radius: 20px; padding: 20px; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.swatches { display: flex; gap: 10px; margin: 6px 0 16px; }
.sw { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; color: var(--muted); font-size: .9rem; }
.sw.yellow { background: var(--hl-yellow); } .sw.green { background: var(--hl-green); }
.sw.blue { background: var(--hl-blue); } .sw.pink { background: var(--hl-pink); } .sw.none { background: var(--surface); }
.ring .ring-body { background: var(--surface); border-radius: 24px; padding: 28px 24px; width: min(420px, calc(100vw - 32px)); text-align: center; box-shadow: var(--shadow); }
.bell { font-size: 3rem; animation: shake 1s ease-in-out infinite; display: inline-block; }
@keyframes shake { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 500; box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
}

@media (max-width: 460px) {
  h1 { font-size: 1.6rem; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .reader { padding: 14px 14px; }
  .alarm .time { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
