/* Evolve Health. System fonts, light and dark, no external resources. */
:root {
  --bg: #f6f7f5; --surface: #ffffff; --surface-2: #eef2ef; --line: #d9e0dc; --text: #17201d; --muted: #5b6763;
  --brand: #0f6b63; --brand-2: #0b524c; --brand-soft: #e1f1ee; --danger: #b42318; --danger-soft: #fdecea;
  --warn: #8a5a00; --warn-soft: #fff4dc; --ok: #146c43; --ok-soft: #e3f4ea; --info: #1d4f91; --info-soft: #e6eefb;
  --private: #6b3fa0; --private-soft: #f1eafa; --focus: #2563eb;
  --radius: 14px; --shadow: 0 1px 2px rgb(16 24 22 / 6%), 0 4px 16px rgb(16 24 22 / 6%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1513; --surface: #161e1b; --surface-2: #1d2724; --line: #2c3834; --text: #e6ece9; --muted: #9aa8a3;
    --brand: #4fc1b3; --brand-2: #7fd6ca; --brand-soft: #173832; --danger: #ff8a7a; --danger-soft: #3a1d1a;
    --warn: #f2c063; --warn-soft: #352a12; --ok: #6fd39c; --ok-soft: #15301f; --info: #8db6f5; --info-soft: #18263a;
    --private: #c8a6f2; --private-soft: #2a2036; --focus: #8db6f5; --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); }
a:hover { color: var(--brand-2); }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.2; margin: 0 0 .25em; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .6em; display: flex; align-items: center; gap: .35em; }
h3 { font-size: .95rem; margin: 0 0 .4em; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: .4em 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }
.pre { white-space: pre-wrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: .6rem 0; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.brand .icon { color: var(--brand); }
.bar-actions { display: flex; align-items: center; gap: 6px; }
.bar-note { font-size: .85rem; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .85rem; text-decoration: none; }
.sync-pill.warn { background: var(--warn-soft); color: var(--warn); }
.banner { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; padding: 8px 16px; background: var(--warn-soft); color: var(--warn); font-size: .9rem; text-align: center; }
.banner[hidden] { display: none; }

/* layout */
.page { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.page.narrow { max-width: 600px; }
.page-inner { max-width: 880px; }
.page-inner > .stack, .page-inner.stack { min-width: 0; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.two-col { display: grid; gap: 16px; }
@media (min-width: 760px) { .two-col { grid-template-columns: 1fr 1fr; } }
.page-head { margin-bottom: 20px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #06201c; } }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: .9rem; border-radius: 8px; }
.btn.big { min-height: 50px; padding: 10px 20px; font-size: 1.05rem; }
button.link { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-align: left; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.actions > :first-child:not(:only-child) { margin-right: auto; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: .95rem; }
input[type=text], input[type=password], input[type=url], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .field:has(textarea) { grid-column: 1 / -1; } }
.field[hidden] { display: none; }
.hint { color: var(--muted); font-size: .88rem; margin: 0; }
.error { color: var(--danger); font-weight: 600; margin: 0; }
.error:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.check.small { font-size: .9rem; }
.check.important { padding: 12px; border-radius: 10px; background: var(--warn-soft); }
.check-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }
fieldset.sensitive { border-color: color-mix(in srgb, var(--private) 35%, var(--line)); background: var(--private-soft); }
.suggest:empty { display: none; }
.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; color: var(--private); font-weight: 600; }
.meter { display: flex; align-items: center; gap: 10px; flex: 1; font-size: .88rem; color: var(--muted); }
.meter .track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter .bar { display: block; height: 100%; width: var(--pct, 0%); background: var(--danger); transition: width .2s; }
.meter[data-ok=yes] .bar { background: var(--ok); }

/* cards and panels */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 18px; }
.panel.attention { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); background: var(--brand-soft); }
.panel.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.card { display: block; padding: 16px; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--brand); }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card.account { display: flex; gap: 12px; align-items: center; }
.card.account div { display: flex; flex-direction: column; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--info-soft); color: var(--text); }
.callout > .icon { margin-top: 2px; color: var(--info); }
.callout.ok { background: var(--ok-soft); } .callout.ok > .icon { color: var(--ok); }
.callout.warn { background: var(--warn-soft); } .callout.warn > .icon { color: var(--warn); }
.callout.private { background: var(--private-soft); } .callout.private > .icon { color: var(--private); }
.callout p { margin: .2em 0; }

/* chips and badges */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: .85rem; }
.chip.danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.shared { background: var(--brand-soft); color: var(--brand); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge.private { background: var(--private-soft); color: var(--private); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.chip-link { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.chip-link span { color: var(--muted); font-size: .88rem; }
.chip-link.danger { background: var(--danger-soft); }
.chip-link.danger strong { color: var(--danger); }

/* welcome */
.hero { padding: 24px 0 8px; max-width: 760px; }
.hero h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.8rem); }
.lead { font-size: 1.15rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 12px; }
.small-links { font-size: .92rem; color: var(--muted); }
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 32px; }
.feature { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.feature .icon { color: var(--brand); }
.feature h3 { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 1.05rem; margin: 8px 0 4px; }
.feature p { color: var(--muted); margin: 0; }
.accounts { margin-top: 24px; }
.open-source { margin-top: 28px; color: var(--muted); }
.lock-head { display: flex; align-items: center; gap: 12px; }
.lock-head .icon { color: var(--brand); }
details.help summary { cursor: pointer; color: var(--brand); font-weight: 600; }

/* home */
.profile-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.profile-card-head { display: flex; gap: 12px; align-items: center; }
.profile-card-head div { display: flex; flex-direction: column; min-width: 0; }
.add-card { display: flex; flex-direction: column; gap: 12px; border-style: dashed; box-shadow: none; }
.add-options { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.avatar.pet { background: var(--warn-soft); color: var(--warn); }
.avatar.big { width: 64px; height: 64px; font-size: 1.4rem; }
.pending, .request { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.pending:first-of-type, .request:first-of-type { border-top: 0; }
.request > div:first-child { flex: 1 1 320px; }

/* profile layout */
.profile-layout { max-width: 1240px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.side-nav, .profile-main { min-width: 0; }
@media (min-width: 920px) { .profile-layout { grid-template-columns: 250px minmax(0, 1fr); padding: 24px; } .side-nav { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow: auto; } }
.side-nav { display: flex; flex-direction: column; gap: 10px; }
.side-profile { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.side-profile div { display: flex; flex-direction: column; font-size: .92rem; }
.side-search { display: flex; align-items: center; gap: 6px; padding-left: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); }
.side-search input { border: 0; min-height: 38px; padding-left: 0; background: transparent; }
.side-search input:focus { outline: none; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .94rem; }
.nav-link:hover { background: var(--surface-2); }
.nav-link[aria-current=page] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-link .count { margin-left: auto; color: var(--muted); font-size: .8rem; }
@media (max-width: 919px) {
  .side-nav nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .side-nav nav hr { display: none; }
  .nav-link { white-space: nowrap; background: var(--surface); border: 1px solid var(--line); }
}
.profile-main { min-width: 0; }
.profile-head { display: flex; gap: 16px; align-items: center; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.add-select { width: auto; min-width: 190px; font-weight: 600; }
.emergency { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.emergency h2 .icon { color: var(--danger); }
.emergency-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.important-note { display: flex; gap: 6px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); margin-top: 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.card-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-list > li { padding: 0; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; }
.row-link:hover { background: var(--surface-2); }
.kind-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); color: var(--brand); flex: none; }
.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-main .muted { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; }
.row-date { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.list > li:not(:has(.row-link)) { display: flex; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.card-list > li:not(:has(.row-link)) { padding: 12px 14px; }
.list-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.empty { padding: 24px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.more { display: inline-block; margin-top: 10px; font-weight: 600; }
details.past summary { cursor: pointer; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: .92rem; text-decoration: none; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; font-weight: 700; color: var(--brand); }
.details { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 20px; margin: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.details:empty { display: none; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.provenance { color: var(--muted); font-size: .86rem; display: flex; gap: 6px; align-items: center; }
.preview img { max-width: 100%; max-height: 420px; border-radius: 10px; margin: 8px 0; }
.vital-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.vital-card { display: flex; flex-direction: column; gap: 2px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.vital-card strong { font-size: 1.3rem; }
.spark { width: 100%; height: 30px; margin-top: 6px; }
.spark polyline { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; }
.timeline-year h2 { color: var(--muted); }
.getting-started ol { margin: 0; padding-left: 1.2em; }
.getting-started li + li { margin-top: 6px; }

/* share wizard */
.steps { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 18px; padding: 0; color: var(--muted); font-size: .9rem; }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: .8rem; }
.steps .current { color: var(--text); font-weight: 700; }
.steps .current span { background: var(--brand); color: #fff; }
.steps .done span { background: var(--ok-soft); color: var(--ok); }
.preset-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.preset { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.preset .icon { color: var(--brand); }
.preset:hover { border-color: var(--brand); }
.preset[aria-pressed=true] { border: 2px solid var(--brand); background: var(--brand-soft); }
.why { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); }
.share-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; }
.share-item .check span, .list .check > span { display: flex; flex-direction: column; }
.share-item .muted { font-size: .88rem; }
.share-item.private { background: linear-gradient(90deg, var(--private-soft), transparent 60%); padding-left: 8px; border-radius: 8px; }
.sub-toggles { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 18px; padding-left: 30px; }
.share-group h2 .check { font-size: 1.05rem; }
.sticky-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -4px 16px rgb(0 0 0 / 8%); }
.methods { display: grid; gap: 10px; }
.method { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.method:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.method input { margin-top: 4px; accent-color: var(--brand); }
.method span { display: flex; flex-direction: column; }
.notice { display: flex; gap: 8px; color: var(--muted); font-size: .9rem; }
.link-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.link-box code { flex: 1 1 240px; overflow-wrap: anywhere; font-size: .82rem; }
.share-qr, .kit-qr { margin: 16px 0 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; }
.qr { width: min(240px, 70vw); height: auto; border-radius: 8px; }
.code-big { font-size: 1.6rem; font-weight: 700; letter-spacing: .08em; margin: 8px 0; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* recorder and visits */
.rec-head { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: #e5484d; animation: pulse 1.4s ease-in-out infinite; }
.paused .rec-dot { animation: none; background: var(--muted); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.6rem; }
.level { flex: 1; max-width: 240px; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.level-bar { display: block; height: 100%; width: calc(var(--level, 0) * 100%); background: var(--ok); transition: width .08s linear; }
.mark-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.marks, .segments, .live-transcript { list-style: none; margin: 10px 0 0; padding: 0; }
.marks li, .segments li, .live-transcript li { padding: 4px 0; }
.live-transcript { max-height: 280px; overflow: auto; }
.t { font-variant-numeric: tabular-nums; color: var(--brand); font-weight: 600; margin-right: 4px; }
.interim { color: var(--muted); font-style: italic; min-height: 1.5em; }
.speech-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); }
.player audio { width: 100%; margin-top: 8px; }
.highlight { align-items: flex-start !important; }
.highlight.warning .badge { background: var(--danger-soft); color: var(--danger); }
.highlight.medication .badge { background: var(--info-soft); color: var(--info); }
.highlight.followup .badge { background: var(--ok-soft); color: var(--ok); }
.highlight .row-main { display: block; }
.rec-actions { position: sticky; bottom: 12px; }

/* import */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .icon { color: var(--brand); }
.formats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.formats p { font-size: .9rem; margin: 2px 0 0; }

/* settings */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0 20px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; }
.tabs a[aria-current=page] { color: var(--brand); border-bottom-color: var(--brand); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); padding: 12px; border-radius: 10px; font-size: .88rem; }
.members .member { padding: 12px 14px; }

/* emergency kit */
.kit-sheet { background: #fff; color: #111; border: 2px solid #111; border-radius: 16px; padding: 24px; max-width: 820px; }
.kit-sheet header { display: flex; gap: 12px; align-items: center; border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 16px; }
.kit-sheet header .icon { color: #0f6b63; }
.kit-grid { display: grid; gap: 20px; }
@media (min-width: 700px) { .kit-grid { grid-template-columns: 1fr auto; } }
.kit-sheet dl { margin: 0; }
.kit-sheet dt { font-weight: 700; text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; color: #444; margin-top: 12px; }
.kit-sheet dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.kit-sheet .big { font-size: 1.25rem; font-weight: 700; }
.write-in { height: 34px; border-bottom: 1px solid #111; }
.kit-steps { margin: 18px 0 0; padding-left: 1.2em; }
.kit .actions { margin-top: 16px; justify-content: flex-start; }
.kit .actions > :first-child { margin-right: 0; }

/* viewer for professionals */
.viewer { max-width: 1000px; margin: 0 auto; padding: 24px 16px 64px; }
.vhead { padding-bottom: 12px; border-bottom: 2px solid var(--text); margin-bottom: 12px; }
.vhead h1 { font-size: 2rem; }
.vfacts { font-size: 1.05rem; }
.vmeta { color: var(--muted); }
.vnotice { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; }
.vsection { margin-top: 22px; break-inside: avoid-page; }
.vsection h2 { border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.flag { color: var(--danger); font-weight: 700; }
.vlist { list-style: none; padding: 0; margin: 0; }
.vvisit { padding: 10px 0; border-bottom: 1px solid var(--line); }
.vvisit-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.label { font-weight: 600; color: var(--muted); }
.vfoot { margin-top: 32px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); padding-top: 8px; }

/* dialog, toast, spinner */
dialog.modal { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / 30%); }
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(10 16 14 / 50%); }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: var(--shadow); transition: transform .25s; z-index: 50; }
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }
.spinner { display: flex; align-items: center; gap: 12px; padding: 24px 0; color: var(--muted); }
.spinner .dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media print {
  .topbar, .banner, .no-print, .side-nav, .quick-actions, .actions, .toast { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page, .viewer { padding: 0; max-width: none; }
  .panel, .card, .details, .card-list { box-shadow: none; border-color: #999; }
  .kit-sheet { border-width: 2px; }
  a { color: #000; }
  details > :not(summary) { display: block; }
}
