/* ═══════════════════════════════════════════════════════
   MagnusCo · Shared Stylesheet
   Refined clinical minimalism
═══════════════════════════════════════════════════════ */

:root {
  --canvas: #F6F3EC;
  --canvas-soft: #EFEAE0;
  --paper: #FDFBF6;
  --paper-2: #FFFFFF;
  --ink: #1A1A1A;
  --ink-2: #2C2A26;
  --muted: #737069;
  --muted-2: #A8A299;
  --line: #E2DCD0;
  --line-2: #D3CCBE;

  --accent: #D64545;
  --accent-soft: #F4DADA;
  --accent-deep: #A83030;

  --ok: #3F7A5B;
  --ok-soft: #DEEBDF;
  --warn: #B8732F;
  --warn-soft: #F3E4D2;
  --fail: #9B3636;
  --fail-soft: #F0D8D8;

  --tone-rose: #C85050;
  --tone-sage: #6B8E73;
  --tone-amber: #B97A30;
  --tone-slate: #5B6B7D;

  --font-display: 'Quicksand', system-ui, sans-serif;
  --font-sans: 'Geist', -apple-system, system-ui, sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(26, 20, 10, 0.04);
  --shadow-md: 0 4px 16px rgba(26, 20, 10, 0.06), 0 1px 2px rgba(26, 20, 10, 0.04);
  --shadow-lg: 0 20px 60px rgba(26, 20, 10, 0.08), 0 2px 4px rgba(26, 20, 10, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 40% at 20% 0%, rgba(214, 69, 69, 0.04), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(107, 142, 115, 0.05), transparent 60%);
  background-attachment: fixed;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
}

input,
textarea,
select {
  font-family: inherit;
  color: var(--ink);
}

code,
kbd {
  font-family: var(--font-mono);
}

em {
  font-style: italic;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════ */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 28px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 40;
}

.brand-co {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}

.brand-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 3px;
}

.nav-primary,
.nav-secondary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  font-weight: 450;
  transition: background 160ms ease, color 160ms ease;
}

.nav-item svg {
  color: var(--muted);
  transition: color 160ms ease;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--canvas-soft);
}

.nav-item:hover svg {
  color: var(--ink);
}

.nav-item.active {
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
}

.nav-item.active svg {
  color: var(--paper);
}

.nav-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 6px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
  transition: background 160ms ease;
  cursor: pointer;
}

.user-chip:hover {
  background: var(--canvas-soft);
}

.user-chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.user-chip-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.user-chip-meta {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════
   AVATARS
═══════════════════════════════════════════════════════ */

.avatar-sm,
.avatar-md,
.avatar-lg,
.avatar {
  display: inline-grid;
  place-items: center;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14;
  font-weight: 500;
  color: var(--paper);
  background: var(--ink);
  flex-shrink: 0;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 11px;
}

.avatar-md {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 15px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 22px;
}

[data-tone="rose"] {
  background: var(--tone-rose);
}

[data-tone="sage"] {
  background: var(--tone-sage);
}

[data-tone="amber"] {
  background: var(--tone-amber);
}

[data-tone="slate"] {
  background: var(--tone-slate);
}

/* ═══════════════════════════════════════════════════════
   MAIN + TOPBAR
═══════════════════════════════════════════════════════ */

.main {
  min-width: 0;
  padding: 0 32px 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  background: linear-gradient(to bottom, var(--canvas) 70%, rgba(246, 243, 236, 0));
  backdrop-filter: blur(10px);
}

.breadcrumb {
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crumb-dim {
  color: var(--muted);
}

.crumb-sep {
  color: var(--muted-2);
}

.crumb-current {
  color: var(--ink);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  width: 320px;
  transition: border-color 160ms, box-shadow 160ms;
}

.search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(26, 20, 10, 0.06);
}

.search svg {
  color: var(--muted);
  flex-shrink: 0;
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 13px;
  background: transparent;
}

.search input::placeholder {
  color: var(--muted);
}

.search kbd {
  font-size: 10.5px;
  padding: 2px 6px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
}

.search-sm {
  width: 240px;
  padding: 6px 10px;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */

.btn-primary,
.btn-primary-sm {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--ink);
  color: var(--paper);
  padding: 9px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  transition: background 160ms ease, transform 160ms ease;
  text-decoration: none;
}

.btn-primary:hover,
.btn-primary-sm:hover {
  background: var(--ink-2);
  transform: translateY(-1px);
}

.btn-primary svg,
.btn-primary-sm svg {
  color: var(--accent);
}

.btn-primary-sm {
  padding: 7px 12px;
  font-size: 12.5px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--paper);
  color: var(--ink);
  padding: 9px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  transition: background 160ms, border-color 160ms;
  text-decoration: none;
}

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

.btn-ghost {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  color: var(--ink);
  transition: background 160ms;
}

.btn-ghost:hover {
  background: var(--canvas-soft);
}

.notif-dot {
  position: absolute;
  top: -4px;
  right: -5px;
  background: var(--accent);
  color: rgb(255, 255, 255);
  font-size: 9px;
  font-weight: bold;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--paper);
  line-height: 1;
  pointer-events: none;
  padding-top: 1px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--muted);
  transition: background 160ms, color 160ms;
}

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

.link-btn {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
  padding: 0;
  transition: text-decoration-color 160ms;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.link-btn:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   FADE-IN
═══════════════════════════════════════════════════════ */

.screen {
  animation: fadeUp 400ms cubic-bezier(.2, .7, .2, 1);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════
   HERO GRID — dashboard
═══════════════════════════════════════════════════════ */

.hero-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 34px;
  position: relative;
  overflow: hidden;
}

.hero-primary {
  background: linear-gradient(135deg, #FDFBF6 0%, #F7F1E5 100%);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 100px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.pill-live .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  position: relative;
}

.pill-live .pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--ok);
  opacity: 0.3;
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.3;
  }

  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.hero-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.hero-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-size: 48px;
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--ink);
  max-width: 520px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.hero-title em {
  color: var(--accent);
  font-weight: 700;
}

.hero-sub {
  font-size: 14px;
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 26px;
  position: relative;
  z-index: 1;
}

.hero-actions {
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.hero-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.9;
}

.hero-decor svg {
  width: 100%;
  height: 100%;
}

/* QR hero card */
.hero-qr {
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  padding: 22px 24px;
}

.qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.qr-head .kicker {
  color: var(--muted-2);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hero-qr .icon-btn {
  color: var(--muted-2);
}

.hero-qr .icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
}

.qr-frame {
  flex: 1;
  display: grid;
  place-items: center;
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
}

.qr-frame::before,
.qr-frame::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
}

.qr-frame::before {
  top: 8px;
  left: 8px;
  border-right: 0;
  border-bottom: 0;
}

.qr-frame::after {
  bottom: 8px;
  right: 8px;
  border-left: 0;
  border-top: 0;
}

.qr-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.qr-url {
  color: var(--muted-2);
  font-size: 11.5px;
}

.hero-qr .link-btn {
  color: var(--paper);
  text-decoration-color: rgba(255, 255, 255, 0.3);
}

.hero-qr .link-btn:hover {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   STATS GRID
═══════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
}

.stat-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-value {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-weight: 400;
  font-size: 38px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 10px;
}

.stat-unit {
  font-size: 20px;
  color: var(--muted);
  margin-left: 2px;
}

.stat-value-text {
  font-size: 24px;
  font-style: italic;
}

.stat-delta {
  font-size: 11.5px;
  color: var(--muted);
}

.stat-delta.up {
  color: var(--ok);
}

.stat-delta.down {
  color: var(--accent);
}

.stat-delta.neutral {
  color: var(--warn);
}

.progress-track {
  height: 4px;
  background: var(--line);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 100px;
  transition: width 500ms cubic-bezier(.2, .7, .2, 1);
}

/* ═══════════════════════════════════════════════════════
   PANELS + TWO-COL LAYOUT
═══════════════════════════════════════════════════════ */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 24px;
}

.panel-accent {
  background: linear-gradient(135deg, var(--paper) 0%, #F9F5EC 100%);
}

.panel-soft {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.panel-soft .panel-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--paper);
  display: grid;
  place-items: center;
  color: var(--accent);
  margin-bottom: 10px;
}

.panel-soft .panel-body {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.panel-title-sm {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 500;
}

.kicker {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   SNAPSHOT GRID
═══════════════════════════════════════════════════════ */

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.snap-tile {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 84px;
  transition: transform 160ms;
}

.snap-tile:hover {
  transform: translateY(-2px);
}

.snap-critical {
  background: var(--ink);
  border-color: var(--ink);
}

.snap-critical .snap-kicker {
  color: var(--muted-2);
}

.snap-critical .snap-value,
.snap-critical .snap-value-sm {
  color: var(--paper);
}

.snap-warn {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.snap-warn .snap-kicker {
  color: var(--accent-deep);
}

.snap-kicker {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.snap-value {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.snap-value sup {
  font-size: 0.5em;
  vertical-align: super;
  color: var(--accent);
}

.snap-value-sm {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════
   ACTIVITY LIST
═══════════════════════════════════════════════════════ */

.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-list li {
  display: flex;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.activity-list li:last-child {
  border-bottom: 0;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.dot-scan {
  background: var(--accent);
}

.dot-update {
  background: var(--ok);
}

.dot-kin {
  background: var(--tone-amber);
}

.dot-doc {
  background: var(--tone-slate);
}

.dot-pay {
  background: var(--muted);
}

.activity-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-text {
  font-size: 13px;
  color: var(--ink);
  font-weight: 450;
}

.activity-meta {
  font-size: 11.5px;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════
   SUGGEST LIST
═══════════════════════════════════════════════════════ */

.suggest-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.suggest-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 160ms, transform 160ms;
}

.suggest-item:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.suggest-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--canvas);
  display: grid;
  place-items: center;
  color: var(--ink);
  flex-shrink: 0;
}

.suggest-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.suggest-body strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.suggest-body span {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════
   FAMILY GRID
═══════════════════════════════════════════════════════ */

.family-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.family-grid-lg {
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.family-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: border-color 160ms, transform 160ms;
}

.family-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.family-card .avatar-md,
.family-card .avatar-lg {
  margin-bottom: 4px;
}

.family-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}

.family-rel {
  font-size: 11.5px;
  color: var(--muted);
}

.family-meta {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.family-card-add {
  background: transparent;
  border: 1.5px dashed var(--line-2);
  color: var(--muted);
  cursor: pointer;
}

.family-card-add:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper-2);
}

.add-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--canvas);
  display: grid;
  place-items: center;
  color: inherit;
}

/* ═══════════════════════════════════════════════════════
   TAGS
═══════════════════════════════════════════════════════ */

.tag {
  display: inline-flex;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 100px;
  background: var(--canvas);
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tag-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag-pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag-fail {
  background: var(--fail-soft);
  color: var(--fail);
}

/* ═══════════════════════════════════════════════════════
   PAGE HEAD (secondary screens)
═══════════════════════════════════════════════════════ */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 16px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.page-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
  margin: 10px 0 8px;
}

.page-title em {
  color: var(--accent);
  font-weight: 400;
}

.page-sub {
  font-size: 14px;
  color: var(--muted);
  max-width: 560px;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   FORM LAYOUT
═══════════════════════════════════════════════════════ */

.form-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
}

.form-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 80px;
  height: fit-content;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 12px 32px;
  position: relative;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background 160ms;
}

.step:hover {
  background: var(--paper);
}

.step-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-2);
}

.step-dot {
  position: absolute;
  left: 12px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-2);
  border: 2px solid var(--canvas);
  box-shadow: 0 0 0 1.5px var(--line-2);
}

.step.done {
  color: var(--muted);
}

.step.done .step-dot {
  background: var(--ok);
  box-shadow: 0 0 0 1.5px var(--ok);
}

.step.done .step-dot::after {
  content: '';
  position: absolute;
  left: -2px;
  top: 10px;
  width: 2px;
  height: 20px;
  background: var(--ok);
  opacity: 0.4;
}

.step.active {
  color: var(--ink);
  background: var(--paper);
}

.step.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 5px var(--accent-soft);
}

.form-body {
  max-width: 680px;
}

.field-group {
  border: 0;
  padding: 0 0 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.field-group:last-child {
  border-bottom: 0;
}

.field-legend {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
  color: var(--ink);
}

.field-row {
  margin-bottom: 20px;
}

.field-row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.label-critical {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 3px;
  font-weight: 500;
}

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
}

/* Segmented control */
.seg-control {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}

.seg {
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 6px;
  transition: all 160ms;
  border: 0;
  background: transparent;
  cursor: pointer;
}

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

.seg.active {
  background: var(--ink);
  color: var(--paper);
}

/* Input groups */
.input-group {
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 160ms, box-shadow 160ms;
}

.input-group:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(26, 20, 10, 0.06);
}

.input-group input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 10px 14px;
  font-size: 13.5px;
  background: transparent;
  min-width: 0;
}

.input-unit {
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  border-left: 1px solid var(--line);
}

/* Chip input */
.chip-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.chip-input-warn {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 12px;
  color: var(--ink);
}

.chip button {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.chip button:hover {
  color: var(--accent);
}

.chip-warn {
  background: var(--paper-2);
  border-color: var(--accent);
  color: var(--accent-deep);
}

.chip-input input {
  flex: 1;
  min-width: 120px;
  border: 0;
  outline: 0;
  padding: 5px 8px;
  font-size: 12.5px;
  background: transparent;
}

/* Toggle rows */
.toggle-row,
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.toggle-item:last-child {
  border-bottom: 0;
}

.toggle-item>div strong {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
}

.toggle-item>div span {
  font-size: 12px;
  color: var(--muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  background: var(--line-2);
  border-radius: 100px;
  transition: background 200ms;
  cursor: pointer;
}

.switch span::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  background: var(--paper);
  border-radius: 50%;
  transition: transform 200ms;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.switch input:checked+span {
  background: var(--ink);
}

.switch input:checked+span::before {
  transform: translateX(16px);
}

.toggle-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}

.toggle-mini input {
  opacity: 0;
  width: 0;
}

.toggle-mini span {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--line-2);
  background: var(--paper);
  display: grid;
  place-items: center;
  transition: all 160ms;
  flex-shrink: 0;
}

.toggle-mini input:checked+span {
  background: var(--ink);
  border-color: var(--ink);
}

.toggle-mini input:checked+span::after {
  content: '';
  width: 8px;
  height: 4px;
  border: 1.5px solid var(--paper);
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* ═══════════════════════════════════════════════════════
   EMERGENCY CARD PREVIEW (phone)
═══════════════════════════════════════════════════════ */

.emergency-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  align-items: start;
}

.device-frame {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.device-bezel {
  position: relative;
  width: 300px;
  background: var(--ink);
  border-radius: 40px;
  padding: 10px;
  box-shadow: var(--shadow-lg), 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.device-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: var(--ink);
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.device-screen {
  background: var(--paper);
  border-radius: 30px;
  padding: 32px 20px 24px;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ev-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding-bottom: 4px;
}

.ev-brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  color: var(--ink);
}

.ev-time {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink);
}

.ev-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.ev-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
}

.ev-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.ev-id {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.ev-critical {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  margin-top: 10px;
}

.ev-crit-tile {
  background: var(--canvas);
  border-radius: var(--r-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ev-crit-warn {
  background: var(--accent);
  color: var(--paper);
}

.ev-crit-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.ev-crit-warn .ev-crit-label {
  color: rgba(255, 255, 255, 0.7);
}

.ev-crit-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.ev-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ev-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
}

.ev-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ev-tag {
  padding: 4px 9px;
  border-radius: 100px;
  background: var(--canvas);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ev-tag-warn {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: transparent;
}

.ev-med-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.ev-med-list li {
  padding: 8px 10px;
  background: var(--canvas);
  border-radius: var(--r-sm);
  color: var(--ink-2);
}

.ev-med-list strong {
  color: var(--ink);
  margin-right: 4px;
}

.ev-contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--canvas);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
}

.ev-contact strong {
  font-size: 12.5px;
  color: var(--ink);
  display: block;
}

.ev-contact span {
  font-size: 10.5px;
  color: var(--muted);
}

.ev-call {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--accent);
  color: var(--paper);
  border-radius: 100px;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
}

.ev-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* Emergency side column */
.emergency-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.share-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  transition: all 160ms;
}

.share-chip:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.share-chip svg {
  color: var(--accent);
}

.share-url {
  padding: 10px 14px;
  background: var(--canvas);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   ADMIN KPIs + Table
═══════════════════════════════════════════════════════ */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  min-height: 130px;
}

.kpi-hero {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.kpi-hero .kpi-label {
  color: var(--muted-2);
}

.kpi-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.kpi-value {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.kpi-delta {
  font-size: 11.5px;
  color: var(--muted);
}

.kpi-delta.up {
  color: var(--ok);
}

.kpi-delta.down {
  color: var(--muted);
}

.kpi-hero .kpi-delta.up {
  color: #8FC9A4;
}

.kpi-spark {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 90px;
  height: 28px;
}

/* Table */
.table-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-pill {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 100px;
  transition: all 160ms;
  cursor: pointer;
}

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

.filter-pill.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.table-wrap {
  margin: 0 -24px -22px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  background: var(--canvas);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--muted);
}

.data-table th:first-child {
  padding-left: 24px;
}

.data-table th:last-child {
  padding-right: 24px;
  width: 40px;
}

.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table td:first-child {
  padding-left: 24px;
}

.data-table td:last-child {
  padding-right: 24px;
}

.data-table tbody tr {
  transition: background 160ms;
}

.data-table tbody tr:hover {
  background: var(--canvas);
}

.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cell-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.cell-meta {
  font-size: 11px;
  color: var(--muted);
}

.data-table code {
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--canvas);
  padding: 2px 6px;
  border-radius: 3px;
}

.progress-tiny {
  height: 3px;
  background: var(--line);
  border-radius: 100px;
  margin-bottom: 4px;
  max-width: 100px;
}

.table-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.pager {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pager-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 160ms;
  cursor: pointer;
}

.pager-btn:hover {
  background: var(--canvas);
  color: var(--ink);
}

.pager-btn.active {
  background: var(--ink);
  color: var(--paper);
}

/* ═══════════════════════════════════════════════════════
   MED / DOC / ACCESS
═══════════════════════════════════════════════════════ */

.med-grid,
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.med-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 160ms, transform 160ms;
}

.med-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.med-card-warn {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--paper), var(--accent-soft));
}

.med-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pill-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--canvas);
  display: grid;
  place-items: center;
  color: var(--ink);
}

.med-card-warn .pill-icon {
  background: var(--paper);
  color: var(--accent);
}

.med-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-top: 6px;
}

.med-name span {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 400;
}

.med-meta {
  font-size: 12.5px;
  color: var(--muted);
}

.med-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

/* Doc cards */
.doc-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  transition: border-color 160ms, transform 160ms;
  cursor: pointer;
}

.doc-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.doc-preview {
  aspect-ratio: 4/3;
  border-radius: var(--r-sm);
  background: var(--canvas);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.doc-preview-pdf {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--canvas) 100%);
  color: var(--accent-deep);
}

.doc-preview-img {
  background: linear-gradient(135deg, #E3E8DD 0%, var(--canvas) 100%);
  color: var(--ok);
}

.doc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}

.doc-meta {
  font-size: 11.5px;
  color: var(--muted);
}

.doc-card-add {
  border: 1.5px dashed var(--line-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  background: transparent;
}

.doc-card-add:hover {
  border-color: var(--ink);
  background: var(--paper);
}

.doc-card-add .add-circle {
  margin-bottom: 4px;
}

/* Access log */
.access-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.access-list li {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}

.access-list li:last-child {
  border-bottom: 0;
}

.access-time strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}

.access-time span {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.access-where strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 2px;
}

.access-where span {
  font-size: 12px;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  body {
    grid-template-columns: 220px 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .family-grid-lg {
    grid-template-columns: repeat(2, 1fr);
  }

  .emergency-layout {
    grid-template-columns: 1fr;
  }

  .form-layout {
    grid-template-columns: 1fr;
  }

  .form-steps {
    flex-direction: row;
    overflow-x: auto;
    position: static;
  }

  .step {
    white-space: nowrap;
    padding-left: 32px;
  }

  .hero-title,
  .page-title {
    font-size: 32px;
  }
}

@media (max-width: 720px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 0 16px 32px;
  }

  .snapshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .search {
    width: 180px;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .data-table {
    font-size: 12px;
  }
}

/* ═══════════════════════════════════════════════════════
   AUTH PAGES (login, register)
   Override body grid — auth is full-bleed, no sidebar
═══════════════════════════════════════════════════════ */

body.auth {
  display: block;
  grid-template-columns: none;
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-form-col {
  display: flex;
  flex-direction: column;
  padding: 32px 56px;
  background: var(--canvas);
  position: relative;
}

.auth-visual-col {
  background: var(--ink);
  color: var(--paper);
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-visual-col::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(214, 69, 69, 0.18), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(107, 142, 115, 0.12), transparent 55%);
  pointer-events: none;
}

/* Top chrome on form side */
.auth-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: auto;
}

.auth-chrome .brand {
  padding: 0;
  border: 0;
  margin: 0;
}

.auth-chrome-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 100px;
  transition: background 160ms, color 160ms;
}

.auth-chrome-back:hover {
  background: var(--canvas-soft);
  color: var(--ink);
}

/* Form wrapper — centered vertically */
.auth-card {
  max-width: 440px;
  width: 100%;
  margin: 48px auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 14px;
}

.auth-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-weight: 400;
  font-size: 46px;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 12px;
}

.auth-title em {
  color: var(--accent);
}

.auth-sub {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 32px;
  max-width: 400px;
}

/* Tabbed toggle between user / kin */
.auth-tabs {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 28px;
  width: fit-content;
}

.auth-tab {
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 100px;
  transition: all 200ms ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

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

.auth-tab svg {
  opacity: 0.6;
}

.auth-tab.active {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-tab.active svg {
  opacity: 1;
  color: var(--accent);
}

/* The two tab panels */
.auth-panel {
  display: none;
  animation: fadeUp 350ms cubic-bezier(.2, .7, .2, 1);
}

.auth-panel.active {
  display: block;
}

/* Form fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-label-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.auth-label a {
  font-size: 11.5px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
  font-weight: 500;
}

.auth-label a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.auth-input {
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
  outline: 0;
  width: 100%;
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
  font-family: inherit;
  color: var(--ink);
}

.auth-input::placeholder {
  color: var(--muted-2);
}

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

.auth-input:focus {
  border-color: var(--ink);
  background: var(--paper-2);
  box-shadow: 0 0 0 3px rgba(26, 20, 10, 0.06);
}

/* Input with icon affordance */
.auth-input-wrap {
  position: relative;
}

.auth-input-wrap .auth-input {
  padding-left: 42px;
}

.auth-input-wrap .auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.auth-input-wrap .auth-input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  transition: all 160ms;
}

.auth-input-wrap .auth-input-suffix:hover {
  background: var(--canvas-soft);
  color: var(--ink);
}

/* Remember / checkbox */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.auth-remember input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.auth-remember .check-box {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 1.5px solid var(--line-2);
  background: var(--paper);
  display: grid;
  place-items: center;
  transition: all 160ms;
  flex-shrink: 0;
}

.auth-remember input:checked+.check-box {
  background: var(--ink);
  border-color: var(--ink);
}

.auth-remember input:checked+.check-box::after {
  content: '';
  width: 8px;
  height: 4px;
  border: 1.5px solid var(--paper);
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Primary submit */
.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 200ms ease, background 200ms ease;
  font-family: inherit;
  margin-top: 8px;
}

.auth-submit:hover {
  background: var(--ink-2);
  transform: translateY(-2px);
}

.auth-submit svg {
  color: var(--accent);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Social / SSO buttons */
.auth-oauth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms, background 160ms, transform 160ms;
  font-family: inherit;
}

.auth-oauth-btn:hover {
  border-color: var(--ink);
  background: var(--paper-2);
  transform: translateY(-1px);
}

/* Footer link */
.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 28px;
}

.auth-footer a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
}

.auth-footer a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.auth-legal {
  margin-top: auto;
  padding-top: 32px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
}

.auth-legal a {
  color: var(--muted);
  text-decoration: none;
}

.auth-legal a:hover {
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════
   VISUAL COLUMN (right side)
═══════════════════════════════════════════════════════ */

.auth-visual-head {
  position: relative;
  z-index: 1;
}

.auth-visual-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  background: rgba(253, 251, 246, 0.06);
  border: 1px solid rgba(253, 251, 246, 0.14);
  border-radius: 100px;
  font-size: 11px;
  color: var(--paper);
  font-weight: 500;
  margin-bottom: 28px;
}

.auth-visual-kicker::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.25);
}

.auth-visual-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 400;
  font-size: 54px;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
  max-width: 655px;
}

.auth-visual-title em {
  color: var(--accent);
  font-style: italic;
}

.auth-visual-sub {
  font-size: 15px;
  color: rgba(253, 251, 246, 0.72);
  line-height: 1.55;
  max-width: 440px;
}

/* Visual mid — stats / trust signals */
.auth-visual-body {
  position: relative;
  z-index: 1;
  margin: 40px 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 24px 0;
  border-top: 1px solid rgba(253, 251, 246, 0.12);
  border-bottom: 1px solid rgba(253, 251, 246, 0.12);
}

.trust-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trust-stat-value {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--paper);
}

.trust-stat-value em {
  color: var(--accent);
  font-style: italic;
}

.trust-stat-label {
  font-size: 11px;
  color: rgba(253, 251, 246, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Testimonial */
.auth-testimonial {
  background: rgba(253, 251, 246, 0.04);
  border: 1px solid rgba(253, 251, 246, 0.1);
  border-radius: var(--r-md);
  padding: 22px 24px;
  position: relative;
  z-index: 1;
}

.auth-testimonial-quote {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14;
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: var(--paper);
  margin-bottom: 14px;
}

.auth-testimonial-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-testimonial-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tone-rose);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
}

.auth-testimonial-author-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--paper);
  line-height: 1.2;
}

.auth-testimonial-author-meta {
  font-size: 11px;
  color: rgba(253, 251, 246, 0.55);
}

/* Visual footer — security badges */
.auth-visual-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  color: rgba(253, 251, 246, 0.5);
}

.auth-visual-footer svg {
  flex-shrink: 0;
}

.auth-badge-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  background: rgba(253, 251, 246, 0.05);
  border: 1px solid rgba(253, 251, 246, 0.1);
  border-radius: 100px;
}

/* Info notice (shown on kin tab) */
.auth-notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: var(--r-md);
  margin-bottom: 24px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--accent-deep);
}

.auth-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent);
}

.auth-notice strong {
  display: block;
  font-weight: 500;
  margin-bottom: 2px;
  color: var(--accent-deep);
}

/* Two-column field row for register */
.auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Strength meter */
.auth-strength {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.auth-strength-bar {
  flex: 1;
  height: 3px;
  background: var(--line);
  border-radius: 100px;
}

.auth-strength-bar.active {
  background: var(--accent);
}

.auth-strength-bar.active.strong {
  background: var(--ok);
}

.auth-strength-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.auth-strength-label strong {
  color: var(--ink);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   AUTH RESPONSIVE
═══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual-col {
    display: none;
  }

  .auth-form-col {
    padding: 24px 24px 32px;
  }

  .auth-title {
    font-size: 36px;
  }
}

/* ═══════════════════════════════════════════════════════
   NEXT OF KIN DASHBOARD — SPECIFIC STYLES
═══════════════════════════════════════════════════════ */

/* Kin sidebar tweaks — narrower footprint */
.sidebar-kin .brand-tag {
  color: var(--accent-deep);
  font-weight: 600;
}

/* Watching banner (persistent identity of whose account) */
.watching-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-md);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.watching-bar::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--accent);
}

.watching-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.watching-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--tone-rose);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  flex-shrink: 0;
}

.watching-bar-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.watching-bar-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  font-weight: 500;
}

.watching-bar-name {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.watching-bar-name .kin-tag {
  font-size: 9.5px;
  padding: 2px 7px;
  background: rgba(214, 69, 69, 0.18);
  color: #F4A8A8;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.watching-bar-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(253, 251, 246, 0.08);
  color: var(--paper);
  border: 1px solid rgba(253, 251, 246, 0.14);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 160ms;
  font-family: inherit;
}

.watching-bar-switch:hover {
  background: rgba(253, 251, 246, 0.14);
  border-color: rgba(253, 251, 246, 0.25);
}

/* ═══════════════════════════════════════════════════════
   EMERGENCY ALERT CARD (top of dashboard if recent scan)
═══════════════════════════════════════════════════════ */

.alert-card {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--paper);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(214, 69, 69, 0.22);
}

.alert-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(253, 251, 246, 0.12), transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}

.alert-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.alert-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
  position: relative;
}

.alert-pulse::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--paper);
  opacity: 0.4;
  animation: alertPulse 1.4s ease-out infinite;
}

@keyframes alertPulse {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }

  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.alert-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}

.alert-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.alert-title em {
  font-style: italic;
}

.alert-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  opacity: 0.9;
}

.alert-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.alert-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.alert-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 100px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  transition: transform 160ms;
  font-family: inherit;
}

.alert-btn:hover {
  transform: translateY(-2px);
}

.alert-btn-ghost {
  background: rgba(253, 251, 246, 0.12);
  color: var(--paper);
  border: 1px solid rgba(253, 251, 246, 0.22);
}

.alert-btn-ghost:hover {
  background: rgba(253, 251, 246, 0.2);
}

.alert-dismiss {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(253, 251, 246, 0.12);
  color: var(--paper);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 160ms;
  z-index: 2;
  border: 0;
}

.alert-dismiss:hover {
  background: rgba(253, 251, 246, 0.22);
}

/* ═══════════════════════════════════════════════════════
   CRITICAL INFO PANEL (always visible for kin)
═══════════════════════════════════════════════════════ */

.critical-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}

.critical-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.critical-identity-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--tone-rose);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.critical-identity-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.critical-identity-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1;
}

.critical-identity-meta {
  font-size: 12px;
  color: var(--muted);
}

.critical-identity-id {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  padding: 2px 8px;
  background: var(--canvas);
  border-radius: 100px;
  width: fit-content;
  margin-top: 4px;
}

.critical-vitals {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.crit-vital {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 18px;
  background: var(--canvas);
  border-radius: var(--r-md);
  min-width: 82px;
}

.crit-vital-warn {
  background: var(--accent);
  color: var(--paper);
}

.crit-vital-dark {
  background: var(--ink);
  color: var(--paper);
}

.crit-vital-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

.crit-vital-warn .crit-vital-label,
.crit-vital-dark .crit-vital-label {
  color: rgba(253, 251, 246, 0.7);
}

.crit-vital-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1;
}

.crit-vital-value sup {
  font-size: 0.55em;
  color: var(--accent);
  vertical-align: super;
}

.crit-vital-warn .crit-vital-value sup {
  color: var(--paper);
}

.critical-quick-call {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.quick-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--ok);
  color: var(--paper);
  border-radius: 100px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: transform 160ms;
}

.quick-call-btn:hover {
  transform: translateY(-1px);
}

.quick-call-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

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

/* ═══════════════════════════════════════════════════════
   KIN-SPECIFIC TWO-COL LAYOUT
═══════════════════════════════════════════════════════ */

.kin-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

/* Medical brief (what to tell a doctor) */
.med-brief {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 24px;
}

.med-brief-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.med-brief-row:last-child {
  border-bottom: 0;
}

.med-brief-row:first-child {
  padding-top: 4px;
}

.med-brief-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.med-brief-key {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}

.med-brief-key.critical {
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.med-brief-key.critical::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

.med-brief-values {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.med-brief-chip {
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--canvas);
  color: var(--ink);
  border-radius: 100px;
  border: 1px solid var(--line);
}

.med-brief-chip-warn {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: var(--accent-soft);
}

.med-brief-text {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
}

/* Permissions panel — what can I do here? */
.perms-panel {
  background: linear-gradient(135deg, var(--paper) 0%, #F9F5EC 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 24px;
}

.perm-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.perm-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.perm-list li:last-child {
  border-bottom: 0;
}

.perm-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.perm-can {
  background: var(--ok-soft);
  color: var(--ok);
}

.perm-cant {
  background: var(--canvas);
  color: var(--muted-2);
}

.perm-text {
  flex: 1;
  color: var(--ink-2);
}

.perm-cant+.perm-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--line-2);
}

/* ═══════════════════════════════════════════════════════
   ACTION GRID — the things a kin can actually do
═══════════════════════════════════════════════════════ */

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.action-tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 200ms;
  text-decoration: none;
  color: inherit;
  text-align: left;
}

.action-tile:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--ink);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.action-tile-accent .action-tile-icon {
  background: var(--accent);
  color: var(--paper);
}

.action-tile-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
}

.action-tile-sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════
   TIMELINE (shared access events)
═══════════════════════════════════════════════════════ */

.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 22px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: var(--line);
}

.timeline li {
  position: relative;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -22px;
  top: 14px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line-2);
}

.timeline-dot.dot-alert {
  background: var(--accent);
  border-color: var(--accent);
}

.timeline-dot.dot-view {
  background: var(--ok);
  border-color: var(--ok);
}

.timeline-dot.dot-update {
  background: var(--muted);
  border-color: var(--muted);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
  gap: 12px;
}

.timeline-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.timeline-time {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.timeline-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.timeline-meta strong {
  color: var(--ink-2);
  font-weight: 500;
}

/* Other accounts you're NoK for */
.other-accounts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.other-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 160ms, transform 160ms;
  text-decoration: none;
  color: inherit;
}

.other-account:hover {
  border-color: var(--ink);
  transform: translateX(2px);
}

.other-account-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  flex-shrink: 0;
}

.other-account-info {
  flex: 1;
  min-width: 0;
}

.other-account-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 2px;
}

.other-account-rel {
  font-size: 11.5px;
  color: var(--muted);
}

.other-account-status {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* Responsive */
@media (max-width: 1100px) {
  .critical-panel {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .critical-quick-call {
    align-items: flex-start;
    flex-direction: row;
  }

  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kin-main-grid {
    grid-template-columns: 1fr;
  }

  .alert-title {
    font-size: 26px;
  }
}

@media (max-width: 720px) {
  .critical-vitals {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .alert-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .alert-btn {
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════
   KIN PAGES — EXTENSIONS
═══════════════════════════════════════════════════════ */

/* Policy card (insurance page) */
.policy-card {
  background: linear-gradient(135deg, var(--ink) 0%, #2A2A2A 100%);
  color: var(--paper);
  border-radius: var(--r-lg);
  padding: 30px 32px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.policy-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(214, 69, 69, 0.15), transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}

.policy-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.policy-provider {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.policy-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  font-weight: 500;
}

.policy-chip {
  font-size: 10.5px;
  padding: 5px 10px;
  background: rgba(253, 251, 246, 0.08);
  border: 1px solid rgba(253, 251, 246, 0.14);
  border-radius: 100px;
  font-weight: 500;
}

.policy-number {
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
  color: var(--paper);
}

.policy-number-mask {
  color: var(--muted-2);
  letter-spacing: 0.1em;
}

.policy-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(253, 251, 246, 0.12);
  position: relative;
  z-index: 1;
}

.policy-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.policy-meta-key {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  font-weight: 500;
}

.policy-meta-value {
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-mono);
}

.policy-meta-value.big {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Call script panel — tell kin exactly what to say */
.script-panel {
  background: var(--accent-soft);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.script-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--accent-deep);
}

.script-panel-head svg {
  flex-shrink: 0;
}

.script-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--accent-deep);
}

.script-body {
  padding: 16px 18px;
  background: var(--paper);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  font-variation-settings: "opsz" 24;
  margin-bottom: 14px;
}

.script-body strong {
  color: var(--ink);
  font-style: normal;
  font-weight: 500;
  font-family: var(--font-sans);
  background: var(--canvas);
  padding: 1px 6px;
  border-radius: 3px;
}

.script-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Claim / coverage rows */
.coverage-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coverage-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  align-items: center;
}

.coverage-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.coverage-info {
  min-width: 0;
}

.coverage-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}

.coverage-meta {
  font-size: 11.5px;
  color: var(--muted);
}

.coverage-amount {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.coverage-amount span {
  font-size: 11px;
  color: var(--muted);
  display: block;
  font-family: var(--font-sans);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Read-only medication list (different from user's med cards) */
.ro-med-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ro-med {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.ro-med-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.ro-med-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ro-med-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 2px;
}

.ro-med-dose {
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.ro-med-schedule {
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 8px 12px;
  background: var(--canvas);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ro-med-schedule svg {
  color: var(--muted);
  flex-shrink: 0;
}

.ro-med-refill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
}

.ro-med-refill-info {
  color: var(--muted);
}

.ro-med-refill-info strong {
  color: var(--ink);
  font-weight: 500;
}

.refill-bar {
  width: 100%;
  height: 3px;
  background: var(--line);
  border-radius: 100px;
  margin-top: 8px;
  overflow: hidden;
}

.refill-bar-fill {
  height: 100%;
  background: var(--ok);
  border-radius: 100px;
  transition: width 300ms;
}

.refill-bar-fill.warn {
  background: var(--warn);
}

.refill-bar-fill.low {
  background: var(--accent);
}

/* Full-screen emergency card trigger on kin emergency page */
.fullscreen-card {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--paper);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(214, 69, 69, 0.22);
}

.fullscreen-card::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(253, 251, 246, 0.15), transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}

.fullscreen-card-body {
  position: relative;
  z-index: 1;
}

.fullscreen-card-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.8;
}

.fullscreen-card-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 10px;
  max-width: 560px;
}

.fullscreen-card-title em {
  font-style: italic;
}

.fullscreen-card-sub {
  font-size: 13.5px;
  opacity: 0.85;
  max-width: 520px;
  line-height: 1.55;
}

.fullscreen-card-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 100px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: transform 180ms;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.fullscreen-card-btn:hover {
  transform: translateY(-2px);
}

/* Document group headers */
.doc-group {
  margin-bottom: 28px;
}

.doc-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.doc-group-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.doc-group-count {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* Filter bar (used on activity and documents) */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  flex-wrap: wrap;
}

.filter-bar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
  padding-right: 6px;
  border-right: 1px solid var(--line);
  margin-right: 4px;
}

/* Info banner on kin pages (non-critical context) */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}

.info-banner-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.info-banner strong {
  font-weight: 500;
  color: var(--ink);
}

/* Account card for "Other accounts" page */
.kin-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.kin-account-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 24px;
  cursor: pointer;
  transition: all 200ms;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kin-account-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kin-account-card.current {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.kin-account-card.current .kin-account-meta {
  color: var(--muted-2);
}

.kin-account-card.current .kin-account-id {
  background: rgba(253, 251, 246, 0.08);
  color: var(--muted-2);
}

.kin-account-card.current .kin-account-stats {
  border-top-color: rgba(253, 251, 246, 0.12);
}

.kin-account-card.current .kin-account-stat-label {
  color: var(--muted-2);
}

.kin-account-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kin-account-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 2px;
}

.kin-account-meta {
  font-size: 12px;
  color: var(--muted);
}

.kin-account-id {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 9px;
  background: var(--canvas);
  color: var(--muted);
  border-radius: 100px;
  width: fit-content;
  letter-spacing: 0.04em;
}

.kin-account-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.kin-account-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kin-account-stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.kin-account-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
}

.kin-account-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 500;
  width: fit-content;
}

.kin-account-alert::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-out infinite;
}

/* Responsive for kin pages */
@media (max-width: 1100px) {
  .ro-med-list {
    grid-template-columns: 1fr;
  }

  .policy-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .fullscreen-card {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════
   SHARE GRID (emergency page)
═══════════════════════════════════════════════════════ */
.share-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 160ms;
  font-family: inherit;
}

.share-chip:hover {
  border-color: var(--ink);
  background: var(--paper);
  transform: translateY(-1px);
}

.share-chip svg {
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════
   DOCUMENT GRID (documents page)
═══════════════════════════════════════════════════════ */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.doc-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 200ms;
}

.doc-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.doc-preview {
  height: 72px;
  border-radius: var(--r-sm);
  background: var(--canvas);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.doc-preview-pdf {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.doc-preview-img {
  background: var(--ok-soft);
  color: var(--ok);
}

.doc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-meta {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════
   ACCESS LOG LIST (activity page)
═══════════════════════════════════════════════════════ */
.access-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.access-list li {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 13px;
}

.access-list li:last-child {
  border-bottom: 0;
}

.access-time {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted);
}

.access-time strong {
  color: var(--ink);
  font-weight: 500;
  font-family: var(--font-sans);
}

.access-where {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.access-where strong {
  font-weight: 500;
  color: var(--ink);
}

.access-where span {
  font-size: 11.5px;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════
   ACCOUNT CARD (accounts page)
═══════════════════════════════════════════════════════ */
.account-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: all 200ms;
}

.account-card:hover {
  border-color: var(--line-2);
}

.account-card-current {
  border-color: var(--ok);
  background: var(--ok-soft);
}

.account-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Toggle row (insurance page legal contacts) */
.toggle-row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.toggle-row .toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.toggle-row .toggle-item:last-child {
  border-bottom: 0;
}

.toggle-row .toggle-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-row .toggle-item div span {
  font-size: 11.5px;
  color: var(--muted);
}



/* Medication rows */
.med-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.med-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  background: var(--canvas);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.med-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--paper);
  display: grid;
  place-items: center;
  color: var(--ink);
  flex-shrink: 0;
}

.med-info {
  flex: 1;
  min-width: 0;
}

.med-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 3px;
}

.med-title span {
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

.med-schedule {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-mono);
}


.contact-relation {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 2px;
}

.stat-unit {
  font-size: 20px;
  color: var(--muted);
  margin-left: 2px;
}

.stat-value-text {
  font-size: 24px;
  font-style: italic;
}

.stat-delta {
  font-size: 11.5px;
  color: var(--muted);
}

.stat-delta.up {
  color: var(--ok);
}

.stat-delta.down {
  color: var(--accent);
}

.stat-delta.neutral {
  color: var(--warn);
}

.progress-track {
  height: 4px;
  background: var(--line);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 100px;
  transition: width 500ms cubic-bezier(.2, .7, .2, 1);
}