/*
 * PreOp Ready styles. DMC design system (Sep 23, 2026): Inter only,
 * clinical blue #1e40af, hairline structure, typography-led hierarchy.
 * No external requests: the font is self-hosted (SIL OFL, see fonts/).
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
}

:root {
  /* DMC tokens. */
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --paper: #f8fafc;
  --surface: #ffffff;
  --line: #e2e8f0;
  --brand: #1e40af;
  --brand-deep: #0a48a9;
  --brand-vivid: #0c51bc;
  --brand-bright: #0063c9;
  --brand-light: #5c9cf9;
  --brand-soft: #eff4ff;
  --brand-press: #12307c;
  --ink-soft: #dbe7ff;
  --kicker-dark: #c9d9f7;

  /* Semantic only: review flags, danger, done. */
  --flag-bg: #fff3cc;
  --flag-line: #cfa02e;
  --flag-ink: #5a4000;
  --danger: #b91c1c;
  --danger-ink: #7f1d1d;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;
  --done: #166534;
  --tint: #f1f5f9;
  --input-line: #94a3b8;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --radius: 16px;

  /* Motion, named by job. */
  --ease-emphasized: cubic-bezier(0.05, 0.7, 0.1, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized-exit: cubic-bezier(0.3, 0, 0.8, 0.15);
  --motion-view-enter: 280ms var(--ease-emphasized);
  --motion-state: 160ms var(--ease-standard);
  --motion-press: 120ms var(--ease-standard);
  --tabbar-h: 64px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

body.no-tabs {
  padding-bottom: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p,
li {
  max-width: 68ch;
  text-wrap: pretty;
}

p {
  margin: 0 0 0.75rem;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-deep);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 20px;
}

/* Micro label: announces a section's job in one or two words. */
.kicker {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------------- Header ---------------- */

.site-header {
  padding: 20px 0 12px;
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
}

.mark-bg {
  fill: var(--brand);
}

.mark-v {
  fill: #ffffff;
}

.mark-v-accent {
  fill: var(--brand-light);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------------- Review flags ---------------- */

.review-banner {
  background: var(--flag-bg);
  border-bottom: 1px solid var(--flag-line);
  color: var(--flag-ink);
  padding: 12px 0 6px;
  font-size: 0.9375rem;
}

.review-banner p {
  margin: 0 0 6px;
}

.flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--flag-bg);
  color: var(--flag-ink);
  border: 1px solid var(--flag-line);
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.3;
  white-space: nowrap;
}

.flag .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.flag-strong {
  background: var(--flag-ink);
  color: var(--flag-bg);
  border-color: var(--flag-ink);
}

.draft-tag {
  display: inline-block;
  vertical-align: 1px;
  margin-left: 6px;
  background: var(--flag-bg);
  color: var(--flag-ink);
  border: 1px solid var(--flag-line);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
}

.show-ids [data-review-ids]::after {
  content: ' ' attr(data-review-ids);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0;
  white-space: normal;
}

/* Section heading: kicker, title, and review flag in one row. */
.sec-head {
  margin-bottom: 16px;
}

.sec-head .kicker {
  margin-bottom: 6px;
}

.sec-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
}

.sec-head-row h3 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 12rem;
}

/* ---------------- Tabs ---------------- */

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tabs-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 44rem;
  margin: 0 auto;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tabbar-h);
  padding: 8px 2px 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-top: 3px solid transparent;
}

.tab .icon {
  width: 24px;
  height: 24px;
}

.tab[aria-current='page'] {
  color: var(--brand);
  border-top-color: var(--brand);
}

.tab:hover {
  color: var(--ink);
}

@media (min-width: 60rem) {
  body {
    padding-bottom: 0;
  }

  .tabs {
    position: sticky;
    top: 0;
    bottom: auto;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .tab {
    flex-direction: row;
    gap: 8px;
    min-height: 52px;
    font-size: 0.9375rem;
    border-top: 0;
    border-bottom: 3px solid transparent;
  }

  .tab[aria-current='page'] {
    border-bottom-color: var(--brand);
  }
}

/* ---------------- Main ---------------- */

main {
  outline: none;
  padding: 8px 0 40px;
}

.view-head {
  margin: 24px 0 20px;
}

.view-head .kicker {
  margin-bottom: 8px;
}

.view-head h2 {
  margin-bottom: 8px;
}

.view-head h2:focus {
  outline: none;
}

.lede {
  color: var(--muted);
  font-size: 1.0625rem;
  margin-bottom: 0;
}

.fine {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Cards group one actionable unit. Everything else is hairline sections. */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 0 0 16px;
  scroll-margin-top: 16px;
}

.card > :last-child {
  margin-bottom: 0;
}

/* Hairline section: the default rhythm of the app. */
.section {
  padding: 26px 0 10px;
  border-top: 1px solid var(--line);
  margin-top: 26px;
  scroll-margin-top: 16px;
}

.section > :last-child {
  margin-bottom: 0;
}

.stack > * + * {
  margin-top: 12px;
}

ul.plain,
ol.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.bullets {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

ul.bullets li + li {
  margin-top: 6px;
}

ol.steps {
  margin: 0 0 0.75rem;
  padding-left: 1.4rem;
}

ol.steps li + li {
  margin-top: 6px;
}

/* ---------------- Buttons and inputs ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-deep);
  color: #fff;
}

.btn-primary:active {
  background: var(--brand-press);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: #cbd5e1;
}

.btn-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-quiet {
  background: transparent;
  color: var(--brand);
  border-color: var(--line);
}

.btn-quiet:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.btn-link {
  background: none;
  border: 0;
  padding: 10px 0;
  min-height: 44px;
  font: inherit;
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.field {
  margin: 0 0 20px;
}

.field > label,
.legend {
  display: block;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.hint {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0 0 8px;
}

.error {
  display: block;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 6px 0 0;
}

input[type='text'],
input[type='tel'],
input[type='date'],
input[type='time'],
input[type='number'] {
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--input-line);
  border-radius: 10px;
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
  max-width: 24rem;
  -webkit-appearance: none;
  appearance: none;
}

input[aria-invalid='true'] {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

input:focus {
  border-color: var(--brand);
}

fieldset {
  border: 0;
  margin: 0 0 20px;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
}

.choices {
  display: grid;
  gap: 8px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  line-height: 1.4;
  color: var(--ink);
}

.choice:hover {
  border-color: var(--input-line);
}

.choice input {
  margin: 2px 0 0;
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--brand);
}

.choice:has(input:checked) {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  background: var(--brand-soft);
}

.choices-inline {
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
}

.two-up {
  display: grid;
  gap: 0 16px;
}

@media (min-width: 36rem) {
  .two-up {
    grid-template-columns: 1fr 1fr;
  }
}

.bp-inputs {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.bp-inputs .field {
  margin: 0;
  flex: 1;
  max-width: 9rem;
}

.bp-slash {
  font-size: 1.5rem;
  color: var(--muted);
  padding-bottom: 8px;
}

/* ---------------- Hero: the countdown ---------------- */

.hero {
  background: var(--brand-deep);
  color: #fff;
  border-radius: 20px;
  padding: 30px 26px 26px;
  margin: 0 0 8px;
  overflow: hidden;
}

.hero .kicker {
  color: var(--kicker-dark);
}

.hero p {
  color: var(--ink-soft);
}

.countdown-big {
  margin: 0 0 4px;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.count-num {
  font-size: clamp(4.5rem, 20vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.count-unit {
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-left: 0.35em;
}

.hero .overview-sub {
  font-size: 1.0625rem;
  margin: 10px 0 6px;
  color: #fff;
  font-weight: 500;
}

.hero .fine {
  color: var(--kicker-dark);
}

.hero .btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

.hero .btn-secondary:hover {
  background: var(--brand-soft);
  border-color: #fff;
}

.hero .btn-quiet {
  color: #fff;
  border-color: rgb(255 255 255 / 45%);
}

.hero .btn-quiet:hover {
  border-color: #fff;
  background: rgb(255 255 255 / 12%);
  color: #fff;
}

.hero :focus-visible {
  outline-color: #fff;
}

.edu-note {
  margin-top: 10px;
  margin-bottom: 0;
}

/* Journey strip: today to surgery day, one tick per week. */
.journey {
  margin: 22px 0 6px;
}

.journey-rail {
  position: relative;
  height: 2px;
  background: rgb(255 255 255 / 28%);
  border-radius: 2px;
  margin: 0 7px;
}

.journey-dot {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(255 255 255 / 55%);
  transform: translate(-50%, -50%);
}

.journey-dot.is-now {
  width: 11px;
  height: 11px;
  background: #fff;
}

.journey-dot.is-day {
  width: 13px;
  height: 13px;
  background: transparent;
  border: 2.5px solid #fff;
}

.journey-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--kicker-dark);
}

/* Checklist progress inside the hero. */
.progress {
  margin: 18px 0 2px;
  padding-top: 16px;
  border-top: 1px solid rgb(255 255 255 / 22%);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.progress-meta span:last-child {
  color: var(--kicker-dark);
  font-weight: 500;
}

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: rgb(255 255 255 / 22%);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--brand-light);
  width: 0;
}

/* ---------------- Fasting rows ---------------- */

.fast-rows {
  border-top: 1px solid var(--line);
  margin: 0 0 14px;
}

.fast-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.fast-row .label {
  font-size: 0.9375rem;
  color: var(--muted);
}

.fast-row .value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.countdown {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.9375rem;
  color: var(--brand);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------------- Checklist ---------------- */

.group {
  margin: 0 0 10px;
}

.group-title {
  padding: 20px 0 6px;
}

.group-title h4 {
  margin: 0;
  font-size: 1rem;
}

.group-title .fine {
  margin: 2px 0 0;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 0;
  min-height: 44px;
}

.check + .check {
  border-top: 1px solid var(--line);
}

.check-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-height: 44px;
  padding: 6px 4px 6px 0;
  cursor: pointer;
  border-radius: 8px;
}

.check-box {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 8px;
  border: 1.5px solid var(--input-line);
  background: #fff;
  display: grid;
  place-items: center;
}

.check-box .icon {
  width: 14px;
  height: 14px;
  stroke-width: 3;
  color: #fff;
  opacity: 0;
  transform: scale(0.25);
}

.check-input:checked + .check-label .check-box {
  background: var(--brand);
  border-color: var(--brand);
}

.check-input:checked + .check-label .check-box .icon {
  opacity: 1;
  transform: scale(1);
}

.check-input:focus-visible + .check-label .check-box {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.check-label .item-text {
  flex: 1;
  color: var(--ink);
  padding-top: 1px;
}

.check .late {
  display: block;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 600;
}

.check .jump {
  display: inline-block;
  font-size: 0.875rem;
  margin-left: 4px;
  padding: 10px 0;
}

.check.is-done .check-label .item-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgb(100 116 139 / 55%);
}

.check.is-med .item-text {
  font-weight: 600;
}

.note-box {
  background: var(--tint);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 0 12px;
  color: var(--body);
}

details.more {
  margin: 0 0 12px;
}

details.more summary {
  cursor: pointer;
  color: var(--brand);
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

/* ---------------- Medicines ---------------- */

.med-add {
  position: relative;
}

.med-add-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.med-add-row input {
  max-width: none;
  flex: 1;
}

.suggest {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 22rem;
  overflow: auto;
}

.suggest li {
  padding: 11px 12px;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
}

.suggest li[aria-selected='true'],
.suggest li:hover {
  background: var(--brand-soft);
}

.med-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.med-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
}

.med-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.med-card h3 {
  font-size: 1.1875rem;
  margin: 0;
}

.med-cat {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 2px 0 12px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -8px -8px 0 0;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}

.icon-btn:hover {
  background: var(--tint);
  color: var(--ink);
}

.med-plan {
  background: var(--brand-soft);
  border: 1px solid #d7e3fa;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0;
}

.med-plan.is-final {
  background: var(--surface);
  border-color: var(--line);
}

.med-headline {
  font-size: 1.125rem;
  font-weight: 650;
  color: var(--ink);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.med-detail {
  margin: 0 0 4px;
}

.urgent,
.alert,
.result.is-high {
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 0 12px;
  color: var(--danger-ink);
}

.urgent {
  font-weight: 600;
}

.warning {
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 0 10px;
}

.med-q {
  margin: 4px 0 12px;
}

.med-q .legend {
  margin-bottom: 8px;
}

/* ---------------- Health ---------------- */

.target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 10px;
}

.target-value {
  font-size: 1.375rem;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.result {
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0 0;
  background: var(--tint);
  border: 1px solid var(--line);
}

.prehab-item + .prehab-item {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.prehab-item h4 {
  margin-bottom: 2px;
}

/* ---------------- Call ---------------- */

.call-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.emergency {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  border-radius: 20px;
}

.emergency .kicker {
  color: var(--kicker-dark);
}

.emergency h3 {
  color: #fff;
}

.emergency p {
  color: var(--ink-soft);
}

.emergency ul li {
  padding: 10px 0;
  border-top: 1px solid rgb(255 255 255 / 18%);
  color: var(--ink-soft);
}

.emergency ul li:first-child {
  border-top: 0;
}

.emergency .btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

.emergency .btn-secondary:hover {
  background: var(--brand-soft);
}

.emergency :focus-visible {
  outline-color: #fff;
}

.flag-list li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.flag-list li:first-child {
  border-top: 0;
}

/* ---------------- Summary ---------------- */

.summary-doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  font-size: 0.9375rem;
}

.summary-doc h3 {
  font-size: 1.0625rem;
  margin: 18px 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.summary-doc .doc-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.summary-doc .doc-banner {
  border: 1px solid var(--flag-line);
  background: var(--flag-bg);
  color: var(--flag-ink);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 10px 0;
  font-weight: 600;
}

.summary-doc table {
  width: 100%;
  border-collapse: collapse;
}

.summary-doc th,
.summary-doc td {
  text-align: left;
  vertical-align: top;
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--line);
}

.summary-doc th {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--muted);
}

.summary-doc dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
  margin: 0;
}

.summary-doc dt {
  font-weight: 600;
}

.summary-doc dd {
  margin: 0;
}

.doc-cols {
  display: grid;
  gap: 0 20px;
}

@media (min-width: 36rem) {
  .doc-cols {
    grid-template-columns: 1fr 1fr;
  }
}

.summary-doc .blank {
  display: inline-block;
  min-width: 11rem;
  border-bottom: 1px solid var(--ink);
}

.summary-doc .d {
  color: var(--flag-ink);
  font-size: 0.8125rem;
  font-weight: 650;
}

.doc-foot {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.print-root {
  display: none;
}

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 28px;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0 0 6px;
}

.attribution {
  font-weight: 600;
  color: var(--body);
}

.noscript {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

/* ---------------- Icons ---------------- */

.icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 6px;
  vertical-align: 1px;
}

/* ---------------- Motion (only when welcome) ---------------- */

@media (prefers-reduced-motion: no-preference) {
  .view-enter {
    animation: view-in var(--motion-view-enter) both;
  }

  .med-card.is-new {
    animation: view-in var(--motion-view-enter) both;
  }

  .suggest {
    animation: fade-in 160ms var(--ease-standard) both;
  }

  .btn,
  .choice,
  .tab,
  .icon-btn {
    transition: background-color var(--motion-state), border-color var(--motion-state), color var(--motion-state);
  }

  .btn:active {
    transform: scale(0.97);
    transition: background-color var(--motion-press), border-color var(--motion-press), color var(--motion-press), transform var(--motion-press);
  }

  .check-box {
    transition: background-color var(--motion-state), border-color var(--motion-state);
  }

  .check-box .icon {
    transition: opacity var(--motion-state), transform var(--motion-state);
  }

  .check-label .item-text {
    transition: color var(--motion-state);
  }

  .progress-fill {
    transition: width 320ms var(--ease-emphasized);
  }

  .live-dot {
    animation: breathe 2.4s ease-in-out infinite;
  }

  @keyframes view-in {
    from {
      opacity: 0;
      transform: translateY(6px);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes fade-in {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  @keyframes breathe {
    0%,
    100% {
      opacity: 0.35;
    }

    50% {
      opacity: 1;
    }
  }
}

/* ---------------- Print: the one-page summary only ---------------- */

@media print {
  @page {
    size: letter;
    margin: 0.45in;
  }

  body {
    background: #fff;
    color: #000;
    padding: 0;
    font-size: 9pt;
    line-height: 1.3;
  }

  .app {
    display: none !important;
  }

  .print-root {
    display: block !important;
  }

  .print-root .summary-doc {
    border: 0;
    padding: 0;
    font-size: 9pt;
  }

  .summary-doc .doc-cols {
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
  }

  .summary-doc p,
  .summary-doc ul.bullets {
    margin-bottom: 4px;
  }

  .summary-doc ul.bullets li + li {
    margin-top: 1px;
  }

  .summary-doc .fine {
    font-size: 8pt;
  }

  .summary-doc p,
  .summary-doc li {
    max-width: none;
  }

  .summary-doc h3 {
    font-size: 10.5pt;
    margin: 9px 0 3px;
    break-after: avoid;
  }

  .summary-doc .doc-title {
    font-size: 15pt;
  }

  .summary-doc th,
  .summary-doc td {
    padding: 2px 6px 2px 0;
  }

  .summary-doc .doc-banner {
    background: #fff;
    color: #000;
    border-color: #000;
  }

  .summary-doc .d {
    color: #000;
  }

  .summary-doc tr {
    break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}
