/* ==========================================================================
   MediRec design system — "Lume" edition
   Near-black ground, warm off-white ink, pale cream as the single accent,
   Instrument Serif for display, Inter for everything else. One sheet serves
   the marketing site and the clinical consoles; console-only pieces are at
   the bottom. Motion is limited to hover/press feedback and one hero drift.
   ========================================================================== */
/* Fonts are requested once per page by a <link> in the head (Inter, Inter Tight, Instrument Serif), not imported here: a stylesheet import blocks first paint, and every page paid for it twice. */

:root {
  --ground: #050505;
  --surface: #111111;
  --surface-2: #181818;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --ink: #f4f4f0;
  --ink-soft: rgba(244, 244, 240, 0.68);
  --ink-mute: rgba(244, 244, 240, 0.50);
  --ink-card: #eef0d0;
  --accent: #eef0d0;
  --accent-deep: #f6f7e2;
  --accent-soft: rgba(238, 240, 208, 0.10);
  --accent-line: rgba(238, 240, 208, 0.30);
  --on-accent: #16160f;
  --amber: #e8930c;
  --amber-soft: rgba(232, 147, 12, 0.14);
  --amber-ink: #f3bd6a;
  --ok: #8fd9a8;
  --ok-soft: rgba(14, 124, 58, 0.22);
  --danger: #ff9b93;
  --danger-soft: rgba(179, 38, 30, 0.24);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 34px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 28px 64px -24px rgba(0, 0, 0, 0.7);
  --radius: 20px;
  --radius-lg: 28px;
  --radius-sm: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Inter Tight", "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --body-alt: "Inter", -apple-system, "Segoe UI", sans-serif;
  --cta: "Inter Tight", "Inter", -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
[id] { scroll-margin-top: 84px; }
body {
  font-family: var(--font); color: var(--ink); background: var(--ground);
  line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: var(--font); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
h1, h2 { font-family: var(--display); font-weight: 500; line-height: 1.04; letter-spacing: -0.03em; }
h1 em, h2 em, .display-em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; font-size: 1.06em; }
h3 { line-height: 1.2; letter-spacing: -0.01em; font-weight: 600; }
.serif { font-family: var(--serif); font-weight: 400; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Type helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--body-alt); font-size: 13px; font-weight: 500;
  color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  border-radius: 999px; padding: 7px 14px; margin-bottom: 18px;
}
.section { padding: 96px 0; }
.section.tight { padding-bottom: 48px; }
.section.on-white { background: var(--ground); }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(32px, 4vw, 50px); margin-bottom: 14px; text-wrap: balance; }
.section-head p { font-family: var(--body-alt); color: var(--ink-soft); font-size: 17px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--cta); font-size: 15px; font-weight: 600; letter-spacing: 0; padding: 13px 24px; border-radius: 999px;
  border: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn-primary { background: #ffffff; color: #000; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.btn-primary:hover { background: #ececec; transform: scale(1.03); }
.btn--cream { background: var(--accent); color: var(--on-accent); }
.btn--cream:hover { background: #f3f5da; }
.btn-ghost, .btn--glass {
  background: rgba(255, 255, 255, 0.10); color: var(--ink);
  backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.btn-ghost:hover, .btn--glass:hover { background: rgba(255, 255, 255, 0.18); }
.btn-light, .btn--dark { background: #0b0b0b; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.btn-light:hover, .btn--dark:hover { background: #242424; }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Nav: floating glass pill (site) / sticky bar (console) ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 5, 5, 0.74);
  backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--line);
}
.nav--float {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 60;
  width: min(1080px, calc(100% - 32px)); border-radius: 999px; border-bottom: 0;
  background: rgba(255, 255, 255, 0.10); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.nav--float .nav-inner { height: auto; padding: 8px 8px 8px 20px; }
.nav--float .logo { font-size: 17px; }
.nav--float .nav-links { font-size: 13.5px; color: rgba(255, 255, 255, 0.75); gap: 26px; }
.nav--float .nav-links a:hover, .nav--float .nav-links a.active { color: #fff; }
.nav--float .nav-cta { gap: 14px; font-size: 13.5px; font-weight: 500; }
.nav--float .nav-cta .btn-ghost { background: none; box-shadow: none; backdrop-filter: none; padding: 0; font-family: var(--font); font-weight: 500; }
.nav--float .nav-cta .btn-primary { padding: 10px 18px; font-size: 13.5px; box-shadow: none; }
.nav--float .nav-cta .btn-primary:hover { transform: none; }
.nav--float .nav-mobile { border-top: 0; background: transparent; padding: 4px 16px 14px; }
.nav--float.nav--open { border-radius: 24px; background: rgba(10, 10, 10, 0.92); }
body:has(.nav--float) main > .page-hero { padding-top: 150px; }
body:has(.nav--float) main > .section:first-child { padding-top: 150px; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 0.42em; font-size: 19px; font-weight: 500; letter-spacing: -0.014em; color: var(--ink); }
.logo-mark, .brand__mark { width: 1.02em; height: 1.02em; flex: none; display: block; color: currentColor; }
.logo .accent { color: inherit; }
.nav-links { display: flex; align-items: center; gap: 26px; font-size: 14.5px; font-weight: 500; color: var(--ink-soft); }
.nav-links a { white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-cta .btn { padding: 10px 18px; font-size: 14px; }
.menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--ink); }
.nav-mobile { display: none; flex-direction: column; gap: 4px; padding: 12px 24px 20px; border-top: 1px solid var(--line); background: var(--ground); }
.nav-mobile a { padding: 10px 0; font-weight: 500; color: var(--ink-soft); }
.nav-badge {
  white-space: nowrap; max-width: min(60vw, 320px); overflow: hidden; text-overflow: ellipsis;
  font-size: 13px; font-weight: 500; color: var(--accent);
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line);
  padding: 5px 12px; border-radius: 999px;
}

/* ---------- Page hero (inner pages): the same late-afternoon light as home ---------- */
.page-hero {
  position: relative; overflow: hidden; padding: 96px 0 64px; text-align: center;
  background:
    radial-gradient(60% 55% at 50% -10%, rgba(37, 99, 235, 0.28) 0%, rgba(37, 99, 235, 0) 70%),
    linear-gradient(to bottom, #0a1020 0%, #050505 100%);
}
.page-hero .wrap { display: flex; flex-direction: column; align-items: center; }
.page-hero h1 { font-size: clamp(44px, 6.2vw, 80px); margin-bottom: 18px; max-width: 16ch; text-wrap: balance; }
.page-hero .lede { text-align: center; }
.page-hero .lede { font-family: var(--body-alt); font-size: 18px; color: var(--ink-soft); max-width: 58ch; }

/* ---------- Stats strip ---------- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--ground); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-block: 56px; }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.6vw, 72px); line-height: 1; color: var(--accent); }
.stat span { display: block; margin-top: 0.7em; font-size: 14px; color: var(--ink-soft); max-width: 22ch; line-height: 1.4; }

/* ---------- Cards & grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; }
.card .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { font-size: 14.5px; color: var(--ink-soft); }
.card-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 500; color: var(--accent); margin-top: 14px; margin-right: 14px; border-bottom: 1px solid var(--accent-line); }
/* a thumb, not a pointer (T-33): every link and control on a phone is at least 44px tall, and an input is 16px so iOS does not zoom */
@media (max-width: 640px) {
  .card-link { min-height: 44px; padding: 8px 0; border-bottom: 0; text-decoration: underline; text-underline-offset: 4px; }
  .nav-links a, .foot-col a, .menu-panel a { display: inline-flex; align-items: center; min-height: 44px; }
  .field input, .field select, .field textarea, input[type="search"], input[type="text"], input[type="email"], input[type="password"], select, textarea { font-size: 16px; }
  .btn, .cta, button.qbtn { min-height: 44px; }
  /* a link inside a sentence keeps its place in the line but takes a thumb's hit area */
  p a, li a, .reel-links a, .hero-secondary, .who-line a, .form-fallback a, .foot a, .row > button.link, button.link { padding-block: 12px; margin-block: -12px; }
}
.card-link:hover { border-bottom-color: var(--accent); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { padding: 32px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step-num { font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--accent); margin-bottom: 16px; }
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { font-size: 14.5px; color: var(--ink-soft); }

.lang-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 760px; margin: 0 auto; }
.lang-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; font-size: 15px; font-weight: 400; color: var(--ink-soft); }
.lang-chip b { color: var(--accent); font-weight: 500; margin-right: 6px; }

/* ---------- Check lists ---------- */
.check-list { list-style: none; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 11px; font-size: 14.5px; align-items: flex-start; color: var(--ink-soft); }
.check-list li b { color: var(--ink); font-weight: 500; }
.check-list .ic { width: 19px; height: 19px; color: var(--accent); flex: none; margin-top: 2px; }
.check-list .cb { flex: none; width: 20px; height: 20px; border-radius: 6px; margin-top: 1px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 12px; font-weight: 600; }

/* ---------- Product detail blocks ---------- */
.product-block { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.product-name { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--accent); margin-bottom: 12px; }
.product-block h2 { font-size: clamp(30px, 3.8vw, 46px); margin-bottom: 12px; }
.product-block .desc { font-size: 16px; color: var(--ink-soft); margin-bottom: 22px; max-width: 520px; }
.product-block .check-list { margin-bottom: 26px; }
.verify-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.verify-head { font-size: 13px; font-weight: 500; color: var(--on-accent); padding: 14px 20px; background: var(--accent); }
.verify-row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-soft); }
.verify-row:last-child { border-bottom: none; }
.verify-row .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.dot.ok { background: var(--ok); }
.dot.warn { background: #f0653f; }
.verify-row .tag { margin-left: auto; font-size: 11px; font-weight: 500; flex: none; color: var(--ink-mute); }

/* ---------- Claims ---------- */
.claim-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 34px 30px; }
.claim-card .aud { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--amber-ink); background: var(--amber-soft); border-radius: 999px; padding: 6px 14px; margin-bottom: 16px; }
.claim-card.insurer .aud { color: var(--accent); background: var(--accent-soft); }
.claim-card h3 { font-size: 21px; margin-bottom: 8px; }
.claim-card > p { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 20px; }

/* ---------- Compliance band ---------- */
.compliance { background: linear-gradient(168deg, #0f2432 0%, #143444 100%); color: var(--ink); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.compliance h2 { color: #fff; }
.compliance .section-head p { color: var(--ink-soft); }
.comp-item { display: flex; gap: 16px; align-items: flex-start; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: var(--radius); padding: 24px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.comp-item .icon { flex: none; width: 42px; height: 42px; border-radius: 10px; background: rgba(255, 255, 255, 0.10); color: var(--accent); display: grid; place-items: center; }
.comp-item .icon .ic { width: 22px; height: 22px; }
.comp-item h3 { font-size: 16.5px; color: #fff; margin-bottom: 6px; }
.comp-item p { font-size: 14px; color: var(--ink-soft); }

/* ---------- Chat mock (Sampark) ---------- */
.chat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-md); align-self: start; }
.chat-head { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; font-weight: 500; font-size: 14px; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.chat-head .sub { display: block; font-size: 12px; color: var(--ink-mute); font-weight: 400; }
.bubble { max-width: 88%; border-radius: 14px; padding: 10px 14px; font-size: 13.5px; line-height: 1.55; margin-bottom: 10px; }
.bubble.in { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.out { background: var(--accent); color: var(--on-accent); margin-left: auto; border-bottom-right-radius: 4px; }
.bubble .time { display: block; font-size: 11px; color: var(--ink-mute); margin-top: 4px; text-align: right; }
.bubble.out .time { color: rgba(22, 22, 15, 0.6); }
.chat-actions { display: flex; gap: 8px; margin-bottom: 10px; max-width: 88%; }
.chat-actions span { flex: 1; text-align: center; font-size: 12.5px; font-weight: 500; color: var(--accent); border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 8px; }

/* ---------- Testimonials ---------- */
.quote { border-top: 1px solid var(--line); padding: 26px 0 0; display: flex; flex-direction: column; gap: 18px; }
.quote .stars { display: none; }
.quote p { font-family: var(--serif); font-size: clamp(19px, 1.5vw, 24px); line-height: 1.3; color: var(--ink); flex: 1; }
.quote-who { display: flex; align-items: center; gap: 12px; }
.avatar { display: none; }
.quote-who b { display: block; font-size: 14.5px; font-weight: 500; }
.quote-who span { font-size: 13px; color: var(--ink-mute); }

/* ---------- Pricing ---------- */
.price-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px 30px; background: var(--surface); display: flex; flex-direction: column; }
.price-card.featured { background: var(--accent); color: var(--on-accent); border-color: var(--accent); position: relative; box-shadow: var(--shadow-lg); }
.price-card .plan { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--accent); margin-bottom: 10px; }
.price-card.featured .plan { color: #5a5a3e; }
.price { font-family: var(--serif); font-size: 52px; line-height: 1; letter-spacing: 0; margin-bottom: 6px; }
.price small { font-family: var(--font); font-size: 15px; font-weight: 400; color: var(--ink-mute); }
.price-desc { font-size: 14px; color: var(--ink-mute); margin-bottom: 22px; }
.price-card.featured .price small, .price-card.featured .price-desc { color: #5a5a3e; }
.price-card .check-list { margin-bottom: 28px; flex: 1; gap: 11px; }
.price-card .check-list li { color: inherit; }
.price-card.featured .check-list .ic { color: var(--on-accent); }
.price-card.featured .btn-primary { background: var(--on-accent); color: var(--accent); }
.price-card.featured .btn-primary:hover { background: #2a2a1e; }
.pop-badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--amber); color: #1a0d00; font-size: 12px; font-weight: 500; padding: 6px 16px; border-radius: 999px; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; text-align: left; background: none; border: none; cursor: pointer; font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; font-size: 19px; color: var(--ink); padding: 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq-q .ic { width: 20px; height: 20px; color: var(--ink-mute); transition: transform 0.25s ease; flex: none; }
.faq-item.open .faq-q .ic { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-a p { padding: 0 0 22px; font-size: 15px; color: var(--ink-soft); max-width: 62ch; }

/* ---------- CTA & demo form (cream block, dark ink) ---------- */
.cta { background: var(--accent); border-radius: var(--radius-lg); color: var(--on-accent); padding: 72px 48px; text-align: center; }
.cta h1, .cta h2 { font-size: clamp(34px, 4.2vw, 56px); margin-bottom: 14px; color: var(--on-accent); }
.cta p { font-size: 17px; color: #4a4a36; max-width: 520px; margin: 0 auto 32px; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.site-form { max-width: 680px; margin: 0 auto; }
.site-form.has-form { background: #fff; border-radius: var(--radius); overflow: hidden; }
.site-form iframe { display: block; width: 100%; min-height: 980px; border: 0; }
.site-form .form-fallback { font-size: 17px; color: var(--on-accent); margin: 0 auto; }
.site-form .form-fallback a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: #4a4a36; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; font-size: 15px; color: #16160f; background: #fff; border: 1.5px solid transparent; border-radius: 10px; padding: 12px 14px; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; color-scheme: light; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #16160f; box-shadow: 0 0 0 3px rgba(22, 22, 15, 0.12); }
.field textarea { resize: vertical; min-height: 88px; }
.field input::placeholder, .field textarea::placeholder { color: #8a8a78; }
.field .err { display: none; font-size: 12.5px; color: #8a2a22; margin-top: 5px; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid select { border-color: #b3261e; }
.contact-aside { text-align: center; margin-top: 28px; font-size: 15px; color: var(--ink-mute); }
.contact-aside a { color: var(--accent); border-bottom: 1px solid var(--accent-line); }

/* ---------- Footer ---------- */
.site-foot { background: var(--ground); color: var(--ink-soft); padding: 64px 0 32px; margin-top: 96px; border-top: 1px solid var(--line); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.foot-brand p { font-size: 14px; margin-top: 14px; max-width: 280px; color: var(--ink-mute); }
.site-foot .logo { color: var(--ink); }
.foot-col h4 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 18px; color: var(--accent); margin-bottom: 14px; }
.foot-col a { display: block; font-size: 14.5px; padding: 5px 0; color: var(--ink-soft); }
.foot-col a:hover { color: var(--ink); }
.foot-bottom { border-top: 1px solid var(--line); padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-mute); }

/* ---------- Motion: reveal is retired; class kept so pages need no edits ---------- */
.reveal { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ==========================================================================
   Console layer — shared by the clinical pages (front desk, doctor, consult,
   Sampark, stats, dashboard, suite). Utilitarian, dense, calm.
   ========================================================================== */
.console { max-width: 1200px; margin: 0 auto; padding: 0 24px 64px; }
.console-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0; }
.console-head .who { font-size: 13px; color: var(--ink-mute); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.console-head .who a { color: var(--accent); font-weight: 500; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { font-family: var(--font); font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.panel .hint { font-size: 12.5px; color: var(--ink-mute); margin-bottom: 14px; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
/* the filing panel (T-37), one for every console */
.files .fl-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.files .fl-row:first-child { border-top: 0; }
.files .fl-main { flex: 1; min-width: 0; } .files .fl-main b { display: block; } .files .fl-main small { color: var(--ink-mute); font-size: 12px; } .files .fl-main p { margin: 3px 0 0; font-size: 13px; color: var(--ink-soft); }
.files .fl-nofile { font-size: 12px; color: var(--ink-mute); white-space: nowrap; padding-top: 4px; }
.files .empty { font-size: 13px; color: var(--ink-mute); padding: 6px 0; }
.filing .u-read { margin: -4px 0 12px; }
.filing .u-read-rows { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.filing .u-read-rows th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-mute); border-bottom: 1px solid var(--line); padding: 4px 6px; }
.filing .u-read-rows td { padding: 5px 6px; border-bottom: 1px solid #f3f4f6; }
.filing .u-read-note { margin-top: 8px; font-size: 12.5px; color: var(--ink-mute); }
.filing .u-recent { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.filing .u-recent-h { font-size: 11.5px; font-weight: 600; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 4px; }
.filing .u-recent-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.filing .u-recent-row.err { opacity: .7; } .filing .u-recent-row.err b { text-decoration: line-through; }
.filing .u-recent-main { flex: 1; min-width: 0; } .filing .u-recent-main b { display: block; } .filing .u-recent-main small { color: var(--ink-mute); font-size: 12px; }
.filing .u-recent-why { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; margin-top: 4px; } .filing .u-recent-why input { flex: 1; min-width: 160px; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; }
.filing .u-kind { display: flex; gap: 6px; flex-wrap: wrap; }
.filing .u-kind .qbtn.on { background: #111827; color: #fff; border-color: #111827; }
.filing .row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.filing .msg { font-size: 13px; margin-top: 10px; min-height: 20px; }
.filing .msg.ok { color: var(--ok, #16a34a); font-weight: 600; }
.filing .msg.err { color: var(--danger, #dc2626); font-weight: 600; }
.filing .u-found { position: absolute; z-index: 6; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px -16px rgba(0,0,0,.35); overflow: hidden; max-height: 280px; overflow-y: auto; }
.filing .u-found .empty { padding: 12px; font-size: 13px; color: var(--ink-mute); }
.filing .u-row { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-bottom: 1px solid #f3f4f6; padding: 9px 12px; cursor: pointer; }
.filing .u-row:hover { background: #f9fafb; }
.filing .u-row b { font-size: 13.5px; } .filing .u-row small { font-size: 12px; color: var(--ink-mute); }
.filing .u-tag { display: inline-block; font-size: 11px; font-weight: 600; color: #166534; background: #dcfce7; border-radius: 999px; padding: 1px 7px; }
.filing .u-picked, .filing .u-pinned { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #f9fafb; font-size: 13.5px; }
.filing .u-picked small { color: var(--ink-mute); font-size: 12px; } .filing .u-picked .qbtn { margin-left: auto; }
.f { margin-bottom: 11px; }
.f label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-mute); margin-bottom: 5px; }
.f input, .f textarea, .f select { width: 100%; font-size: 14px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--ground); }
.f textarea { resize: vertical; min-height: 54px; line-height: 1.55; }
.f input:focus, .f textarea:focus, .f select:focus { outline: 2px solid var(--accent-line); border-color: var(--accent-line); }
input, select, textarea { color: var(--ink); background: var(--ground); border-color: var(--line-strong); }
input::placeholder, textarea::placeholder { color: var(--ink-mute); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 4px 11px; color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.pill.warn { color: var(--amber-ink); background: var(--amber-soft); box-shadow: none; }
.pill.bad { color: var(--danger); background: var(--danger-soft); box-shadow: none; }
.pill.ok { color: var(--ok); background: var(--ok-soft); box-shadow: none; }
.pill.mute { color: var(--ink-mute); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.tag { font-size: 11px; font-weight: 500; letter-spacing: 0.02em; border-radius: 6px; padding: 3px 9px; }
.tag.ok { color: var(--ok); background: var(--ok-soft); }
.tag.warn { color: var(--amber-ink); background: var(--amber-soft); }
.tag.bad { color: var(--danger); background: var(--danger-soft); }
.tag.info { color: var(--ink-mute); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.banner { display: none; margin-top: 12px; padding: 12px 16px; border-radius: 12px; font-weight: 500; font-size: 14px; }
.banner.show { display: block; }
.banner.ok { background: var(--ok-soft); border: 1px solid rgba(143, 217, 168, 0.35); color: var(--ok); }
.banner.bad { background: var(--danger-soft); border: 1px solid rgba(255, 155, 147, 0.35); color: var(--danger); }
.list-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list-row:first-child { border-top: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row small { display: block; color: var(--ink-mute); font-size: 12.5px; }
.empty { color: var(--ink-mute); font-size: 13.5px; padding: 18px 0; text-align: center; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-mute); }
.kv dd { color: var(--ink); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-mute); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat-tile b { display: block; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-tile span { font-size: 12.5px; color: var(--ink-mute); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  /* the seven-link row (About joined in T-91) no longer fits beside the logo and CTA: hamburger from here down */
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .menu-btn { display: block; }
  .nav-mobile.open { display: flex; }
}
@media (max-width: 960px) {
  .product-block, .grid-2, .panel-grid { grid-template-columns: 1fr; }
  .grid-3, .steps, .stats-grid, .foot-grid, .tiles { grid-template-columns: 1fr 1fr; }
  .nav--float { top: 12px; }
}
@media (max-width: 680px) {
  .section { padding: 64px 0; }
  body:has(.nav--float) main > .page-hero, body:has(.nav--float) main > .section:first-child { padding-top: 110px; }
  .grid-3, .steps, .stats-grid, .foot-grid, .tiles { grid-template-columns: 1fr; }
  .cta { padding: 56px 24px; }
  .kv { grid-template-columns: 1fr; }
  .page-hero { padding: 72px 0 48px; }
}
@media (min-width: 961px) { .nav-mobile { display: none !important; } }

/* ==========================================================================
   Light console shell (every page behind login). Body-level tokens flip the
   shared components; the rail and top bar are mounted by main.js.
   ========================================================================== */
body.console-light {
  color-scheme: light;
  --ground: #F9F9FA; --surface: #ffffff; --surface-2: #f3f4f6;
  --line: #e5e7eb; --line-strong: #d1d5db;
  --ink: #111827; --ink-soft: #4b5563; --ink-mute: #566070; /* T-100: AA on tinted rows and chips, not only on white */
  --accent: #111827; --accent-deep: #000000; --accent-soft: #eef2ff; --accent-line: #c7d2fe; --on-accent: #ffffff;
  --amber: #e8930c; --amber-soft: #fff4e0; --amber-ink: #9a5b00;
  --ok: #166534; --ok-soft: #dcfce7; --danger: #b91c1c; --danger-soft: #fee2e2;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06); --shadow-md: 0 10px 30px -18px rgba(17, 24, 39, 0.25); --shadow-lg: 0 24px 48px -24px rgba(17, 24, 39, 0.3);
  --radius: 12px; --radius-lg: 14px; --radius-sm: 9px;
  --blue: #4f46e5; --blue-soft: #c7d2fe; --blue-ink: #3730a3;
  /* T-77: one soft hue per referral kind — the tint and the ink that reads on it (each pair ≥ 6.3:1) */
  --kind-lab: #e0f2fe; --kind-lab-ink: #075985;
  --kind-imaging: #ccfbf1; --kind-imaging-ink: #115e59;
  --kind-pharmacy: #dcfce7; --kind-pharmacy-ink: #166534;
  --kind-specialist: #fef3c7; --kind-specialist-ink: #92400e;
  /* T-80: the sidebar's width, so the page's gutter and the sidebar can never disagree about it */
  --rail-w: 232px;
  background: var(--ground); color: var(--ink); padding-left: var(--rail-w);
}
/* folded back to the icon strip T-31 built */
body.console-light.rail-mini { --rail-w: 56px; }
body.console-light h1, body.console-light h2, body.console-light h3 { font-family: var(--font); letter-spacing: -0.01em; }
body.console-light h1 { font-weight: 600; }
body.console-light .btn-primary { background: #111827; color: #fff; box-shadow: none; }
body.console-light .btn-primary:hover { background: #000; transform: none; }
body.console-light .btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
body.console-light .btn-ghost:hover { background: #f3f4f6; }
body.console-light .pill { color: var(--ink-soft); background: var(--surface-2); box-shadow: none; }
body.console-light .pill.ok { color: #166534; background: #dcfce7; }
body.console-light .pill.warn { color: #9a5b00; background: #fff4e0; }
body.console-light .pill.bad { color: #991b1b; background: #fee2e2; }
body.console-light .tag.ok { color: #166534; background: #dcfce7; }
body.console-light .tag.warn { color: #9a5b00; background: #fff4e0; }
body.console-light .tag.bad { color: #991b1b; background: #fee2e2; }
body.console-light .tag.info { box-shadow: inset 0 0 0 1px var(--line); }
body.console-light .banner.ok { border-color: #bbf7d0; }
body.console-light .banner.bad { border-color: #fecaca; }
body.console-light .f input, body.console-light .f textarea, body.console-light .f select,
body.console-light input, body.console-light select, body.console-light textarea { background: #fff; color: var(--ink); border-color: var(--line-strong); }
body.console-light .f input:focus, body.console-light .f textarea:focus, body.console-light .f select:focus { outline: 2px solid #c7d2fe; border-color: #a5b4fc; }
body.console-light .stat-tile b { font-family: var(--font); font-weight: 600; font-size: 26px; letter-spacing: -0.02em; color: var(--ink); }
body.console-light .verify-head { background: #111827; color: #fff; }
body.console-light .dot.ok { background: #16a34a; }
body.console-light .nav { position: sticky; background: rgba(249, 249, 250, 0.9); border-bottom: 1px solid var(--line); }
body.console-light .nav-badge { color: var(--ink-soft); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
body.console-light .console-head .who a { color: var(--ink); font-weight: 600; }

/* The console top bar. The sidebar already carries the mark, the clinic and who is signed in, so on a
   desk the bar keeps the role chip on the left and the person on the right, on the same edges as the
   page below it (the shadcn dashboard shape: a thin bar, the identity beside the navigation). On a
   phone the sidebar is the icon strip at the bottom, so the mark comes back and the name gives way to
   the initials, keeping the bar to one line. */
body.console-light .nav .console-head { min-height: 52px; padding: 8px 24px; flex-wrap: nowrap; }
body.console-light .nav .logo { font-size: 17px; }
body.console-light .nav .who { flex-wrap: nowrap; gap: 10px; white-space: nowrap; min-width: 0; }
body.console-light .nav .who .me-av { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #e0e7ff; color: #3730a3; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
body.console-light .nav .who .me-nm { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
body.console-light .nav .who .me-nm b { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
body.console-light .nav .who .me-nm small { font-size: 11.5px; color: var(--ink-mute); text-transform: capitalize; }
body.console-light .nav .who #logout { margin-left: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px; }
body.console-light .nav .who #logout:hover { color: var(--ink); border-color: var(--line-strong); }
@media (min-width: 961px) { body.console-light .nav .logo { display: none; } }
@media (max-width: 640px) {
  body.console-light .nav .console-head { min-height: 48px; padding: 6px 16px; gap: 8px; }
  body.console-light .nav .nav-badge { margin-left: auto; }
  body.console-light .nav .who .me-nm { display: none; }
  /* T-100: a long page name ("Doctor · live consultation") shortens instead of pushing Sign out off a 390px screen */
  body.console-light .nav .nav-badge { min-width: 0; flex: 0 1 auto; overflow: hidden; }
  body.console-light .nav .nav-badge.role { white-space: nowrap; max-width: 46vw; }
  body.console-light .nav .who { flex: none; }
}

/* role chips — the badges the marketing preview uses for front desk / doctor / patient */
.role { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: #f3f4f6; color: #374151; }
.role.desk { background: #fff3e0; color: #9a5b00; }
.role.doc { background: #e0e7ff; color: #3730a3; }
.role.admin { background: #111827; color: #fff; }
.role.pt { background: #dcfce7; color: #166534; }
.role svg, .role .ic { width: 12px; height: 12px; }
body.console-light .nav-badge.role { box-shadow: none; font-size: 10.5px; padding: 5px 10px; }

/* console components shared by the doctor and front-desk consoles */
body.console-light .content { display: grid; gap: 16px; align-content: start; padding-top: 16px; }
body.console-light .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
/* a phone (T-31): no grid or flex child may force the page wider than the screen; a wide table scrolls inside itself */
body.console-light .content { grid-template-columns: minmax(0, 1fr); }
body.console-light .content > *, body.console-light .content .tile, body.console-light .content .card { min-width: 0; }
@media (max-width: 640px) {
  body.console-light .content table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body.console-light .content .two, body.console-light .content .tiles4, body.console-light .content .tiles3 { grid-template-columns: minmax(0, 1fr) !important; }
}
body.console-light .tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; }
body.console-light .tile .k { font-size: 12px; color: var(--ink-mute); font-weight: 500; }
body.console-light .tile .v { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
body.console-light .tile .v small { font-size: 12px; font-weight: 600; color: #15803d; }
body.console-light .tile .v small.dn { color: #b91c1c; }
body.console-light .tile .v small.flat { color: var(--ink-mute); }
body.console-light .tile .sub { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }
body.console-light .mini { display: flex; align-items: flex-end; gap: 3px; height: 28px; margin-top: 10px; }
body.console-light .mini i { flex: 1; min-height: 3px; background: #e5e7eb; border-radius: 2px 2px 0 0; transform-origin: bottom; }
body.console-light .mini i.hi { background: #111827; }
body.console-light .mini i.w { background: #e5e7eb; } body.console-light .mini i.in { background: #4f46e5; } body.console-light .mini i.d { background: #111827; }
body.console-light .card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
body.console-light .card h3 { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
body.console-light .card .s { font-size: 12px; color: var(--ink-mute); }
body.console-light table.queue { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
body.console-light table.queue th { text-align: left; font-weight: 500; color: var(--ink-mute); padding: 6px 8px 8px; border-bottom: 1px solid var(--line); font-size: 11.5px; }
body.console-light table.queue td { padding: 10px 8px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
body.console-light table.queue tr.qrow { cursor: pointer; }
body.console-light table.queue tr.qrow:hover td { background: #fafafa; }
body.console-light table.queue tr.qrow.on td { background: #f3f4f6; }
body.console-light table.queue tr.qrow.on td:first-child { box-shadow: inset 3px 0 0 #111827; }
body.console-light table.queue td.pt { font-weight: 500; white-space: nowrap; }
body.console-light table.queue td.pt small { display: block; font-weight: 400; color: var(--ink-mute); font-size: 11.5px; }
body.console-light table.queue td.cond { color: var(--ink-soft); }
body.console-light table.queue td.empty { color: var(--ink-mute); font-size: 13px; padding: 18px 8px; text-align: center; }
body.console-light .tk { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; background: #f3f4f6; font-size: 11px; font-weight: 600; margin-right: 8px; font-variant-numeric: tabular-nums; }
body.console-light .tag2 { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
body.console-light .tag2.done { background: #dcfce7; color: #166534; }
body.console-light .tag2.in { background: #eef2ff; color: #3730a3; }
body.console-light .tag2.in::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ef4444; animation: blink 1.2s ease-in-out infinite; }
body.console-light .tag2.waiting { background: #f3f4f6; color: #374151; }
body.console-light .tag2.rep { background: #fff4e0; color: #9a5b00; }
@keyframes blink { 50% { opacity: 0.25; } }
body.console-light .own { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9.5px; font-weight: 600; color: #fff; background: #4f46e5; }
body.console-light .qbtn { font-size: 11.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
body.console-light .qbtn:hover { border-color: var(--line-strong); color: var(--ink); }
body.console-light .qbtn.primary { background: #111827; color: #fff; border-color: #111827; }
body.console-light .qbtn.primary:hover { background: #000; }
body.console-light .qbtn:disabled { opacity: 0.6; cursor: wait; }
body.console-light .acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
body.console-light .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d1d5db; margin-right: 7px; vertical-align: middle; }
body.console-light .dot.on { background: #ef4444; animation: blink 1.2s ease-in-out infinite; }
@media (max-width: 960px) { body.console-light table.queue .hide-sm { display: none; } body.console-light .tile { padding: 12px 14px 10px; } body.console-light .tile .v { font-size: 22px; } }

/* ==========================================================================
   The console sidebar (T-80). The same rail T-31 built — the same links, the
   same icons, the same role gating — with the names shown instead of hidden
   behind a tooltip, a header that says which clinic and who is signed in, a
   count on each link that carries work, and a control that folds it back to
   the icon strip. One accent, a pale pill for the page you are on, one rule
   above the account group and no other border.
   ========================================================================== */
body.console-light > .rail { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w); z-index: 55; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 10px; overflow-y: auto; overscroll-behavior: contain; }
body.console-light > .rail a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 9px; border-radius: 9px; color: #374151; font-size: 13.5px; font-weight: 500; transition: background 0.15s ease, color 0.15s ease; }
body.console-light > .rail a svg { width: 17px; height: 17px; flex: none; }
body.console-light > .rail a .lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.console-light > .rail a:hover { background: #f3f4f6; color: #111827; }
/* where you are: a pale accent pill. The rail used to paint it solid black, which read as a button */
body.console-light > .rail a.on { background: var(--accent-soft); color: var(--blue-ink); }
body.console-light > .rail a.on svg { color: var(--blue); }
/* the workspace header: the mark, the clinic's name, and the person signed in with their role */
body.console-light > .rail .rail-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
body.console-light > .rail .lg { flex: none; display: grid; place-items: center; width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 9px; background: #111827; color: #fff; }
body.console-light > .rail .lg:hover { background: #000; color: #fff; }
body.console-light > .rail .lg svg { width: 18px; height: 18px; }
body.console-light > .rail .rail-who { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
body.console-light > .rail .rail-who b { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.console-light > .rail .rail-who small { font-size: 11.5px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a count badge, and only where something is actually waiting: console.js leaves a zero hidden */
body.console-light > .rail .ct { flex: none; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
body.console-light > .rail a.on .ct { background: var(--blue-ink); }
/* a zero is hidden, and `display: inline-grid` above would otherwise beat the browser's own
   `[hidden] { display: none }` and leave an empty blue dot beside every quiet link */
body.console-light > .rail .ct[hidden] { display: none; }
/* the account group's rule, shown only for the role that has a link under it */
body.console-light > .rail .rail-sec { display: none; font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-mute); padding: 10px 9px 4px; margin-top: 4px; border-top: 1px solid var(--line); }
body[data-role="admin"].console-light > .rail .rail-sec[data-roles~="admin"],
body[data-role="doctor"].console-light > .rail .rail-sec[data-roles~="doctor"] { display: block; }
body.console-light > .rail .rail-hide { display: flex; align-items: center; gap: 10px; min-height: 36px; margin-top: 6px; padding: 0 9px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-mute); cursor: pointer; }
body.console-light > .rail .rail-hide:hover { background: #f3f4f6; color: var(--ink); }
body.console-light > .rail .rail-hide .cv { flex: none; width: 17px; text-align: center; font-size: 15px; line-height: 1; transition: transform 0.15s ease; }
body.console-light.rail-mini > .rail .rail-hide .cv { transform: rotate(180deg); }
body.console-light > .rail .sp { flex: 1; }
body.console-light > .rail a[data-roles] { display: none; }
body[data-role="doctor"] > .rail a[data-roles~="doctor"],
body[data-role="frontdesk"] > .rail a[data-roles~="frontdesk"],
body[data-role="admin"] > .rail a[data-roles~="admin"] { display: flex; }
/* folded: the icon strip, with the names back in the fly-out and the count as a small corner badge */
body.console-light.rail-mini > .rail { align-items: center; gap: 8px; padding: 14px 0; }
body.console-light.rail-mini > .rail a { width: 32px; height: 32px; min-height: 0; padding: 0; gap: 0; justify-content: center; position: relative; }
body.console-light.rail-mini > .rail .lb,
body.console-light.rail-mini > .rail .rail-who,
body.console-light.rail-mini > .rail .rail-sec { display: none; }
body.console-light.rail-mini > .rail .rail-head { padding: 0 0 10px; margin-bottom: 0; border-bottom: 0; justify-content: center; }
body.console-light.rail-mini > .rail .rail-hide { width: 32px; height: 32px; min-height: 0; margin: 0; padding: 0; justify-content: center; }
body.console-light.rail-mini > .rail .ct { position: absolute; top: -3px; right: -5px; min-width: 15px; height: 15px; padding: 0 4px; font-size: 9.5px; border: 1.5px solid #fff; }
/* the name flies out only when it is not already on the row */
body.console-light.rail-mini > .rail a[title]:hover::after, body.console-light.rail-mini > .rail a[title]:focus-visible::after { content: attr(title); position: absolute; left: 42px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 12px; font-weight: 500; color: #fff; background: #111827; padding: 5px 9px; border-radius: 7px; box-shadow: 0 6px 18px -8px rgba(0,0,0,.5); pointer-events: none; z-index: 60; }
/* the shared slot picker and any other small dialog on a console page */
.modal-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(17, 24, 39, 0.45); display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; color: var(--ink); border-radius: 14px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 18px 20px 20px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-note { font-size: 13px; color: var(--ink-mute); margin-bottom: 10px; }
.modal-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13.5px; }
.modal-row input[type=date] { margin-left: 8px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; }
.modal-sub { color: var(--ink-mute); font-size: 12.5px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.slots .slot { font: inherit; font-size: 13px; padding: 8px 4px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font-variant-numeric: tabular-nums; }
.slots .slot:hover { background: #111827; color: #fff; border-color: #111827; }
.slots .slot[disabled] { background: #f3f4f6; color: #9ca3af; cursor: default; text-decoration: line-through; }
.slots .slot.arrived[disabled] { text-decoration: none; }
.slots .empty { grid-column: 1 / -1; }
.modal-row input[type=search] { flex: 1; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; }
.pp-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.pp-list .pp-row { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; }
.pp-list .pp-row:hover { background: #f3f4f6; }
.pp-list .pp-row small { color: var(--ink-mute); font-size: 12px; }
.pp-list .empty { font-size: 13px; color: var(--ink-mute); padding: 8px 2px; }
body.console-light > .rail a { position: relative; }
/* under 960px the rail lies along the bottom of the screen (T-31): a phone still moves between the consoles */
@media (max-width: 960px) {
  body.console-light { padding-left: 0; padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  body.console-light > .rail { top: auto; bottom: 0; right: 0; width: auto; height: auto; flex-direction: row; align-items: center; justify-content: flex-start; gap: 4px; padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  body.console-light > .rail::-webkit-scrollbar { display: none; }
  body.console-light > .rail a { flex: 0 0 auto; width: 40px; height: 40px; min-height: 0; padding: 0; gap: 0; justify-content: center; }
  /* a thumb reads icons, not a sidebar: the labels, the header's words, the account rule and the
     collapse control are all desktop furniture and come off. The mark stays: it is the way home. */
  body.console-light > .rail .lb,
  body.console-light > .rail .rail-who,
  body.console-light > .rail .rail-sec,
  body.console-light > .rail .rail-hide { display: none; }
  body.console-light > .rail .rail-head { flex: 0 0 auto; padding: 0; margin: 0; border-bottom: 0; }
  body.console-light > .rail .ct { position: absolute; top: 0; right: 0; min-width: 15px; height: 15px; padding: 0 4px; font-size: 9.5px; border: 1.5px solid #fff; }
  body.console-light > .rail .sp { display: none; }
}
/* twelve links (the admin's) fit a 360px screen at 28px each (T-32); the current page's link is scrolled into view by main.js */
@media (max-width: 480px) {
  body.console-light > .rail { gap: 2px; padding-left: 4px; padding-right: 4px; justify-content: space-between; }
  body.console-light > .rail a { width: 28px; height: 36px; border-radius: 7px; }
  body.console-light > .rail a svg { width: 16px; height: 16px; }
  body.console-light > .rail .lg { width: 28px; height: 28px; }
  body.console-light > .rail .ct { min-width: 13px; height: 13px; padding: 0 3px; font-size: 9px; border-width: 1px; }
}
@media (max-width: 400px) {
  body.console-light > .rail { gap: 1px; }
  body.console-light > .rail a { width: 26px; }
  body.console-light > .rail .lg { width: 26px; }
}

/* Console toasts (Console.toast) */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
/* on a phone the toast rises above the bottom rail (T-32): this rule sits after the base one on purpose */
@media (max-width: 960px) { body.console-light #toasts { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } }
.toast { padding: 10px 14px; border-radius: 10px; font-size: 14px; background: var(--surface-2, #181818); color: var(--ink, #f4f4f0); border: 1px solid var(--line, rgba(255,255,255,.1)); box-shadow: 0 6px 24px rgba(0,0,0,.25); opacity: 1; transition: opacity .3s; }
.toast.ok { border-color: #22c55e; }
.toast.err { border-color: #ef4444; }
.toast.out { opacity: 0; }

/* Demo clinic notice (DEMO_MODE) — pinned at the top of every console page */
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: #fff7e6; border: 1px solid #f3d9a4; color: #6b4b00; font-size: 13.5px; line-height: 1.5; }
.demo-bar b { color: #4a3300; }
.demo-bar-actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.demo-bar-actions button, .demo-bar-actions a { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid #e0bf7a; background: #fff; color: #4a3300; cursor: pointer; text-decoration: none; }
.demo-bar-actions button:hover, .demo-bar-actions a:hover { background: #fdf0d5; }
.demo-bar-actions button:disabled { opacity: .6; cursor: wait; }

/* ==========================================================================
   The marker line under an emphasised word in a public heading (assets/scribble.js).
   Stroke widths are in em, so the line keeps its weight from a 40 px heading to an 80 px
   one, and stay the same when the drawing stretches to the word's width.
   ========================================================================== */
em.has-scrib { position: relative; display: inline-block; }
.scrib { position: absolute; left: -3%; width: 106%; bottom: -0.14em; height: 0.28em; overflow: visible; pointer-events: none; }
.scrib path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.scrib .s1 { stroke: #2563eb; stroke-width: max(0.06em, 3px); }
.scrib .s2 { stroke: #1d4ed8; stroke-width: max(0.032em, 1.6px); opacity: 0.85; }
.scrib .s3 { stroke: #7cb3ff; stroke-width: 0.016em; opacity: 0.8; }
.scrib-on .scrib path, .thero .lines .line.in .scrib path { animation: scribDraw 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards; }
.scrib-on .scrib .s2 { animation-delay: 0.12s; } .scrib-on .scrib .s3 { animation-delay: 0.22s; }
/* in the rotating headline the line waits for its words to rise, then draws, every time the line comes back */
.thero .lines .line.in .scrib .s1 { animation-delay: 0.55s; } .thero .lines .line.in .scrib .s2 { animation-delay: 0.67s; } .thero .lines .line.in .scrib .s3 { animation-delay: 0.77s; }
@keyframes scribDraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .scrib path { stroke-dashoffset: 0; animation: none !important; } }
.scrib-keep { white-space: nowrap; }
@media (max-width: 640px) { .stats-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; } }

/* T-100: the skip link is the first stop on every console page; it shows only when focused */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 1001; padding: 8px 14px; border-radius: 9px; background: #111827; color: #fff; font-size: 13.5px; font-weight: 600; text-decoration: none; transition: top 0.15s ease; }
.skip-link:focus { top: 12px; outline: 2px solid var(--blue); outline-offset: 2px; }
main[tabindex="-1"]:focus { outline: none; }
/* T-100: on a phone the bottom bar names its links; it scrolls sideways when a role has many */
@media (max-width: 960px) {
  body.console-light > .rail a { width: 56px; height: 48px; flex-direction: column; gap: 2px; }
  body.console-light > .rail a .lb { display: block; flex: none; max-width: 54px; font-size: 9.5px; font-weight: 500; line-height: 1.1; text-align: center; }
}
@media (max-width: 960px) {
  body[data-role].console-light > .rail .rail-sec[data-roles] { display: none; }
}
@media (max-width: 480px) {
  body.console-light > .rail { justify-content: flex-start; }
  body.console-light > .rail a { width: 48px; height: 46px; }
  body.console-light > .rail a .lb { max-width: 46px; font-size: 9px; }
}
@media (max-width: 400px) {
  body.console-light > .rail a { width: 44px; }
}

/* T-104: the intake — the reason for visit and the vitals, as the desk takes them and the room edits them */
.intake { display: grid; gap: 8px; }
.intake label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.intake textarea { font: inherit; font-size: 13.5px; font-weight: 400; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); min-width: 0; width: 100%; min-height: 54px; resize: vertical; }
.intake input { font: inherit; font-size: 13.5px; font-weight: 400; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); min-width: 0; width: 100%; }
.intake .ik-vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.vitals-line { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.reason-line { font-size: 12.5px; color: var(--ink); }

/* T-106: a report value outside its range, marked where the report is listed */
.fl-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fl-flag { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.fl-flag .hl { font-weight: 700; margin-left: 2px; }
.fl-flag.hi { background: #fee2e2; color: #991b1b; }
.fl-flag.lo { background: #e0e7ff; color: #3730a3; }

/* T-109: the idle lock — opaque, so nothing underneath can be read from across the room */
.idle-lock { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; background: #f3f4f6; }
.lock-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 30px 80px -40px rgba(17, 24, 39, 0.5); display: grid; gap: 10px; }
.lock-card h2 { margin: 0; font-size: 20px; }
.lock-card p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.lock-card label { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.lock-card input { font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; }
.lock-msg { min-height: 18px; font-size: 13px; color: #b91c1c; }
.lock-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* the file viewer (console.js viewFiles): a report or a scan over the page, zoomable, stepped through with ← → */
.viewer { position: fixed; inset: 0; z-index: 90; background: rgba(10, 12, 18, 0.92); display: grid; grid-template-rows: auto 1fr auto; color: #fff; }
.viewer { transition: opacity 0.25s ease; } .viewer.vw-enter { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .viewer { transition: none; } }
.viewer .vw-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); flex-wrap: wrap; }
.viewer .vw-title { display: grid; min-width: 0; }
.viewer .vw-title b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .vw-title small { font-size: 12.5px; color: rgba(255, 255, 255, 0.65); }
.viewer .vw-tools { display: flex; align-items: center; gap: 6px; }
.viewer .vw-tools > span { display: flex; gap: 6px; }
.viewer .vw-tools > span[hidden] { display: none; }
.viewer .vw-tools button, .viewer .vw-tools a { font: inherit; font-size: 14px; min-width: 38px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06); color: #fff; cursor: pointer; display: inline-grid; place-items: center; text-decoration: none; }
.viewer .vw-tools button:hover, .viewer .vw-tools a:hover { background: rgba(255, 255, 255, 0.16); }
.viewer .vw-tools button:disabled { opacity: 0.35; cursor: default; }
.viewer .vw-count { font-size: 12.5px; color: rgba(255, 255, 255, 0.7); padding: 0 6px; }
.viewer .vw-stage { position: relative; overflow: hidden; display: grid; place-items: center; min-height: 0; touch-action: none; }
.viewer .vw-stage img { max-width: 94%; max-height: 94%; object-fit: contain; transition: transform 0.12s ease; user-select: none; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.viewer .vw-stage.zoomed { cursor: grab; }
.viewer .vw-stage.zoomed:active { cursor: grabbing; }
.viewer .vw-stage iframe { width: min(1100px, 96%); height: 96%; border: 0; border-radius: 6px; background: #fff; }
.viewer .vw-note { padding: 10px 16px 14px; font-size: 13.5px; color: rgba(255, 255, 255, 0.85); border-top: 1px solid rgba(255, 255, 255, 0.12); max-height: 20vh; overflow: auto; white-space: pre-line; }
.viewer .vw-note[hidden] { display: none; }
