/* Layout: a ship's bridge for your life. Navy masthead, big-button launch row, four status tiles, then personal help links. Detail pages share one card system. */
:root {
  --paper: #f7f9fc;
  --card: #ffffff;
  --ink: #0f1d33;
  --ink-soft: #3a4a63;
  --navy: #13325e;
  --navy-ink: #ffffff;
  --brass: #9a6d12;
  --flag: #c4302b;
  --sea: #1f6f8b;
  --line: #ccd6e4;
  --ok: #1d7a46;
  --ok-bg: #e3f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff4d9;
  --bad-bg: #fde8e6;
  --focus: #f2a900;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Atkinson Hyperlegible", Verdana, Arial, sans-serif;
  --base: 20px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0b1424; --card: #13213a; --ink: #eef3fa; --ink-soft: #b9c6d9;
  --navy: #0a1a33; --navy-ink: #ffffff; --brass: #e2b04a; --flag: #ff8a80; --sea: #6cc4e0;
  --line: #2b3d5c; --ok: #6fdc9b; --ok-bg: #12331f; --warn: #ffd27a; --warn-bg: #3a2f10; --bad-bg: #3d1a18; --focus: #ffc94a; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --paper: #0b1424; --card: #13213a; --ink: #eef3fa; --ink-soft: #b9c6d9;
  --navy: #0a1a33; --navy-ink: #ffffff; --brass: #e2b04a; --flag: #ff8a80; --sea: #6cc4e0;
  --line: #2b3d5c; --ok: #6fdc9b; --ok-bg: #12331f; --warn: #ffd27a; --warn-bg: #3a2f10; --bad-bg: #3d1a18; --focus: #ffc94a; color-scheme: dark;
}
:root.size-lg { --base: 23px; }
:root.size-xl { --base: 26px; }
:root.contrast {
  --paper: #ffffff; --card: #ffffff; --ink: #000000; --ink-soft: #000000; --navy: #000000;
  --brass: #6a4400; --flag: #a00000; --sea: #003f5c; --line: #000000; --ok: #005a20; --ok-bg: #ffffff;
  --warn: #6a4400; --warn-bg: #ffffff; --bad-bg: #ffffff; --focus: #0050ff; color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: var(--base); }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 1rem; line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--navy); }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; margin: 0; }
h2 { font-family: var(--display); font-weight: 800; font-size: 2.1rem; letter-spacing: .01em; text-transform: uppercase; }
h3 { font-size: 1.15rem; }
p { margin: 0; }
a { color: var(--sea); }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
button { font: inherit; cursor: pointer; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }

/* Masthead */
.mast { background: var(--navy); color: var(--navy-ink); }
.mast .wrap { display: flex; align-items: center; gap: 1rem; padding-block: .8rem; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 800; font-size: 2rem; letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; }
.brand .flagmark { width: 1.2rem; height: 1.2rem; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; border: 2px solid #fff; }
.brand .flagmark i:nth-child(1), .brand .flagmark i:nth-child(4) { background: #c4302b; }
.brand .flagmark i:nth-child(2), .brand .flagmark i:nth-child(3) { background: #f2c230; }
.tools { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.tools span { font-size: .8rem; opacity: .85; }
.tbtn { background: transparent; color: var(--navy-ink); border: 2px solid rgba(255,255,255,.55); border-radius: 8px; padding: .25rem .6rem; min-height: 44px; min-width: 44px; font-weight: 700; }
.tbtn[aria-pressed="true"] { background: #fff; color: #13325e; border-color: #fff; }

/* Nav */
nav.main { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--card); border-bottom: 2px solid var(--line); }
nav.main .wrap { display: flex; gap: .3rem; overflow-x: auto; padding-block: .5rem; }
nav.main a { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: .1rem; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .82rem; padding: .45rem .7rem; border-radius: 10px; min-height: 56px; justify-content: center; border: 2px solid transparent; }
nav.main a svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2; }
nav.main a:hover { border-color: var(--line); }
nav.main a[aria-current="page"] { background: var(--navy); color: var(--navy-ink); }

main { padding-block: 1.5rem 3rem; }
section.view { display: grid; gap: 1.5rem; }
.lede { color: var(--ink-soft); font-size: 1.05rem; max-width: 42em; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; min-width: 0; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 52px; padding: .5rem 1.1rem; border-radius: 10px; border: 2px solid var(--navy); background: var(--navy); color: var(--navy-ink); font-weight: 700; font-size: 1rem; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.on { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.btn.sm { min-height: 46px; font-size: .9rem; padding: .3rem .8rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: .8rem 1.2rem; border-radius: 12px; font-weight: 700; z-index: 20; max-width: calc(100% - 32px); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; white-space: nowrap; }
.pill.done { background: var(--ok-bg); color: var(--ok); }
.pill.attention { background: var(--warn-bg); color: var(--warn); }
.pill.todo { background: var(--bad-bg); color: var(--flag); }
.empty { color: var(--ink-soft); font-style: italic; }
.note-proto { font-size: .8rem; color: var(--ink-soft); text-align: center; padding-block: 1rem 2rem; }
.bar { height: .7rem; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.phone { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; user-select: all; }
.num { font-variant-numeric: tabular-nums; }

/* HOME DASHBOARD */
.hello { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 1.5rem; align-items: end; }
.hello h1 { font-family: var(--display); font-weight: 800; font-size: 2.8rem; text-transform: uppercase; letter-spacing: .01em; }
.hello p { color: var(--ink-soft); font-size: 1.05rem; }
.nextup { display: flex; gap: 1rem; align-items: center; background: var(--navy); color: var(--navy-ink); border-radius: 14px; padding: .8rem 1rem .8rem .8rem; text-decoration: none; }
.nextup .porthole { width: 4.2rem; height: 4.2rem; border-radius: 50%; border: 4px solid #e2b04a; display: grid; place-content: center; text-align: center; font-family: var(--display); font-size: 1.6rem; line-height: .9; }
.nextup .porthole small { display: block; font-family: var(--body); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; }
.nextup .porthole span { font-size: 1.6rem; opacity: 1; }
.nextup b { display: block; font-size: 1.05rem; }
.nextup span { font-size: .85rem; opacity: .9; }
.launch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
.launch button, .launch a { display: grid; justify-items: center; gap: .35rem; padding: 1rem .5rem; min-height: 7rem; background: var(--card); border: 2px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; font-weight: 700; text-align: center; font-size: .95rem; }
.launch button:hover, .launch a:hover { border-color: var(--navy); }
.launch .ic { width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-content: center; color: #fff; }
.launch .ic svg { width: 1.6rem; height: 1.6rem; stroke: currentColor; fill: none; stroke-width: 2; }
.launch small { font-weight: 400; color: var(--ink-soft); font-size: .78rem; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.tile { display: grid; gap: .8rem; align-content: start; }
.tile-head { display: flex; justify-content: space-between; gap: .8rem; align-items: start; flex-wrap: wrap; }
.tile-head h3 { font-size: 1.35rem; }
.tile .stat { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.tile .stat b { font-family: var(--display); font-size: 2.4rem; line-height: 1; font-weight: 800; }
.tile .stat span { color: var(--ink-soft); font-size: .9rem; }
.check { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .5rem; align-items: center; font-size: .95rem; }
.mark { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-content: center; font-weight: 800; font-size: .85rem; }
.mark.done { background: var(--ok-bg); color: var(--ok); }
.mark.attention { background: var(--warn-bg); color: var(--warn); }
.mark.todo { background: var(--bad-bg); color: var(--flag); }
.tile .btn { justify-self: start; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.helpgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.helpcard { display: grid; gap: .6rem; align-content: start; }
.helpcard h3 { display: flex; align-items: center; gap: .5rem; }
.helpcard h3 svg { width: 1.5rem; height: 1.5rem; stroke: var(--sea); fill: none; stroke-width: 2; flex: none; }
.svc .phone { white-space: nowrap; }
.svc { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .2rem .5rem; padding: .45rem 0; border-top: 1px solid var(--line); font-size: .95rem; }
.svc a { font-weight: 700; }
.svc small { color: var(--ink-soft); display: block; font-size: .8rem; }

/* Doc tables (estate) */
.doclist { display: grid; gap: 0; }
.doc { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) auto; gap: 1rem; align-items: center; padding: .9rem 0; border-top: 1px solid var(--line); }
.doc:first-child { border-top: 0; }
.doc h3 { font-size: 1.05rem; }
.doc .sub { color: var(--ink-soft); font-size: .88rem; }
.doc .where { font-size: .88rem; }
.doc .act { display: grid; gap: .4rem; justify-items: end; }
.callout { background: var(--warn-bg); border-radius: 12px; padding: .9rem 1.1rem; }

/* Health */
.meds li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); }
.meds li:first-child { border-top: 0; }
.meds time { font-weight: 700; font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: auto; display: block; overflow: visible; }
.spark .ln { fill: none; stroke: var(--sea); stroke-width: 2; }
.spark .goal { stroke: var(--ink-soft); stroke-dasharray: 4 4; stroke-width: 1; }
.spark .pt { fill: var(--sea); stroke: var(--card); stroke-width: 2; }
.spark .hit { fill: transparent; }
.spark text { fill: var(--ink-soft); font-size: 11px; font-family: var(--body); }
.spark .end { fill: var(--ink); font-weight: 700; font-size: 13px; }
.goals { display: grid; gap: .9rem; }
.goal-row { display: grid; gap: .3rem; }
.goal-row .row { justify-content: space-between; }

/* Money */
.hbars { display: grid; gap: .55rem; }
.hbar { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 4.5rem; gap: .7rem; align-items: center; font-size: .92rem; }
.hbar .track { height: 1rem; }
.hbar .track i { display: block; height: 100%; background: var(--sea); border-radius: 0 4px 4px 0; min-width: 4px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.bills li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .8rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); }
.bills li:first-child { border-top: 0; }
.acct { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.acct:first-child { border-top: 0; }
.acct b { font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.kpi b { display: block; font-family: var(--display); font-size: 2.2rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--ink-soft); font-size: .9rem; }

/* Today Aboard */
.program { background: var(--card); border: 3px solid var(--navy); border-radius: 18px; overflow: hidden; }
.program-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center; padding: 1.2rem 1.4rem; border-bottom: 3px double var(--navy); }
.porthole-lg { width: 6.2rem; height: 6.2rem; border-radius: 50%; border: 6px solid #b5831f; background: var(--navy); color: #fff; display: grid; place-content: center; text-align: center; box-shadow: inset 0 0 0 3px rgba(255,255,255,.25); }
.porthole-lg b { font-family: var(--display); font-size: 2.4rem; line-height: .9; display: block; }
.porthole-lg small { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.program-title { min-width: 0; }
.program-title .kicker { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--flag); font-weight: 700; }
.program-title h2 { font-size: 3.1rem; }
.program-title p { color: var(--ink-soft); }
.conditions { display: grid; gap: .25rem; font-size: .88rem; text-align: right; color: var(--ink-soft); }
.conditions b { color: var(--ink); }
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); border-bottom: 2px solid var(--line); }
.notes > div { padding: .9rem 1.4rem; border-right: 2px solid var(--line); }
.notes > div:last-child { border-right: 0; }
.highlight { background: var(--warn-bg); }
.sched { padding: .4rem 1.4rem 1.2rem; }
.period { font-family: var(--display); font-weight: 800; font-size: 1.6rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sea); margin: 1rem 0 .3rem; display: flex; align-items: center; gap: .8rem; }
.period::after { content: ""; flex: 1; border-top: 2px dotted var(--line); }
.event { display: grid; grid-template-columns: 6.2rem 1fr auto; gap: 1rem; align-items: start; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.event time { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.event .what { min-width: 0; }
.event .where { color: var(--ink-soft); font-size: .92rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .1rem .5rem; border-radius: 999px; border: 2px solid currentColor; margin-left: .4rem; vertical-align: middle; }
.tag.health { color: var(--flag); } .tag.social { color: var(--sea); } .tag.self { color: var(--ok); } .tag.home { color: var(--brass); }
.event .btn { min-height: 48px; font-size: .9rem; padding: .3rem .8rem; white-space: nowrap; }
.event.past { opacity: .55; }
.event.now { background: var(--ok-bg); margin: 0 -1.4rem; padding-left: 1.4rem; padding-right: 1.4rem; }
.event.now time::after { content: "Now"; display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ok); }
.program-foot { padding: .9rem 1.4rem; background: var(--navy); color: var(--navy-ink); display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; font-size: .9rem; }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cal-head h3 { font-family: var(--display); font-size: 1.8rem; text-transform: uppercase; min-width: 9ch; }
.cal-scroll { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(2.6rem, 1fr)); gap: 4px; min-width: 17rem; }
.cal .dow { font-weight: 700; text-align: center; font-size: .8rem; text-transform: uppercase; color: var(--ink-soft); padding: .3rem 0; }
.cal button { background: var(--card); border: 2px solid var(--line); border-radius: 10px; min-height: 4.2rem; padding: .3rem; text-align: left; display: flex; flex-direction: column; gap: .2rem; color: var(--ink); }
.cal button.other { opacity: .4; }
.cal button.today { border-color: #b5831f; border-width: 3px; }
.cal button[aria-pressed="true"] { background: var(--navy); color: var(--navy-ink); border-color: var(--navy); }
.cal .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 3px; flex-wrap: wrap; }
.dots i { width: .55rem; height: .55rem; border-radius: 50%; }
.d-health { background: var(--flag); } .d-social { background: var(--sea); } .d-self { background: var(--ok); } .d-home { background: var(--brass); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--ink-soft); }
.legend span { display: inline-flex; gap: .35rem; align-items: center; }
.cal-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.daylist ul { padding: 0; margin: .6rem 0 0; display: grid; gap: .6rem; }
.daylist li { list-style: none; display: grid; grid-template-columns: 5rem 1fr; gap: .6rem; }
form.add { display: grid; gap: .6rem; margin-top: 1rem; border-top: 2px solid var(--line); padding-top: 1rem; }
label { font-weight: 700; display: grid; gap: .25rem; }
input, select { font: inherit; font-weight: 400; min-height: 52px; padding: .5rem .7rem; border: 2px solid var(--ink-soft); border-radius: 10px; background: var(--card); color: var(--ink); width: 100%; }

/* People */
.person { display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; align-items: start; }
.avatar { width: 4rem; height: 4rem; border-radius: 50%; display: grid; place-content: center; font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: #fff; }
.person .role { color: var(--ink-soft); }
.person .meta { font-size: .9rem; display: grid; gap: .15rem; margin: .4rem 0 .7rem; }
.sos { border: 3px solid var(--flag); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.sos h3 { color: var(--flag); }
.svc-big { display: grid; gap: .3rem; }
.svc-big .who { font-weight: 700; font-size: 1.1rem; }
.svc-big p { color: var(--ink-soft); font-size: .92rem; }
.svc-big .tip { font-size: .85rem; background: var(--paper); border-radius: 8px; padding: .4rem .6rem; }

/* Decisions / lifestyle / resources */
.dec-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.dec-card { text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; color: var(--ink); display: grid; gap: .35rem; }
.dec-card:hover, .dec-card[aria-pressed="true"] { border-color: var(--navy); border-width: 3px; padding: calc(1rem - 1px) calc(1.1rem - 1px); }
.steps { display: grid; gap: .6rem; padding: 0; margin: .8rem 0 0; }
.steps li { list-style: none; display: grid; grid-template-columns: 2.6rem 1fr; gap: .8rem; align-items: start; padding: .6rem; border-radius: 10px; border: 2px solid var(--line); }
.steps li.done { background: var(--ok-bg); border-color: var(--ok); }
.steps .chk { width: 2.6rem; height: 2.6rem; border-radius: 8px; border: 3px solid var(--ink-soft); background: var(--card); display: grid; place-content: center; font-weight: 800; color: var(--ok); font-size: 1.2rem; }
.steps li.done .chk { border-color: var(--ok); }
.steps small { color: var(--ink-soft); display: block; }
.meter { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.meter-bar { flex: 1; min-width: 10rem; height: 1rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.weigh { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.weigh ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.chip { min-height: 48px; padding: .3rem .9rem; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700; }
.chip[aria-pressed="true"] { background: var(--sea); border-color: var(--sea); color: #fff; }
.res-filter { display: flex; gap: .5rem; flex-wrap: wrap; }
.res { display: grid; gap: .3rem; }
.res .org { font-weight: 700; font-size: 1.05rem; }
.res p { color: var(--ink-soft); font-size: .95rem; }
.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.more a { text-decoration: none; color: var(--ink); display: grid; gap: .25rem; }
.more a:hover { border-color: var(--navy); }
.more a p { color: var(--ink-soft); font-size: .92rem; }

@media (max-width: 900px) {
  .launch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .helpgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --base: 18px; } :root.size-lg { --base: 21px; } :root.size-xl { --base: 24px; }
  .hello { grid-template-columns: 1fr; } .hello h1 { font-size: 2.2rem; }
  .launch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles, .helpgrid, .more, .kpis, .dec-list, .cal-grid, .weigh { grid-template-columns: 1fr; }
  .doc { grid-template-columns: 1fr; gap: .4rem; } .doc .act { justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; }
  .program-head { grid-template-columns: auto 1fr; }
  .conditions { grid-column: 1 / -1; text-align: left; grid-template-columns: 1fr 1fr; }
  .program-title h2 { font-size: 2.3rem; }
  .porthole-lg { width: 5rem; height: 5rem; } .porthole-lg b { font-size: 1.9rem; }
  .event { grid-template-columns: 4.8rem 1fr; } .event .btn { grid-column: 2; justify-self: start; }
  .notes > div { border-right: 0; border-bottom: 2px solid var(--line); }
  .tools { margin-left: 0; }
  .sched { padding-inline: 1rem; } .event.now { margin: 0 -1rem; padding-inline: 1rem; }
  .hbar { grid-template-columns: 5.5rem minmax(0, 1fr) 4rem; }
  .meds li { grid-template-columns: 4.6rem minmax(0, 1fr); } .meds li .btn { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- App additions ---- */
.demo-bar { background: var(--warn-bg); color: var(--ink); font-size: .9rem; }
.demo-bar .wrap { padding-block: .5rem; }
.acct-btn { color: var(--navy-ink); text-decoration: none; font-weight: 700; border: 2px solid rgba(255,255,255,.55); border-radius: 8px; padding: .4rem .7rem; min-height: 44px; display: inline-flex; align-items: center; }
.auth { max-width: 30rem; margin: 1rem auto; display: grid; gap: 1rem; }
.auth h1 { font-family: var(--display); font-weight: 800; font-size: 2.6rem; text-transform: uppercase; }
.auth form { display: grid; gap: .8rem; }
.tabs { display: flex; gap: .5rem; }
.tabs button { flex: 1; }
.msg { padding: .7rem 1rem; border-radius: 10px; font-weight: 700; }
.msg.err { background: var(--bad-bg); color: var(--flag); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.linkbtn { background: none; border: 0; color: var(--sea); text-decoration: underline; padding: .3rem 0; min-height: 44px; font-weight: 700; justify-self: start; }
form.inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .7rem; align-items: end; margin-top: 1rem; border-top: 2px solid var(--line); padding-top: 1rem; }
form.inline .btn { width: 100%; }
form.inline .wide { grid-column: 1 / -1; }
.check-label { display: flex; gap: .5rem; align-items: center; font-weight: 700; min-height: 52px; }
.check-label input { width: 1.6rem; height: 1.6rem; min-height: 0; }
.btn.danger { color: var(--flag); border-color: var(--flag); background: transparent; }
.btn.danger.armed { background: var(--flag); color: #fff; }
.editbox { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .7rem; align-items: end; background: var(--paper); padding: .8rem; border-radius: 10px; }
.loading { padding: 3rem 0; text-align: center; color: var(--ink-soft); }
.daylist li .btn { justify-self: start; }
.daylist li { grid-template-columns: 5rem 1fr auto; align-items: center; }
.sched .empty { padding: 1rem 0; }
