/* Parkie Pal. One phone-width column, a fixed bottom tab bar, big targets everywhere.
   Built for people with Parkinson's: large type, high contrast, generous gaps between
   anything tappable, no gestures, no small print. */
:root {
  --bg: #EAF0F7;
  --surface: #FFFFFF;
  --raised: #F4F7FB;
  --ink: #14243A;
  --muted: #4B5D74;
  --line: #C8D4E3;
  --accent: #2560A3;
  --accent-ink: #FFFFFF;
  --s1: #B84A35; --s2: #C9772A; --s3: #A8922A; --s4: #4E8E51; --s5: #1C7A6D;
  --due: #B9650F; --due-bg: #FCEFD9;
  --miss: #B84A35; --miss-bg: #F8E3DE;
  --ok: #1C7A6D; --ok-bg: #DDF0EC;
  --on-score: #FFFFFF;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 22px;
  --tap: 3.4rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1626; --surface: #16223A; --raised: #1C2A44; --ink: #EDF2F9; --muted: #A6B5CA;
    --line: #2F3E58; --accent: #8EB9EE; --accent-ink: #0D1626;
    --s1: #E0735C; --s2: #E9A15A; --s3: #D8C35E; --s4: #84BF86; --s5: #45B3A2;
    --due: #F0B060; --due-bg: #3A2C17; --miss: #EE8C78; --miss-bg: #3D2420; --ok: #6FD0BE; --ok-bg: #173631;
    --on-score: #0D1626;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: clamp(17px, 5.15vw, 20px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[data-size="xl"] { font-size: clamp(19.5px, 5.95vw, 23px); }
html, body { height: 100%; }
body {
  overflow: hidden;
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body);
  font-size: 1rem; line-height: 1.45; -webkit-tap-highlight-color: transparent;
  min-height: 100vh; min-height: 100dvh;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
/* The page never scrolls; #scroller does, and the tab bar sits beneath it in normal flow. */
#app { height: 100%; height: 100dvh; display: flex; flex-direction: column; }
.scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.screen {
  max-width: 34rem; margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(env(safe-area-inset-top, 0px) + 1.1rem) 1.6rem;
  display: flex; flex-direction: column; gap: 1.1rem;
}
.screen.no-tabs { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 2rem); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.title { font-family: var(--display); font-weight: 400; font-size: min(2.1rem, 10vw); line-height: 1.08; overflow-wrap: break-word; }
.subtitle { margin: .3rem 0 0; color: var(--muted); font-size: 1rem; font-variant-numeric: tabular-nums; }
.section-title { font-size: 1.15rem; font-weight: 800; margin-top: .4rem; }
.lede { color: var(--muted); margin: 0; }

.card { background: var(--surface); border-radius: var(--radius); padding: clamp(.7rem, 3.6vw, 1rem); display: flex; flex-direction: column; gap: .9rem; }

.btn {
  min-height: var(--tap); border-radius: 18px; border: 0; padding: .6rem 1.2rem;
  font-weight: 800; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--accent); color: var(--accent-ink); text-align: center;
}
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--surface); color: var(--ink); border: 2px solid var(--line); }
.btn.quiet { background: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; min-height: 2.6rem; padding-inline: .4rem; }
.btn.danger { background: transparent; color: var(--miss); border: 2px solid currentColor; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; }
.row > .btn { flex: 1 1 10rem; }

label.field { display: flex; flex-direction: column; gap: .4rem; font-weight: 700; }
.input {
  min-height: var(--tap); border: 2px solid var(--line); border-radius: 16px; padding: .5rem .9rem;
  background: var(--raised); font-size: 1.2rem; width: 100%;
}
.input:focus { border-color: var(--accent); outline: none; }
.input.code { letter-spacing: .35em; font-weight: 800; font-variant-numeric: tabular-nums; }
.help { color: var(--muted); font-size: .9rem; font-weight: 500; }
.error { background: var(--miss-bg); color: var(--miss); border-radius: 14px; padding: .75rem .9rem; font-weight: 700; margin: 0; }
.notice { background: var(--ok-bg); color: var(--ok); border-radius: 14px; padding: .75rem .9rem; font-weight: 700; margin: 0; }

/* ---------- boot + sign-in ---------- */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 1rem; color: var(--muted); }
.mark { width: 4.6rem; height: 4.6rem; border-radius: 22%; background: #fff url(/icons/logo.png) center / 82% no-repeat; box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(20, 36, 58, .10); flex: none; }
.welcome { padding-top: 2.4rem; gap: 1.4rem; }
.welcome .mark { width: 5.6rem; height: 5.6rem; }
.welcome .title { font-size: 2.7rem; }
.tabs-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface); border-radius: 18px; padding: .3rem; gap: .3rem; }
.tabs-toggle button { min-height: 3rem; border: 0; border-radius: 14px; background: transparent; font-weight: 800; color: var(--muted); }
.tabs-toggle button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- header with day nav ---------- */
.dayhead { display: flex; align-items: center; gap: .5rem; }
.dayhead .title { font-size: min(2.1rem, 9.2vw); }
.dayhead .grow { flex: 1; min-width: 0; text-align: center; }
.round {
  width: clamp(48px, 13vw, var(--tap)); height: clamp(48px, 13vw, var(--tap)); flex: none; border-radius: 50%; border: 2px solid var(--line);
  background: var(--surface); display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; line-height: 1;
}
.round[disabled] { opacity: .3; cursor: default; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; }
.wd { border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .45rem 0; border-radius: 16px; min-height: 4.4rem; }
.wd .l { font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.wd .dot { width: min(2.05rem, 9.5vw); height: min(2.05rem, 9.5vw); border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; font-size: .9rem; font-weight: 800; color: var(--on-score); font-variant-numeric: tabular-nums; }
.wd .dot.has { border: 0; }
.wd[aria-current="date"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- check-in cards ---------- */
.slot { border: 3px solid transparent; }
.slot.now { border-color: var(--accent); }
.slot-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.slot-head h2 { font-size: 1.3rem; font-weight: 800; }
.slot-head .t { color: var(--muted); font-size: .95rem; }
.pill { margin-left: auto; font-size: .85rem; font-weight: 800; border-radius: 999px; padding: .2rem .7rem; }
.pill.now { background: var(--accent); color: var(--accent-ink); }
.scores { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(.3rem, 1.6vw, .5rem); }
.sc {
  min-height: 4.6rem; border-radius: 18px; border: 2px solid var(--line); background: var(--raised);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; padding: .3rem 0;
  font-variant-numeric: tabular-nums;
}
.sc b { font-size: 1.7rem; line-height: 1; font-weight: 800; }
.sc span { font-size: min(.72rem, 3.5vw); font-weight: 700; color: var(--muted); }
.sc[aria-checked="true"] { border-color: transparent; color: var(--on-score); }
.sc[aria-checked="true"] span { color: inherit; }
.sc[data-v="1"][aria-checked="true"] { background: var(--s1); }
.sc[data-v="2"][aria-checked="true"] { background: var(--s2); }
.sc[data-v="3"][aria-checked="true"] { background: var(--s3); }
.sc[data-v="4"][aria-checked="true"] { background: var(--s4); }
.sc[data-v="5"][aria-checked="true"] { background: var(--s5); }
.sc:active { transform: scale(.95); }
.sc[disabled] { cursor: default; }
.sc[disabled]:active { transform: none; }
.note { width: 100%; min-height: 5.2rem; resize: vertical; border: 2px solid var(--line); border-radius: 16px; padding: .7rem .9rem; background: var(--raised); font-size: 1.1rem; line-height: 1.45; }
.note:focus { border-color: var(--accent); outline: none; }
.note::placeholder { color: var(--muted); }
.status { text-align: center; color: var(--muted); font-size: .9rem; font-weight: 600; min-height: 1.4em; margin: 0; }

/* ---------- tablets ---------- */
.dose { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; align-items: center; border-radius: var(--radius); padding: 1rem; background: var(--surface); border: 3px solid transparent; }
.dose .time { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; grid-row: span 2; min-width: 4.4rem; }
.dose .what { font-size: 1.2rem; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.dose .dose-sub { color: var(--muted); font-size: .95rem; }
.dose .act { grid-column: 1 / -1; margin-top: .6rem; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.dose .act .btn { flex: 1 1 9rem; }
.dose.due { border-color: var(--due); background: var(--due-bg); }
.dose.miss { border-color: var(--miss); background: var(--miss-bg); }
.dose.done { background: var(--ok-bg); }
.tag { font-size: .85rem; font-weight: 800; border-radius: 999px; padding: .15rem .7rem; display: inline-block; white-space: nowrap; margin-top: .3rem; }
.dose .dose-sub { display: flex; flex-wrap: wrap; align-items: center; column-gap: .6rem; }
.tag.due { background: var(--due); color: var(--surface); }
.tag.miss { background: var(--miss); color: var(--surface); }
.tag.done { background: var(--ok); color: var(--surface); }
.donetext { font-weight: 800; color: var(--ok); font-size: 1.05rem; flex: 1 1 auto; }

.medrow { display: flex; align-items: center; gap: .8rem; padding: .8rem 0; border-top: 2px solid var(--line); }
.medrow:first-of-type { border-top: 0; }
.medrow .grow { flex: 1; min-width: 0; }
.medrow b { display: block; font-size: 1.1rem; overflow-wrap: anywhere; }
.medrow .help { font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { min-height: 3rem; padding: .3rem 1rem; border-radius: 999px; border: 2px solid var(--line); background: var(--raised); font-weight: 800; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: .5rem; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip .x { font-size: 1.3rem; line-height: 1; }

/* ---------- full-screen tablet alert ---------- */
.alert {
  position: fixed; inset: 0; z-index: 50; background: var(--due-bg); color: var(--ink);
  display: flex; flex-direction: column; justify-content: center; gap: 1.2rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1.5rem) max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 1.5rem) max(20px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
}
.alert .inner { max-width: 32rem; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 1.2rem; }
.alert .big { font-family: var(--display); font-size: 2.6rem; line-height: 1.05; font-weight: 400; }
.alert ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.alert li { background: var(--surface); border-radius: 18px; padding: .9rem 1rem; font-size: 1.3rem; font-weight: 800; }
.alert li span { display: block; font-size: 1rem; font-weight: 600; color: var(--muted); }
.alert .btn { min-height: 4.2rem; font-size: 1.25rem; }
.alert .btn.go { background: var(--ok); color: var(--surface); }

/* ---------- insights ---------- */
.ranges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; background: var(--surface); padding: .3rem; border-radius: 18px; }
.ranges button { min-height: 3rem; border: 0; border-radius: 14px; background: none; font-weight: 800; color: var(--muted); font-size: .9rem; line-height: 1.1; padding: .2rem; }
.ranges button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.hero { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; }
.hero .num { width: 6.2rem; height: 6.2rem; border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem; font-weight: 800; color: var(--on-score); font-variant-numeric: tabular-nums; }
.hero .num.empty { background: var(--raised); color: var(--muted); border: 2px dashed var(--line); }
.hero h2 { font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.hero .k { display: block; font-size: .9rem; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.hero p { margin: .2rem 0 0; color: var(--muted); }
.facts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .7rem; }
.facts li { font-size: 1.05rem; font-weight: 600; padding-left: 1.4rem; position: relative; }
.facts li::before { content: ""; position: absolute; left: 0; top: .5em; width: .6rem; height: .6rem; border-radius: 50%; background: var(--accent); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-family: var(--body); font-weight: 700; }
.chart .grid { stroke: var(--line); stroke-width: 1.5; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: .12; }
.chart .val { fill: var(--ink); font-weight: 800; }
.bars { display: flex; flex-direction: column; gap: .6rem; }
.bar { display: grid; grid-template-columns: minmax(0, 6.4rem) minmax(2rem, 1fr) 2.6rem; align-items: center; gap: .6rem; }
.bar .lab { font-weight: 700; font-size: .95rem; }
.bar .track { height: 1.6rem; background: var(--raised); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; }
.bar .v { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.bar.none .v { color: var(--muted); font-weight: 600; }
.mix { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; align-items: end; }
.mix .col { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.mix .stick { width: 100%; border-radius: 12px 12px 6px 6px; min-height: .4rem; }
.mix .c { font-weight: 800; font-variant-numeric: tabular-nums; }
.mix .w { font-size: .75rem; font-weight: 700; color: var(--muted); }
.empty-state { text-align: center; color: var(--muted); padding: 1rem .5rem; }

/* ---------- more ---------- */
.list { display: flex; flex-direction: column; gap: .7rem; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.setting .grow { flex: 1 1 12rem; min-width: 0; }
.setting b { display: block; font-size: 1.05rem; }
.linkbox { background: var(--raised); border-radius: 14px; padding: .7rem .9rem; font-size: .95rem; font-weight: 600; overflow-wrap: anywhere; user-select: all; }
.banner { background: var(--accent); color: var(--accent-ink); border-radius: 18px; padding: .8rem 1rem; font-weight: 700; }

/* ---------- bottom tab bar ---------- */
.tabbar {
  position: relative; flex: none; z-index: 20;
  background: var(--surface); border-top: 2px solid var(--line);
  padding: .35rem 8px calc(env(safe-area-inset-bottom, 0px) + .35rem);
}
.tabbar .in { max-width: 34rem; margin: 0 auto; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: .3rem; }
.tabbar button {
  border: 0; background: none; min-height: 4.1rem; border-radius: 16px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .15rem; color: var(--muted); font-weight: 800; font-size: .85rem; position: relative;
}
.tabbar svg { width: 1.7rem; height: 1.7rem; }
.tabbar button[aria-current="page"] { color: var(--accent); background: var(--raised); }
.tabbar .badge { position: absolute; top: .35rem; right: calc(50% - 1.5rem); width: .8rem; height: .8rem; border-radius: 50%; background: var(--due); border: 2px solid var(--surface); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 5.8rem); z-index: 40;
  background: var(--ink); color: var(--bg); font-weight: 700; border-radius: 16px; padding: .8rem 1.1rem; width: max-content; max-width: calc(100% - 32px);
  display: flex; gap: 1rem; align-items: center;
}
.toast button { border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline; min-height: 2.6rem; }

@media (prefers-reduced-motion: no-preference) {
  .sc, .btn { transition: transform .1s ease, background-color .15s ease; }
}

/* ---------- check-in details ---------- */
.sub-q { display: flex; flex-direction: column; gap: .5rem; }
.sub-q .q { font-weight: 800; font-size: 1rem; }
.states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.3rem, 1.6vw, .5rem); }
.st {
  min-height: 4.2rem; border-radius: 16px; border: 2px solid var(--line); background: var(--raised);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; padding: .3rem .2rem; text-align: center;
}
.st b { font-size: 1.15rem; font-weight: 800; line-height: 1.1; }
.st span { font-size: .72rem; font-weight: 700; color: var(--muted); line-height: 1.2; }
.st[aria-checked="true"] { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.st[aria-checked="true"] span { color: inherit; }
.st:active { transform: scale(.96); }

/* ---------- falls ---------- */
.fall { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.fall .grow { flex: 1 1 8rem; min-width: 0; }
.fall .grow b { display: block; font-size: 1.05rem; }
.fall .grow span { display: block; overflow-wrap: anywhere; }
.fk { font-size: .85rem; font-weight: 800; border-radius: 999px; padding: .2rem .7rem; white-space: nowrap; }
.fk.fall { background: var(--miss); color: var(--surface); }
.fk.near { background: var(--due); color: var(--surface); }

/* ---------- insights extras ---------- */
.split { display: flex; height: 1.8rem; border-radius: 999px; overflow: hidden; gap: 3px; background: var(--raised); }
.split span { display: block; min-width: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-weight: 600; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .4rem; vertical-align: -.05rem; }
.noterow { display: flex; gap: .8rem; align-items: flex-start; }
.ball { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--on-score); }

/* ---------- appointment summary ---------- */
.sum-head .k, .tile .k { display: block; font-size: .85rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.tile { background: var(--surface); border-radius: 18px; padding: .9rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.tile b { font-size: 2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile b small { font-size: 1rem; color: var(--muted); }
.tile span { color: var(--muted); font-weight: 600; font-size: .9rem; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .3rem .4rem; }
.tbl td { padding: .55rem .4rem; border-top: 2px solid var(--line); vertical-align: top; }
.tbl td .help { font-size: .85rem; }
.tbl .n { text-align: right; white-space: nowrap; width: 1%; }
.tbl th.n { padding-left: .8rem; }

/* ---------- check-in times editor ---------- */
.slotrow { display: grid; grid-template-columns: 1fr; gap: .5rem; padding-bottom: .4rem; border-bottom: 2px solid var(--line); }
.slotrow:last-of-type { border-bottom: 0; }
@media (min-width: 400px) { html:not([data-size="xl"]) .slotrow { grid-template-columns: 1fr 8.5rem; align-items: end; border-bottom: 0; padding-bottom: 0; } }

/* ---------- printing the summary ---------- */
@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --surface: #fff; --raised: #f3f6fa; --ink: #000; --muted: #333; --line: #bbb; color-scheme: light; }
  html { font-size: 12pt; }
  html, body { height: auto; overflow: visible; }
  #app { height: auto; display: block; }
  .scroll { overflow: visible; }
  body { background: #fff; }
  .tabbar, .no-print, .toast, .alert { display: none !important; }
  .screen { max-width: none; padding: 0; gap: .6rem; }
  .card, .tile { border: 1px solid #bbb; break-inside: avoid; padding: .6rem .8rem; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .title { font-size: 1.8rem; }
  .ball, .fk, .split span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- phone quirks ---------- */
/* No double-tap zoom or 300ms delay on controls: matters with a tremor. */
button, input, textarea, label, .sc, .st, .chip { touch-action: manipulation; }
/* iPhone Safari draws date and time boxes its own way: keep them full size and left-aligned. */
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; display: block; text-align: left; min-width: 0; }
input::-webkit-date-and-time-value { text-align: left; margin: 0; }
/* Labels inside buttons never push the button wider than its column. */
.sc span, .st span, .st b { max-width: 100%; }
.sc span { font-size: min(.72rem, 3.4vw); }
.st span { font-size: min(.72rem, 3.4vw); }
.st b { font-size: min(1.15rem, 5vw); }
.tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: min(.85rem, 4vw); }
@media (orientation: landscape) and (max-height: 500px) {
  .tabbar button { min-height: 3.2rem; flex-direction: row; gap: .4rem; }
  .alert .big { font-size: 1.8rem; }
}

/* ---------- edit a check-in in place ---------- */
.slot-head .edit {
  margin-left: auto; min-height: 2.75rem; min-width: 4.2rem; padding: .3rem .9rem; border-radius: 999px;
  border: 2px solid var(--line); background: var(--raised); color: var(--accent); font-weight: 800; font-size: .9rem;
}
.slot-head .pill + .edit { margin-left: .5rem; }
.inline-edit { gap: .7rem; }

/* ---------- credit ---------- */
.credit { margin: .4rem 0 0; text-align: center; color: var(--muted); font-size: .85rem; letter-spacing: .02em; }
.credit b { color: var(--ink); font-weight: 800; }

/* ---------- install guide ---------- */
.guide { gap: 1.2rem; padding-top: calc(env(safe-area-inset-top, 0px) + 1.6rem); }
.guide .title { font-size: min(2.3rem, 10vw); }
.k-eyebrow { margin: 0 0 .4rem; font-size: .85rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.big-lede { font-size: 1.1rem; margin-top: .6rem; }
.gsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; counter-reset: g; }
.gstep {
  counter-increment: g; position: relative; display: grid; grid-template-columns: 3.4rem 1fr; gap: .9rem; align-items: center;
  background: var(--surface); border-radius: 20px; padding: .9rem 1rem .9rem .9rem; font-size: 1.1rem; line-height: 1.4;
}
.gstep::before {
  content: counter(g); position: absolute; top: -.45rem; left: -.35rem; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .95rem; display: grid; place-items: center;
}
.gicon { width: 3.4rem; height: 3.4rem; border-radius: 16px; background: var(--raised); color: var(--accent); display: grid; place-items: center; border: 2px solid var(--line); }
.gicon svg { width: 1.9rem; height: 1.9rem; }
.kbd { display: inline-grid; place-items: center; width: 1.7rem; height: 1.5rem; vertical-align: -.35rem; border: 2px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--accent); }
.kbd svg { width: 1.1rem; height: 1.1rem; }
.btn.big { min-height: 4.4rem; font-size: 1.2rem; }
.btn.big svg { width: 1.6rem; height: 1.6rem; flex: none; }

/* ---------- family notes ---------- */
.fnote { background: var(--raised); border-radius: 16px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .25rem; border-left: 5px solid var(--accent); }
.fnote .who { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
.fnote .who b { font-size: 1.05rem; }
.fnote p { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.fnote .btn.quiet { align-self: flex-start; padding-inline: 0; }

/* ---------- doctor codes and clinician view ---------- */
.codebox { background: var(--raised); border: 2px dashed var(--accent); border-radius: 18px; padding: 1rem; text-align: center; display: flex; flex-direction: column; gap: .2rem; }
.codebox .k { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.codebox b { font-size: min(2.2rem, 9.5vw); letter-spacing: .1em; white-space: nowrap; font-variant-numeric: tabular-nums; user-select: all; }
.doc-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; background: var(--surface); border-radius: 16px; padding: .6rem .6rem .6rem 1rem; }
.doc-bar span { flex: 1 1 12rem; min-width: 0; }
.daytbl td { font-size: .95rem; }
@media (min-width: 900px) {
  .screen.summary { max-width: 52rem; }
  .screen.summary .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- activity ---------- */
.act-head { display: flex; align-items: center; gap: .6rem; }
.act-head .pill { margin-left: auto; background: var(--ok-bg); color: var(--ok); }
.act-week { display: flex; flex-direction: column; gap: .4rem; background: var(--raised); border-radius: 16px; padding: .8rem .9rem; }
.act-week-top { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.act-week-top span { color: var(--muted); font-weight: 700; }
.act-week .track { display: block; height: 1.2rem; background: var(--surface); border-radius: 999px; overflow: hidden; border: 2px solid var(--line); }
.act-week .fill { height: 100%; background: var(--s5); border-radius: 999px; }
.act-row { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; background: var(--raised); border-radius: 16px; }
.act-row .grow { flex: 1; min-width: 0; }
.act-row b { display: block; font-size: 1.1rem; }
.act-row .help { overflow-wrap: anywhere; }
.act-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.act-kinds .st { min-height: 3.4rem; }
.act-kinds .st b { font-size: min(1.05rem, 4.6vw); }
.act-form { gap: 1rem; }
.goal-track { position: relative; }
.goal-track::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: var(--goal); width: 3px; background: var(--ink); opacity: .55; border-radius: 2px; }
.act-form .states .st b { font-size: min(1.05rem, 4.1vw); }
.act-form .states .st span { font-size: min(.72rem, 3.1vw); }

/* ---------- collapsible symptoms ---------- */
.sym-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%;
  min-height: 3.2rem; padding: .5rem .9rem; border-radius: 16px; border: 2px solid var(--line); background: var(--raised);
  font-weight: 800; font-size: 1rem; text-align: left;
}
.sym-toggle .sym-count { color: var(--accent); font-weight: 800; margin-left: .3rem; white-space: nowrap; }
.sym-arrow { flex: none; color: var(--accent); font-size: .9rem; font-weight: 800; display: inline-flex; align-items: center; gap: .35rem; }
.sym-arrow::after { content: ""; width: .55rem; height: .55rem; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.sym-toggle[aria-expanded="true"] .sym-arrow::after { transform: rotate(-135deg) translateY(-2px); }

/* 13 activities in two columns: the last one spans the row so nothing sits alone */
.act-kinds .st:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- activity extra detail ---------- */
.act-more { gap: 1rem; padding: .2rem 0 0; }
.q-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.unit { display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--raised); border: 2px solid var(--line); border-radius: 999px; padding: 2px; }
.unit button { min-height: 2.75rem; min-width: 4.2rem; border: 0; border-radius: 999px; background: transparent; font-weight: 800; color: var(--muted); padding: 0 .8rem; }
.unit button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
