/* Tinnitus Log for Veterans.
 * Light first. The book's pair, coyote brown on near-black olive, is the
 * accent on a warm stone ground; the olive hero card and the olive tab bar
 * are the only dark surfaces. Big type for older eyes, 18px base. */
:root {
  color-scheme: light;
  --bg: #EFECE6; --card: #FFFFFF; --ink: #221B0C; --ink-2: #5E5546; --ink-3: #847B6C; --line: #DDD6C8;
  --accent: #A8732F; --accent-ink: #85581F; --accent-soft: #F5EADA;
  --olive: #221B0C; --olive-2: #332A14;
  --danger: #A33A2A; --danger-soft: #F8E4E0;
  --lo-bg: #DDE8DF; --lo-ink: #2F6B44; --mid-bg: #F3E1C0; --mid-ink: #85581F; --hi-bg: #A8732F; --hi-ink: #FFFFFF;
  --r: 20px; --r-s: 14px;
  --shadow: 0 1px 2px rgba(34, 27, 12, .06), 0 12px 32px -16px rgba(34, 27, 12, .35);
  --tab-h: 64px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15120B; --card: #221B0C; --ink: #F3ECDD; --ink-2: #C4B8A2; --ink-3: #978D79; --line: #3D331F;
  --accent: #C9914A; --accent-ink: #E3B36F; --accent-soft: #3A2B14;
  --olive: #2C2410; --olive-2: #3F3418;
  --danger: #E08A7A; --danger-soft: #43221C;
  --lo-bg: #233826; --lo-ink: #9CCDA8; --mid-bg: #4A3819; --mid-ink: #E3B36F; --hi-bg: #C9914A; --hi-ink: #1A1409;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -16px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html {
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none; background: var(--bg);
}
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px; line-height: 1.4; color: var(--ink); background: var(--bg);
  padding-top: env(safe-area-inset-top, 0px);
}
.app { max-width: 640px; margin: 0 auto; padding: 12px 16px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom, 0px)); }
#screen:focus { outline: none; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--olive); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ic { width: 22px; height: 22px; flex: none; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h2 { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
p { margin: 0 0 .6em; }
p:last-child { margin-bottom: 0; }
.hint { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; line-height: 1.4; }
.fine { font-size: 13px; color: var(--ink-3); }
.empty { color: var(--ink-3); text-align: center; padding: 24px 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, [role="button"], .tab, .seg, .chip { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* Tab bar */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 640px; z-index: 20;
  display: flex; background: var(--olive); border-radius: 22px 22px 0 0;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 30px -12px rgba(34, 27, 12, .5);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; padding: 8px 2px 4px; border-radius: 14px; color: rgba(255, 255, 255, .62); text-decoration: none; font-size: 12px; font-weight: 600; transition: color .15s, background .15s; }
.tab .ic { width: 24px; height: 24px; }
.tab.on { color: var(--accent); background: rgba(255, 255, 255, .06); }
.tab:active { transform: scale(.96); }

/* Hero */
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center; margin: 4px 0 18px; padding: 24px 20px 18px; border-radius: 26px;
  background: radial-gradient(120% 90% at 85% -10%, rgba(168, 115, 47, .55), transparent 60%), radial-gradient(80% 60% at 0% 100%, rgba(168, 115, 47, .18), transparent 60%), linear-gradient(160deg, #332A14, #221B0C 55%, #17120A);
  box-shadow: 0 2px 4px rgba(34, 27, 12, .15), 0 26px 50px -22px rgba(34, 27, 12, .7);
}
.hero .kicker { font-size: 14px; color: var(--accent); font-weight: 700; margin: 0 0 6px; }
[data-theme="dark"] .hero .kicker { color: #E3B36F; }
.hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 6px; }
.hero-sub { font-size: 16px; color: rgba(255, 255, 255, .8); margin: 0 auto 16px; max-width: 32ch; }
.hero-row { display: flex; align-items: flex-end; justify-content: center; gap: 22px; }
.streak { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.streak b { font-size: 40px; font-weight: 800; color: #E3B36F; }
.streak span { font-size: 12px; color: rgba(255, 255, 255, .75); margin-top: 6px; }
.strip { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: 26px; }
.bar::before { content: ""; flex: 1; }
.bar i { display: block; width: 7px; border-radius: 4px 4px 0 0; background: #E3B36F; margin: 0 1px; min-height: 0; }
.bar i.pm { opacity: .55; }
.bar { position: relative; }
.bar i.am, .bar i.pm { position: absolute; bottom: 18px; }
.bar i.am { left: 4px; }
.bar i.pm { right: 4px; }
.bar span { font-size: 11px; color: rgba(255, 255, 255, .6); height: 14px; margin-top: 4px; }
.bar.cur span { color: #fff; font-weight: 700; }
.bar.cur::after { content: ""; position: absolute; bottom: 14px; left: 2px; right: 2px; height: 2px; background: var(--accent); border-radius: 2px; }
.link.light { color: #fff; opacity: .85; margin-top: 8px; }

/* Cards and sections */
.card { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.section h2 { margin-bottom: 16px; }
details.section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
details.section > summary::after { content: ""; width: 10px; height: 10px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(45deg); margin: 0 6px 4px 0; transition: transform .2s; }
details.section[open] > summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.opt { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--bg); padding: 3px 8px; border-radius: 999px; }
details.section[open] .section-body { margin-top: 16px; }

/* Fields */
.field { margin: 0 0 20px; }
.field:last-child { margin-bottom: 0; }
.fhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.fhead label, .fhead .label { font-size: 17px; font-weight: 600; }
.field.slider .fhead { align-items: center; margin-bottom: 0; }
output.big { font-size: 40px; font-weight: 800; color: var(--accent-ink); min-width: 2ch; text-align: right; line-height: 1; font-variant-numeric: tabular-nums; }
.field.slider.unset output.big { font-size: 16px; font-weight: 600; color: var(--ink-3); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 48px; background: transparent; margin: 0; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--accent) var(--pct, 0%), var(--line) var(--pct, 0%)); box-shadow: inset 0 1px 3px rgba(34, 27, 12, .25); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 38px; height: 38px; margin-top: -11px; border-radius: 50%; background: #fff; border: 3px solid var(--olive); box-shadow: 0 3px 8px rgba(34, 27, 12, .35); transition: transform .1s; }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.08); }
input[type="range"]::-moz-range-track { height: 16px; border-radius: 8px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 16px; border-radius: 8px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 3px solid var(--olive); box-shadow: 0 3px 8px rgba(34, 27, 12, .35); }
.field.slider.unset input[type="range"]::-webkit-slider-thumb { border-color: var(--ink-3); background: var(--bg); }
.field.slider.unset input[type="range"]::-moz-range-thumb { border-color: var(--ink-3); background: var(--bg); }
.ticks { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); padding: 0 6px; margin-top: -4px; }

.segs { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 14px; border-radius: var(--r-s); border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 17px; cursor: pointer; transition: background .12s, color .12s, transform .1s; }
.seg.on { background: var(--olive); color: #fff; border-color: var(--olive); }
.seg:active { transform: scale(.97); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 8px 14px 8px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-size: 16px; font-weight: 500; cursor: pointer; transition: background .12s, border-color .12s, transform .1s; text-align: left; }
.chip .chip-ic { width: 0; height: 18px; opacity: 0; margin-left: -6px; transition: opacity .15s; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip.on .chip-ic { width: 18px; opacity: 1; margin-left: 0; }
.chip:active { transform: scale(.97); }
.multi.stack .chips { flex-direction: column; }
.multi.stack .chip { border-radius: var(--r-s); width: 100%; justify-content: flex-start; }

.stepper { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: var(--r-s); overflow: hidden; max-width: 260px; background: var(--card); }
.step { width: 60px; font-size: 28px; line-height: 1; background: var(--bg); border: 0; color: var(--ink); cursor: pointer; }
.step:active { background: var(--line); }
.stepper input { flex: 1; min-width: 0; width: 80px; text-align: center; font-size: 22px; font-weight: 700; border: 0; background: transparent; padding: 10px 4px; min-height: 52px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input[type="text"], input[type="date"], input[type="time"], input[type="number"]:not(.stepper input), textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; font-size: 17px; border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--card); color: var(--ink);
}
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; }
textarea { min-height: 104px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }

.reveal { margin: -8px 0 20px; padding: 14px 14px 4px; border-radius: 16px; background: var(--accent-soft); border: 1.5px solid var(--accent); }
.reveal-title { font-size: 17px; margin: 0 0 14px; color: var(--accent-ink); }
.reveal .seg, .reveal .chip, .reveal input, .reveal textarea { background: var(--card); }
.reveal .chip.on { background: var(--card); }

.listrow { border: 1.5px dashed var(--line); border-radius: 16px; padding: 12px 12px 2px; margin-bottom: 10px; }
.listrow-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.listrow .field { margin-bottom: 14px; }
details.fixedrow { border-top: 1px solid var(--line); }
details.fixedrow > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 10px 0; cursor: pointer; font-weight: 600; font-size: 16px; }
details.fixedrow > summary::-webkit-details-marker { display: none; }
.rowsum { font-size: 13px; color: var(--ink-3); font-weight: 500; white-space: nowrap; }
.rowbody { padding: 4px 0 10px; }

.form-error { color: var(--danger); background: var(--danger-soft); padding: 12px 14px; border-radius: 12px; font-weight: 600; margin: 0 0 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: var(--r-s); border: 1.5px solid transparent; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; transition: transform .1s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--olive); color: #fff; box-shadow: 0 2px 0 var(--accent), 0 10px 22px -12px rgba(34, 27, 12, .7); }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.big { width: 100%; min-height: 58px; font-size: 18px; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 15px; flex: none; }
.btn.coyote { background: var(--accent); color: #0F0C06; box-shadow: none; }
.btn.light { background: transparent; border-color: rgba(255, 255, 255, .4); color: #fff; }
.link { background: none; border: 0; color: var(--accent-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; cursor: pointer; text-decoration: none; }
.link .ic { width: 20px; height: 20px; }
.link.danger { color: var(--danger); }
.filebtn { cursor: pointer; }
.btnrow { display: flex; flex-direction: column; gap: 10px; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.iconbtn.flip .ic { transform: rotate(180deg); }
.iconbtn:disabled { opacity: .35; cursor: default; }

.savebar { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 6px); z-index: 5; padding: 10px 0 2px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.under { text-align: center; margin: 6px 0 0; }

/* Toast, banner, dialog */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 20px); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: var(--olive); color: #fff; font-weight: 700; box-shadow: 0 10px 30px -8px rgba(34, 27, 12, .6); transition: opacity .2s, transform .2s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok .ic { color: var(--accent); }
.demo-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent); margin-bottom: 14px; font-size: 15px; line-height: 1.35; }
.demo-banner .ic { flex: none; }
.demo-banner div { flex: 1; }
.confirm { border: 0; border-radius: var(--r); padding: 22px; max-width: min(92vw, 420px); box-shadow: var(--shadow); background: var(--card); color: var(--ink); }
.confirm::backdrop { background: rgba(34, 27, 12, .5); }
.confirm p { font-size: 18px; margin: 0 0 18px; }
.confirm .btnrow { flex-direction: row; justify-content: flex-end; }

/* Page heads and rows */
.page-head { padding: 10px 4px 14px; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 6px; }
.page-head p { color: var(--ink-2); font-size: 16px; }
.page-head.sub .link { margin-left: -4px; margin-bottom: 2px; }
.rows-list { margin-bottom: 14px; }
.rows-list .card { margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 14px 16px; }
.row > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row b { font-size: 18px; }
.status { font-size: 14px; color: var(--ink-3); }
.chev { color: var(--ink-3); width: 22px; }
.rowic { color: var(--accent-ink); }

/* Calendar and entries */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav h2 { margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-wd { text-align: center; font-size: 13px; color: var(--ink-3); padding: 4px 0; font-weight: 600; }
.cal-cell { position: relative; aspect-ratio: 1; min-height: 40px; border-radius: 10px; border: 0; background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.has.lo { background: var(--lo-bg); color: var(--lo-ink); }
.cal-cell.has.mid { background: var(--mid-bg); color: var(--mid-ink); }
.cal-cell.has.hi { background: var(--hi-bg); color: var(--hi-ink); }
.cal-cell.today { outline: 2px solid var(--olive); outline-offset: 1px; }
.cal-cell.future { opacity: .3; cursor: default; }
.cal-cell:active:not(.future) { transform: scale(.94); }
.dot-spike { position: absolute; right: 4px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--card); }
.dot-spike.inline { position: static; display: inline-block; margin: 0 4px 0 10px; box-shadow: none; }
.legend { font-size: 13px; color: var(--ink-2); margin: 12px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-left: 8px; }
.sw.lo { background: var(--lo-bg); } .sw.mid { background: var(--mid-bg); } .sw.hi { background: var(--hi-bg); }
.entries .card { margin-bottom: 10px; }
.entry { display: flex; gap: 12px; align-items: center; padding: 12px 14px; text-decoration: none; color: inherit; }
.entry-date { width: 54px; flex: none; text-align: center; display: flex; flex-direction: column; }
.entry-date b { font-size: 16px; }
.entry-date span { font-size: 12px; color: var(--ink-3); }
.entry-body { flex: 1; min-width: 0; }
.entry-nums { display: flex; align-items: baseline; gap: 6px; }
.num { font-size: 24px; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.sep { font-size: 13px; color: var(--ink-3); margin-right: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.tag.spike { background: var(--danger-soft); color: var(--danger); }
.tag.demo { border: 1px dashed var(--line); background: transparent; }
.entry-note { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Appointment */
.range { display: flex; gap: 10px; }
.range label { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.quick { margin-top: 12px; }
.numbers { color: #fff; background: radial-gradient(100% 80% at 100% 0%, rgba(168, 115, 47, .4), transparent 55%), linear-gradient(160deg, #332A14, #221B0C 60%); }
.numbers h2 { color: #fff; }
.numbers .hint { color: rgba(255, 255, 255, .75); margin: -8px 0 14px; }
.four { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.four div { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: 14px 12px; display: flex; flex-direction: column; }
.four b { font-size: 42px; line-height: 1; color: #E3B36F; font-weight: 800; font-variant-numeric: tabular-nums; }
.four span { font-size: 14px; color: rgba(255, 255, 255, .85); margin-top: 8px; line-height: 1.3; }
.facts { margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--ink-2); font-size: 16px; }
.facts dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.checklist { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.checkrow { display: flex; align-items: center; gap: 12px; min-height: 46px; font-size: 16px; cursor: pointer; }
.checkrow input { width: 24px; height: 24px; accent-color: var(--accent-ink); flex: none; margin: 0; }
.checkrow.big { align-items: flex-start; padding: 10px 0 4px; }
.checkrow.big input { margin-top: 4px; }
.checkrow small { color: var(--ink-2); font-size: 14px; line-height: 1.35; display: block; margin-top: 2px; }

/* Prose screens */
.prose p { font-size: 17px; line-height: 1.5; }
.prose h3 { font-size: 17px; margin: 18px 0 6px; }
.prose p.hint { font-size: 14px; }
.crisis { border: 2px solid var(--accent); }
.danger-zone { border: 1.5px solid var(--danger-soft); }
.install p { font-size: 16px; }
.about p { font-size: 15px; color: var(--ink-2); }

@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover { filter: brightness(1.12); }
  .btn.ghost:hover, .seg:hover:not(.on), .chip:hover:not(.on), .iconbtn:hover:not(:disabled) { border-color: var(--ink-3); }
  .row:hover, .entry:hover { box-shadow: 0 1px 2px rgba(34, 27, 12, .08), 0 14px 32px -14px rgba(34, 27, 12, .45); }
  .tab:hover { color: #fff; }
  .link:hover { text-decoration: underline; }
}
@media (min-width: 600px) {
  .btnrow { flex-direction: row; flex-wrap: wrap; }
  .btnrow .btn.big { width: auto; flex: 1; }
  .hero h1 { font-size: 32px; }
}
@media (min-width: 900px) {
  :root { --tab-h: 0px; }
  body { padding-left: 224px; }
  .tabbar { left: 0; top: 0; bottom: 0; transform: none; width: 224px; max-width: none; flex-direction: column; justify-content: flex-start; gap: 4px; border-radius: 0; padding: 28px 14px; box-shadow: none; }
  .tab { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; font-size: 16px; }
  .app { padding: 28px 24px 48px; max-width: 680px; }
  .savebar { bottom: 0; }
  .toast { bottom: 28px; left: calc(50% + 112px); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- Migraine wears its own book's colors: olive drab on olive-black (#868F24 / #1F220B) ---- */
[data-cond="migraine"] { --accent: #6F7A1C; --accent-ink: #55601A; --accent-soft: #EEF0D9; --olive: #1F220B; --olive-2: #2E3214; --hi-bg: #6F7A1C; --mid-bg: #E9EBC9; --mid-ink: #55601A; }
[data-cond="migraine"][data-theme="dark"] { --accent: #A9B23F; --accent-ink: #C9D16A; --accent-soft: #2E3214; --card: #1F220B; --bg: #13150A; }
[data-cond="migraine"] .hero { background: radial-gradient(120% 90% at 85% -10%, rgba(134, 143, 36, .55), transparent 60%), radial-gradient(80% 60% at 0% 100%, rgba(134, 143, 36, .18), transparent 60%), linear-gradient(160deg, #2E3214, #1F220B 55%, #14160A); }
[data-cond="migraine"] .hero .kicker { color: #B8C04E; }
[data-cond="migraine"] .preview-bar { background: #1F220B; }
/* the "Which log" switcher in More */
.segs.stack { flex-direction: column; }
.segs.stack .seg { justify-content: flex-start; text-align: left; min-height: 64px; gap: 12px; }
.segs.stack .seg .emoji { font-size: 26px; line-height: 1; }
.segs.stack .seg small { margin-left: auto; font-weight: 500; font-size: 13px; opacity: .75; }
