/* =====================================================================================================================
   PD Screening — design system
   Calm clinical surface, one typeface (Figtree), teal brand from the app icon, evidence colours green / amber / red.
   Motion: one page entrance, the report gauge sweep, and feedback on presses. Everything respects reduced motion.
   Class names used by page scripts are kept: card, grid g2 g3, row between, btn (ghost, danger), pill (low mid high off),
   notice (info), status-ok / status-pd, st (on, done), task (done), progress > i, timer, live, kv, num, led (on).
   ================================================================================================================== */
:root {
  --bg: #f1f5f4;            /* cool mint-grey page */
  --panel: #ffffff;
  --ink: #132a30;           /* text */
  --ink-2: #3c5359;         /* secondary text */
  --muted: #5b6f74;         /* tertiary text, still 4.5:1 on white */
  --line: #dde6e4;
  --line-2: #c9d6d3;
  --accent: #0f766e;        /* brand teal (icon) */
  --accent-strong: #0b5f58;
  --accent-ink: #ffffff;
  --accent-soft: #e3f3f0;
  --accent-tint: #f2faf8;
  --low: #15803d; --low-soft: #e6f5ea;
  --mid: #b45309; --mid-soft: #fdf1e1;
  --high: #b42318; --high-soft: #fdeceb;
  --r-lg: 18px; --r-md: 12px; --r-sm: 9px;
  --radius: var(--r-lg);
  --shadow-1: 0 1px 0 rgba(19, 42, 48, .04), 0 1px 3px rgba(19, 42, 48, .06);
  --shadow-2: 0 2px 6px rgba(19, 42, 48, .06), 0 12px 32px -12px rgba(19, 42, 48, .18);
  --shadow: var(--shadow-1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --header-h: 64px;
  --tabbar-h: 64px;
  --font: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
  font-family: var(--font);
  color-scheme: light;
}
@view-transition { navigation: auto; }          /* smooth cross-fade between pages where the browser supports it */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.55; font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
::selection { background: #bfe6df; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #5fc3b6; outline-offset: 2px; border-radius: 6px; }
code { font-size: .92em; background: var(--accent-tint); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }

/* ---------------------------------------------------------------------------------------------- header */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
header.top .wrap { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 700; letter-spacing: -.01em; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand .mark rect { fill: var(--accent); }
.brand .mark .trace { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 0; animation: trace-draw 1.1s .15s var(--ease) both; }
.brand-long { color: var(--muted); font-weight: 500; }
@keyframes trace-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.topnav { display: flex; gap: 4px; margin-left: auto; background: var(--bg); border: 1px solid var(--line); padding: 4px; border-radius: 999px; }
.topnav a { color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: 999px;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease); }
.topnav a:hover { color: var(--ink); background: rgba(255, 255, 255, .7); text-decoration: none; }
.topnav a.on { background: var(--panel); color: var(--accent-strong); box-shadow: var(--shadow-1); }
.icon-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 999px;
  color: var(--ink-2); font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: var(--panel);
  transition: background-color .2s var(--ease), color .2s var(--ease); }
.icon-btn:hover { color: var(--high); background: var(--high-soft); text-decoration: none; }
.icon-btn svg, .tabbar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* phone tab bar */
.tabbar { display: none; }

/* ---------------------------------------------------------------------------------------------- layout */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 30px; padding-bottom: 64px; }
h1 { font-size: clamp(26px, 2.2vw + 14px, 34px); line-height: 1.15; letter-spacing: -.025em; font-weight: 800; margin: 0 0 6px; }
h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.01em; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 15px; line-height: 1.35; font-weight: 700; margin: 0 0 8px; }
.sub { color: var(--ink-2); margin: 0 0 24px; max-width: 70ch; font-size: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 6px; }
.page-head > :first-child { min-width: 0; flex: 1 1 380px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* ---------------------------------------------------------------------------------------------- surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--shadow-1); min-width: 0; }
.card.flat { box-shadow: none; background: var(--accent-tint); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; min-height: 28px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg); transition: transform .25s var(--ease); flex: none; }
details.card[open] > summary::before { transform: rotate(45deg); }
details.card[open] > summary ~ * { animation: rise .3s var(--ease) both; }

/* ---------------------------------------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: 9px 18px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 14.5px; letter-spacing: .005em;
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 16px -8px rgba(15, 118, 110, .7);
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease), color .2s var(--ease);
}
.btn:hover { background: var(--accent-strong); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--panel); color: var(--accent-strong); border-color: var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: var(--accent-tint); border-color: var(--accent); }
.btn.danger { background: var(--high); border-color: var(--high); box-shadow: 0 6px 16px -8px rgba(180, 35, 24, .7); }
.btn.danger:hover { background: #931c13; }
.btn:disabled, .btn[disabled] { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }

input, select, textarea {
  font: inherit; font-size: 16px; /* 16px stops phones zooming into fields */
  min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: #fff; color: var(--ink); width: 100%; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(15, 118, 110, .15); }
input[type=radio], input[type=checkbox] { width: auto; min-height: 0; }
input[type=file] { padding: 8px; flex: 1 1 220px; }
label { font-size: 13.5px; color: var(--ink-2); font-weight: 600; display: block; margin-bottom: 6px; }

/* ---------------------------------------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: .01em; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 2px; }
tr:last-child td { border-bottom: 0; }
tbody tr, table tr { transition: background-color .15s var(--ease); }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------------------------------------------------------------------- small parts */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-strong); white-space: nowrap; line-height: 1.5;
  transition: background-color .2s var(--ease), color .2s var(--ease); }
.pill.low { background: var(--low-soft); color: var(--low); }
.pill.mid { background: var(--mid-soft); color: var(--mid); }
.pill.high { background: var(--high-soft); color: var(--high); }
.pill.off { background: #edf1f0; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13.5px; }
.notice { border: 1px solid #f3d3a6; border-left: 4px solid var(--mid); background: var(--mid-soft); padding: 11px 14px; border-radius: var(--r-md);
  font-size: 14px; color: #5a3306; animation: rise .3s var(--ease) both; }
.notice.info { border-color: #bfe2dc; border-left-color: var(--accent); background: var(--accent-tint); color: var(--ink); }
.disclaimer { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 36px; padding-top: 14px; max-width: 90ch; }
.stat { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; font-size: 14.5px; }
.kv > div { padding: 2px 0; } .kv div:nth-child(odd) { color: var(--ink-2); } .kv div:nth-child(even) { font-weight: 600; }
.status-pd { color: var(--high); font-weight: 700; } .status-ok { color: var(--low); font-weight: 700; }
ol.small li, ul.small li { margin: 3px 0; }

/* ---------------------------------------------------------------------------------------------- dashboard */
.overview .card { display: flex; flex-direction: column; }
.overview .card .foot { margin-top: auto; padding-top: 14px; }
.model-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.model-row:last-of-type { border-bottom: 0; }
.list-link { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.list-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s var(--ease); }
.list-link:hover svg { transform: translateX(3px); }
.protocol { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.protocol li { counter-increment: step; position: relative; padding: 0 0 12px 38px; font-size: 14.5px; }
.protocol li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; font-size: 13px; }
.protocol li:not(:last-child)::after { content: ""; position: absolute; left: 12.5px; top: 27px; bottom: 2px; width: 1px; background: var(--line-2); }

/* devices */
.dev { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dev:last-child { border-bottom: 0; }
.led { width: 10px; height: 10px; border-radius: 50%; background: #c3ccd0; flex: none; }
.led.on { background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: pulse 2s infinite; }
canvas.live { width: 100%; height: 120px; border: 1px solid var(--line); border-radius: var(--r-md); background:
  linear-gradient(var(--accent-tint), var(--accent-tint)) padding-box; display: block; }
.figs img { width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }

/* ---------------------------------------------------------------------------------------------- assessment wizard */
.steps { display: flex; gap: 6px; margin: 0 0 22px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top) + 10px); z-index: 10; box-shadow: var(--shadow-2);
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.steps::-webkit-scrollbar { display: none; }
.steps .st { flex: 1 0 auto; text-align: center; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 13.5px; font-weight: 700;
  white-space: nowrap; scroll-snap-align: center; transition: background-color .3s var(--ease), color .3s var(--ease); }
.steps .st.on { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -8px rgba(15, 118, 110, .8); }
.steps .st.done { background: var(--accent-soft); color: var(--accent-strong); }
.steps .st.done::before { content: "✓ "; }
.task { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; background: #fff;
  transition: border-color .3s var(--ease), background-color .3s var(--ease); }
.task.done { border-color: #9fd8cf; background: var(--accent-tint); }
.progress { height: 8px; background: #e8eeed; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress > i { display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #14b8a6, var(--accent)); transition: width .35s var(--ease); }
.passage { font-size: 18px; line-height: 1.8; background: var(--accent-tint); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 22px; max-width: 70ch; }
.timer { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.nms-list { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); overscroll-behavior: contain; }
.nms-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.nms-row:last-child { border-bottom: 0; }
.nms-q { flex: 1; font-size: 14.5px; min-width: 0; }
.nms-opts { display: flex; gap: 6px; flex: none; }
.nms-opt.pill { cursor: pointer; margin: 0; min-width: 64px; min-height: 36px; justify-content: center; font-size: 13.5px; border: 1px solid transparent; }
.nms-opt.pill.off { background: #fff; border-color: var(--line-2); color: var(--ink-2); }
.nms-opt.pill.off:hover { border-color: var(--accent); }
.nms-opt input { position: absolute; opacity: 0; pointer-events: none; }
.nms-opt:has(input:focus-visible) { outline: 3px solid #5fc3b6; outline-offset: 2px; }

/* ---------------------------------------------------------------------------------------------- report */
.result { position: relative; overflow: hidden; }
.result::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.result.low::before { background: var(--low); } .result.mid::before { background: var(--mid); } .result.high::before { background: var(--high); }
.gauge-wrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.gauge-wrap svg { flex: none; max-width: 100%; height: auto; }
.gauge-needle { transition: transform 1.3s var(--ease-spring); }
.gauge-arc { stroke-dasharray: 1; stroke-dashoffset: 1; animation: arc-draw .9s var(--ease) forwards; }
@keyframes arc-draw { to { stroke-dashoffset: 0; } }
.verdict { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 4px; }
.verdict .pill { font-size: 17px; padding: 5px 16px; }
.verdict .lr { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.mod-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bar { position: relative; height: 10px; background: linear-gradient(90deg, var(--low-soft), #eef1f0 50%, var(--high-soft)); border-radius: 99px; margin: 10px 0 4px; }
.bar > b { position: absolute; top: -4px; width: 4px; height: 18px; background: var(--ink); border-radius: 2px; animation: marker-in .8s .35s var(--ease) both; }
@keyframes marker-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------------------------------------------------------------------------------------------- dialog (new patient) */
dialog.sheet { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; color: var(--ink); }
dialog.sheet .sheet-body { background: var(--panel); border-radius: 22px; padding: 24px; width: min(480px, 92vw); box-shadow: var(--shadow-2); }
dialog.sheet[open] .sheet-body { animation: pop .32s var(--ease) both; }
dialog.sheet::backdrop { background: rgba(19, 42, 48, .38); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .25s var(--ease) both; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------------------------------- login */
.login { min-height: calc(100vh - var(--header-h) - 200px); display: grid; place-items: center; }
.login .card { width: min(420px, 100%); padding: 30px 28px; box-shadow: var(--shadow-2); }
.login .mark-lg { width: 52px; height: 52px; margin-bottom: 16px; }
.login .mark-lg rect { fill: var(--accent); }
.login .mark-lg path { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------------------------------------- motion */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 70% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
/* the one page entrance: blocks of the page settle in, one after another */
.page > * { animation: rise .5s var(--ease) both; }
.page > :nth-child(2) { animation-delay: .05s; } .page > :nth-child(3) { animation-delay: .1s; }
.page > :nth-child(4) { animation-delay: .15s; } .page > :nth-child(n+5) { animation-delay: .2s; }
.page > .steps { animation-name: fade; }   /* sticky bar: no transform (it would break sticky on some browsers) */
.page > dialog { animation: none; }

/* ---------------------------------------------------------------------------------------------- phones */
@media (max-width: 760px) {
  :root { --header-h: 56px; }
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 20px; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }
  .topnav, .brand-long, .icon-btn-label { display: none; }
  header.top .wrap { justify-content: space-between; }
  .icon-btn { width: 40px; padding: 0; justify-content: center; }
  .brand { font-size: 17px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted);
    font-size: 11.5px; font-weight: 700; position: relative; transition: color .2s var(--ease); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a svg { width: 23px; height: 23px; transition: transform .25s var(--ease-spring); }
  .tabbar a:active svg { transform: scale(.88); }
  .tabbar a.on { color: var(--accent-strong); }
  .tabbar a.on::before { content: ""; position: absolute; top: 6px; width: 54px; height: 32px; border-radius: 999px; background: var(--accent-soft); z-index: -1;
    animation: pop .3s var(--ease) both; }

  h1 { font-size: 27px; }
  .sub { font-size: 15.5px; margin-bottom: 18px; }
  .page-head { display: block; }
  .page-head .actions { margin: 0 0 20px; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .card { padding: 18px 16px; border-radius: 16px; }
  .grid { gap: 14px; }
  .btn { min-height: 46px; }
  .timer { font-size: 34px; }
  .stat { font-size: 26px; }
  .passage { font-size: 17px; padding: 14px 16px; }
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 10px 8px; }
  .steps { top: calc(var(--header-h) + env(safe-area-inset-top) + 8px); margin-left: -4px; margin-right: -4px; }
  .nms-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
  .nms-opts .nms-opt.pill { flex: 1; min-height: 42px; font-size: 14.5px; }
  .gauge-wrap { flex-direction: column; align-items: stretch; gap: 6px; }
  .gauge-wrap svg { align-self: center; width: 240px; }
  .gauge-wrap > div { min-width: 0 !important; }
  .verdict .lr { font-size: 19px; }

  /* the new-patient form slides up from the bottom like a phone sheet */
  dialog.sheet { margin: auto 0 0; width: 100%; }
  dialog.sheet .sheet-body { width: 100%; border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
  dialog.sheet .sheet-body::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 9px; background: var(--line-2); margin: -8px auto 14px; }
  dialog.sheet[open] .sheet-body { animation: sheet-up .38s var(--ease) both; }
  .sheet-actions .btn { flex: 1; }
}
@media (hover: none) { .btn:hover { background: var(--accent); } .btn.ghost:hover { background: var(--panel); } .btn.danger:hover { background: var(--high); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}

/* ---------------------------------------------------------------------------------------------- print */
@media print {
  header.top, .tabbar, .noprint, .steps { display: none !important; }
  body { background: #fff; font-size: 12.5px; }
  main.wrap { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ccc; }
  .page > * { animation: none !important; }
  table { display: table; }
}
