:root {
  /* Light blue + white, by request: one deliberate light look (no dark theme). */
  color-scheme: light;
  --bg: #f2f8fe;
  --surface: #ffffff;
  --surface-2: #f5f9fe;
  --ink: #0c2a47;
  --ink-2: #3d5a77;
  --muted: #6c86a0;
  --line: #d5e5f5;
  --accent: #1b74c5;
  --accent-hover: #155fa3;
  --accent-ink: #ffffff;
  --accent-soft: #e3f0fc;
  --sky: #8cc8f5;
  --sky-2: #cfe7fb;
  --danger: #b3261e;
  --danger-soft: #fbe4e2;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --good: #1d7a3a;
  --s-new: #2a78d6;
  --s-cur: #eb6834;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4;
  --grid: #e6eef7;
  --shadow: 0 1px 2px rgba(12, 42, 71, .05), 0 6px 20px rgba(27, 116, 197, .08);
  --radius: 16px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; flex: none; object-fit: cover;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: .02em;
}
.brand-text { min-width: 0; }
.brand-text b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.pill.ok i { background: var(--good); }
.pill.wait i { background: var(--warn); }
.pill.demo { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.iconbtn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  min-width: 44px; height: 44px; padding: 0 10px; font-size: 14px; font-weight: 600; color: var(--ink-2);
}

main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
.screen-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.screen-title h1 { font-size: 24px; letter-spacing: -.01em; }
.screen-title small { color: var(--muted); font-size: 14px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tabbar button {
  border: 0; background: none; padding: 8px 4px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* ---------- cards & form ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 8px; min-width: 0; }
.stack > * { min-width: 0; }
input[type="datetime-local"] { min-width: 0; }
.field > label, .field-label {
  font-size: 14px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; text-transform: uppercase;
}
.field-label .req { color: var(--danger); margin-left: 2px; }
.input {
  width: 100%; min-height: 52px; padding: 12px 14px;
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 18px;
}
.input:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.input.invalid, .seg.invalid { border-color: var(--danger); }
textarea.input { min-height: 84px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1 1 0; min-width: 0; width: auto; }
.hint { font-size: 14px; color: var(--muted); }
.err { font-size: 14px; color: var(--danger); font-weight: 600; }

/* segmented buttons (radio + multi) */
.seg { display: flex; flex-wrap: wrap; gap: 8px; border: 1.5px solid transparent; border-radius: 14px; }
.seg button {
  flex: 1 1 140px; min-height: 54px; padding: 10px 14px;
  border: 1.5px solid var(--line); background: var(--surface-2); border-radius: 12px;
  font-size: 17px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.seg button .tick {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none;
  display: grid; place-items: center;
}
.seg.multi button .tick { border-radius: 5px; }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.seg button[aria-pressed="true"] .tick, .seg button[aria-checked="true"] .tick { border-color: var(--accent-ink); background: var(--accent-ink); }
.seg button[aria-pressed="true"] .tick::after, .seg button[aria-checked="true"] .tick::after {
  content: ""; width: 10px; height: 6px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: translateY(-1px) rotate(-45deg);
}

.btn {
  min-height: 52px; padding: 12px 20px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: 17px; color: var(--ink);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: var(--surface); }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* physician type-ahead */
.ta { position: relative; }
.ta-picked {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1.5px solid var(--accent); background: var(--accent-soft); border-radius: 12px; min-height: 56px;
}
.ta-picked b { font-size: 18px; }
.ta-list {
  margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  max-height: 340px; overflow-y: auto; overscroll-behavior: contain;
}
.ta-list button {
  width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none;
  padding: 12px 14px; min-height: 52px; display: flex; align-items: center; gap: 10px; font-size: 17px;
}
.ta-list button:last-child { border-bottom: 0; }
.ta-list button:hover, .ta-list button.active { background: var(--accent-soft); }
.ta-list .ta-letter {
  position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 700;
  font-size: 13px; padding: 4px 14px; border-bottom: 1px solid var(--line); letter-spacing: .08em;
}
.ta-list .ta-add { color: var(--accent); font-weight: 700; }
.ta-list mark { background: none; color: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.ta-meta { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700;
  letter-spacing: .03em; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap;
}
.badge.endo { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.newdoc { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.savebar { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 10; padding: 14px 0 6px; background: linear-gradient(180deg, rgba(242,248,254,0), var(--bg) 40%); }

/* ---------- front page (splash + one-time sign-in) ---------- */
.fp {
  position: relative; min-height: 100%; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f1f8ff 45%, #e3f1fd 100%);
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.fp-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.fp-blob.b1 { width: 320px; height: 320px; background: #bfe3fb; left: -120px; top: 38%; }
.fp-blob.b2 { width: 280px; height: 280px; background: #d7ecfd; right: -110px; top: 60%; }
.fp.anim .fp-blob.b1 { animation: drift 14s ease-in-out infinite alternate; }
.fp.anim .fp-blob.b2 { animation: drift 17s ease-in-out -4s infinite alternate-reverse; }
@keyframes drift { to { transform: translate(60px, -40px) scale(1.12); } }

.fp-hero {
  position: relative; z-index: 1; width: calc(100% - 24px); max-width: 560px; margin-top: 12px;
  height: clamp(180px, 30vh, 300px); border-radius: 28px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(20, 80, 140, .22);
}
.fp-photo { position: absolute; inset: 0; background: #1d4f86 url("img/hospital.jpg") 50% 60% / cover no-repeat; }
.fp.anim .fp-photo { animation: heroZoom 2.6s cubic-bezier(.2, .7, .2, 1) both, heroDrift 22s ease-in-out 2.6s infinite alternate; }
@keyframes heroZoom { from { transform: scale(1.18); filter: saturate(.7) brightness(1.1); } to { transform: scale(1.04); filter: none; } }
@keyframes heroDrift { from { transform: scale(1.04) translateX(0); } to { transform: scale(1.1) translateX(-14px); } }
.fp-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0) 45%, rgba(227,241,253,.55) 80%, rgba(241,248,255,.92) 100%); }
.fp-pill {
  position: absolute; z-index: 2; left: 14px; top: 14px; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.85); color: #0c2a47;
  font-size: 13px; font-weight: 700; letter-spacing: .01em; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.fp-pill i { width: 7px; height: 7px; border-radius: 50%; background: #2f8fe0; }
.fp.anim .fp-pill { animation: fadeUp .6s ease .3s both; }
.fp.anim .fp-pill i { animation: ping 2.4s ease-out 1.6s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(47,143,224,.6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(47,143,224,0); } }

.fp-iconwrap { position: relative; z-index: 3; width: 88px; height: 88px; margin-top: -44px; display: grid; place-items: center; }
.fp-icon {
  position: relative; z-index: 3; width: 88px; height: 88px; border-radius: 22px;
  box-shadow: 0 12px 26px rgba(23, 101, 179, .35), 0 0 0 5px #ffffff;
}
.fp.anim .fp-icon { animation: pop .8s cubic-bezier(.34, 1.56, .64, 1) .35s both; }
@keyframes pop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }

.fp-title { position: relative; z-index: 1; text-align: center; margin-top: 14px; padding: 0 16px; }
.fp-title h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #0c2a47; line-height: 1.1; }
.fp-title p { margin: 6px 0 0; color: #4b6784; font-size: 15px; }
.fp-title h1 .fp-sub2 { display: block; margin-top: 4px; font-size: clamp(16px, 5.3vw, 21px); font-weight: 700; letter-spacing: -.01em; color: #1b74c5; }
.fp.anim .fp-title { animation: fadeUp .7s ease .55s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.fp-pulse { position: relative; z-index: 1; width: 240px; height: 40px; margin-top: 6px; }
.fp-pulse path { fill: none; stroke: #3aa0f0; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 0; }
.fp-pulse circle { fill: #3aa0f0; }
.fp.anim .fp-pulse path { stroke-dashoffset: 400; animation: draw 1.2s cubic-bezier(.6, .1, .3, 1) .8s forwards; }
.fp.anim .fp-pulse circle { opacity: 0; animation: dotIn .3s ease 1.95s forwards, beat 1.6s ease-in-out 2.3s infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dotIn { to { opacity: 1; } }
@keyframes beat { 0%, 100% { r: 4; } 50% { r: 6.5; } }

.fp-logos {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 0;
  margin-top: 8px; padding: 10px 6px; background: #ffffff; border: 1px solid #dcebf9; border-radius: 18px;
  box-shadow: 0 4px 16px rgba(27, 116, 197, .08); width: calc(100% - 32px); max-width: 440px;
}
.fp-logo { flex: 1 1 0; display: grid; place-items: center; height: 56px; padding: 0 6px; min-width: 0; }
.fp-logo + .fp-logo { border-left: 1px solid #e3eef9; }
.fp-logo img { max-height: 40px; max-width: 100%; object-fit: contain; }
.fp-logo .wordmark { font-weight: 800; font-size: 12px; color: #0f5ea8; text-align: center; line-height: 1.1; overflow-wrap: anywhere; }
.fp-logo .wordmark small { display: block; font-size: 9px; font-weight: 600; color: #6c86a0; }
.fp.anim .fp-logos { animation: fadeUp .6s ease .95s both; }
.fp.anim .fp-logo { animation: fadeUp .5s ease both; }
.fp.anim .fp-logo:nth-child(1) { animation-delay: 1.1s; }
.fp.anim .fp-logo:nth-child(2) { animation-delay: 1.22s; }
.fp.anim .fp-logo:nth-child(3) { animation-delay: 1.34s; }

.fp-bottom { position: relative; z-index: 1; width: calc(100% - 32px); max-width: 440px; margin-top: 16px; display: grid; gap: 12px; justify-items: center; }
.fp.anim .fp-bottom { animation: fadeUp .6s ease 1.25s both; }
.fp-welcome { text-align: center; display: grid; gap: 2px; }
.fp-hello { font-size: 15px; color: #4b6784; font-weight: 600; }
.fp-name {
  display: block; font-size: 28px; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(90deg, #0c2a47 0%, #1b74c5 40%, #7cc8f8 50%, #1b74c5 60%, #0c2a47 100%);
  background-size: 250% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fp-sub { font-size: 14px; color: #6c86a0; margin-top: 4px; }
.fp.anim .fp-hello { animation: fadeUp .5s ease 1.35s both; }
.fp.anim .fp-name { animation: nameIn .7s cubic-bezier(.2, .8, .2, 1) 1.5s both, shimmer 1.4s ease-in-out 1.9s both; }
.fp.anim .fp-sub { animation: fadeUp .5s ease 1.8s both; }
@keyframes nameIn { from { opacity: 0; transform: translateY(14px) scale(.96); letter-spacing: .08em; } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ring that closes around the icon, then a ripple */
.fp-ring { position: absolute; width: 124px; height: 124px; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); z-index: 2; }
.fp-ring circle { fill: none; stroke-width: 4; }
.fp-ring .trk { stroke: rgba(47, 143, 224, .15); }
.fp-ring .arc { stroke: #2f8fe0; stroke-linecap: round; stroke-dasharray: 340; stroke-dashoffset: 340; }
.fp.anim .fp-ring { animation: fadeIn .4s ease .9s both; }
.fp-w:not(.anim) .fp-ring .arc { stroke-dashoffset: 0; }
.fp.anim .fp-ring .arc { animation: ring 1.3s cubic-bezier(.65, 0, .35, 1) 1.1s forwards; }
@keyframes ring { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fp-ripple { position: absolute; left: 50%; top: 50%; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; border: 3px solid #2f8fe0; opacity: 0; z-index: 1; pointer-events: none; }
.fp.anim .fp-ripple.r1 { animation: ripple 1s ease-out 2.4s both; }
.fp.anim .fp-ripple.r2 { animation: ripple 1s ease-out 2.6s both; }
@keyframes ripple { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(2.1); } }
.fp.anim.fp-w .fp-icon { animation: pop .8s cubic-bezier(.34, 1.56, .64, 1) .35s both, iconBeat .5s ease 2.4s both; }
@keyframes iconBeat { 50% { transform: scale(1.08); } }

/* leaving: the welcome page lifts away while the call log fades up underneath */
.fp-overlay { position: fixed; inset: 0; z-index: 200; min-height: 0; height: 100%; }
.fp.leaving { animation: fpOut .85s cubic-bezier(.4, 0, .2, 1) forwards; }
.fp.leaving .fp-hero { animation: heroOut .85s cubic-bezier(.4, 0, .2, 1) forwards; }
.fp.leaving .fp-iconwrap, .fp.leaving .fp-title, .fp.leaving .fp-pulse, .fp.leaving .fp-logos, .fp.leaving .fp-bottom { animation: liftOut .6s cubic-bezier(.4, 0, .2, 1) forwards; }
.fp.leaving .fp-logos { animation-delay: .04s; }
.fp.leaving .fp-bottom { animation-delay: .08s; }
@keyframes fpOut { 0% { opacity: 1; } 55% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes heroOut { to { transform: translateY(-24px) scale(1.06); opacity: 0; filter: blur(4px); } }
@keyframes liftOut { to { transform: translateY(-28px); opacity: 0; } }
body.app-enter .topbar { animation: appIn .6s cubic-bezier(.2, .8, .2, 1) .25s both; }
body.app-enter main { animation: appIn .7s cubic-bezier(.2, .8, .2, 1) .35s both; }
body.app-enter .tabbar { animation: tabIn .6s cubic-bezier(.2, .8, .2, 1) .45s both; }
@keyframes appIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes tabIn { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }
@keyframes leave { to { opacity: 0; transform: scale(1.02); } }

.fp-card { width: 100%; background: rgba(255,255,255,.92); border: 1px solid #dcebf9; border-radius: 22px; padding: 16px; display: grid; gap: 12px; justify-items: center; box-shadow: 0 10px 30px rgba(20, 80, 140, .10); }
.fp-card h2 { font-size: 18px; color: #0c2a47; }
.fp-card p { margin: -6px 0 0; font-size: 14px; color: #4b6784; text-align: center; }
.dots { display: flex; gap: 16px; justify-content: center; height: 18px; }
.dots i { width: 15px; height: 15px; border-radius: 50%; border: 2px solid #8cb7de; transition: background .15s, border-color .15s, transform .15s; }
.dots i.on { background: #1b74c5; border-color: #1b74c5; transform: scale(1.1); }
.dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; width: 100%; }
.keypad button { height: 52px; border-radius: 14px; border: 1px solid #dcebf9; background: #f7fbff; color: #0c2a47; font-size: 24px; font-weight: 600; transition: background .12s, transform .08s; }
.keypad button:active { background: #e3f0fc; transform: scale(.97); }
.keypad button.ghost { background: none; border: 0; font-size: 15px; color: #3d5a77; }
.who { display: grid; gap: 10px; width: 100%; }
.fp .banner { margin: 0; font-size: 13px; }
@media (min-width: 900px) {
  .fp { justify-content: center; }
  .fp-hero { height: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  .fp.anim *, .fp.anim .fp-photo { animation: none !important; }
  .fp.anim .fp-pulse path { stroke-dashoffset: 0; }
  .fp.anim .fp-pulse circle { opacity: 1; }
  .fp.anim .fp-ring .arc { stroke-dashoffset: 0; }
  .fp.anim .fp-name { opacity: 1; }
  .fp.leaving, .fp.leaving *, body.app-enter * { animation-duration: .01s !important; animation-delay: 0s !important; }
}

/* ---------- list ---------- */
.list { display: grid; gap: 10px; }
.callrow {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.callrow .t { font-weight: 700; font-size: 17px; }
.callrow .d { color: var(--muted); font-size: 14px; }
.callrow .chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.callrow .when { text-align: right; font-size: 14px; color: var(--ink-2); }
.pending-dot { color: var(--warn); font-weight: 700; font-size: 12px; }
.daygroup { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin: 10px 2px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* ---------- reports ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters select { min-height: 44px; font-size: 15px; padding: 8px 36px 8px 12px; flex: 1 1 150px; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 600; min-height: 40px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.kpi b { display: block; font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi em { font-style: normal; font-size: 13px; color: var(--ink-2); }
.charts { display: grid; gap: 14px; align-items: start; }
.chart h2 { font-size: 18px; }
.chart .sub { color: var(--muted); font-size: 14px; margin: 2px 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; color: var(--ink-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(96px, 36%) 1fr auto; gap: 10px; align-items: center; font-size: 15px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.hbar .track { display: flex; gap: 2px; height: 22px; background: none; }
.hbar .seg-bar { height: 100%; min-width: 2px; }
.hbar .seg-bar:first-child { border-radius: 0; }
.hbar .seg-bar:last-child { border-radius: 0 4px 4px 0; }
.hbar .val { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 2.5ch; text-align: right; color: var(--ink); }
.more { font-size: 14px; color: var(--muted); margin-top: 8px; }
.svgwrap { overflow-x: auto; }
.svgwrap svg { display: block; }
.svgwrap text { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.svgwrap .gridl { stroke: var(--grid); stroke-width: 1; }
.svgwrap .axis { stroke: var(--line); }
details.tbl { margin-top: 10px; }
details.tbl summary { cursor: pointer; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.tablewrap { overflow-x: auto; margin-top: 8px; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--bg);
  padding: 8px 10px; border-radius: 8px; font-size: 14px; line-height: 1.35; max-width: 260px; box-shadow: var(--shadow);
}

/* ---------- misc ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
}
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 70; display: grid; align-items: end; }
.sheet {
  background: var(--surface); border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  max-width: 760px; width: 100%; margin: 0 auto; display: grid; gap: 14px; max-height: 90vh; overflow-y: auto;
}
.sheet h2 { font-size: 20px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-table { width: 100%; }
.admin-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
@media (min-width: 720px) {
  .charts { grid-template-columns: 1fr 1fr; }
  .charts .wide { grid-column: 1 / -1; }
}

/* ---------- dashboard ---------- */
main.wide { max-width: 1100px; }
.dash-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.dash-nav .chip { white-space: nowrap; flex: none; }
.dash-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 3fr 2fr; align-items: start; } .dash-grid > :first-child { grid-row: span 2; } }
.card.stack { align-content: start; }
.dash-grid h2, .card > h2 { font-size: 18px; }
.rev-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rev-row:last-child { border-bottom: 0; }
.rev-row .grow { flex: 1 1 200px; min-width: 0; }
.qa { display: grid; gap: 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .grow { flex: 1 1 220px; min-width: 0; margin: 0; }
table.dtable { border-collapse: collapse; width: 100%; font-size: 15px; }
table.dtable th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.dtable td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.dtable tbody tr { cursor: pointer; }
table.dtable tbody tr:hover { background: var(--accent-soft); }
table.dtable tr.off td { color: var(--muted); }
table.dtable .n { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.badge.role-owner { background: var(--accent); color: #fff; border-color: transparent; }
.badge.role-editor { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.linkbtn { background: none; border: 0; padding: 2px 0; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
details.merge summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.seg button:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 640px) { .hide-sm { display: none; } }

.card.stack > p { margin: 0; }

/* hospital picker */
.input.hp-open { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer; }
.input.hp-open span:first-child { color: var(--muted); }
.hp-list { max-height: 52vh; }
.hp-list button { align-items: center; }
.hp-sub { display: block; font-size: 14px; color: var(--muted); font-weight: 500; }
.hp-count { float: right; font-weight: 600; }

/* physician picker filters */
.ta-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ta-filters .chips-row { flex: 1 1 auto; }
.ta-filters .ta-place { flex: 1 1 140px; min-height: 42px; font-size: 15px; padding: 8px 36px 8px 12px; }
.ta-list .ta-name { min-width: 0; }
.ta-list .ta-meta { max-width: 45%; overflow: hidden; text-overflow: ellipsis; }

#f-at { flex: 1 1 0; width: 0; min-width: 0; }

.signout { margin-top: 18px; text-align: center; font-size: 14px; }

.install-card { display: grid; gap: 10px; margin-bottom: 14px; border-color: #bcdcf7; background: linear-gradient(180deg, #ffffff, #f2f8ff); }
.install-card p { margin: 0; color: var(--ink-2); }
.install-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; color: var(--ink); }

/* Admin access tab */
.dtable.perm td.c, .dtable.perm th.c { text-align: center; width: 76px; }
.dtable.perm .yes { color: #1f8a4c; font-weight: 800; font-size: 18px; }
.dtable.perm .no { color: #a9bccf; font-weight: 700; }
.dtable td .btn.small { white-space: nowrap; }

/* ---------- Log a call | Find a physician switch ---------- */
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin: 4px 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 2px 10px rgba(16, 70, 130, .06); }
.mode-switch button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink-2); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; white-space: nowrap; padding: 0 6px; }
.mode-switch button svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 360px) { .mode-switch button { font-size: 15px; } .mode-switch button svg { display: none; } }
.mode-switch button[aria-selected="true"] { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(27, 116, 197, .3); }
.find-q { font-size: 18px; }
.find-list { max-height: none; }
.find-list button, .pc-partners button { flex-wrap: wrap; }
.hasnums { display: flex; gap: 4px; flex-basis: 100%; margin-top: 4px; }
.hasnum { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: #eef4fb; color: var(--ink-2); }
.hasnum.cell { background: #e3f5ea; color: #1f7a45; }

/* ---------- Doctor card ---------- */
.pc-head h2 { margin: 0 0 4px; font-size: 24px; line-height: 1.2; }
.pc-cred { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 8px; }
.pc-practice { margin-top: 6px; font-size: 16px; font-weight: 700; color: var(--accent); }
.pc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.pc-actions .btn { flex: 1 1 130px; text-decoration: none; text-align: center; }
.pc-info { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 10px 0; }
.pc-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 16px; }
.pc-row:last-child { border-bottom: 0; }
.pc-l { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 2px; }
.pc-v a { color: var(--accent); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.pc-h3 { font-size: 17px; margin: 16px 0 8px; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; }
.btn.ghost { border-color: transparent; background: transparent; width: 100%; margin-top: 6px; }
.split3 { display: grid; grid-template-columns: 1.4fr .6fr .8fr; gap: 10px; }
@media (max-width: 380px) { .split3 { grid-template-columns: 1fr 1fr; } .split3 > :first-child { grid-column: 1 / -1; } }
.find-list .ta-meta, .pc-partners .ta-meta { white-space: normal; text-align: right; }
.ta-picked.stacked { flex-direction: column; align-items: stretch; gap: 10px; }
.ta-picked.stacked .pick-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick-name { display: block; margin: 14px auto 0; font-size: 16px; }
.who { max-height: 50vh; overflow-y: auto; display: grid; gap: 8px; }
/* Short screens (side panes, landscape phones): smaller photo so the keypad shows sooner. */
@media (max-height: 760px) { .fp-hero { height: clamp(120px, 22vh, 200px); } }
/* Partners on the doctor card */
.pc-phead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.pc-phead .pc-h3 { margin: 0; }
.pc-partners { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pc-prow { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.pc-prow:last-child { border-bottom: 0; }
.pc-pbtn { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 12px 14px; font: inherit; font-size: 17px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.pc-pbtn:hover { background: var(--accent-soft); }
.pc-pbtn .ta-meta { margin-left: 0; white-space: normal; text-align: left; }
.pc-rm { padding: 12px 14px; color: var(--danger); font-size: 15px; }
.pp-done { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 17px; }
.badge.app { background: #fff; color: #0f5ea8; border: 1px solid #9cc6ec; }
.pc-phead .btn { white-space: nowrap; flex: none; }
/* Tap-a-number pop-up */
.pc-num { border: 0; background: none; padding: 0; font: inherit; text-align: left; cursor: pointer; color: var(--accent); font-weight: 700; font-size: 17px; display: flex; flex-direction: column; }
.pc-num-hint { font-size: 12px; font-weight: 600; color: var(--muted); }
.numpop { position: fixed; inset: 0; z-index: 200; background: rgba(12, 42, 71, .35); display: flex; align-items: flex-end; justify-content: center; padding: 16px; animation: fadeUp .18s ease both; }
.numpop-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 18px; padding: 16px; display: grid; gap: 10px; box-shadow: 0 18px 50px rgba(12, 42, 71, .3); margin-bottom: env(safe-area-inset-bottom, 0); }
.numpop-card .btn { text-decoration: none; text-align: center; }
.numpop-head { text-align: center; padding: 4px 0 6px; }
.numpop-head b { display: block; font-size: 24px; }
.numpop-head span { font-size: 14px; color: var(--muted); }

/* Business-card scan */
.scan-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.scan-btn svg { width: 22px; height: 22px; }
.scan-wait { text-align: center; padding: 20px 0 10px; }
.spinner { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stack-seg { display: grid; grid-template-columns: 1fr; }
.check { gap: 10px; font-size: 16px; margin: 6px 0; }
.check input { width: 20px; height: 20px; }
.pc-save { margin: 14px 0 10px; }

/* Florida referral map */
.flmap .flsvg { width: 100%; height: auto; display: block; margin: 6px 0; }
.flmap .mstate { fill: #eaf4fd; stroke: #7fb2e0; stroke-width: 2; stroke-linejoin: round; }
.flmap .mcounty { fill: none; stroke: #cfe2f5; stroke-width: 1; }
.flmap .mlabel { font-size: 21px; font-weight: 800; fill: #0c2a47; paint-order: stroke; stroke: #fff; stroke-width: 6px; stroke-linejoin: round; pointer-events: none; }
.flmap .mdot { fill: rgba(27, 116, 197, .38); stroke: #fff; stroke-width: 2; cursor: pointer; }
.flmap .mdot:hover, .flmap .mdot.sel { fill: rgba(15, 94, 168, .85); stroke: #0c2a47; stroke-width: 3; }
.flmap .mhosp { fill: #0c2a47; stroke: #fff; stroke-width: 1.5; }
.flmap .mtop { display: flex; flex-wrap: wrap; gap: 8px; }
.flmap .msel h3 { margin: 10px 0 2px; font-size: 20px; }
/* "Shared with the team" reminder on Find a physician */
.share-note { margin: 0 0 14px; padding: 12px 14px; border: 2px solid var(--accent); border-radius: 14px; background: var(--accent-soft); display: grid; gap: 4px; }
.share-note b { font-size: 17px; color: #0f5ea8; line-height: 1.25; }
.share-note span { font-size: 15px; color: var(--ink-2); line-height: 1.4; }
.find-count { font-weight: 700; margin-bottom: -4px; }
/* Import from contacts */
.imp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 12px; }
.imp-head h3 { margin: 0; font-size: 17px; }
.imp-list { border: 1px solid var(--line); border-radius: 12px; max-height: 42vh; overflow-y: auto; margin: 6px 0 10px; }
.imp-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 16px; cursor: pointer; }
.imp-row:last-child { border-bottom: 0; }
.imp-row input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.imp-row em { display: block; font-style: normal; font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.imp-row em.imp-diff { color: var(--muted); }
.imp-ok { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; min-width: 58px; }
.imp-ok small { font-size: 11px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.imp-note { background: var(--accent-soft); border: 1.5px solid var(--accent); border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.imp-head .linkbtn { white-space: nowrap; flex: none; }
#imp-save-btn { white-space: nowrap; }
/* "You just texted…" follow-up banner */
.follow { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 2px solid var(--accent); box-shadow: 0 4px 14px rgba(27, 116, 197, .15); display: grid; gap: 10px; font-size: 16px; }
.pc-more summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 14px; margin-top: 4px; }
.pc-more div { font-size: 14px; color: var(--ink-2); margin-top: 3px; }

/* Voice logging */
.voice-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 14px; font-weight: 700; color: var(--accent); border: 2px dashed var(--accent); background: var(--surface); }
.voice-btn svg, #voice-listen svg, .voice-drafts svg { width: 20px; height: 20px; vertical-align: -4px; }
#voice-listen { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0; }
#voice-listen.listening { background: #d93838; color: #fff; border-color: #d93838; }
.voice-ex { font-style: italic; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
#voice-text { width: 100%; font-size: 17px; }
.voice-cands { margin: 8px 0; }
.voice-drafts .vd { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line, #dbe7f3); }
.voice-drafts .vd-text { font-size: 15px; }
ol.steps { padding-left: 22px; display: grid; gap: 8px; font-size: 15px; }
code.copy { display: inline-block; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line, #dbe7f3); border-radius: 8px; padding: 4px 8px; font-size: 13px; user-select: all; -webkit-user-select: all; }
code.copy.big { display: block; font-size: 16px; padding: 10px 12px; margin: 6px 0 10px; }
.quiet .ta-list { max-height: none; }

/* Who called: doctor or patient */
.caller-switch { margin: -2px 0 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line, #dbe7f3); }
.caller-switch .field-label { font-size: 15px; }
.caller-switch .seg button { font-size: 18px; font-weight: 800; min-height: 58px; }
.badge.pt { background: #e4f5ea; color: #1d7a3e; border-color: transparent; font-weight: 800; }

/* =====================================================================
   Button effects: three looks the owner can pick on the Dashboard.
   body.fx-halo (default) · body.fx-glass · body.fx-neon
   Every button presses in slightly; a newly activated button "pops"
   (about 0.1 s to fill in) and sends a ring outward (.fx-pop from app.js).
   ===================================================================== */
@property --fx-ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
:root { --g1: #56b4ff; --g2: #1b74c5; --g3: #0b4f93; --halo: 43, 140, 230; }
/* Two blues: Log a call / doctor = royal blue; Find a physician / patient = teal blue */
.mode-switch button[data-v="find"], .seg button[data-key="caller"][data-v="patient"] { --g1: #4fe0e6; --g2: #0f9bb8; --g3: #0b5f86; --halo: 18, 170, 205; }
.chip, .tabbar button { --g1: #6cc0ff; --g2: #2a86d8; --g3: #1760a8; }

button, .btn { position: relative; transition: transform .12s ease, box-shadow .2s ease, background-color .12s ease, color .12s ease, border-color .12s ease, filter .12s ease; }
button:active:not(:disabled), .btn:active { transform: scale(.965); }
.seg button, .mode-switch button, .btn.primary, .chip { overflow: hidden; isolation: isolate; }

/* ---------- HALO: blue gradient, glowing halo that gently breathes ---------- */
.fx-halo .seg button[aria-checked="true"], .fx-halo .seg button[aria-pressed="true"],
.fx-halo .mode-switch button[aria-selected="true"], .fx-halo .btn.primary, .fx-halo .chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 48%, var(--g3) 100%); border-color: transparent; color: #fff;
  box-shadow: 0 0 0 2.4px rgba(var(--halo), .16), 0 5px 14px rgba(var(--halo), .34), inset 0 1px 0 rgba(255, 255, 255, .4);
  animation: fxBreathe 3s ease-in-out infinite;
}
@keyframes fxBreathe {
  0%, 100% { box-shadow: 0 0 0 2.4px rgba(var(--halo), .14), 0 5px 14px rgba(var(--halo), .30), inset 0 1px 0 rgba(255, 255, 255, .4); }
  50% { box-shadow: 0 0 0 4.8px rgba(var(--halo), .21), 0 8px 22px rgba(var(--halo), .44), inset 0 1px 0 rgba(255, 255, 255, .4); }
}
.fx-halo .tabbar button[aria-current="page"] { color: var(--g2); background: radial-gradient(circle at 50% 35%, rgba(var(--halo), .22), rgba(var(--halo), .06) 70%); }
.fx-halo .tabbar button[aria-current="page"] svg { filter: drop-shadow(0 0 5px rgba(var(--halo), .6)); }

/* ---------- GLASS: glossy lit-from-above glass, with a light sweep ---------- */
.fx-glass .seg button[aria-checked="true"], .fx-glass .seg button[aria-pressed="true"],
.fx-glass .mode-switch button[aria-selected="true"], .fx-glass .btn.primary, .fx-glass .chip[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .08) 48%, rgba(255, 255, 255, 0) 52%), linear-gradient(160deg, var(--g1), var(--g2) 60%, var(--g3));
  border: 1px solid rgba(255, 255, 255, .75); color: #fff; text-shadow: 0 1px 2px rgba(5, 40, 80, .35);
  box-shadow: 0 8px 22px rgba(var(--halo), .38), inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -3px 8px rgba(5, 40, 90, .28);
}
.fx-glass .seg button[aria-checked="true"]::before, .fx-glass .seg button[aria-pressed="true"]::before,
.fx-glass .mode-switch button[aria-selected="true"]::before, .fx-glass .btn.primary::before, .fx-glass .chip[aria-pressed="true"]::before {
  content: ""; position: absolute; inset: -2px; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .6) 50%, transparent 65%);
  transform: translateX(-130%); animation: fxSweep 4.5s ease-in-out infinite;
}
@keyframes fxSweep { 0%, 62% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.fx-glass .tabbar button[aria-current="page"] { color: var(--g3); background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(210, 232, 252, .9)); box-shadow: inset 0 1px 1px #fff, 0 3px 10px rgba(var(--halo), .25); }

/* ---------- NEON: deep navy with a spinning light ring ---------- */
.fx-neon .seg button[aria-checked="true"], .fx-neon .seg button[aria-pressed="true"],
.fx-neon .mode-switch button[aria-selected="true"], .fx-neon .btn.primary, .fx-neon .chip[aria-pressed="true"] {
  border: 3px solid transparent; color: #eaf7ff; text-shadow: 0 0 8px rgba(140, 210, 255, .85);
  background: linear-gradient(160deg, #103a66, #0a2442) padding-box, conic-gradient(from var(--fx-ang), #0a2442 0deg, var(--g1) 70deg, #e6fbff 110deg, var(--g1) 150deg, #0a2442 220deg, var(--g2) 300deg, #0a2442 360deg) border-box;
  box-shadow: 0 0 12px rgba(var(--halo), .55), 0 0 28px rgba(var(--halo), .30);
  animation: fxSpin 3.2s linear infinite;
}
@keyframes fxSpin { to { --fx-ang: 360deg; } }
.fx-neon .seg button[aria-checked="true"] .tick, .fx-neon .seg button[aria-pressed="true"] .tick { border-color: #9fe3ff; background: #9fe3ff; box-shadow: 0 0 8px rgba(159, 227, 255, .9); }
.fx-neon .seg button[aria-checked="true"] .tick::after, .fx-neon .seg button[aria-pressed="true"] .tick::after { border-color: #0a2442; }
.fx-neon .tabbar button[aria-current="page"] { color: #0a2442; background: rgba(var(--halo), .14); }
.fx-neon .tabbar button[aria-current="page"] svg { color: var(--g2); filter: drop-shadow(0 0 7px rgba(var(--halo), .9)); }

/* Ticks on gradient buttons: white box, blue check */
.fx-halo .seg button[aria-checked="true"] .tick::after, .fx-halo .seg button[aria-pressed="true"] .tick::after,
.fx-glass .seg button[aria-checked="true"] .tick::after, .fx-glass .seg button[aria-pressed="true"] .tick::after { border-color: var(--g2); }

/* ---------- The pop: fills in over ~0.1 s, overshoots a hair, and sends out a ring ---------- */
.fx-pop { animation: fxPop .46s cubic-bezier(.2, .9, .25, 1.25) both !important; }
.fx-pop::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  animation: fxRing .7s ease-out .06s both;
}
@keyframes fxPop {
  0% { transform: scale(.94); filter: saturate(.25) brightness(1.35); }
  25% { transform: scale(1.045); filter: saturate(1.15) brightness(1.12); }
  60% { transform: scale(.99); filter: none; }
  100% { transform: scale(1); filter: none; }
}
@keyframes fxRing {
  0% { box-shadow: 0 0 0 0 rgba(var(--halo), .52), 0 0 0 0 rgba(255, 255, 255, .7) inset; }
  100% { box-shadow: 0 0 0 14px rgba(var(--halo), 0), 0 0 0 0 rgba(255, 255, 255, 0) inset; }
}
/* The ring must be allowed outside the button while popping */
.seg button.fx-pop, .mode-switch button.fx-pop, .btn.primary.fx-pop, .chip.fx-pop { overflow: visible; }

/* Style picker on the Dashboard */
.fx-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fx-pick .fx-demo { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface-2); display: grid; gap: 10px; text-align: center; }
.fx-pick .fx-demo.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fx-pick .fx-demo b { font-size: 16px; }
.fx-pick .fx-demo .hint { font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .fx-halo *, .fx-glass *, .fx-neon *, .fx-pop, .fx-pop::after { animation: none !important; }
  .fx-glass .seg button::before, .fx-glass .btn.primary::before { display: none; }
}

/* Who's gone quiet: tap the header to open or close */
.quiet details > summary.quiet-sum { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-right: 34px; position: relative; }
.quiet details > summary.quiet-sum::-webkit-details-marker { display: none; }
.quiet summary.quiet-sum h2 { margin: 0; }
.quiet .quiet-n { font-size: 15px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }
.quiet summary.quiet-sum::after { content: ""; position: absolute; right: 6px; top: 50%; width: 11px; height: 11px; border-right: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
.quiet details[open] > summary.quiet-sum::after { transform: translateY(-30%) rotate(-135deg); }
.quiet details[open] > summary.quiet-sum { margin-bottom: 10px; }

/* Provider comparison (vertical bars) */
.svgwrap.cmp text.cmp-n { font-size: 14px; font-weight: 800; fill: var(--ink); }
.svgwrap.cmp text.cmp-l { font-size: 13px; font-weight: 700; fill: var(--ink-2); }
.svgwrap.cmp text.cmp-l.app { fill: #0f7f98; }
.cmp-ctl select { min-height: 40px; font-size: 15px; padding: 6px 34px 6px 12px; width: auto; }
.filter-on { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 15px; }
.filter-on .linkbtn { margin-left: 8px; }

/* Doctor names that open their card */
button.plink { border: 0; background: none; padding: 0; margin: 0; font: inherit; text-align: left; cursor: pointer; color: var(--accent); text-decoration: underline; text-decoration-color: rgba(27, 116, 197, .35); text-underline-offset: 3px; }
button.plink:hover, button.plink:focus-visible { text-decoration-color: currentColor; }
.hbar button.lbl.plink { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; min-width: 0; position: static; }
.hbar button.lbl.plink:active { transform: none; }
.plink-t { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(27, 116, 197, .35); text-underline-offset: 3px; }

/* Sign-in security (v2): Face ID button, 6-digit PIN dots, locked badge */
.bio-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; font-size: 17px; }
.bio-btn svg { width: 24px; height: 24px; flex: none; }
.dots.six { gap: 12px; }
.badge.warn { background: #fdecec; color: #b42318; border-color: transparent; }
.signout .linkbtn { margin: 0 6px; }
.undo-imp { display: block; margin: 2px auto 8px; font-size: 15px; }
#imp-save-btn:disabled { opacity: .55; cursor: not-allowed; }
.imp-actions { display: grid; gap: 10px; position: sticky; bottom: 0; background: var(--card, #fff); padding-top: 10px; }

/* Organ-system buttons: one row on a phone, each in its own color
   (thyroid orange, parathyroid blue, adrenal gold, matching the report charts). */
.seg[aria-labelledby="lbl-systems"] { flex-wrap: nowrap; gap: 6px; }
.seg button[data-key="systems"] {
  flex: 1 1 0; min-width: 0; min-height: 50px; padding: 8px 4px; gap: 5px;
  font-size: clamp(13px, 3.6vw, 16.5px); font-weight: 700; letter-spacing: -.02em; white-space: nowrap; padding: 8px 2px;
}
.seg button[data-key="systems"] .tick { display: none; } /* the color fill shows it's picked; the check mark would push Parathyroid off a phone screen */
.seg button[data-key="systems"][data-v="thyroid"]     { --g1: #ffa66e; --g2: #eb6834; --g3: #c0461a; --halo: 235, 104, 52;  background: #fff2ea; border-color: #f5c3a8; color: #b4471a; }
.seg button[data-key="systems"][data-v="parathyroid"] { --g1: #6cb6ff; --g2: #2a78d6; --g3: #17529e; --halo: 42, 120, 214;  background: #edf5ff; border-color: #b9d4f4; color: #1d5fae; }
.seg button[data-key="systems"][data-v="adrenal"]     { --g1: #ffd661; --g2: #e0a812; --g3: #a97803; --halo: 212, 162, 12; background: #fff8e2; border-color: #efd68a; color: #8d6308; }
.seg button[data-key="systems"] .tick { border-color: currentColor; }
.seg button[data-key="systems"][aria-pressed="true"] { background: linear-gradient(135deg, var(--g1), var(--g2) 50%, var(--g3)); border-color: transparent; color: #fff; text-shadow: 0 1px 2px rgba(60, 30, 0, .3); }
.seg button[data-key="systems"][aria-pressed="true"] .tick { border-color: #fff; background: #fff; }
.seg button[data-key="systems"][aria-pressed="true"] .tick::after { border-color: var(--g3); }
