/* ─────────────────────────────────────────────────────────────────────────
   Allexia — premium hospital design system
   Direction: Indian cardiac center · pale blue-white paper · deep navy ink
   Display: Lora · Body: Hanken Grotesk · Hindi: Hind · Mono: JetBrains Mono
   Accent: brass (#a07f3a) used sparingly on brand mark and numbered eyebrows
   ───────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,500&family=Hanken+Grotesk:wght@400;500;600;700&family=Hind:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* Surfaces */
  --paper:        #f4f7fc;   /* page bg, pale blue-white */
  --paper-tint:   #ecf0f8;
  --surface:      #ffffff;
  --surface-alt:  #fafbfd;

  /* Ink (text) */
  --ink:          #0a1f44;   /* primary, deep navy */
  --ink-soft:     #1f3461;
  --muted:        #5b6e8f;
  --muted-2:      #93a0bb;

  /* Lines */
  --line:         #e1e8f3;
  --line-strong:  #c8d4e8;
  --line-on-dark: rgba(255, 255, 255, 0.16);

  /* Brand — deep navy, NOT corporate-bright */
  --brand:        #0d2966;
  --brand-deep:   #061a4a;
  --brand-soft:   #e8edf7;
  --brand-link:   #1f4ca8;

  /* Accents */
  --teal:         #1d6f80;
  --teal-soft:    #d8ebed;
  --brass:        #a07f3a;   /* premium accent, used sparingly */
  --brass-soft:   #f3ebd5;

  /* States */
  --rose:         #a51e2c;
  --rose-soft:    #fbe9eb;
  --green:        #1c5e3b;
  --green-soft:   #e2f0e8;
  --amber:        #8a5a0c;
  --amber-soft:   #fbf0d9;

  /* Geometry */
  --r-sm:  6px;
  --r:     12px;
  --r-lg:  18px;
  --r-xl:  28px;

  /* Shadows — restrained, premium */
  --shadow-xs: 0 1px 0 rgba(10, 31, 68, 0.04);
  --shadow-sm: 0 1px 2px rgba(10, 31, 68, 0.05), 0 0 0 1px rgba(10, 31, 68, 0.02);
  --shadow:    0 4px 14px -3px rgba(10, 31, 68, 0.08), 0 2px 4px -2px rgba(10, 31, 68, 0.04);
  --shadow-lg: 0 18px 40px -12px rgba(10, 31, 68, 0.18), 0 6px 14px -6px rgba(10, 31, 68, 0.08);

  /* Type */
  --font-display: 'Lora', 'Hind', Georgia, 'Iowan Old Style', serif;
  --font-body:    'Hanken Grotesk', 'Hind', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

/* Subtle blueprint background — only on body, won't show inside .app */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(800px 600px at 0% -10%, rgba(13, 41, 102, 0.05), transparent 60%),
    radial-gradient(700px 500px at 100% 110%, rgba(29, 111, 128, 0.04), transparent 50%);
}

a { color: var(--brand-link); text-decoration: none; }
button, input, textarea, select { font-family: inherit; color: inherit; }

/* ── Headings — Lora display serif ─────────────────────────────────── */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.12;
  color: var(--ink);
}
h1 { font-size: clamp(30px, 6vw, 38px); font-weight: 500; }
h2 { font-size: 22px; font-weight: 500; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
em, .italic { font-style: italic; }

p, label, button, input { font-family: var(--font-body); }
p { color: var(--ink-soft); }
p.muted { color: var(--muted); font-size: 15px; }

/* ── App shell ─────────────────────────────────────────────────────── */
.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--paper);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.app.has-nav main { padding-bottom: 96px; } /* leave room for bottom nav */

@media (min-width: 481px) and (max-width: 899px) {
  .app { box-shadow: var(--shadow-lg); }
}

/* ── Desktop layout (≥900px): sidebar + content ────────────────────── */
@media (min-width: 900px) {
  body::before {
    background:
      radial-gradient(1200px 900px at 0% -10%, rgba(13, 41, 102, 0.06), transparent 60%),
      radial-gradient(900px 700px at 100% 110%, rgba(29, 111, 128, 0.04), transparent 50%);
  }

  .app {
    max-width: none;
    border-left: none; border-right: none;
    background: transparent;
    flex-direction: row;
    align-items: flex-start;
  }
  .app.has-nav main { padding-bottom: 60px; }

  /* Hide mobile-only chrome */
  .app > header.app-header { display: none; }
  .bottom-nav { display: none; }

  /* Sidebar — fixed-width column on the left */
  .desktop-aside {
    position: sticky; top: 0;
    width: 260px;
    flex-shrink: 0;
    height: 100dvh;
    padding: 22px 14px 14px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-xs);
  }
  .desktop-aside .brand {
    padding: 0 8px 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
  }
  .desktop-aside nav.side {
    display: flex; flex-direction: column;
    gap: 2px;
    flex: 1;
  }
  .desktop-aside nav.side a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r);
    color: var(--ink-soft);
    font-size: 14px; font-weight: 500;
    transition: background 160ms, color 160ms;
  }
  .desktop-aside nav.side a:hover { background: var(--paper-tint); color: var(--ink); }
  .desktop-aside nav.side a.active {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
  }
  .desktop-aside nav.side a svg {
    width: 18px; height: 18px;
    stroke: currentColor;
    stroke-width: 1.7;
    fill: none;
    stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
  }
  .desktop-aside nav.side .group-label {
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 500;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--muted-2);
    padding: 16px 12px 6px;
  }
  .desktop-aside .side-foot {
    border-top: 1px solid var(--line);
    padding: 14px 8px 4px;
  }
  .desktop-aside .side-foot .who {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px;
    color: var(--ink);
  }
  .desktop-aside .side-foot .who .avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
  }
  .desktop-aside .side-foot .who .meta {
    font-size: 11px; color: var(--muted);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
  }
  .desktop-aside .side-foot .signout {
    display: block; width: 100%;
    margin-top: 10px;
    background: transparent; border: 1px solid var(--line-strong);
    color: var(--ink-soft);
    padding: 8px 12px;
    border-radius: var(--r);
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms, color 160ms;
  }
  .desktop-aside .side-foot .signout:hover { color: var(--rose); border-color: var(--rose); }

  /* Main content area on desktop */
  .app > main {
    flex: 1;
    min-width: 0;
    max-width: 1180px;
    padding: 32px 40px 64px;
  }

  /* Topbar shown above main on desktop — replaces header on mobile */
  .desktop-topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
  }
  .desktop-topbar .pretitle {
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .desktop-topbar h1 {
    font-size: 26px;
    margin: 0;
  }
  .desktop-topbar .right { display: flex; align-items: center; gap: 12px; }
}

@media (max-width: 899px) {
  .desktop-aside { display: none; }
  .desktop-topbar { display: none; }
}

header.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

/* Brand mark — Lora upright with brass vertical rule */
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.brand::before {
  content: '';
  width: 3px; height: 20px;
  background: var(--brass);
  border-radius: 2px;
}

main { flex: 1; padding: 28px 22px 40px; }

/* ── Section eyebrow ────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.eyebrow::before {
  content: '';
  width: 18px; height: 2px;
  background: var(--brass);
  border-radius: 1px;
}

/* ── Forms ──────────────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.input, .textarea, .select {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  box-shadow: var(--shadow-xs);
}
.textarea { height: 110px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235b6e8f' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 40px;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(13, 41, 102, 0.08);
}
.input.center {
  text-align: center;
  letter-spacing: 8px;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  text-transform: uppercase;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }

.field { margin-bottom: 18px; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 24px;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: var(--r);
  font-family: var(--font-body);
  font-weight: 600; font-size: 15px;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: transform 80ms ease, background 200ms, border-color 200ms, box-shadow 200ms;
  width: 100%;
  box-shadow: var(--shadow-sm);
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:hover:not(:disabled) {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  box-shadow: var(--shadow);
}

.btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.btn.ghost:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--surface);
}

.btn.teal { background: var(--teal); border-color: var(--teal); }
.btn.teal:hover:not(:disabled) { background: #155460; border-color: #155460; }

.btn.danger { background: var(--rose); border-color: var(--rose); }
.btn.danger:hover:not(:disabled) { background: #861823; border-color: #861823; }

.btn.row { width: auto; padding: 0 18px; height: 42px; font-size: 14px; }

/* ── Row / stack utilities ──────────────────────────────────────────── */
.row { display: flex; gap: 12px; align-items: center; }
.row > .grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-tight { gap: 10px; }
.spacer { height: 16px; }
.spacer-lg { height: 32px; }

/* ── Tiles for home grid ────────────────────────────────────────────── */
.tile {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.tile:active { transform: translateY(1px); }

/* hero tile — register, deep navy. Compact, action-density. */
.tile.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--brand);
  color: #fff;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-radius: var(--r-lg);
}
.tile.hero .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile.hero .label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.tile.hero .title {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}
.tile.hero .arrow {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 16px;
  flex-shrink: 0;
  transition: background 200ms;
}
.tile.hero:hover .arrow { background: rgba(255, 255, 255, 0.2); }

/* outline tile — lookup, same compact treatment */
.tile.outline {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border-radius: var(--r-lg);
}
.tile.outline .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile.outline .label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
}
.tile.outline .title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.tile.outline .arrow {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 16px;
  flex-shrink: 0;
  transition: background 200ms;
}
.tile.outline:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.tile.outline:hover .arrow { background: var(--brand); color: #fff; }

/* subtle tile — secondary nav (Settings, Sync) */
.tile.subtle {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px 16px;
  font-size: 14px; font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--r);
}
.tile.subtle .arrow { color: var(--muted-2); font-size: 14px; }
.tile.subtle:hover { border-color: var(--line-strong); }

/* ── Alerts ────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  margin-top: 14px;
  border: 1px solid transparent;
  line-height: 1.45;
}
.alert.error { background: var(--rose-soft); color: var(--rose); border-color: rgba(165, 30, 44, 0.14); }
.alert.ok    { background: var(--green-soft); color: var(--green); border-color: rgba(28, 94, 59, 0.14); }
.alert.warn  { background: var(--amber-soft); color: var(--amber); border-color: rgba(138, 90, 12, 0.14); }

/* ── Pills ─────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.pill.online  { background: var(--green-soft); color: var(--green); border-color: rgba(28, 94, 59, 0.2); }
.pill.offline { background: var(--rose-soft);  color: var(--rose);  border-color: rgba(165, 30, 44, 0.2); }
.pill.syncing { background: var(--amber-soft); color: var(--amber); border-color: rgba(138, 90, 12, 0.2); }

/* ── PIN input ─────────────────────────────────────────────────────── */
.pin {
  display: flex; gap: 14px; justify-content: center;
  margin: 22px 0 6px;
}
.pin input {
  width: 60px; height: 72px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r);
  text-align: center;
  font-family: var(--font-display);
  font-size: 32px; font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: border-color 200ms, box-shadow 200ms;
  box-shadow: var(--shadow-xs);
}
.pin input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(13, 41, 102, 0.08);
}
.pin input:not(:placeholder-shown) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* ── Lang toggle ───────────────────────────────────────────────────── */
.lang {
  display: inline-flex;
  padding: 3px;
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
}
.lang button {
  background: transparent; border: none;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 180ms;
}
.lang button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.lang button[data-locale="hi"] { font-family: 'Hind', var(--font-body); font-weight: 600; }

/* ── Scanner ───────────────────────────────────────────────────────── */
.scanner {
  width: 100%; aspect-ratio: 1;
  max-width: 460px;
  margin: 0 auto;
  background: linear-gradient(140deg, #061021 0%, #0a1731 100%);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.photo-cap { max-width: 460px; margin: 0 auto; }
.scanner::after {
  /* viewfinder corners — brass for premium accent */
  content: '';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64%; aspect-ratio: 1;
  background:
    linear-gradient(to right, var(--brass) 3px, transparent 3px) 0 0/28px 3px no-repeat,
    linear-gradient(to bottom, var(--brass) 3px, transparent 3px) 0 0/3px 28px no-repeat,
    linear-gradient(to left, var(--brass) 3px, transparent 3px) 100% 0/28px 3px no-repeat,
    linear-gradient(to bottom, var(--brass) 3px, transparent 3px) 100% 0/3px 28px no-repeat,
    linear-gradient(to right, var(--brass) 3px, transparent 3px) 0 100%/28px 3px no-repeat,
    linear-gradient(to top, var(--brass) 3px, transparent 3px) 0 100%/3px 28px no-repeat,
    linear-gradient(to left, var(--brass) 3px, transparent 3px) 100% 100%/28px 3px no-repeat,
    linear-gradient(to top, var(--brass) 3px, transparent 3px) 100% 100%/3px 28px no-repeat;
  pointer-events: none;
  z-index: 2;
}
.scanner video,
.scanner #qr-region,
.scanner #qr-region > div {
  width: 100% !important; height: 100% !important; object-fit: cover;
}

.photo-cap {
  width: 100%; aspect-ratio: 3/4;
  background: #061021;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.photo-cap video, .photo-cap img { width: 100%; height: 100%; object-fit: cover; }
.photo-cap .shutter {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  width: 68px; height: 68px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 80ms;
}
.photo-cap .shutter:active { transform: translateX(-50%) scale(0.92); }

/* ── Patient profile card ──────────────────────────────────────────── */
.patient-card {
  display: flex; gap: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.patient-card .avatar {
  width: 92px; height: 92px;
  background: var(--brand-soft);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--brand);
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
}
.patient-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.patient-card .info { flex: 1; min-width: 0; }
.patient-card .name {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--ink);
}
.patient-card .meta {
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 3px;
}
.patient-card .meta.mono {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ── Visit list — vertical timeline rule ───────────────────────────── */
.visit-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 14px;
  position: relative;
}
.visit-item {
  padding: 14px 18px 14px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  position: relative;
}
.visit-item::before {
  content: '';
  position: absolute;
  left: 12px; top: 16px;
  width: 3px; height: calc(100% - 32px);
  background: var(--brand);
  border-radius: 2px;
  opacity: 0.5;
}
.visit-item .vt {
  font-family: var(--font-body);
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 2px;
  color: var(--ink);
}
.visit-item .vmeta {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

/* ── Steps progress (register flow) ────────────────────────────────── */
.steps {
  display: flex; gap: 6px;
  margin-bottom: 20px;
}
.step {
  flex: 1; height: 4px;
  background: var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  border: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 80ms;
}
.step:not(:disabled):hover { transform: scaleY(1.5); }
.step:not(:disabled):active { transform: scaleY(0.9); }
.step.done { background: var(--brand); }
.step.active::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--brand);
  animation: stepFill 600ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform-origin: left;
}
@keyframes stepFill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Skip / link buttons ───────────────────────────────────────────── */
.skip-btn {
  display: block; margin: 18px auto 0;
  background: transparent; border: none;
  font-family: var(--font-body);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 18px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  transition: color 200ms, text-decoration-color 200ms;
}
.skip-btn:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* ── Bottom navigation bar ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10;
  pointer-events: none;
}
.bottom-nav-inner {
  pointer-events: auto;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 6px 4px 4px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--r);
  transition: color 200ms, transform 80ms;
}
.bottom-nav a:active { transform: scale(0.96); }
.bottom-nav a svg {
  width: 22px; height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.active svg { stroke-width: 1.9; }
.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: -7px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2px;
  background: var(--brand);
  border-radius: 0 0 2px 2px;
}

/* ── Toast ─────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; top: 22px;
  transform: translateX(-50%) translateY(-12px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 16px 40px rgba(10, 31, 68, 0.28);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms, transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--rose); }

/* ── Loader ────────────────────────────────────────────────────────── */
.loader {
  width: 28px; height: 28px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-loader { display: flex; justify-content: center; padding: 60px 20px; }

/* ── Page entrance — single safe fade-in (won't trap dynamic content) */
.app { animation: appIn 280ms cubic-bezier(0.2, 0, 0, 1); }
@keyframes appIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

main > h1, main > h2 { animation: fadeUp 420ms cubic-bezier(0.4, 0, 0.2, 1) both; }
main > .eyebrow { animation: fadeUp 360ms cubic-bezier(0.4, 0, 0.2, 1) both; }
main > .stack > * { animation: fadeUp 460ms cubic-bezier(0.4, 0, 0.2, 1) both; }
main > .stack > *:nth-child(1) { animation-delay: 60ms; }
main > .stack > *:nth-child(2) { animation-delay: 130ms; }
main > .stack > *:nth-child(3) { animation-delay: 200ms; }
main > .stack > *:nth-child(n+4) { animation-delay: 270ms; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Section divider — plain hairline rule with optional label ────── */
.divider {
  display: flex; align-items: center; gap: 14px;
  margin: 28px 0 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}
.divider .label {
  font-family: var(--font-mono);
  color: var(--muted);
}

/* ── Card stack pattern (settings list) ────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}
.card .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Inline data grid (e.g., aadhaar last4 + phone) */
.data-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  padding: 16px 18px;
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-top: 14px;
}
.data-grid dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.data-grid dd {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
