/* ==========================================================================
   Luv Health — design system                       a Vayunex product

   Direction: "Heartline."
   A care platform should feel like being taken care of. Warm porcelain
   ground, a raspberry-crimson that reads human rather than hospital, deep
   plum ink, and one recurring gesture: the heartline — a soft pulse rule
   that underlines what matters. The onboarding is the signature: one
   question, two doors, no noise.

   Three portals, one system, color-keyed so you always know where you are:
   patient = crimson · clinic = plum · console = ink.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --crimson:      #D6244F;
  --crimson-deep: #A31238;
  --crimson-ink:  #6E0A24;
  --crimson-hov:  #E93A63;
  --blush:        #FDEDF1;
  --blush-2:      #F9D6DF;

  --plum:      #4A1D33;
  --plum-deep: #33101F;
  --ink:       #26101B;
  --body:      #443037;
  --muted:     #7A6169;
  --faint:     #99848B;

  --porcelain: #FFFBF9;
  --paper:     #FFFFFF;
  --line:      #EFDFE2;
  --line-2:    #F7ECEE;

  --ok:      #1E7A54;  --ok-wash:   #E9F6EF;  --ok-line:   #C6E7D5;
  --warn:    #8A5B00;  --warn-wash: #FFF6E3;  --warn-line: #F2DFB4;
  --info:    #12557E;  --info-wash: #EAF3F9;  --info-line: #CBE1EF;

  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;

  --t-mega: clamp(40px, 7vw, 76px);
  --t-hero: clamp(28px, 4.5vw, 44px);
  --t-h1: 27px; --t-h2: 20px; --t-h3: 16.5px;
  --t-body: 16px; --t-small: 14px; --t-cap: 13px; --t-tiny: 12px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 48px; --s9: 72px;

  --r-s: 8px; --r: 12px; --r-l: 18px; --r-xl: 26px;
  --shadow-1: 0 1px 2px rgba(110,10,36,.05), 0 3px 12px rgba(110,10,36,.06);
  --shadow-2: 0 2px 6px rgba(110,10,36,.08), 0 16px 40px -12px rgba(110,10,36,.18);
  --container: 1120px;
  --ease: cubic-bezier(.3,.7,.15,1);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--porcelain); color: var(--ink);
  font-family: var(--font); font-size: var(--t-body); line-height: 1.55;
  -webkit-font-smoothing: antialiased; }
h1,h2,h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 var(--s3);
  font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: var(--t-h1); } h2 { font-size: var(--t-h2); } h3 { font-size: var(--t-h3); }
p { margin: 0 0 var(--s4); }
a { color: var(--crimson-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2.5px solid var(--crimson); outline-offset: 2px; border-radius: 4px; }
.pnav :focus-visible, .hero-stage :focus-visible { outline-color: #fff; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s5); }

/* The heartline — the signature gesture */
.heartline { position: relative; display: inline-block; }
.heartline::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -.08em; height: .16em;
  background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' preserveAspectRatio='none'%3E%3Cpath d='M0 8 H38 L44 8 48 2 53 11 58 5 61 8 H120' fill='none' stroke='%23D6244F' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat center / 100% 100%;
}

/* ---------- 3. Public shell (landing + onboarding) ---------- */
.pubbar { position: sticky; top: 0; z-index: 50;
  background: rgba(255,251,249,.86); backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line-2); }
.pubbar .container { display: flex; align-items: center; gap: var(--s5);
  padding-top: var(--s3); padding-bottom: var(--s3); }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.logo:hover { text-decoration: none; }
.logo .mark { width: 36px; height: 36px; border-radius: 11px; color: #fff;
  background: linear-gradient(145deg, var(--crimson-hov), var(--crimson-ink));
  display: grid; place-items: center; box-shadow: 0 4px 14px -4px rgba(214,36,79,.55); }
.logo b { font-family: var(--display); font-size: 20px; letter-spacing: -.02em; }
.logo b em { font-style: normal; color: var(--crimson); }
.logo small { display: block; font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint); }
.pubbar nav { margin-left: auto; display: flex; align-items: center; gap: var(--s5); }
.pubbar nav a { color: var(--body); font-weight: 550; font-size: var(--t-small); }
.pubbar nav a.btn, .pubbar nav a.btn:hover { color: #fff; }

/* Hero */
.hero { position: relative; overflow: hidden;
  background:
    radial-gradient(90rem 42rem at 85% -20%, var(--blush) 0%, transparent 55%),
    radial-gradient(60rem 34rem at -12% 8%, #FFF0EA 0%, transparent 50%),
    var(--porcelain); }
.hero .container { padding-top: var(--s9); padding-bottom: var(--s9);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--s8); align-items: center; }
.hero h1 { font-size: var(--t-mega); font-weight: 800; letter-spacing: -.03em;
  line-height: 1.02; margin-bottom: var(--s5); }
.hero .lede { font-size: 19px; color: var(--body); max-width: 46ch; }
.hero-cta { display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s6); }
.hero-meta { margin-top: var(--s6); display: flex; gap: var(--s5);
  font-size: var(--t-cap); color: var(--muted); flex-wrap: wrap; }
.hero-meta b { color: var(--ink); }

.hero-art { position: relative; min-height: 420px; }
.float-card { position: absolute; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-l); box-shadow: var(--shadow-2); padding: var(--s4) var(--s5);
  animation: drift 7s var(--ease) infinite alternate; }
.float-card b { display: block; font-size: var(--t-small); }
.float-card span { font-size: var(--t-cap); color: var(--muted); }
.float-card .fc-ic { width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: var(--s2);
  background: var(--blush); color: var(--crimson); }
.float-card:nth-child(1) { top: 4%;  left: 6%;  animation-delay: 0s; }
.float-card:nth-child(2) { top: 30%; right: 0%; animation-delay: .8s; }
.float-card:nth-child(3) { bottom: 18%; left: 0%; animation-delay: 1.6s; }
.float-card:nth-child(4) { bottom: 0%; right: 14%; animation-delay: 2.4s; }
@keyframes drift { from { transform: translateY(-7px); } to { transform: translateY(9px); } }

.sect { padding: var(--s9) 0; }
.sect.tint { background: linear-gradient(180deg, #fff 0%, var(--blush) 160%); }
.sect-head { max-width: 60ch; margin-bottom: var(--s7); }
.sect-head h2 { font-size: var(--t-hero); letter-spacing: -.025em; }
.sect-head p { color: var(--muted); font-size: 17px; }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.feat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: var(--s6); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.feat:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.feat .f-ic { width: 44px; height: 44px; border-radius: 13px; margin-bottom: var(--s4);
  background: var(--blush); color: var(--crimson); display: grid; place-items: center; }
.feat h3 { margin-bottom: var(--s2); }
.feat p { color: var(--muted); font-size: var(--t-small); margin: 0; }

.pubfoot { border-top: 1px solid var(--line-2); padding: var(--s6) 0; }
.pubfoot .container { display: flex; justify-content: space-between; gap: var(--s4);
  flex-wrap: wrap; font-size: var(--t-cap); color: var(--muted); }

/* ---------- 4. Onboarding — the signature ---------- */
.stage { min-height: 100dvh; display: grid; place-items: center; position: relative;
  overflow: hidden; padding: var(--s6);
  background:
    radial-gradient(70rem 44rem at 20% -10%, var(--blush) 0%, transparent 60%),
    radial-gradient(56rem 40rem at 110% 110%, #FFE9E0 0%, transparent 55%),
    var(--porcelain); }
.stage-inner { width: 100%; max-width: 880px; text-align: center;
  animation: stagein .6s var(--ease) both; }
@keyframes stagein { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.stage .eyebrow { font-size: var(--t-tiny); letter-spacing: .22em; text-transform: uppercase;
  color: var(--crimson-deep); font-weight: 700; margin-bottom: var(--s3); }
.stage h1 { font-size: var(--t-hero); font-weight: 800; letter-spacing: -.028em;
  margin-bottom: var(--s2); }
.stage .sub { color: var(--muted); font-size: 17px; margin-bottom: var(--s7); }

.doors { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); text-align: left; }
.door { position: relative; display: block; background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--r-xl); padding: var(--s7);
  color: var(--ink); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease); }
.door:hover { text-decoration: none; transform: translateY(-6px) scale(1.012);
  box-shadow: var(--shadow-2); border-color: var(--blush-2); }
.door::after { content: ''; position: absolute; inset: auto 0 0 0; height: 5px;
  background: linear-gradient(90deg, var(--crimson-hov), var(--crimson-ink));
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.door:hover::after { transform: scaleX(1); }
.door .d-ic { width: 58px; height: 58px; border-radius: 17px; margin-bottom: var(--s5);
  display: grid; place-items: center; background: var(--blush); color: var(--crimson);
  transition: transform .3s var(--ease); }
.door:hover .d-ic { transform: rotate(-6deg) scale(1.06); }
.door.alt .d-ic { background: #F3E8F0; color: var(--plum); }
.door.alt::after { background: linear-gradient(90deg, #7A3B5E, var(--plum-deep)); }
.door h2 { font-size: 24px; margin-bottom: var(--s2); }
.door p { color: var(--muted); font-size: var(--t-small); margin-bottom: var(--s4); }
.door .d-go { font-weight: 700; color: var(--crimson-deep); font-size: var(--t-small);
  display: inline-flex; align-items: center; gap: 6px; }
.door.alt .d-go { color: var(--plum); }
.stage .aside { margin-top: var(--s6); font-size: var(--t-cap); color: var(--faint); }

/* Join forms on the stage */
.stagecard { max-width: 560px; margin: 0 auto; text-align: left;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-xl);
  padding: var(--s7); box-shadow: var(--shadow-2); }
.steps { display: flex; gap: 6px; margin-bottom: var(--s5); }
.steps i { height: 5px; flex: 1; border-radius: 99px; background: var(--line); }
.steps i.on { background: var(--crimson); }

/* ---------- 5. Portal shell ---------- */
.pnav { color: #fff; }
.pnav.patient { background: linear-gradient(120deg, var(--crimson) 0%, var(--crimson-ink) 100%); }
.pnav.clinic  { background: linear-gradient(120deg, #5C2440 0%, var(--plum-deep) 100%); }
.pnav.console { background: linear-gradient(120deg, #2E1B26 0%, #170D13 100%); }
.pnav .container { display: flex; align-items: center; gap: var(--s2);
  padding-top: var(--s3); padding-bottom: 0; flex-wrap: wrap; }
.pnav .plogo { display: flex; align-items: center; gap: 9px; color: #fff;
  margin-right: var(--s5); padding-bottom: var(--s3); }
.pnav .plogo:hover { text-decoration: none; }
.pnav .plogo .mark { width: 30px; height: 30px; border-radius: 9px;
  background: rgba(255,255,255,.16); display: grid; place-items: center; }
.pnav .plogo b { font-family: var(--display); font-size: 17px; }
.pnav .ptag { font-size: var(--t-tiny); letter-spacing: .14em; text-transform: uppercase;
  opacity: .65; padding-bottom: var(--s3); margin-right: auto; }
.pnav .puser { display: flex; align-items: center; gap: var(--s4);
  padding-bottom: var(--s3); font-size: var(--t-cap); }
.pnav .puser a { color: #fff; opacity: .85; }
.pnav .pbell { position: relative; color: #fff; display: grid; place-items: center; }
.pnav .pbell .nb { position: absolute; top: -6px; right: -8px; min-width: 15px; height: 15px;
  background: #fff; color: var(--crimson-deep); border-radius: 99px; font-size: 9.5px;
  font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.pnav .tabs { display: flex; gap: 2px; width: 100%; overflow-x: auto; }
.pnav .tabs a { color: rgba(255,255,255,.82); font-weight: 600; font-size: var(--t-small);
  padding: 10px 16px 13px; border-radius: 10px 10px 0 0; white-space: nowrap; }
.pnav .tabs a:hover { color: #fff; background: rgba(255,255,255,.09); text-decoration: none; }
.pnav .tabs a[aria-current="page"] { background: var(--porcelain); color: var(--ink); }

.page { padding: var(--s6) 0 var(--s8); min-height: 60vh; }
.page-head { margin-bottom: var(--s5); }
.page-head .crumbs { font-size: var(--t-cap); color: var(--muted); margin-bottom: var(--s2); }
.page-head .lede { color: var(--muted); max-width: 64ch; margin: var(--s2) 0 0; }
.cols { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: var(--s6);
  align-items: start; }
.cols > .rail { position: sticky; top: var(--s5); display: grid; gap: var(--s4); }
.section-h { display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s4); margin: var(--s6) 0 var(--s4); padding-bottom: 6px;
  border-bottom: 2.5px solid var(--blush-2); }
.section-h:first-child { margin-top: 0; }
.section-h h2 { margin: 0; font-size: 18px; }
.section-h a { font-size: var(--t-cap); font-weight: 650; white-space: nowrap; }

/* ---------- 6. Components ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: var(--s5); box-shadow: var(--shadow-1); }
.card + .card { margin-top: var(--s4); }
.card .meta, .meta { color: var(--muted); font-size: var(--t-cap); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: var(--s4); }
a.tile { display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: var(--s5); color: var(--ink); box-shadow: var(--shadow-1);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease); }
a.tile:hover { text-decoration: none; transform: translateY(-3px);
  box-shadow: var(--shadow-2); border-color: var(--blush-2); }
a.tile .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--blush);
  color: var(--crimson); display: grid; place-items: center; margin-bottom: var(--s3); }
a.tile b { display: block; font-family: var(--display); font-size: var(--t-h3); }
a.tile span { display: block; color: var(--muted); font-size: var(--t-cap); margin-top: 3px; }

.rows { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden;
  background: var(--paper); box-shadow: var(--shadow-1); }
.rows > * { display: flex; gap: var(--s4); align-items: center;
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line-2); color: inherit; }
.rows > *:last-child { border-bottom: 0; }
.rows > a:hover { background: var(--porcelain); text-decoration: none; }
.r-ic { width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--blush); color: var(--crimson); display: grid; place-items: center; }
.r-ic.ok { background: var(--ok-wash); color: var(--ok); }
.r-ic.warn { background: var(--warn-wash); color: var(--warn); }
.r-ic.info { background: var(--info-wash); color: var(--info); }
.r-ic.ink { background: var(--ink); color: var(--blush-2); }
.r-main { flex: 1; min-width: 0; }
.r-main b { display: block; font-size: var(--t-small); font-weight: 650; }
.r-main span { display: block; color: var(--muted); font-size: var(--t-cap); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-side { flex: none; text-align: right; color: var(--faint); font-size: var(--t-cap); }

.kv { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.kv th, .kv td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line-2);
  vertical-align: top; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.kv th { color: var(--muted); font-weight: 450; width: 44%; padding-right: var(--s4); }
.kv td { font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 22px; border: 0; border-radius: 12px;
  background: var(--crimson); color: #fff; font-weight: 700; font-size: 15px;
  cursor: pointer; box-shadow: 0 6px 18px -6px rgba(214,36,79,.55);
  transition: transform .15s var(--ease), background .15s var(--ease); }
.btn:hover { background: var(--crimson-hov); color: #fff; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: var(--paper); color: var(--crimson-ink);
  border: 1.5px solid var(--blush-2); box-shadow: none; }
.btn.ghost:hover { background: var(--blush); border-color: var(--crimson); }
.btn.quiet { background: var(--line-2); color: var(--body); box-shadow: none; }
.btn.quiet:hover { background: var(--line); }
.btn.dark { background: var(--ink); box-shadow: none; }
.btn.big { min-height: 54px; padding: 14px 30px; font-size: 16.5px; border-radius: 14px; }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: var(--t-cap); border-radius: 9px; }
.btn.block { display: flex; width: 100%; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2.5px 10px;
  border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; background: var(--line-2); color: var(--muted);
  white-space: nowrap; }
.pill.red { background: var(--blush); color: var(--crimson-ink); }
.pill.solid { background: var(--crimson); color: #fff; }
.pill.ok { background: var(--ok-wash); color: var(--ok); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.info { background: var(--info-wash); color: var(--info); }

.banner { display: flex; gap: var(--s3); align-items: flex-start; border: 1px solid;
  border-radius: var(--r); padding: var(--s4) var(--s5); margin-bottom: var(--s4);
  font-size: var(--t-small); line-height: 1.55; }
.banner svg { flex: none; margin-top: 2px; }
.banner.ok { background: var(--ok-wash); border-color: var(--ok-line); color: #14523A; }
.banner.warn { background: var(--warn-wash); border-color: var(--warn-line); color: #6B4700; }
.banner.info { background: var(--info-wash); border-color: var(--info-line); color: #0C3D5C; }
.banner.danger { background: var(--blush); border-color: var(--blush-2); color: var(--crimson-ink); }
.banner code { font-family: var(--mono); font-size: .88em;
  background: rgba(0,0,0,.05); padding: 1px 4px; border-radius: 3px; }

.alarm { background: var(--crimson-ink); color: #FFE3EA; border-radius: var(--r-l);
  padding: var(--s5) var(--s5) var(--s5) var(--s6); position: relative;
  margin-bottom: var(--s4); line-height: 1.6; font-size: 15px; }
.alarm::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: var(--crimson-hov); border-radius: var(--r-l) 0 0 var(--r-l); }
.alarm h3 { color: #fff; display: flex; gap: 10px; align-items: center; font-family: var(--display); }
.alarm .tel { display: inline-flex; gap: 8px; align-items: center; margin-top: var(--s3);
  background: #fff; color: var(--crimson-ink); font-weight: 800; padding: 11px 22px;
  border-radius: 11px; font-size: 16px; }
.alarm .tel:hover { background: var(--blush); text-decoration: none; }

/* Forms */
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s5); }
.fgrid .span2 { grid-column: 1 / -1; }
.field { margin-bottom: var(--s4); }
.field > label { display: block; font-weight: 650; font-size: var(--t-cap);
  margin-bottom: 6px; color: var(--body); }
.field .hint { font-size: var(--t-cap); color: var(--muted); margin-top: 6px; }
.field .err { font-size: var(--t-cap); color: var(--crimson-deep); font-weight: 650; margin-top: 6px; }
input:not([type]), input[type=text], input[type=email], input[type=password],
input[type=tel], input[type=date], input[type=time], input[type=number],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 12px 15px; border: 1.5px solid var(--line); border-radius: 11px;
  background: var(--paper); font-size: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--crimson);
  box-shadow: 0 0 0 3.5px var(--blush); }
textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
select { appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%237A6169' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: var(--s3) var(--s4);
  border: 1.5px solid var(--line); border-radius: 11px; cursor: pointer;
  font-size: var(--t-small); line-height: 1.5; margin-bottom: var(--s3);
  background: var(--paper); }
.check:has(input:checked) { border-color: var(--crimson); background: var(--blush); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--crimson); flex: none; }
form ul.errorlist { margin: 4px 0 0; padding-left: 18px; color: var(--crimson-deep);
  font-size: var(--t-cap); font-weight: 650; }
form ul:not(.errorlist) { margin: 6px 0 0; padding-left: 18px; font-size: var(--t-cap);
  color: var(--muted); line-height: 1.6; }

/* Chat */
.chatlog { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5);
  background: var(--porcelain); border: 1px solid var(--line);
  border-radius: var(--r-l) var(--r-l) 0 0; min-height: 300px; max-height: 58vh;
  overflow-y: auto; }
.msg { max-width: 78%; padding: 11px 16px; border-radius: 16px; font-size: 15px;
  line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { background: var(--crimson); color: #fff; align-self: flex-end;
  border-bottom-right-radius: 5px; }
.msg.ai { background: var(--paper); border: 1px solid var(--line); align-self: flex-start;
  border-bottom-left-radius: 5px; }
.msg.clinic { background: var(--info-wash); border: 1px solid var(--info-line);
  align-self: flex-start; border-bottom-left-radius: 5px; }
.msg.note { align-self: center; max-width: 95%; background: var(--warn-wash);
  border: 1px solid var(--warn-line); color: #6B4700; font-size: var(--t-cap);
  border-radius: var(--r); text-align: center; }
.msg-meta { font-size: 11px; color: var(--faint); margin: -6px 4px 0; }
.msg-meta.me { align-self: flex-end; } .msg-meta.ai { align-self: flex-start; }
.summary-card { align-self: stretch; max-width: 100%; background: var(--paper);
  border: 1px solid var(--line); border-left: 4px solid var(--crimson);
  border-radius: var(--r); padding: var(--s4) var(--s5); font-size: var(--t-small); }
.summary-card ul { margin: var(--s2) 0 0; padding-left: 18px; color: var(--muted); }
.composer { display: flex; gap: var(--s3); padding: var(--s4); background: var(--paper);
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-l) var(--r-l); }
.composer textarea { min-height: 46px; max-height: 140px; border-radius: 23px; }
.composer .btn { border-radius: 50%; width: 46px; min-height: 46px; padding: 0;
  flex: none; align-self: flex-end; }
.typing { display: inline-flex; gap: 4px; padding: 12px 16px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 5px;
  align-self: flex-start; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--blush-2);
  animation: bob 1.2s var(--ease) infinite; }
.typing i:nth-child(2){animation-delay:.15s} .typing i:nth-child(3){animation-delay:.3s}
@keyframes bob { 0%,60%,100%{transform:none;opacity:.5} 30%{transform:translateY(-4px);opacity:1} }

/* Slot picker — pick five or more */
.slotdays { display: grid; gap: var(--s3); }
.slotday summary { cursor: pointer; font-weight: 700; padding: var(--s3) var(--s4);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  font-size: var(--t-small); display: flex; justify-content: space-between; }
.slotday summary .cnt { color: var(--crimson-deep); font-size: var(--t-cap); }
.slotday[open] summary { border-radius: var(--r) var(--r) 0 0; }
.slotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px,1fr));
  gap: var(--s2); padding: var(--s4); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--r) var(--r); background: var(--porcelain); }
.pick { min-height: 42px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--paper); font-weight: 650; font-size: var(--t-cap); cursor: pointer;
  font-variant-numeric: tabular-nums; transition: all .13s var(--ease); }
.pick:hover { border-color: var(--crimson); }
.pick.on { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.picktray { position: sticky; bottom: var(--s4); background: var(--ink); color: #fff;
  border-radius: var(--r-l); padding: var(--s4) var(--s5); display: flex;
  align-items: center; gap: var(--s4); box-shadow: var(--shadow-2); margin-top: var(--s5); }
.picktray .cnt { font-family: var(--display); font-size: 26px; font-weight: 800;
  min-width: 2ch; text-align: center; }
.picktray .cnt.enough { color: #7EE2AE; }
.picktray .what { flex: 1; font-size: var(--t-cap); opacity: .85; }

/* Month calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); margin-bottom: var(--s3); }
.cal { width: 100%; border-collapse: collapse; table-layout: fixed;
  border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden;
  background: var(--paper); }
.cal th { background: var(--porcelain); border-bottom: 1px solid var(--line);
  padding: 8px 6px; font-size: var(--t-tiny); text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); }
.cal td { border: 1px solid var(--line-2); vertical-align: top; height: 92px;
  padding: 6px; position: relative; }
.cal td.dim { background: var(--porcelain); }
.cal td.blocked { background: repeating-linear-gradient(-45deg, var(--blush),
  var(--blush) 6px, #fff 6px, #fff 12px); }
.cal td.today .dnum { background: var(--crimson); color: #fff; }
.cal .dnum { display: inline-grid; place-items: center; min-width: 23px; height: 23px;
  border-radius: 50%; font-weight: 700; font-size: var(--t-cap); }
.cal .cv { display: block; margin-top: 4px; padding: 2px 6px; border-radius: 5px;
  background: var(--blush); color: var(--crimson-ink); font-size: 11px; font-weight: 650;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal .day-act { position: absolute; bottom: 4px; right: 6px; opacity: 0; transition: opacity .15s; }
.cal td:hover .day-act { opacity: 1; }
.cal .day-act button { border: 0; background: none; color: var(--crimson-deep);
  font-size: 11px; font-weight: 700; cursor: pointer; }

/* Misc */
.empty { text-align: center; padding: var(--s8) var(--s6); color: var(--muted); }
.empty .e-ic { width: 54px; height: 54px; margin: 0 auto var(--s4); border-radius: 15px;
  background: var(--blush); color: var(--crimson); display: grid; place-items: center; }
.empty h3 { color: var(--ink); }
.empty p { max-width: 42ch; margin: 0 auto var(--s4); font-size: var(--t-small); }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite;
  display: inline-block; }
.spin.dark { border-color: var(--blush-2); border-top-color: var(--crimson); }
@keyframes sp { to { transform: rotate(360deg) } }
.feed-box { display: flex; gap: 8px; }
.feed-box input { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.flash { margin: var(--s4) 0 0; }
.pfoot { border-top: 1px solid var(--line-2); padding: var(--s5) 0; margin-top: var(--s8);
  font-size: var(--t-cap); color: var(--faint); }
.pfoot .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s3); }

/* ---------- 7. Responsive ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; padding-top: var(--s7); }
  .hero-art { display: none; }
  .feat-grid { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .cols > .rail { position: static; }
  .doors { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  .cal td { height: 62px; }
  .cal .cv { display: none; }
  .cal .cvn { display: inline-block; margin-top: 4px; font-size: 11px;
    font-weight: 700; color: var(--crimson-deep); }
  .pubbar nav a:not(.btn) { display: none; }
}
@media (min-width: 901px) { .cal .cvn { display: none; } }

/* ---------- 8. Console — the operator's room ----------
   Same brand, back-of-house lighting: a near-black plum sidebar with one
   living element (the heartline above the footer), warm porcelain workspace,
   Bricolage numerals for the money. */

.con { display: flex; min-height: 100vh; background: var(--porcelain); }

/* -- sidebar -- */
.con-side { position: fixed; inset: 0 auto 0 0; width: 254px; z-index: 60;
  display: flex; flex-direction: column;
  background: linear-gradient(178deg, #2E1424 0%, #200D18 100%);
  border-right: 1px solid rgba(255,255,255,.05); }
.con-brand { display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 18px; }
.con-brand .mark { width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--crimson); color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 14px -4px rgba(214,36,79,.7); }
.con-brand b { display: block; font-family: var(--display); font-size: 16.5px;
  color: #fff; line-height: 1.1; letter-spacing: .01em; }
.con-brand span { display: block; font-size: 10.5px; font-weight: 650;
  letter-spacing: .17em; text-transform: uppercase; color: rgba(255,222,231,.42);
  margin-top: 2px; }

.con-nav { flex: 1; overflow-y: auto; padding: 2px 12px 12px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
.con-nav .cg { margin: 18px 8px 6px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: rgba(255,222,231,.34); }
.con-nav a { position: relative; display: flex; align-items: center; gap: 11px;
  padding: 8.5px 12px; margin: 1px 0; border-radius: 10px;
  color: rgba(255,247,249,.72); font-size: 13.5px; font-weight: 550;
  transition: background .14s var(--ease), color .14s var(--ease); }
.con-nav a svg { opacity: .7; flex: none; transition: opacity .14s var(--ease); }
.con-nav a:hover { background: rgba(255,255,255,.055); color: #fff;
  text-decoration: none; }
.con-nav a:hover svg { opacity: 1; }
.con-nav a[aria-current] { background: rgba(214,36,79,.17); color: #fff;
  font-weight: 650; }
.con-nav a[aria-current] svg { opacity: 1; color: #FF7A9C; }
.con-nav a[aria-current]::before { content: ""; position: absolute;
  left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--crimson); box-shadow: 0 0 10px rgba(214,36,79,.8); }
.cbdg { margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px;
  border-radius: 10px; display: grid; place-items: center;
  background: var(--crimson); color: #fff; font-size: 11px; font-weight: 700; }
.cbdg.dim { background: rgba(255,255,255,.14); color: rgba(255,255,255,.8); }

/* the one living element */
.con-pulse { padding: 4px 18px 0; }
.con-pulse svg { display: block; width: 100%; height: 22px;
  color: rgba(214,36,79,.75); }
.con-pulse path { stroke-dasharray: 320; stroke-dashoffset: 320;
  animation: con-draw 1.8s .3s var(--ease) forwards; }
@keyframes con-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .con-pulse path { animation: none; stroke-dashoffset: 0; } }

.con-foot { padding: 12px 14px 16px; display: flex; align-items: center; gap: 10px;
  border-top: 1px solid rgba(255,255,255,.06); }
.con-foot .avr { width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: rgba(214,36,79,.25); border: 1px solid rgba(214,36,79,.5);
  color: #FFD9E2; font-weight: 750; font-size: 13px;
  display: grid; place-items: center; text-transform: uppercase; }
.con-foot .who { flex: 1; min-width: 0; }
.con-foot .who b { display: block; color: #fff; font-size: 13px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-foot .who span { display: block; color: rgba(255,222,231,.42);
  font-size: 11px; }
.con-foot > a { color: rgba(255,247,249,.55); padding: 6px; border-radius: 8px; }
.con-foot > a:hover { color: #fff; background: rgba(255,255,255,.07); }

/* -- main column -- */
.con-main { flex: 1; margin-left: 254px; min-width: 0; }
.con-top { position: sticky; top: 0; z-index: 40; display: flex;
  align-items: center; gap: 14px; padding: 13px 30px;
  background: color-mix(in srgb, var(--porcelain) 86%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.con-top h1 { font-family: var(--display); font-size: 21px; margin: 0;
  letter-spacing: -.01em; }
.con-top .crumb { color: var(--faint); font-size: var(--t-cap); }
.con-top .grow { flex: 1; }
.con-burger { display: none; border: 1px solid var(--line); background: var(--paper);
  border-radius: 10px; width: 38px; height: 38px; place-items: center;
  color: var(--ink); cursor: pointer; }
.con-wrap { padding: 24px 30px 70px; max-width: 1280px; }
.con-scrim { display: none; }

/* -- KPI cards -- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4);
  margin-bottom: var(--s5); }
.kpi { background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 15px 17px; box-shadow: var(--shadow-1); }
.kpi .kl { display: flex; align-items: center; gap: 7px; font-size: 12px;
  font-weight: 650; letter-spacing: .03em; color: var(--muted); }
.kpi .kl svg { color: var(--crimson); opacity: .8; }
.kpi .kv2 { font-family: var(--display); font-size: 29px; font-weight: 700;
  letter-spacing: -.01em; color: var(--ink); margin-top: 6px; line-height: 1;
  font-variant-numeric: tabular-nums; }
.kpi .kd { margin-top: 7px; font-size: 12px; color: var(--faint); }
.kpi .kd .up { color: var(--ok); font-weight: 700; }
.kpi .kd .down { color: var(--crimson-deep); font-weight: 700; }

/* -- dashboard grid + chart cards -- */
.con-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr);
  gap: var(--s4); align-items: start; }
.con-grid .card + .card { margin-top: var(--s4); }
.chead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.chead b { font-family: var(--display); font-size: 15.5px; }
.chead .meta { margin-left: auto; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .bar { fill: var(--blush-2); transition: fill .15s var(--ease); }
.chart .bar.hot { fill: var(--crimson); }
.chart .bar:hover { fill: var(--crimson-hov); }
.chart .axis { font: 10.5px var(--font); fill: var(--faint); }
.chart .lline { fill: none; stroke: var(--plum); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.chart .lfill { fill: url(#confade); opacity: .5; }
.chart .dot { fill: var(--crimson); }

/* -- data tables -- */
.tblwrap { overflow-x: auto; margin: 0 calc(var(--s5) * -1);
  padding: 0 var(--s5); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--faint);
  padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s var(--ease); }
.tbl tbody tr:hover { background: var(--porcelain); }
.tbl a.rowlink { font-weight: 650; color: var(--ink); }
.tbl a.rowlink:hover { color: var(--crimson); text-decoration: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .sub { display: block; color: var(--faint); font-size: 11.5px;
  margin-top: 1px; }
.code { font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  background: var(--blush); color: var(--crimson-ink); padding: 2px 7px;
  border-radius: 6px; letter-spacing: .04em; }

/* -- filter bar + small controls -- */
.fbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: var(--s4); }
.fbar select, .fbar input[type=search], .fbar input[type=text] {
  height: 38px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--paper); font: 550 13.5px var(--font);
  color: var(--body); }
.fbar input[type=search] { min-width: 210px; }
.fbar select:focus, .fbar input:focus { outline: 2px solid var(--crimson);
  outline-offset: 1px; border-color: transparent; }
.fbar .grow { flex: 1; }
.btn.sm { min-height: 38px; padding: 8px 15px; font-size: 13.5px;
  border-radius: 10px; }
.btn.tiny { min-height: 31px; padding: 4px 11px; font-size: 12.5px;
  border-radius: 8px; box-shadow: none; }
.btn.danger { background: var(--paper); color: var(--crimson-deep);
  border: 1px solid var(--blush-2); box-shadow: none; }
.btn.danger:hover { background: var(--blush); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  font-weight: 650; }
.prio i { width: 8px; height: 8px; border-radius: 50%; }
.prio.low i { background: var(--faint); }
.prio.normal i { background: var(--info); }
.prio.high i { background: var(--warn); }
.prio.urgent i { background: var(--crimson); box-shadow: 0 0 0 3px var(--blush); }

/* -- ticket thread -- */
.tmsg { display: flex; gap: 11px; padding: 13px 0;
  border-bottom: 1px solid var(--line-2); }
.tmsg:last-child { border-bottom: 0; }
.tmsg .avr { width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 750; font-size: 12.5px;
  background: var(--blush); color: var(--crimson-ink); text-transform: uppercase; }
.tmsg.staff .avr { background: var(--ink); color: var(--blush-2); }
.tmsg .tb { flex: 1; min-width: 0; }
.tmsg .th2 { display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; color: var(--faint); }
.tmsg .th2 b { color: var(--ink); font-size: 13px; }
.tmsg .tx { margin-top: 3px; font-size: 14px; white-space: pre-wrap; }
.tmsg.note { background: var(--warn-wash); border: 1px solid var(--warn-line);
  border-radius: 12px; padding: 11px 13px; margin: 6px 0; }
.tmsg.note .avr { background: var(--warn-wash); color: var(--warn);
  border: 1px solid var(--warn-line); }

/* -- misc -- */
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.mini { border: 1px solid var(--line-2); border-radius: 11px; padding: 10px 13px;
  background: var(--porcelain); }
.mini b { display: block; font-family: var(--display); font-size: 19px; }
.mini span { font-size: 11.5px; color: var(--muted); }
.permrows { font-size: 13px; }
.permrows > div { display: flex; gap: 9px; padding: 7px 0;
  border-bottom: 1px solid var(--line-2); align-items: baseline; }
.permrows > div:last-child { border-bottom: 0; }
.permrows b { flex: none; width: 118px; }
.permrows span { color: var(--muted); }

/* -- responsive console -- */
@media (max-width: 1120px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .con-grid { grid-template-columns: 1fr; }
}
@media (max-width: 940px) {
  .con-side { transform: translateX(-100%);
    transition: transform .28s var(--ease); box-shadow: none; }
  .con.nav-open .con-side { transform: translateX(0);
    box-shadow: 0 0 60px rgba(32,13,24,.5); }
  .con-main { margin-left: 0; }
  .con-top { padding: 11px 16px; }
  .con-wrap { padding: 18px 16px 60px; }
  .con-burger { display: grid; }
  .con.nav-open .con-scrim { display: block; position: fixed; inset: 0;
    z-index: 55; background: rgba(32,13,24,.45); border: 0; }
  .statgrid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } }

/* ---------- 9. Doctor suite — clinic tint, dark mode, SOAP, assistant ------
   The clinic reuses the console shell (.con) with a plum tint (.dsh) and
   gains the one thing back-of-house rooms deserve: its own light switch. */

.con.dsh .con-side { background: linear-gradient(178deg, #3A1629 0%, #250C1B 100%); }
.con.dsh .con-brand span { color: rgba(255,222,231,.5); }

/* -- dark theme: token swap scoped to the shell -- */
.con[data-theme="dark"] {
  --porcelain: #150A10; --paper: #1F1119; --ink: #FFF3F6;
  --body: #EBD9DF; --muted: #B096A0; --faint: #837079;
  --line: #37222D; --line-2: #2B1823;
  --blush: #3A1B29; --blush-2: #52263B;
  --ok-wash: #11301F; --ok: #5FD39A; --ok-line: #1E4A31;
  --warn-wash: #382A0D; --warn: #F0BE5A; --warn-line: #55411A;
  --info-wash: #0F2A3C; --info: #6FB9E8; --info-line: #1D4258;
  --crimson-ink: #FF9AB4;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 3px 12px rgba(0,0,0,.35);
  --shadow-2: 0 2px 6px rgba(0,0,0,.5), 0 16px 40px -12px rgba(0,0,0,.6);
  background: var(--porcelain); color: var(--body);
}
.con[data-theme="dark"] .con-top { border-color: var(--line); }
.con[data-theme="dark"] input, .con[data-theme="dark"] select,
.con[data-theme="dark"] textarea {
  background: #251420; border-color: var(--line); color: var(--body);
  color-scheme: dark; }
.con[data-theme="dark"] .btn.ghost { background: #2A1622; color: #FFC2D2;
  border-color: var(--line); }
.con[data-theme="dark"] .btn.danger { background: #2A1622; }
.con[data-theme="dark"] .chart .lline { stroke: #C990A8; }
.con[data-theme="dark"] .code { background: #3A1B29; color: #FFB1C6; }
.con[data-theme="dark"] .con-burger { background: var(--paper); color: var(--ink); }
.con[data-theme="dark"] .tmsg.note { background: #382A0D; }

/* -- theme toggle -- */
.themetog { display: flex; align-items: center; gap: 8px; margin: 0 14px 10px;
  padding: 7px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05); color: rgba(255,247,249,.8);
  font: 600 12.5px var(--font); cursor: pointer; width: calc(100% - 28px); }
.themetog:hover { background: rgba(255,255,255,.1); color: #fff; }
.themetog .sw { margin-left: auto; width: 30px; height: 17px; border-radius: 9px;
  background: rgba(255,255,255,.2); position: relative;
  transition: background .2s var(--ease); }
.themetog .sw::after { content: ""; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  transition: transform .2s var(--ease); }
.con[data-theme="dark"] .themetog .sw { background: var(--crimson); }
.con[data-theme="dark"] .themetog .sw::after { transform: translateX(13px); }

/* -- patient banner (always visible during clinical work) -- */
.pbanner { position: sticky; top: 63px; z-index: 35; display: flex;
  flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: -24px -30px 20px; padding: 10px 30px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.pbanner .pb-id b { font-family: var(--display); font-size: 16.5px; }
.pbanner .pb-id span { color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.pbanner .pb-allergy { display: inline-flex; align-items: center; gap: 5px;
  background: var(--blush); color: var(--crimson-ink);
  border: 1px solid var(--blush-2); padding: 2.5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; }
.pbanner .pb-ok { color: var(--ok); font-size: 12px; font-weight: 650; }
.pbanner .grow { flex: 1; }
.pbanner .pb-meta { color: var(--faint); font-size: 12px; }

/* -- SOAP workspace -- */
.soap { display: grid; grid-template-columns: minmax(0,1fr) 300px;
  gap: var(--s4); align-items: start; }
.soap .rail2 { position: sticky; top: 130px; }
.soap .rail2 .card + .card { margin-top: var(--s4); }
.sec-tag { display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 8px; background: var(--crimson); color: #fff;
  font: 800 13px var(--display); }
.vgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.vgrid .field { margin-bottom: 0; }
.vgrid input { text-align: center; font-variant-numeric: tabular-nums; }
.qfill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  color: var(--body); font: 600 12.5px var(--font); cursor: pointer;
  transition: all .15s var(--ease); }
.qfill:hover { border-color: var(--crimson); color: var(--crimson); }
.dxrow { display: grid; grid-template-columns: 110px 1fr 1fr 36px; gap: 8px;
  margin-bottom: 8px; }
.dxrow input { height: 40px; }
.dxrow .del { border: 1px solid var(--line); background: var(--paper);
  border-radius: 10px; color: var(--muted); cursor: pointer; }
.dxrow .del:hover { color: var(--crimson-deep); border-color: var(--blush-2); }
.autosave { display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--faint); }
.autosave .dot2 { width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); }
.autosave.saving .dot2 { background: var(--warn); animation: asv 1s infinite; }
@keyframes asv { 50% { opacity: .3; } }
.lockbar { position: sticky; bottom: 0; z-index: 30; display: flex; gap: 10px;
  align-items: center; margin: var(--s5) -30px -70px; padding: 12px 30px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.signed-stamp { display: inline-flex; align-items: center; gap: 7px;
  background: var(--ok-wash); color: var(--ok); border: 1px solid var(--ok-line);
  padding: 5px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.soap-read h4 { font-family: var(--display); font-size: 14.5px;
  margin: 16px 0 5px; color: var(--crimson-ink); }
.soap-read p { margin: 0 0 4px; white-space: pre-wrap; font-size: 14px; }
.amend { border-left: 3px solid var(--warn); background: var(--warn-wash);
  border-radius: 0 10px 10px 0; padding: 10px 14px; margin-top: 10px; }
.amend .who { font-size: 12px; color: var(--muted); margin-bottom: 3px; }

/* -- knowledge base list -- */
.kb { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; }
.kb .ki { position: relative; padding: 7px 0; }
.kb .ki::before { content: ""; position: absolute; left: -19px; top: 14px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--crimson);
  border: 2px solid var(--paper); }
.kb .ki.file::before { background: var(--info); }
.kb .ki b { font-size: 13px; display: block; }
.kb .ki p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.kb .ki .tag2 { font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--faint); text-transform: uppercase; }

/* -- assistant FAB + panel -- */
.afab { position: fixed; right: 26px; bottom: 26px; z-index: 70;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-deep));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 30px -8px rgba(214,36,79,.75);
  transition: transform .2s var(--ease); }
.afab:hover { transform: translateY(-3px) scale(1.04); }
.afab .ini { position: absolute; top: -4px; right: -4px; width: 22px;
  height: 22px; border-radius: 50%; background: var(--plum); color: #FFD9E2;
  font: 750 11px var(--font); display: grid; place-items: center;
  border: 2px solid var(--porcelain); text-transform: uppercase; }
.apanel { position: fixed; right: 26px; bottom: 96px; z-index: 71;
  width: min(400px, calc(100vw - 32px)); max-height: min(600px, 78vh);
  display: none; flex-direction: column; background: var(--paper);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-2); }
.apanel.open { display: flex; }
.ap-head { padding: 13px 16px 11px; background:
  linear-gradient(135deg, var(--crimson), var(--crimson-deep)); color: #fff; }
.ap-head b { font-family: var(--display); font-size: 15px; display: block; }
.ap-head span { font-size: 11.5px; opacity: .85; }
.ap-modes { display: flex; gap: 4px; margin-top: 9px;
  background: rgba(0,0,0,.22); border-radius: 999px; padding: 3px;
  width: max-content; }
.ap-modes button { border: 0; background: transparent; color: rgba(255,255,255,.75);
  font: 700 11.5px var(--font); padding: 4px 14px; border-radius: 999px;
  cursor: pointer; }
.ap-modes button[aria-pressed="true"] { background: #fff; color: var(--crimson-deep); }
.ap-log { flex: 1; overflow-y: auto; padding: 14px; display: flex;
  flex-direction: column; gap: 9px; background: var(--porcelain);
  min-height: 180px; }
.ap-msg { max-width: 88%; padding: 9px 13px; border-radius: 14px;
  font-size: 13.5px; white-space: pre-wrap; overflow-wrap: break-word; }
.ap-msg.me { align-self: flex-end; background: var(--crimson); color: #fff;
  border-bottom-right-radius: 5px; }
.ap-msg.ai { align-self: flex-start; background: var(--paper);
  border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.ap-msg.sys { align-self: center; background: var(--warn-wash);
  border: 1px solid var(--warn-line); color: var(--warn); font-size: 12.5px;
  border-radius: 10px; }
.ap-msg .ailabel { display: block; font-size: 10px; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase; color: var(--crimson);
  margin-bottom: 3px; }
.ap-empty { margin: auto; text-align: center; color: var(--muted);
  font-size: 12.5px; padding: 10px 18px; }
.ap-in { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line);
  background: var(--paper); }
.ap-in textarea { flex: 1; resize: none; border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 12px; font: 450 13.5px var(--font);
  background: var(--porcelain); color: var(--body); max-height: 110px; }
.ap-in button { width: 42px; border: 0; border-radius: 12px;
  background: var(--crimson); color: #fff; cursor: pointer; display: grid;
  place-items: center; }
.ap-in button:disabled { opacity: .5; }
.ap-foot { padding: 5px 14px 9px; font-size: 10.5px; color: var(--faint);
  background: var(--paper); text-align: center; }
.ap-typing { align-self: flex-start; display: inline-flex; gap: 4px;
  padding: 10px 14px; }
.ap-typing i { width: 6px; height: 6px; border-radius: 50%;
  background: var(--faint); animation: apty 1s infinite; }
.ap-typing i:nth-child(2) { animation-delay: .18s; }
.ap-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes apty { 40% { transform: translateY(-4px); opacity: .5; } }

@media (max-width: 940px) {
  .soap { grid-template-columns: 1fr; }
  .soap .rail2 { position: static; }
  .pbanner { margin: -18px -16px 16px; padding: 9px 16px; top: 57px; }
  .lockbar { margin: var(--s5) -16px -60px; padding: 10px 16px; }
  .vgrid { grid-template-columns: 1fr 1fr; }
  .apanel { right: 16px; bottom: 86px; }
  .afab { right: 16px; bottom: 18px; }
}

/* ---------- 10. Patient shell tint ---------- */
.con.pts .con-side { background: linear-gradient(178deg, #41101F 0%, #26060F 100%); }
.con.pts .con-brand span { color: rgba(255,214,224,.55); }
.plangrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--s4); align-items: stretch; }
.plan { position: relative; background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; }
.plan.now { border-color: var(--crimson); box-shadow: 0 0 0 2px var(--blush-2),
  var(--shadow-1); }
.plan h3 { font-family: var(--display); margin: 0 0 2px; font-size: 18px; }
.plan .pmoney { font-family: var(--display); font-size: 27px; font-weight: 700;
  margin: 8px 0 2px; }
.plan .pmoney small { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan ul { margin: 10px 0 16px; padding: 0 0 0 18px; font-size: 13.5px;
  color: var(--body); }
.plan ul li { margin-bottom: 5px; }
.plan .btn { margin-top: auto; }
.nowtag { position: absolute; top: -10px; right: 14px; background: var(--crimson);
  color: #fff; font: 700 11px var(--font); padding: 3px 11px;
  border-radius: 999px; }

/* ---------- 11. SOAP builders + intake ---------- */
.chiprow { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid var(--line); background: var(--paper);
  color: var(--body); font: 600 12.5px var(--font); padding: 6px 13px;
  border-radius: 999px; cursor: pointer; transition: all .14s var(--ease); }
.chip:hover { border-color: var(--crimson); color: var(--crimson); }
.chip.on { background: var(--blush); border-color: var(--blush-2);
  color: var(--crimson-ink); font-weight: 700; }
.bld { border: 1px solid var(--line); border-radius: 12px; padding: 13px;
  margin-top: 10px; background: var(--porcelain); }
.bld .bld-h { margin-bottom: 9px; font-size: 14px; }
.bld .bld-lbl { font-weight: 700; font-size: 11.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin: 11px 0 6px; }
.bld .bld-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.bld .bld-row label { font-weight: 650; font-size: var(--t-cap); flex: none; }
.bld .bld-row input[type=range] { flex: 1; accent-color: var(--crimson); }
.bld .bld-row output { font-family: var(--display); font-size: 19px;
  font-weight: 700; min-width: 26px; text-align: center; }
.bld .bld-acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; gap: 3px; margin-bottom: 4px; }
.seg button { border: 0; background: transparent; font: 700 12.5px var(--font);
  color: var(--muted); padding: 5px 15px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--crimson); color: #fff; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 7px; }
.qsym { border: 1px solid var(--line); background: var(--paper); text-align: left;
  font: 550 12.5px var(--font); color: var(--body); padding: 7px 11px;
  border-radius: 9px; cursor: pointer; }
.qsym.pos { background: var(--blush); border-color: var(--blush-2);
  color: var(--crimson-ink); }
.qsym.neg { background: var(--ok-wash); border-color: var(--ok-line);
  color: var(--ok); }
.exrow { display: grid; grid-template-columns: 1fr 84px 92px; gap: 7px;
  align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.exrow:last-of-type { border-bottom: 0; }
.exlbl { font-size: 13px; }
.exbtn { border: 1px solid var(--line); background: var(--paper);
  font: 650 11.5px var(--font); padding: 5px 0; border-radius: 8px;
  cursor: pointer; color: var(--muted); }
.exbtn.n.on { background: var(--ok-wash); border-color: var(--ok-line); color: var(--ok); }
.exbtn.a.on { background: var(--blush); border-color: var(--blush-2); color: var(--crimson-ink); }

/* ---------- 12. Chat threads (patient <-> clinic) ---------- */
.cx { display: flex; flex-direction: column; gap: 4px; padding: 16px 4px;
  max-height: 56vh; overflow-y: auto; }
.cx-m { max-width: 78%; padding: 10px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.5; white-space: pre-wrap;
  overflow-wrap: break-word; }
.cx-m.mine { align-self: flex-end; background: var(--crimson); color: #fff;
  border-bottom-right-radius: 5px; }
.cx-m.theirs { align-self: flex-start; background: var(--paper);
  border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.cx-m .rec { display: block; font-weight: 750; font-size: 12px;
  letter-spacing: .03em; margin-bottom: 4px; opacity: .9; }
.cx-meta { font-size: 10.5px; color: var(--faint); margin: 0 6px 8px; }
.cx-meta.mine { align-self: flex-end; }
.cx-meta.theirs { align-self: flex-start; }
.cx-day { align-self: center; font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
  background: var(--porcelain); border: 1px solid var(--line-2);
  padding: 3px 12px; border-radius: 999px; margin: 10px 0 8px; }
.cx-in { display: flex; gap: 8px; align-items: flex-end; padding-top: 12px;
  border-top: 1px solid var(--line); }
.cx-in textarea { flex: 1; resize: none; min-height: 46px; max-height: 130px;
  margin: 0; }
.cx-in .btn { flex: none; }
.cx-attach { display: flex; gap: 8px; align-items: center; margin-top: 8px;
  flex-wrap: wrap; }
.cx-attach select { width: auto; max-width: 260px; padding: 8px 34px 8px 12px;
  font-size: 13px; }
.filecard { border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 15px; margin-bottom: 10px; background: var(--paper); }
.filecard .fc-top { display: flex; gap: 10px; align-items: center; }
.filecard .fc-top b { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.filecard .fc-sum { margin: 8px 0 0; padding: 8px 11px; border-radius: 9px;
  background: var(--porcelain); border: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--muted); }
.filecard .fc-sum b { color: var(--crimson-ink); font-size: 10.5px;
  letter-spacing: .07em; text-transform: uppercase; display: block;
  margin-bottom: 2px; }
.filecard .fc-act { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap;
  align-items: center; }
.filecard .fc-act select { width: auto; padding: 7px 32px 7px 11px;
  font-size: 12.5px; margin: 0; }

/* ---------- 12b. File cards, refined ---------- */
.filecard { display: grid; grid-template-columns: 44px minmax(0,1fr);
  gap: 4px 14px; padding: 15px 16px; }
.filecard .fc-ic { grid-row: 1 / span 4; width: 44px; height: 44px;
  border-radius: 12px; background: var(--blush); color: var(--crimson);
  display: grid; place-items: center; }
.filecard .fc-top { display: flex; align-items: baseline; gap: 10px; }
.filecard .fc-top b { font-size: 14.5px; }
.filecard .fc-top .meta { margin-left: auto; white-space: nowrap; }
.filecard .fc-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.filecard .fc-sum { position: relative; margin: 8px 0 0; padding: 9px 12px 9px 14px;
  border: 0; border-left: 3px solid var(--blush-2); border-radius: 0 10px 10px 0;
  background: var(--porcelain); font-size: 12.5px; line-height: 1.55;
  color: var(--muted); }
.filecard .fc-sum b { display: inline-block; margin: 0 6px 0 0; padding: 1px 8px;
  border-radius: 999px; background: var(--blush); color: var(--crimson-ink);
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.filecard .fc-act { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
  align-items: center; }
.sendgrp { display: flex; align-items: stretch; }
.sendgrp select { width: auto; max-width: 230px; margin: 0; padding: 7px 30px 7px 12px;
  font-size: 12.5px; border-radius: 9px 0 0 9px; border-right: 0; height: 34px; }
.sendgrp .btn.tiny { border-radius: 0 9px 9px 0; min-height: 34px; }
.fc-del { margin-left: auto; border: 0; background: none; color: var(--faint);
  cursor: pointer; padding: 6px; border-radius: 8px; display: grid;
  place-items: center; }
.fc-del:hover { color: var(--crimson-deep); background: var(--blush); }
@media (max-width: 560px) {
  .filecard { grid-template-columns: 1fr; }
  .filecard .fc-ic { display: none; }
  .sendgrp select { max-width: 160px; }
}

/* ---------- 13. Landing: photos, doctors, FAQ, CTA, footer ---------- */
.photoband { padding: 10px 0 34px; }
.photoband .container { display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.ph { margin: 0; border-radius: 18px; overflow: hidden; position: relative;
  border: 1px solid var(--line); box-shadow: var(--shadow-1); min-height: 230px;
  background: var(--blush); }
.ph img { width: 100%; height: 100%; min-height: 230px; object-fit: cover;
  display: block; }
.ph.tall img { min-height: 270px; }
.ph figcaption { position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 16px 13px; color: #fff; font-size: 13px; font-weight: 600;
  background: linear-gradient(transparent, rgba(32,10,20,.78)); }
.docstrip { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.doccard { background: var(--paper); border: 1px solid var(--line);
  border-radius: 15px; padding: 18px; text-align: center;
  box-shadow: var(--shadow-1); }
.doccard .avr2 { display: grid; place-items: center; width: 54px; height: 54px;
  border-radius: 50%; margin: 0 auto 10px; background: var(--blush);
  color: var(--crimson-ink); font: 750 21px var(--display);
  text-transform: uppercase; }
.doccard b { display: block; font-family: var(--display); font-size: 15px; }
.doccard .meta { display: block; margin: 2px 0 8px; }
.faqwrap { max-width: 720px; margin: 0 auto; }
.faqwrap details { background: var(--paper); border: 1px solid var(--line);
  border-radius: 13px; padding: 0 18px; margin-bottom: 10px; }
.faqwrap summary { cursor: pointer; font-weight: 700; font-size: 15px;
  padding: 15px 0; list-style: none; position: relative; }
.faqwrap summary::-webkit-details-marker { display: none; }
.faqwrap summary::after { content: "+"; position: absolute; right: 2px;
  top: 12px; font-family: var(--display); font-size: 19px;
  color: var(--crimson); transition: transform .18s var(--ease); }
.faqwrap details[open] summary::after { transform: rotate(45deg); }
.faqwrap details p { margin: 0 0 15px; color: var(--muted); font-size: 14px;
  line-height: 1.65; }
.ctaband { background: linear-gradient(135deg, var(--crimson), var(--crimson-ink));
  color: #fff; text-align: center; padding: 56px 0 60px; }
.ctaband h2 { font-family: var(--display); font-size: clamp(26px, 4vw, 38px);
  margin: 0 0 8px; }
.ctaband p { margin: 0 auto 22px; max-width: 46ch; opacity: .92; }
.ctaband .btn { background: #fff; color: var(--crimson-ink);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.ctaband .btn:hover { background: var(--blush); color: var(--crimson-ink); }
.pubfoot2 { background: var(--ink); color: rgba(255,240,244,.75);
  padding: 44px 0 26px; font-size: 13.5px; }
.pubfoot2 .pf-cols { display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 26px; padding-bottom: 26px;
  border-bottom: 1px solid rgba(255,255,255,.09); }
.pubfoot2 .pf-cols b { display: block; color: #fff; margin-bottom: 9px;
  font-family: var(--display); font-size: 14.5px; }
.pubfoot2 .pf-cols b em { color: var(--crimson-hov); font-style: normal; }
.pubfoot2 .pf-cols a { display: block; color: rgba(255,240,244,.72);
  padding: 3.5px 0; }
.pubfoot2 .pf-cols a:hover { color: #fff; text-decoration: none; }
.pubfoot2 .pf-cols .meta { color: rgba(255,240,244,.5); font-size: 12.5px;
  line-height: 1.6; }
.pubfoot2 .pf-base { display: flex; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; padding-top: 18px; font-size: 12.5px;
  color: rgba(255,240,244,.55); }
@media (max-width: 900px) {
  .photoband .container { grid-template-columns: 1fr; }
  .ph img, .ph.tall img { min-height: 200px; }
  .pubfoot2 .pf-cols { grid-template-columns: 1fr 1fr; }
}
