:root {
  --bg: #f4f6f1;
  --surface: #ffffff;
  --ink: #17231c;
  --muted: #5d6b62;
  --line: #e1e6de;
  --green: #1f5f3f;
  --green-2: #2e8b57;
  --green-soft: #e3f1e8;
  --sand: #e9dcc0;
  --flag: #c8442f;
  --foundation: #8fbf9f;
  --build: #2e8b57;
  --power: #d88c2a;
  --peak: #c8442f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1612; --surface: #18221c; --ink: #e8efe9; --muted: #9aaba0; --line: #2a3830;
    --green: #4fbf83; --green-2: #5fd193; --green-soft: #1f3327; --sand: #3a3324;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
h3 small { color: var(--muted); font-weight: 500; font-size: .85rem; margin-left: 6px; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); } .small { font-size: .85rem; }

.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--green); color: #fff;
}
@media (prefers-color-scheme: dark) { .topbar { background: #12301f; } }
.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: .2px; }
.icon-btn { background: none; border: 0; color: inherit; font-size: 1.3rem; cursor: pointer; padding: 4px 8px; }

main { max-width: 640px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
main > *, .stack > * { min-width: 0; } /* grid children must not stretch the page sideways */
body { overflow-x: clip; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.hero { background: linear-gradient(135deg, var(--green-soft), var(--surface)); }
.eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--green); font-weight: 700; margin-bottom: 4px; }
.stack { display: grid; gap: 12px; }

/* Buttons */
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 6px; width: 100%;
  padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0f1612; } }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--flag); border-color: var(--flag); }
.btn.sm { width: auto; padding: 8px 12px; font-size: .9rem; }
.hero .btn { margin-top: 10px; }
.link { background: none; border: 0; padding: 0; color: var(--green); font: inherit; cursor: pointer; text-align: left; text-decoration: none; }
.link.strong { color: var(--ink); font-weight: 700; }

/* Setup */
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; margin-bottom: 8px; }
legend small { color: var(--muted); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, .chip-btn {
  display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; font-size: .92rem; white-space: nowrap;
}
.chip input:checked + span, .chip-btn.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--green-2); outline-offset: 2px; }
.focus-list { display: grid; gap: 8px; }
.focus-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.focus-opt input { margin-top: 4px; accent-color: var(--green); width: 18px; height: 18px; flex: none; }
.focus-opt small { display: block; color: var(--muted); font-size: .82rem; }
.focus-opt:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.error { color: var(--flag); font-weight: 600; }

/* Lists */
.mini-list { list-style: none; padding: 0; margin: 8px 0 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.rx { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rx.big { color: var(--green); font-weight: 700; font-size: 1rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; color: var(--green); font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); }

.routine-links { display: grid; gap: 8px; }
.routine-btn { text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.routine-btn small { display: block; color: var(--muted); }

/* Workout */
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.progress div { height: 100%; background: var(--green-2); transition: width .3s; }
.ex.complete { border-color: var(--green-2); }
.ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tag { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); margin-bottom: 4px; }
.tag.role-power { background: #fbecd6; color: #94570e; }
.tag.role-core { background: #e5ecf8; color: #2f5596; }
.tag.role-mobility { background: #efe6f6; color: #6b3f8c; }
.tag.role-accessory { background: var(--sand); color: #6a5426; }
.tag.role-flexibility { background: #dff1ef; color: #1d6b63; }
.tag.role-conditioning { background: #fde4e1; color: #a3372a; }
@media (prefers-color-scheme: dark) {
  .tag.role-power { background: #3a2a14; color: #f0b56a; }
  .tag.role-core { background: #1c2740; color: #9db8ec; }
  .tag.role-mobility { background: #2c1f38; color: #cfa8ec; }
  .tag.role-accessory { color: #e2c891; }
  .tag.role-flexibility { background: #14302d; color: #8fd6cc; }
  .tag.role-conditioning { background: #3a1d19; color: #f2a296; }
}
.sets { width: 100%; border-collapse: collapse; margin-top: 6px; }
.sets th { font-size: .75rem; text-transform: uppercase; color: var(--muted); text-align: left; padding: 4px; font-weight: 600; }
.sets td { padding: 4px; }
.sets td:first-child { width: 36px; color: var(--muted); font-weight: 700; }
.sets td:last-child { width: 44px; text-align: right; }
.sets input { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--ink); min-width: 0; }
.sets tr.done input { background: var(--green-soft); }
.check { position: relative; display: inline-block; width: 34px; height: 34px; cursor: pointer; flex: none; }
.check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.check span { position: absolute; inset: 0; border: 2px solid var(--line); border-radius: 9px; background: var(--surface); }
.check input:checked + span { background: var(--green-2); border-color: var(--green-2); }
.check input:checked + span::after { content: "✓"; color: #fff; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; }
.check input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.field { display: grid; gap: 6px; }
.field span { font-weight: 600; }
.field input[type=range] { accent-color: var(--green); }
.field output { font-weight: 700; color: var(--green); }
textarea, select, .assess-form input { font: inherit; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }

/* Plan */
.phase-bar { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 10px 0 6px; }
.ph { text-align: center; color: #fff; font-weight: 700; padding: 6px 0; border-radius: 6px; font-size: .85rem; }
.ph.cur { outline: 3px solid var(--ink); outline-offset: 1px; }
.ph-foundation { background: var(--foundation); } .ph-build { background: var(--build); } .ph-power { background: var(--power); } .ph-peak { background: var(--peak); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; font-size: .75rem; }
.legend span { color: #fff; padding: 2px 8px; border-radius: 99px; }
.week.current { border-color: var(--green); border-width: 2px; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.day { text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; display: grid; gap: 2px; }
.day .d { font-size: .78rem; color: var(--muted); }
.day .st { font-size: .78rem; font-weight: 700; min-height: 1em; }
.day.done { background: var(--green-soft); border-color: var(--green-2); }
.day.done .st { color: var(--green); }
.day.today { border-color: var(--green); border-width: 2px; }
.day.today .st { color: var(--green); }
.day.missed .st { color: var(--power); }

/* Library */
/* Exercise library: vertical, grouped list */
.lib-search { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
.lib-count { margin: 0 4px; }
.lib-group h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.lib-group h3 .tag { margin: 0; }
.lib-group h3 small { color: var(--muted); font-weight: 600; font-size: .85rem; }
.lib-rows { list-style: none; margin: 0; padding: 0; }
.lib-rows li + li { border-top: 1px solid var(--line); }
.lib-row { width: 100%; text-align: left; background: none; border: 0; padding: 10px 2px; cursor: pointer; font: inherit; color: var(--ink);
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name chev" "meta chev"; column-gap: 10px; row-gap: 2px; align-items: center; }
.lib-name { grid-area: name; font-weight: 600; }
.lib-row small { grid-area: meta; color: var(--muted); font-size: .78rem; }
.lib-row .chev { grid-area: chev; color: var(--muted); font-size: 1.3rem; }
.lib-row.unavail .lib-name, .lib-row.unavail small { opacity: .55; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.sheet { background: var(--surface); width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); position: relative; }
@media (min-width: 700px) { .modal { align-items: center; } .sheet { border-radius: 18px; } }
.sheet ol { padding-left: 20px; } .sheet li { margin-bottom: 6px; }
.why { background: var(--green-soft); padding: 10px 12px; border-radius: 10px; }
.close { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer; }

/* Progress */
.weekbars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; }
.wb { display: grid; justify-items: center; gap: 2px; font-size: .72rem; color: var(--muted); }
.bar-track { width: 100%; height: 70px; background: var(--bg); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.bar { width: 100%; background: var(--green-2); border-radius: 4px 4px 0 0; }
.assess-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.assess-form select { grid-column: 1 / -1; }
.assess-form .btn { grid-column: 1 / -1; width: 100%; }
.chart svg { width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart .line { fill: none; stroke: var(--green-2); stroke-width: 2.5; stroke-linejoin: round; }
.chart .dot { fill: var(--surface); stroke: var(--green-2); stroke-width: 2.5; }
.chart .empty { color: var(--muted); text-align: center; padding: 24px 0; background: var(--bg); border-radius: 10px; }
.delta { font-weight: 700; margin-top: 4px; }
.delta.good { color: var(--green); } .delta.bad { color: var(--flag); }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; margin-left: 6px; }
.hist { border-top: 1px solid var(--line); padding: 10px 0; }
.hist summary { cursor: pointer; list-style: none; }
.hist summary small { display: block; color: var(--muted); }
.hist .btn { margin-top: 8px; }

/* Tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar[hidden] { display: none; }
.tabbar button { background: none; border: 0; padding: 8px 0 10px; font: inherit; font-size: .75rem; color: var(--muted); cursor: pointer; display: grid; justify-items: center; gap: 2px; }
.tabbar button span { font-size: 1.25rem; }
.tabbar button.active { color: var(--green); font-weight: 700; }

.timer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 15; background: var(--ink); color: var(--bg); padding: 10px 14px 10px 18px; border-radius: 999px; font-weight: 700; display: flex; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.timer[hidden], .toast[hidden] { display: none; }
.timer button { background: none; border: 0; color: inherit; font-size: 1.2rem; cursor: pointer; }
.toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--green); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.2); }

/* Phone / installed-app polish */
.topbar { padding-top: calc(12px + env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.toast { top: calc(64px + env(safe-area-inset-top)); }
html { -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
.card.install { position: relative; border-color: var(--green); padding-right: 40px; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--green); }
.field input[type=time] { font: inherit; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

/* Account & Sync */
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row .btn { flex: 1; }
details.card > summary { cursor: pointer; list-style: none; line-height: 1.4; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 12px; }
.field input[type=email], .field input[type=password] { font: inherit; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
.cooldown-head { padding-top: 12px; padding-bottom: 12px; }

/* ───────── Wide screens: tablet landscape & desktop (≥ 900px) ───────── */
@media (min-width: 900px) {
  body { padding-bottom: 24px; }
  :root { --topbar-h: 60px; }

  /* Header: nav moves from the bottom bar into the top bar */
  .topbar { min-height: var(--topbar-h); gap: 16px; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .tabbar { position: static; display: flex; gap: 4px; background: none; border: 0; padding: 0; margin: 0 auto; }
  .tabbar button { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: .95rem; color: rgba(255,255,255,.78); }
  .tabbar button span { font-size: 1.05rem; }
  .tabbar button:hover { background: rgba(255,255,255,.1); color: #fff; }
  .tabbar button.active { background: rgba(255,255,255,.18); color: #fff; }
  .timer { bottom: 24px; }

  /* Content flows to the full window width */
  main { max-width: none; padding: 24px; gap: 18px; }
  /* Setup: full width, options on the left, problem areas on the right */
  #setupForm { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: 36px; align-items: start; }
  #setupForm > * { grid-column: 1; }
  #setupForm > .focus-fs { grid-column: 2; grid-row: 1 / span 20; }
  .view-setup .focus-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  /* Routines: drills in two columns */
  .view-routine .mini-list { columns: 2 320px; column-gap: 32px; }
  .view-routine .mini-list li { break-inside: avoid; }

  /* Today: next session on the left, everything else on the right */
  .view-today { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  .view-today > .hero { grid-column: 1; grid-row: span 4; }
  .view-today > .install { grid-column: 1 / -1; }
  .view-today > :not(.hero):not(.install) { grid-column: 2; }

  /* Plan: weeks in a responsive grid */
  .view-plan { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); align-items: start; }
  .view-plan > :first-child { grid-column: 1 / -1; }

  /* Exercises: groups flow into columns */
  #libList { display: block; columns: 3 340px; column-gap: 18px; }
  #libList > * { break-inside: avoid; margin-bottom: 18px; }
  #libList > .lib-count { column-span: all; }

  /* Progress & Settings: cards in columns */
  .view-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .view-progress > .stats { grid-column: 1 / -1; }
  .view-settings { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); align-items: start; }

  /* Workout split view */
  main.wide-workout { display: block; }
  .wk-layout { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .wk-layout.drawer-closed { grid-template-columns: minmax(0, 1fr); }
  .wk-drawer { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 16px); max-height: calc(100vh - var(--topbar-h) - env(safe-area-inset-top) - 40px); overflow-y: auto; padding: 14px; }
  .wk-drawer-head h2 { font-size: 1.15rem; }
  .wk-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
  .wk-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); padding: 10px 6px 4px; }
  .wk-step { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--ink); font: inherit; cursor: pointer; }
  .wk-step:hover { background: var(--bg); }
  .wk-step.on { background: var(--green-soft); border-color: var(--green-2); }
  .wk-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
  .wk-step.done .wk-dot { background: var(--green-2); border-color: var(--green-2); color: #fff; }
  .wk-step-text { display: grid; min-width: 0; }
  .wk-step-text strong { font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wk-step-text small { font-size: .76rem; color: var(--muted); }

  .wk-main { min-width: 0; }
  .wk-toolbar { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 16px); z-index: 3; display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
  .wk-toolbar .btn[disabled] { opacity: .4; cursor: default; }
  .wk-where { flex: 1; display: grid; min-width: 0; }
  .wk-where small { color: var(--muted); font-size: .8rem; }
  .wk-panel { display: grid; gap: 18px; align-items: start; }
  .wk-panel .ex h3 { font-size: 1.5rem; }
  .wk-panel .rx.big { font-size: 1.25rem; }
  .wk-panel .sets input { padding: 12px; font-size: 1.1rem; }
  .wk-panel .check { width: 42px; height: 42px; }
  .wk-howto ol { padding-left: 20px; } .wk-howto li { margin-bottom: 6px; }
  .wk-warm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
  .wk-warm-grid ol { padding-left: 18px; margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
}
/* Very wide: exercise log and instructions side by side */
@media (min-width: 1200px) {
  .wk-panel { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}

/* Exercise popup: key-position photos and demo video */
.media { margin: 16px 0 4px; }
.media-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.media-head h4 { margin: 0; }
.vid-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.kp-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; overscroll-behavior-x: contain; }
.kp { margin: 0; scroll-snap-align: start; min-width: 0; }
.kp img, .kp-ph { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; object-fit: cover; background: var(--bg); }
.kp-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); border: 1.5px dashed var(--line); font-size: .8rem; }
.kp figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.kp figcaption b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: .75rem; margin-right: 4px; }
.vid { margin-bottom: 10px; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.vid video { width: 100%; height: 100%; display: block; }
.vid-ph { background: var(--green-soft); color: var(--green); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 16px; }
.vid-ph b { color: var(--ink); }
.vid-ph span { color: var(--muted); font-size: .9rem; max-width: 34ch; }
@media (min-width: 900px) { .sheet { max-width: 760px; } }
.kp-ph, .kp figcaption { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Form controls never push past their container. iOS/Safari give date and time inputs a built-in
 * minimum width that ignores width: 100%, so reset their native appearance and let them shrink. */
input, select, textarea, button { max-width: 100%; min-width: 0; }
.assess-form > *, .field > * { min-width: 0; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-height: 44px; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; margin: 0; }
