/* ---------------------------------------------------------------------------
   Palette. Session-kind hues are validated for mutual separation (OKLab ΔE,
   normal + CVD) against each other and against both surfaces. Every chip also
   carries an uppercase text label, so colour reinforces identity, never carries
   it alone.
   --------------------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  --ground: #f7f7f9;
  --raised: #ffffff;
  --sunk: #eceef2;
  --hairline: #dcdfe6;
  --hairline-soft: #e9ebf0;
  --ink: #14161c;
  --ink-2: #4e5460;
  --ink-3: #7b8291;

  --accent: #d6472a;
  --accent-hot: #f0532f;
  --accent-ink: #ffffff;
  --accent-soft: #fdeae5;

  --run: #0089ad;        --run-soft: #e0f2f8;
  --strength: #9147cc;   --strength-soft: #f1e8fb;
  --cardio: #1f7a42;     --cardio-soft: #e2f2e7;
  --prehab: #9e6d08;     --prehab-soft: #f9efdc;
  --bp: #c13d86;         --bp-soft: #fce8f3;
  --rest: #7b8291;       --rest-soft: #eceef2;

  --ok: #1f7a42;         --ok-soft: #e2f2e7;
  --warn: #9e6d08;       --warn-soft: #f9efdc;
  --stop: #c0392b;       --stop-soft: #fbe9e7;

  --f-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --f-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-data: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --pad: 1.05rem;
  --tabbar-h: 3.6rem;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0b0d12;
    --raised: #151922;
    --sunk: #10131a;
    --hairline: #262c39;
    --hairline-soft: #1d222c;
    --ink: #eef0f5;
    --ink-2: #a6adbd;
    --ink-3: #767e90;

    --accent: #ff7a55;
    --accent-hot: #ff9070;
    --accent-ink: #14161c;
    --accent-soft: #2e1a14;

    --run: #35c4e8;        --run-soft: #102a33;
    --strength: #cb8bf5;   --strength-soft: #241833;
    --cardio: #4dc47e;     --cardio-soft: #10281b;
    --prehab: #e0a828;     --prehab-soft: #2b2110;
    --bp: #f072b4;         --bp-soft: #301526;
    --rest: #767e90;       --rest-soft: #171b24;

    --ok: #4dc47e;         --ok-soft: #10281b;
    --warn: #e0a828;       --warn-soft: #2b2110;
    --stop: #ff6b6b;       --stop-soft: #331314;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

button { font: inherit; color: inherit; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }

.view {
  padding: calc(env(safe-area-inset-top) + 1.1rem) var(--pad)
           calc(var(--tabbar-h) + max(env(safe-area-inset-bottom), 8px) + 1.5rem);
  max-width: 46rem;
  margin: 0 auto;
  outline: none;
  transition: transform .2s cubic-bezier(.2, .8, .3, 1);
}
.view.pulling { transition: none; }

/* ---------------------------------------------------------- pull to refresh */
.ptr {
  position: fixed; top: 0; left: 50%; z-index: 60;
  width: 34px; height: 34px; margin-left: -17px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--raised); border: 1px solid var(--hairline);
  color: var(--accent); opacity: 0; pointer-events: none;
  transform: translateY(-46px);
}
.ptr svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ptr .ptr-spin { display: none; }
.ptr.ready .ptr-icon { transform: rotate(180deg); }
.ptr .ptr-icon { transition: transform .18s ease; }
.ptr.busy .ptr-icon { display: none; }
.ptr.busy .ptr-spin { display: block; animation: ptrspin .7s linear infinite; }
@keyframes ptrspin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex;
  background: var(--raised);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--hairline);
  /* Always keep a little breathing room, even with no home indicator. */
  padding: 0 0 max(env(safe-area-inset-bottom), 8px);
}
.tab {
  appearance: none; background: none; border: 0; padding: 0;
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; height: var(--tabbar-h); color: var(--ink-3); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tab svg {
  width: 22px; height: 22px; flex: none; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.tab span {
  font-size: .625rem; line-height: 1; letter-spacing: .02em;
  font-family: var(--f-body); font-weight: 600; text-transform: none;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 8px; }

/* ---------------------------------------------------------- header */
.hdr { margin-bottom: 1.2rem; }
.eyebrow {
  font-family: var(--f-data); font-size: .66rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.hdr h1 { font-size: 1.75rem; margin-top: .18rem; letter-spacing: -.01em; }
.hdr .sub { color: var(--ink-2); font-size: .92rem; margin-top: .3rem; }

/* ---------------------------------------------------------- cards */
.card {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
}
.card-head {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto;
  gap: .8rem; align-items: center;
  padding: .9rem 1rem; width: 100%;
  background: none; border: 0; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.card-text { min-width: 0; }
.card-titlerow { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.card-title { font-family: var(--f-display); font-size: 1.08rem; line-height: 1.25; }
.card-sub {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; color: var(--ink-2); font-size: .82rem; margin-top: .22rem; line-height: 1.4;
}
.card.open .card-sub { display: none; }
.chev { color: var(--ink-3); transition: transform .18s ease; }
.chev svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.card.open .chev { transform: rotate(90deg); }

.card-body { display: none; padding: 0 1rem 1.1rem; border-top: 1px solid var(--hairline-soft); }
.card.open .card-body { display: block; }
.card-summary { color: var(--ink-2); font-size: .9rem; margin: .9rem 0 0; }

/* completion dot */
.dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--hairline); background: var(--sunk);
  display: grid; place-items: center; flex: none; padding: 0; cursor: pointer;
}
.dot svg { width: 14px; height: 14px; fill: none; stroke: var(--ink-3); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.dot[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.dot[aria-pressed="true"] svg { stroke: #fff; }
.dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.kind {
  font-family: var(--f-data); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .16rem .4rem; border-radius: 3px; font-weight: 600; white-space: nowrap;
}
.kind.run { color: var(--run); background: var(--run-soft); }
.kind.strength { color: var(--strength); background: var(--strength-soft); }
.kind.cardio { color: var(--cardio); background: var(--cardio-soft); }
.kind.prehab { color: var(--prehab); background: var(--prehab-soft); }
.kind.bp { color: var(--bp); background: var(--bp-soft); }
.kind.rest { color: var(--rest); background: var(--rest-soft); }

/* Left edge stripe so each card is identifiable before the chip is read. */
.card { position: relative; }
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--stripe, transparent);
}
.card.k-run { --stripe: var(--run); }
.card.k-strength { --stripe: var(--strength); }
.card.k-cardio { --stripe: var(--cardio); }
.card.k-prehab { --stripe: var(--prehab); }
.card.k-bp { --stripe: var(--bp); }
.card.k-rest { --stripe: var(--rest); }
.card.done-all { border-color: color-mix(in srgb, var(--ok) 40%, var(--hairline)); }

/* ---------------------------------------------------------- exercise rows */
.sec-title {
  font-family: var(--f-data); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin: 1.1rem 0 .4rem; font-weight: 600;
}
.ex-row {
  display: grid; grid-template-columns: 22px minmax(0,1fr) auto;
  gap: .1rem .6rem; align-items: center;
  padding: .42rem 0; border-bottom: 1px solid var(--hairline-soft);
}
.ex-row.ticked .ex-name, .ex-row.ticked .ex-plain { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.ex-row.ticked .ex-name button { color: var(--ink-3); }
.ex-row.ticked .ex-dose { color: var(--ink-3); }

/* Per-exercise tick. Bigger hit area than its visual size. */
.tick {
  appearance: none; background: var(--sunk); border: 1.5px solid var(--hairline);
  width: 22px; height: 22px; border-radius: 6px; padding: 0; cursor: pointer;
  display: grid; place-items: center; flex: none; -webkit-tap-highlight-color: transparent;
  position: relative;
}
.tick::after { content: ""; position: absolute; inset: -9px; }
.tick svg { width: 12px; height: 12px; fill: none; stroke: transparent; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tick[aria-checked="true"] { background: var(--ok); border-color: var(--ok); }
.tick[aria-checked="true"] svg { stroke: #fff; }
.tick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.progress-chip {
  font-family: var(--f-data); font-size: .64rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: .12rem .36rem; border-radius: 4px; white-space: nowrap;
}
.mini-meter { display: block; height: 3px; background: var(--sunk); border-radius: 2px; margin-top: .45rem; overflow: hidden; }
.mini-meter i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.ex-row:last-child { border-bottom: 0; }
.ex-name { font-size: .95rem; }
.ex-name button {
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer;
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--hairline);
  text-underline-offset: .18em; text-decoration-thickness: 1px;
}
.ex-name button:hover { text-decoration-color: var(--accent); color: var(--accent); }
.ex-dose { font-family: var(--f-data); font-size: .82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-plain { font-size: .92rem; color: var(--ink-2); }

.notes { margin: 1rem 0 0; padding: .75rem .85rem; background: var(--sunk); border-radius: 8px; font-size: .86rem; color: var(--ink-2); }
.notes p { margin: 0 0 .5rem; }
.notes p:last-child { margin: 0; }

/* ---------------------------------------------------------- pain logger */
.pain { margin-top: .3rem; }
.pain-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; margin-top: .55rem; }
.pain-scale button {
  appearance: none; border: 1px solid var(--hairline); background: var(--raised);
  border-radius: 6px; padding: .5rem 0; font-family: var(--f-data); font-size: .8rem;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pain-scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pain-verdict { margin-top: .6rem; padding: .6rem .75rem; border-radius: 8px; font-size: .87rem; }
.pain-verdict.ok { background: var(--ok-soft); color: var(--ok); }
.pain-verdict.warn { background: var(--warn-soft); color: var(--warn); }
.pain-verdict.stop { background: var(--stop-soft); color: var(--stop); }

/* ---------------------------------------------------------- progress */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline);
         border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.stat { background: var(--raised); padding: .75rem .8rem; }
.stat dt { font-family: var(--f-data); font-size: .58rem; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); }
.stat dd { margin: .22rem 0 0; font-family: var(--f-display); font-size: 1.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat dd small { font-size: .68rem; font-family: var(--f-body); color: var(--ink-2); }

.meter { height: 7px; background: var(--sunk); border-radius: 4px; overflow: hidden; margin: .5rem 0 1.3rem; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }

/* ---------------------------------------------------------- week table */
.wk-list { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--raised); }
.wk {
  display: grid; grid-template-columns: 2.4rem 1fr auto; gap: .7rem; align-items: center;
  padding: .6rem .8rem; border-bottom: 1px solid var(--hairline-soft); font-size: .9rem;
}
.wk:last-child { border-bottom: 0; }
.wk.now { background: var(--accent-soft); }
.wk.past { color: var(--ink-3); }
.wk-n { font-family: var(--f-data); font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wk.now .wk-n { color: var(--accent); font-weight: 700; }
.wk-focus { font-size: .78rem; color: var(--ink-3); }
.wk-nums { font-family: var(--f-data); font-size: .8rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.wk-nums b { font-weight: 600; }
.wk.cut .wk-n::after { content: "↓"; margin-left: .15rem; color: var(--warn); }

/* ---------------------------------------------------------- library */
.search {
  width: 100%; padding: .7rem .85rem; font-size: 1rem;
  border: 1px solid var(--hairline); border-radius: 9px; background: var(--raised); color: var(--ink);
  margin-bottom: 1rem; -webkit-appearance: none;
}
.search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.lib-group { font-family: var(--f-data); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
             color: var(--ink-3); margin: 1.3rem 0 .45rem; font-weight: 600; }
.lib-item { background: var(--raised); border: 1px solid var(--hairline); border-radius: var(--radius);
            margin-bottom: .5rem; padding: .85rem 1rem; }
.lib-item h3 { font-size: 1rem; display: flex; gap: .45rem; align-items: baseline; flex-wrap: wrap; }
.lib-item p { margin: .4rem 0 0; font-size: .87rem; color: var(--ink-2); }
.lib-item p.avoid { color: var(--stop); }
.links { display: flex; gap: .4rem; margin-top: .7rem; flex-wrap: wrap; }
.links a {
  font-family: var(--f-data); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .3rem .55rem; border: 1px solid var(--hairline); border-radius: 5px;
  text-decoration: none; color: var(--ink-2); -webkit-tap-highlight-color: transparent;
}
.links a:hover, .links a:focus-visible { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.badge { font-family: var(--f-data); font-size: .55rem; letter-spacing: .1em; text-transform: uppercase;
         color: var(--ok); background: var(--ok-soft); padding: .1rem .32rem; border-radius: 3px; font-weight: 600; }

/* ---------------------------------------------------------- more */
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .85rem 1rem; background: var(--raised);
  border: 1px solid var(--hairline); border-radius: var(--radius); margin-bottom: .55rem;
}
.row .lbl { font-size: .94rem; }
.row .hint { font-size: .78rem; color: var(--ink-3); margin-top: .15rem; }
.btn {
  appearance: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: .5rem .9rem; border-radius: 8px; font-size: .86rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn.ghost { background: none; color: var(--accent); }
.btn.danger { background: none; border-color: var(--stop); color: var(--stop); }
.btn:disabled { opacity: .45; cursor: default; }
input[type="date"] {
  font: inherit; font-size: .9rem; padding: .4rem .5rem; border: 1px solid var(--hairline);
  border-radius: 7px; background: var(--raised); color: var(--ink);
}

.msg { padding: .7rem .85rem; border-radius: 8px; font-size: .85rem; margin-bottom: .6rem; }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.msg.stop { background: var(--stop-soft); color: var(--stop); }

.gate { background: var(--raised); border: 1px solid var(--hairline); border-radius: var(--radius);
        padding: .85rem 1rem; margin-bottom: .55rem; }
.gate h3 { font-size: .96rem; }
.gate p { margin: .3rem 0 0; font-size: .86rem; color: var(--ink-2); }

.foot { margin-top: 1.6rem; font-size: .76rem; color: var(--ink-3); line-height: 1.5; }
.foot a { color: var(--ink-3); }

/* ---------------------------------------------------------- streak + grid */
.hdr-top { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.streak-pill {
  display: inline-flex; align-items: center; gap: .28rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  color: var(--accent-ink); font-family: var(--f-data); font-size: .82rem; font-weight: 700;
  padding: .22rem .55rem .22rem .45rem; border-radius: 999px; letter-spacing: .02em;
}
.streak-pill .flame { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.stat.streak dd { color: var(--accent); }

.grid-wrap { overflow-x: auto; padding-bottom: .2rem; }
.daygrid {
  display: grid; grid-template-rows: repeat(7, 12px); grid-auto-columns: 12px;
  grid-auto-flow: column; gap: 3px; justify-content: start; align-content: start;
}
.gd { width: 12px; height: 12px; border-radius: 3px; background: var(--sunk); display: inline-block; flex: none; }
.gd.done { background: var(--ok); }
.gd.protected { background: var(--bp); }
.gd.partial { background: var(--warn); }
.gd.missed { background: var(--hairline); }
.legend-row { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .6rem 0 0; font-size: .72rem; color: var(--ink-3); }
.legend-row span { display: inline-flex; align-items: center; gap: .3rem; }

/* ---------------------------------------------------------- advice */
.advice {
  border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .8rem;
  border: 1px solid transparent;
}
.advice.info { background: var(--run-soft); border-color: color-mix(in srgb, var(--run) 30%, transparent); }
.advice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.advice.stop { background: var(--stop-soft); border-color: color-mix(in srgb, var(--stop) 35%, transparent); }
.advice-title { font-family: var(--f-display); font-size: 1.05rem; margin-bottom: .25rem; }
.advice.info .advice-title { color: var(--run); }
.advice.warn .advice-title { color: var(--warn); }
.advice.stop .advice-title { color: var(--stop); }
.advice p { margin: 0; font-size: .89rem; color: var(--ink-2); }
.advice .btn { margin-top: .8rem; }

.capnote {
  margin: .95rem 0 0; padding: .7rem .85rem; border-radius: 9px;
  background: var(--warn-soft); color: var(--ink-2); font-size: .85rem;
  border-left: 3px solid var(--warn);
}
.capnote strong { display: block; color: var(--warn); margin-bottom: .2rem; font-size: .92rem; }

/* ---------------------------------------------------------- day nav */
.daynav {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem;
  background: var(--raised); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: .5rem .6rem; margin-bottom: .8rem;
}
.navbtn {
  appearance: none; background: none; border: 1px solid var(--hairline); border-radius: 8px;
  width: 2.2rem; height: 2.2rem; color: var(--accent); font-size: 1.1rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.navbtn:hover { border-color: var(--accent); background: var(--accent-soft); }
.daynav-mid { text-align: center; min-width: 0; }
.daynav-label { font-weight: 650; font-size: .95rem; }
.daynav-date { font-size: .78rem; color: var(--ink-3); }

/* ---------------------------------------------------------- misc */
.pain-card .pain-head { padding: .9rem 1rem .1rem; }
.pain-card .card-body { border-top: 0; }
.card-sub-static { color: var(--ink-2); font-size: .82rem; margin-top: .22rem; }
.pain-scale button.hot[aria-pressed="true"] { background: var(--stop); border-color: var(--stop); color: #fff; }
.pain-note { margin: .55rem 0 0; font-size: .82rem; color: var(--ink-3); }
.wk-main { font-size: .9rem; }
.wk.now .wk-main { font-weight: 650; }
.wk-focus { display: block; }
.btn.sm { padding: .38rem .7rem; font-size: .8rem; }
.btn.wide { width: 100%; margin-top: 1.2rem; }
.badge.alt { color: var(--ink-3); background: var(--sunk); }
.swap { font-size: .84rem; color: var(--ink-2); margin-top: .5rem; }
.swap strong { color: var(--strength); }
.sheet-group { color: var(--ink-3); font-size: .7rem; font-family: var(--f-data); letter-spacing: .12em; text-transform: uppercase; margin: .3rem 0 0; }
.sheet-cue { margin: .9rem 0 0; }
.sheet-avoid { margin: .7rem 0 0; color: var(--stop); }
.wk.now { background: var(--accent-soft); }
.wk.now .wk-n { color: var(--accent); font-weight: 700; }
.meter i { background: linear-gradient(90deg, var(--accent), var(--accent-hot)); }
.tab[aria-selected="true"] { color: var(--accent); }
.stats { grid-template-columns: repeat(4, 1fr); }
.stat dd { font-size: 1.3rem; }

/* ---------------------------------------------------------- sheet */
.sheet-back {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--raised); width: 100%; max-width: 46rem;
  border-radius: 16px 16px 0 0; padding: 1.1rem var(--pad) calc(env(safe-area-inset-bottom) + 1.4rem);
  max-height: 85vh; overflow-y: auto; animation: rise .2s ease;
}
@keyframes rise { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 34px; height: 4px; background: var(--hairline); border-radius: 3px; margin: 0 auto .9rem; }
.sheet h2 { font-size: 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
