[hidden] { display: none !important; }
:root {
  --bg: #f4f6f8; --card: #fff; --ink: #1b2430; --muted: #5d6877; --line: #dde2e8;
  --brand: #0f766e; --brand-ink: #fff; --brand-soft: #e2f3f1; --danger: #b42318; --danger-soft: #fdecea;
  --warn: #92600a; --warn-soft: #fff4dc; --ok: #146c3a; --ok-soft: #e3f5ea;
  --radius: 14px; --nav-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11161c; --card: #1a212a; --ink: #e8edf2; --muted: #9aa6b5; --line: #2c3540;
    --brand: #2bb3a5; --brand-ink: #06201d; --brand-soft: #163a37; --danger: #ff8a7d; --danger-soft: #3a1c19;
    --warn: #f0c060; --warn-soft: #3a2f14; --ok: #6fd39a; --ok-soft: #14301f; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.no-scroll { overflow: hidden; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; } h2 { font-size: 1.15rem; margin: 1.2rem 0 .5rem; } h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: .4rem 0 .8rem; } a { color: var(--brand); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .grow { flex: 1; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; }
.stack > * + * { margin-top: .7rem; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .7rem; padding: .55rem 1rem; padding-top: calc(.55rem + env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--brand); font-size: 1.1rem; }
.view { max-width: 760px; margin: 0 auto; padding: 1rem 1rem calc(var(--nav-h) + 6.5rem + env(safe-area-inset-bottom)); outline: none; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: var(--nav-h);
  text-decoration: none; color: var(--muted); font-size: .75rem; gap: 2px; }
.bottom-nav a .ico { font-size: 1.3rem; line-height: 1; }
.bottom-nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.card + .card { margin-top: .8rem; }
.list { display: grid; gap: .6rem; }
.item { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
a.item:hover, a.item:focus-visible { border-color: var(--brand); }
.item .t { font-weight: 600; } .item .s { color: var(--muted); font-size: .88rem; }

label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; min-height: 44px; }
textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
input[type="checkbox"] { width: auto; min-height: 0; }
.field { margin-bottom: .8rem; }
.grid2 { display: grid; gap: .7rem; grid-template-columns: 1fr 1fr; } @media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }

.btn { font: inherit; min-height: 44px; padding: .5rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn:hover { border-color: var(--brand); } .btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.btn.danger { color: var(--danger); border-color: var(--danger); } .btn.danger.solid { background: var(--danger); color: #fff; }
.btn.small { min-height: 36px; padding: .25rem .7rem; font-size: .9rem; } .btn.block { display: flex; width: 100%; margin-top: .5rem; }
.icon-btn { background: none; border: 0; font-size: 1.2rem; min-width: 44px; min-height: 44px; color: var(--muted); cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.badge { display: inline-block; font-size: .75rem; padding: .1rem .55rem; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.err { background: var(--danger-soft); color: var(--danger); } .badge.ok { background: var(--ok-soft); color: var(--ok); }
.banner { border-radius: 10px; padding: .7rem .9rem; margin: .6rem 0; background: var(--warn-soft); color: var(--warn); }
.banner.err { background: var(--danger-soft); color: var(--danger); } .banner.info { background: var(--brand-soft); color: var(--ink); }

.hero-rec { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.4rem 1rem; }
.rec-big { width: 132px; height: 132px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 3rem; cursor: pointer; box-shadow: 0 6px 18px rgba(180,35,24,.35); }
.rec-big:active { transform: scale(.97); }
.fab { position: fixed; right: 1rem; bottom: calc(var(--nav-h) + 1rem + env(safe-area-inset-bottom)); z-index: 19; height: 56px; padding: 0 1.2rem; border-radius: 99px; border: 0;
  background: var(--danger); color: #fff; font: 600 1rem inherit; font-family: inherit; box-shadow: 0 4px 14px rgba(0,0,0,.3); cursor: pointer; display: flex; align-items: center; gap: .5rem; }

.note { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: .9rem; }
.note + .note { margin-top: .7rem; }
.note-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.note audio { width: 100%; margin: .3rem 0 .6rem; }
.note-text { white-space: pre-wrap; }
.tabs { display: flex; gap: .4rem; margin: .4rem 0 .8rem; } .tabs button { flex: 1; }
.tabs .on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.picker { position: relative; }
.picker-list { border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin-top: .2rem; max-height: 14rem; overflow: auto; }
.picker-list button { display: block; width: 100%; text-align: left; padding: .65rem .8rem; min-height: 44px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; cursor: pointer; }
.picker-list button:last-child { border-bottom: 0; } .picker-list .hd { padding: .3rem .8rem; font-size: .75rem; color: var(--muted); background: var(--bg); }
.chip { display: inline-flex; gap: .4rem; align-items: center; padding: .25rem .4rem .25rem .7rem; border-radius: 99px; background: var(--brand-soft); }

.backdrop { 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(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: .5rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
.sheet.wide { max-width: 760px; }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; } .sheet-head h2 { margin: .6rem 0; }
.timer { font-size: 2.6rem; font-variant-numeric: tabular-nums; text-align: center; margin: .6rem 0; }
.rec-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--danger); margin-right: .5rem; animation: blink 1.2s infinite; } .paused .rec-dot { animation: none; opacity: .4; }
@keyframes blink { 50% { opacity: .2; } }
.rec-controls { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin: .8rem 0; } .rec-controls .btn { min-width: 110px; }

#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 5rem + env(safe-area-inset-bottom)); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: .4rem; pointer-events: none; }
.toast { background: #222b36; color: #fff; padding: .6rem 1rem; border-radius: 10px; max-width: 90vw; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.toast.error { background: var(--danger); } .toast.ok { background: var(--ok); color: #fff; }

.center-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login { width: min(420px, 100%); text-align: center; } .login .logo { border-radius: 18px; margin-bottom: .5rem; }
.g-btn { display: flex; justify-content: center; min-height: 44px; margin: 1.2rem 0 .4rem; }
.msg { color: var(--danger); } #denied { text-align: left; background: var(--danger-soft); border-radius: 10px; padding: .6rem 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; } th, td { text-align: left; padding: .45rem .4rem; border-bottom: 1px solid var(--line); } .scroll-x { overflow-x: auto; }
details > summary { cursor: pointer; padding: .4rem 0; font-weight: 600; }
.steps { padding-left: 1.2rem; } .steps li { margin-bottom: .35rem; }
@media (min-width: 760px) { .bottom-nav { position: sticky; } }
