:root{
  --premium-bg:#f4f7fb;--premium-surface:rgba(255,255,255,.78);--premium-surface-strong:#fff;
  --premium-text:#10213a;--premium-muted:#66758a;--premium-line:rgba(119,141,166,.20);
  --premium-blue:#2563eb;--premium-cyan:#06b6d4;--premium-violet:#0f9f8f;--premium-green:#10b981;
  --premium-shadow:0 18px 60px rgba(34,74,128,.12);--premium-shadow-sm:0 8px 28px rgba(34,74,128,.08);
  --premium-radius:24px;--premium-radius-sm:16px
}
html{scroll-behavior:smooth}
body{
  min-height:100vh;background:
  radial-gradient(circle at 12% 12%,rgba(37,99,235,.14),transparent 30%),
  radial-gradient(circle at 88% 18%,rgba(6,182,212,.13),transparent 27%),
  radial-gradient(circle at 74% 80%,rgba(124,58,237,.09),transparent 30%),
  linear-gradient(180deg,#f8fbff 0%,#f4f7fb 48%,#eef4fb 100%);
  color:var(--premium-text);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  background-attachment:fixed
}
body:before,body:after{content:"";position:fixed;z-index:-1;border-radius:999px;filter:blur(80px);opacity:.65;pointer-events:none}
body:before{width:360px;height:360px;left:-120px;top:120px;background:rgba(37,99,235,.16)}
body:after{width:420px;height:420px;right:-160px;bottom:30px;background:rgba(6,182,212,.14)}
header{
  height:76px!important;padding:0 clamp(16px,4vw,56px)!important;background:rgba(255,255,255,.72)!important;
  border-bottom:1px solid rgba(255,255,255,.72)!important;backdrop-filter:blur(22px) saturate(145%);
  -webkit-backdrop-filter:blur(22px) saturate(145%);box-shadow:0 1px 0 rgba(120,142,170,.10);z-index:100!important
}
.brand{gap:12px!important}.logo,.brand>b{
  width:44px!important;height:44px!important;border-radius:14px!important;
  background:linear-gradient(145deg,#2563eb,#0ea5e9 58%,#06b6d4)!important;
  box-shadow:0 10px 24px rgba(37,99,235,.28),inset 0 1px 0 rgba(255,255,255,.35)!important
}
.brand strong{font-size:16px;letter-spacing:.2px}.brand small{color:#718096!important}
.badge{background:rgba(255,255,255,.76)!important;border:1px solid rgba(37,99,235,.12);box-shadow:var(--premium-shadow-sm);color:#2458ba!important}
main{max-width:1180px!important;padding:54px 22px 80px!important}
#roleIntro{position:relative;max-width:820px;margin:12px auto 0;padding:18px 16px 2px}
#roleIntro:before{content:"";position:absolute;inset:-36px 10% auto;height:190px;background:radial-gradient(ellipse,rgba(37,99,235,.15),transparent 68%);z-index:-1}
.eyebrow{
  display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;
  background:rgba(255,255,255,.68);border:1px solid rgba(37,99,235,.14);box-shadow:var(--premium-shadow-sm);
  color:#2563eb!important;letter-spacing:1.6px!important
}
.eyebrow:before{content:"";width:8px;height:8px;border-radius:50%;background:#10b981;box-shadow:0 0 0 5px rgba(16,185,129,.12)}
.center h1,#roleIntro h1{font-size:clamp(38px,6vw,68px)!important;line-height:1.02;letter-spacing:-2.4px;margin:18px 0 14px!important;background:linear-gradient(120deg,#0f2747 12%,#2459bd 55%,#0d8fb3);-webkit-background-clip:text;background-clip:text;color:transparent}
.muted{color:var(--premium-muted)!important}
#roleIntro .muted{font-size:17px;max-width:650px;margin:0 auto;line-height:1.7}
.roles{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:18px!important;max-width:1080px!important;margin:42px auto 18px!important
}
.role,.tile,.panel,.doctorflow,.clinicalbox,.v83-card,.v83-panel,.v83-hero{
  position:relative;overflow:hidden;background:var(--premium-surface)!important;border:1px solid rgba(255,255,255,.82)!important;
  box-shadow:var(--premium-shadow-sm)!important;backdrop-filter:blur(18px) saturate(135%);-webkit-backdrop-filter:blur(18px) saturate(135%)
}
.role{min-height:265px;border-radius:28px!important;padding:28px!important;transition:transform .25s ease,box-shadow .25s ease,border-color .25s ease!important}
.role:before,.tile:before,.v83-card:before{content:"";position:absolute;width:180px;height:180px;border-radius:50%;right:-72px;top:-82px;opacity:.18;filter:blur(2px);pointer-events:none}
.role:nth-child(1):before{background:linear-gradient(135deg,#2563eb,#06b6d4)}
.role:nth-child(2):before{background:linear-gradient(135deg,#0f9f8f,#2563eb)}
.role:nth-child(3):before{background:linear-gradient(135deg,#10b981,#06b6d4)}
.role:hover,.tile:hover,.v83-card:hover{transform:translateY(-6px)!important;box-shadow:0 24px 70px rgba(34,74,128,.16)!important;border-color:rgba(37,99,235,.22)!important}
.role .icon{width:60px;height:60px;display:grid;place-items:center;border-radius:18px;background:rgba(255,255,255,.76);box-shadow:inset 0 0 0 1px rgba(37,99,235,.08);font-size:30px!important}
.role h2{font-size:22px;margin:20px 0 8px!important;letter-spacing:-.4px}.role p{line-height:1.58!important;color:var(--premium-muted)!important}
.enter,.primary{
  background:linear-gradient(135deg,#2563eb,#1677e8 58%,#06a8c7)!important;border:1px solid rgba(255,255,255,.25)!important;
  border-radius:14px!important;box-shadow:0 10px 22px rgba(37,99,235,.22);transition:transform .18s ease,box-shadow .18s ease!important
}
.enter:hover,.primary:hover{transform:translateY(-1px);box-shadow:0 14px 28px rgba(37,99,235,.28)}
.secondary,.back,.logout{
  background:rgba(255,255,255,.78)!important;border:1px solid rgba(113,136,165,.20)!important;border-radius:13px!important;
  color:#2458ba!important;box-shadow:0 5px 18px rgba(32,68,112,.06)
}
.panel{border-radius:28px!important;padding:30px!important;box-shadow:var(--premium-shadow)!important}
.authpage{min-height:calc(100vh - 160px)!important}.auth-role-icon{width:72px;height:72px;display:grid;place-items:center;margin:10px auto 14px!important;border-radius:22px;background:linear-gradient(145deg,rgba(37,99,235,.12),rgba(6,182,212,.13));box-shadow:inset 0 0 0 1px rgba(37,99,235,.08)}
.auth-back{background:rgba(255,255,255,.75)!important;box-shadow:var(--premium-shadow-sm)}
.oauth button,.field input,.field textarea,.field select{
  border:1px solid rgba(114,136,163,.22)!important;background:rgba(255,255,255,.86)!important;border-radius:14px!important;
  transition:border-color .18s ease,box-shadow .18s ease
}
.oauth button:hover,.field input:focus,.field textarea:focus,.field select:focus{border-color:rgba(37,99,235,.42)!important;box-shadow:0 0 0 4px rgba(37,99,235,.08);outline:none}
.dashHead{padding:8px 2px 4px}.dashHead h1{font-size:clamp(30px,4vw,46px);letter-spacing:-1.4px;margin:0 0 8px}
.grid,.v83-grid{gap:16px!important}.tile,.v83-card{border-radius:22px!important;padding:22px!important;min-height:155px;transition:transform .22s ease,box-shadow .22s ease!important}
.tile:nth-child(4n+1):before,.v83-card:nth-child(4n+1):before{background:#2563eb}.tile:nth-child(4n+2):before,.v83-card:nth-child(4n+2):before{background:#06b6d4}.tile:nth-child(4n+3):before,.v83-card:nth-child(4n+3):before{background:#0f9f8f}.tile:nth-child(4n+4):before,.v83-card:nth-child(4n+4):before{background:#10b981}
.tile .ti,.v83-icon{width:48px;height:48px;display:grid!important;place-items:center;border-radius:15px;background:rgba(255,255,255,.78);font-size:25px!important}
.tile b,.v83-card strong{font-size:16px;margin-top:14px!important}.tile span,.v83-card small{color:var(--premium-muted)!important;line-height:1.5}
.doctorflow,.clinicalbox,.v83-panel{border-radius:24px!important}.steps{gap:9px!important}.step{border:1px solid rgba(113,136,165,.19)!important;background:rgba(255,255,255,.78)!important}.step.on{background:linear-gradient(135deg,#2563eb,#0ea5e9)!important;color:#fff!important;box-shadow:0 8px 20px rgba(37,99,235,.20)}
.notice,.aianswer,.v83-answer{border-radius:16px!important;border:1px solid rgba(37,99,235,.10)!important;background:linear-gradient(145deg,rgba(239,247,255,.88),rgba(255,255,255,.78))!important}
.chip,.medai-icd-term{background:rgba(239,246,255,.84)!important;border:1px solid rgba(37,99,235,.11)!important}
@media (prefers-color-scheme:dark){
  :root{--premium-bg:#07111f;--premium-surface:rgba(13,26,43,.78);--premium-surface-strong:#0d1a2b;--premium-text:#e8f1fb;--premium-muted:#9fb0c6;--premium-line:rgba(160,183,213,.14);--premium-shadow:0 18px 60px rgba(0,0,0,.34);--premium-shadow-sm:0 8px 28px rgba(0,0,0,.24)}
  body{background:radial-gradient(circle at 10% 10%,rgba(37,99,235,.20),transparent 32%),radial-gradient(circle at 88% 16%,rgba(6,182,212,.14),transparent 28%),linear-gradient(180deg,#081321,#07111f 58%,#0a1422 100%);color:var(--premium-text)}
  header{background:rgba(7,17,31,.72)!important;border-bottom-color:rgba(160,183,213,.10)!important}.brand small,.muted,.role p,.tile span,.v83-card small{color:var(--premium-muted)!important}
  .center h1,#roleIntro h1{background:linear-gradient(120deg,#f5fbff,#9bc7ff 48%,#6be3f6);-webkit-background-clip:text;background-clip:text;color:transparent}
  .role,.tile,.panel,.doctorflow,.clinicalbox,.v83-card,.v83-panel,.v83-hero{border-color:rgba(160,183,213,.13)!important}
  .oauth button,.field input,.field textarea,.field select,.secondary,.back,.logout,.step{background:rgba(12,25,42,.84)!important;color:#dcecff!important;border-color:rgba(160,183,213,.15)!important}
  .badge{background:rgba(12,25,42,.84)!important;color:#acd1ff!important;border-color:rgba(160,183,213,.13)!important}
}
@media(max-width:820px){main{padding:36px 14px 70px!important}.roles{grid-template-columns:1fr!important;max-width:620px!important}.role{min-height:auto}.center h1,#roleIntro h1{letter-spacing:-1.4px}.grid{grid-template-columns:1fr!important}}
@media(max-width:520px){header{height:68px!important}.logo,.brand>b{width:40px!important;height:40px!important}.panel{padding:22px 16px!important}.role{padding:22px!important}.tile,.v83-card{padding:18px!important}.authpage{min-height:calc(100vh - 130px)!important}}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* ===== MEDAI premium bento dashboard ===== */
.medai-dashboard-hero{padding:30px!important;align-items:flex-end!important;background:linear-gradient(135deg,rgba(255,255,255,.84),rgba(242,248,255,.78))!important}
.medai-dashboard-hero b{display:block;font-size:clamp(26px,3.7vw,42px);letter-spacing:-1.2px;line-height:1.08;margin:9px 0 8px}
.hero-chip,.bento-kicker,.dashboard-section-head span{display:inline-flex;align-items:center;gap:7px;font-size:10px;font-weight:900;letter-spacing:1.45px;text-transform:uppercase;color:#2b61bf}
.hero-chip{padding:7px 10px;border-radius:999px;background:rgba(37,99,235,.08);border:1px solid rgba(37,99,235,.10)}
.medai-bento{display:grid;grid-template-columns:1.25fr 1fr 1fr;grid-auto-rows:minmax(210px,auto);gap:16px;margin:18px 0 34px}
.bento-card{position:relative;overflow:hidden;border:1px solid rgba(255,255,255,.82);border-radius:26px;padding:24px;text-align:left;cursor:pointer;color:var(--premium-text);background:rgba(255,255,255,.78);box-shadow:var(--premium-shadow-sm);backdrop-filter:blur(18px) saturate(135%);-webkit-backdrop-filter:blur(18px) saturate(135%);transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease;min-width:0}
.bento-card:before{content:"";position:absolute;width:230px;height:230px;border-radius:50%;right:-90px;top:-105px;filter:blur(2px);opacity:.24;pointer-events:none}
.bento-card:after{content:"";position:absolute;inset:0;background:linear-gradient(130deg,rgba(255,255,255,.18),transparent 42%);pointer-events:none}
.bento-card:hover{transform:translateY(-5px);box-shadow:0 26px 72px rgba(34,74,128,.17);border-color:rgba(37,99,235,.18)}
.bento-card>*{position:relative;z-index:1}.bento-card strong{display:block;font-size:22px;letter-spacing:-.45px;line-height:1.16;margin:18px 0 8px}.bento-card>small{display:block;color:var(--premium-muted);font-size:13px;line-height:1.58;max-width:92%}.bento-icon{width:52px;height:52px;border-radius:17px;display:grid;place-items:center;background:rgba(255,255,255,.76);box-shadow:inset 0 0 0 1px rgba(37,99,235,.07);font-size:26px;margin-top:14px}.bento-link{display:inline-flex;margin-top:20px;font-weight:800;font-size:12px;color:#245fc1}
.bento-hero{grid-row:span 2;min-height:436px;padding:30px;background:linear-gradient(155deg,rgba(239,247,255,.94),rgba(255,255,255,.78))}.bento-hero strong{font-size:30px;max-width:330px}.bento-hero small{font-size:14px;max-width:330px}.bento-hero .bento-icon{width:68px;height:68px;font-size:32px;border-radius:21px}
.bento-hero:before{background:linear-gradient(145deg,#2563eb,#06b6d4)}.bento-thera:before{background:linear-gradient(145deg,#0f9f8f,#1769e0)}.bento-language:before{background:linear-gradient(145deg,#0ea5e9,#10b981)}.bento-ai:before{background:linear-gradient(145deg,#2563eb,#14b8a6)}.bento-progress:before{background:linear-gradient(145deg,#06b6d4,#2563eb)}.bento-stats:before{background:linear-gradient(145deg,#10b981,#14b8a6)}
.bento-stats{background:linear-gradient(155deg,rgba(239,253,248,.92),rgba(255,255,255,.78))}
.bento-statrow{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:16px 0 7px}.bento-statrow span{display:block;padding:13px;border-radius:16px;background:rgba(255,255,255,.72);box-shadow:inset 0 0 0 1px rgba(16,185,129,.08)}.bento-statrow b{display:block;font-size:24px;line-height:1;margin:0}.bento-statrow small{display:block;margin-top:6px;color:var(--premium-muted);font-size:11px}
.dashboard-section-head{display:flex;justify-content:space-between;align-items:end;gap:18px;margin:12px 2px 16px}.dashboard-section-head h2{margin:5px 0 0;font-size:24px;letter-spacing:-.5px}.dashboard-section-head>small{color:var(--premium-muted)}
@media(max-width:980px){.medai-bento{grid-template-columns:1fr 1fr}.bento-hero{grid-row:span 1;grid-column:span 2;min-height:270px}.bento-hero strong{max-width:none}.bento-hero small{max-width:620px}}
@media(max-width:640px){.medai-dashboard-hero{padding:22px!important;align-items:flex-start!important}.medai-dashboard-hero .primary{width:100%}.medai-bento{grid-template-columns:1fr;grid-auto-rows:auto}.bento-card,.bento-hero{grid-column:auto;min-height:190px;padding:22px}.bento-hero{min-height:240px}.bento-hero strong{font-size:26px}.dashboard-section-head{align-items:flex-start;flex-direction:column;gap:4px}}
@media(prefers-color-scheme:dark){.medai-dashboard-hero{background:linear-gradient(135deg,rgba(13,26,43,.88),rgba(10,29,50,.80))!important}.bento-card{background:rgba(13,26,43,.78);border-color:rgba(160,183,213,.12);color:var(--premium-text)}.bento-hero{background:linear-gradient(155deg,rgba(18,42,72,.90),rgba(13,26,43,.78))}.bento-stats{background:linear-gradient(155deg,rgba(10,52,46,.72),rgba(13,26,43,.80))}.bento-icon,.bento-statrow span{background:rgba(255,255,255,.07)}.bento-link{color:#8fc0ff}.hero-chip,.bento-kicker,.dashboard-section-head span{color:#8fc0ff}.hero-chip{background:rgba(59,130,246,.12);border-color:rgba(147,197,253,.10)}}

/* ===== MEDAI public premium landing ===== */
.public-landing{display:block!important;text-align:left!important}
.public-hero{min-height:520px;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr);gap:42px;align-items:center;padding:34px 0 26px}
.public-hero-copy{max-width:720px}.public-hero-copy h1{font-size:clamp(42px,6vw,76px)!important;line-height:.98;letter-spacing:-3.2px;margin:18px 0 18px!important;background:linear-gradient(120deg,#0f2747 8%,#2459bd 52%,#0d8fb3);-webkit-background-clip:text;background-clip:text;color:transparent}
.public-hero-copy .muted{font-size:18px!important;line-height:1.7;max-width:680px}
.public-hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:25px}.public-hero-actions button{min-height:50px;padding:0 20px}
.public-trust-row{display:flex;gap:11px;flex-wrap:wrap;margin-top:23px}.public-trust-row span{font-size:12px;font-weight:800;color:#365f97;background:rgba(255,255,255,.68);border:1px solid rgba(37,99,235,.10);padding:8px 11px;border-radius:999px;box-shadow:0 5px 18px rgba(34,74,128,.06)}
.public-visual{position:relative;height:430px;border-radius:36px;background:radial-gradient(circle at 50% 45%,rgba(37,99,235,.14),transparent 34%),linear-gradient(145deg,rgba(255,255,255,.74),rgba(241,248,255,.54));border:1px solid rgba(255,255,255,.86);box-shadow:0 26px 80px rgba(34,74,128,.14);overflow:hidden;backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px)}
.med-core{position:absolute;left:50%;top:48%;transform:translate(-50%,-50%);width:170px;height:170px;border-radius:42px;background:linear-gradient(145deg,#2563eb,#0ea5e9 58%,#06b6d4);box-shadow:0 24px 60px rgba(37,99,235,.34),inset 0 1px 0 rgba(255,255,255,.35);display:flex;flex-direction:column;justify-content:center;align-items:center;color:#fff;z-index:3}.med-core-icon{font-size:38px;line-height:1}.med-core b{font-size:26px;letter-spacing:.5px;margin-top:6px}.med-core small{opacity:.78;font-size:11px;margin-top:3px}
.med-orbit{position:absolute;left:50%;top:48%;transform:translate(-50%,-50%);border:1px solid rgba(37,99,235,.14);border-radius:50%}.orbit-a{width:300px;height:300px}.orbit-b{width:390px;height:390px;border-color:rgba(6,182,212,.12)}
.float-chip{position:absolute;z-index:4;padding:10px 13px;border-radius:14px;background:rgba(255,255,255,.78);border:1px solid rgba(255,255,255,.88);box-shadow:0 12px 28px rgba(34,74,128,.11);font-size:12px;font-weight:800;color:#274b77;backdrop-filter:blur(16px)}.chip-a{left:28px;top:64px}.chip-b{right:22px;top:85px}.chip-c{left:34px;bottom:74px}.chip-d{right:30px;bottom:58px}
.ecg-line{position:absolute;left:0;right:0;bottom:118px;width:100%;height:90px;color:rgba(37,99,235,.19);z-index:1}
.public-feature-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:18px 0 56px}.public-feature-grid article{padding:20px;border-radius:20px;background:rgba(255,255,255,.72);border:1px solid rgba(255,255,255,.85);box-shadow:var(--premium-shadow-sm);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}.public-feature-grid article>span{display:grid;place-items:center;width:43px;height:43px;border-radius:14px;background:rgba(37,99,235,.08);font-size:22px}.public-feature-grid article b{display:block;margin:14px 0 6px;font-size:15px}.public-feature-grid article small{color:var(--premium-muted);line-height:1.55}
.role-heading{text-align:center;max-width:720px;margin:8px auto 4px}.role-heading span{font-size:10px;font-weight:900;letter-spacing:1.5px;color:#2b61bf}.role-heading h2{font-size:clamp(28px,4vw,42px);letter-spacing:-1.2px;margin:8px 0 0}
.public-roles{margin-top:24px!important;margin-bottom:12px!important}.public-roles .role{min-height:290px!important}.public-roles .enter{width:100%;margin-top:8px}
@media(max-width:980px){.public-hero{grid-template-columns:1fr;min-height:auto}.public-visual{height:390px;max-width:720px;width:100%;margin:0 auto}.public-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.public-hero{padding-top:12px;gap:28px}.public-hero-copy h1{font-size:clamp(39px,13vw,58px)!important;letter-spacing:-2.2px}.public-hero-copy .muted{font-size:16px!important}.public-hero-actions{display:grid;grid-template-columns:1fr}.public-hero-actions button{width:100%}.public-visual{height:320px;border-radius:28px}.med-core{width:132px;height:132px;border-radius:34px}.med-core b{font-size:21px}.med-core-icon{font-size:30px}.orbit-a{width:235px;height:235px}.orbit-b{width:300px;height:300px}.float-chip{font-size:10px;padding:8px 10px}.chip-a{left:12px;top:42px}.chip-b{right:10px;top:58px}.chip-c{left:12px;bottom:50px}.chip-d{right:12px;bottom:38px}.public-feature-grid{grid-template-columns:1fr;gap:10px;margin-bottom:42px}.public-feature-grid article{padding:17px}.public-trust-row{gap:7px}.public-trust-row span{font-size:11px}.public-roles .role{min-height:auto!important}}
@media(prefers-color-scheme:dark){.public-hero-copy h1{background:linear-gradient(120deg,#f5fbff,#9bc7ff 48%,#6be3f6);-webkit-background-clip:text;background-clip:text;color:transparent}.public-visual{background:radial-gradient(circle at 50% 45%,rgba(37,99,235,.18),transparent 34%),linear-gradient(145deg,rgba(13,26,43,.80),rgba(8,28,48,.64));border-color:rgba(160,183,213,.12)}.float-chip,.public-feature-grid article,.public-trust-row span{background:rgba(13,26,43,.74);border-color:rgba(160,183,213,.12);color:#dcecff}.public-feature-grid article>span{background:rgba(59,130,246,.12)}.role-heading span{color:#8fc0ff}}
@media(prefers-reduced-motion:no-preference){.float-chip{animation:medFloat 5.5s ease-in-out infinite}.chip-b{animation-delay:-1.2s}.chip-c{animation-delay:-2.6s}.chip-d{animation-delay:-3.8s}.med-core{animation:medPulse 4.8s ease-in-out infinite}.orbit-a{animation:medSpin 24s linear infinite}.orbit-b{animation:medSpin 34s linear infinite reverse}@keyframes medFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}@keyframes medPulse{0%,100%{transform:translate(-50%,-50%) scale(1)}50%{transform:translate(-50%,-50%) scale(1.025)}}@keyframes medSpin{to{transform:translate(-50%,-50%) rotate(360deg)}}}

/* ===== Contrast hotfix: clinical/student dashboards keep light surfaces readable in device dark mode ===== */
body.medai-clinical-layout #dash,
body.medai-clinical-layout #dashboard,
body.medai-clinical-layout .v83-wrap{color:#102f43!important}
body.medai-clinical-layout .v83-card,
body.medai-clinical-layout .v83-panel,
body.medai-clinical-layout .v83-hero,
body.medai-clinical-layout .v95-stat,
body.medai-clinical-layout .v95-topic,
body.medai-clinical-layout .v95-question,
body.medai-clinical-layout .v96-card,
body.medai-clinical-layout .v96-flash,
body.medai-clinical-layout .v96-question,
body.medai-clinical-layout .v96-plan-day,
body.medai-clinical-layout .v96-empty,
body.medai-clinical-layout .notice,
body.medai-clinical-layout .aianswer,
body.medai-clinical-layout .v83-answer{
  color:#102f43!important;
}
body.medai-clinical-layout .v83-card strong,
body.medai-clinical-layout .v83-panel h1,
body.medai-clinical-layout .v83-panel h2,
body.medai-clinical-layout .v83-panel h3,
body.medai-clinical-layout .v95-stat b,
body.medai-clinical-layout .v95-topic b,
body.medai-clinical-layout .v96-card b,
body.medai-clinical-layout .v96-card h3,
body.medai-clinical-layout .v96-flash b,
body.medai-clinical-layout .medai-essential-grid b{
  color:#17384b!important;
}
body.medai-clinical-layout .muted,
body.medai-clinical-layout .v83-card small,
body.medai-clinical-layout .v95-stat small,
body.medai-clinical-layout .v96-card small,
body.medai-clinical-layout .v96-muted,
body.medai-clinical-layout .medai-essential-grid small{
  color:#64748b!important;
}
body.medai-clinical-layout input,
body.medai-clinical-layout textarea,
body.medai-clinical-layout select,
body.medai-clinical-layout .v95-nav button,
body.medai-clinical-layout .v95-options button,
body.medai-clinical-layout .v96-ratings button,
body.medai-clinical-layout .v96-option{
  color:#102f43!important;
  background:#fff!important;
}
body.medai-clinical-layout .v83-card,
body.medai-clinical-layout .v83-panel,
body.medai-clinical-layout .v83-hero{
  background:#fff!important;
}
@media(prefers-color-scheme:dark){
  body.medai-clinical-layout #dash,
  body.medai-clinical-layout #dashboard{
    background:linear-gradient(135deg,#f5f9fc,#eef7f6)!important;
    color:#102f43!important;
  }
  body.medai-clinical-layout .v83-wrap,
  body.medai-clinical-layout .medai-clinical-hero,
  body.medai-clinical-layout .medai-essential,
  body.medai-clinical-layout .v95-summary,
  body.medai-clinical-layout .v95-weak,
  body.medai-clinical-layout .v96-grid{
    color:#102f43!important;
  }
}

/* ===== Mobile horizontal content rails: iMed-style swipe ===== */
@media(max-width:760px){
  body.medai-clinical-layout .v96-grid,
  body.medai-clinical-layout .v95-summary,
  body.medai-clinical-layout .v95-weak,
  body.medai-clinical-layout .medai-essential-grid,
  body.medai-clinical-layout .v83-grid,
  #bmedCourseGrid,
  .public-feature-grid,
  .public-roles{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:12px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x mandatory!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-inline:contain!important;
    scrollbar-width:none!important;
    padding:4px 16px 14px!important;
    margin-left:-16px!important;
    margin-right:-16px!important;
  }
  body.medai-clinical-layout .v96-grid::-webkit-scrollbar,
  body.medai-clinical-layout .v95-summary::-webkit-scrollbar,
  body.medai-clinical-layout .v95-weak::-webkit-scrollbar,
  body.medai-clinical-layout .medai-essential-grid::-webkit-scrollbar,
  body.medai-clinical-layout .v83-grid::-webkit-scrollbar,
  #bmedCourseGrid::-webkit-scrollbar,
  .public-feature-grid::-webkit-scrollbar,
  .public-roles::-webkit-scrollbar{display:none!important}

  body.medai-clinical-layout .v96-grid>.v96-card,
  body.medai-clinical-layout .v95-summary>.v95-stat,
  body.medai-clinical-layout .v95-weak>.v95-topic,
  body.medai-clinical-layout .medai-essential-grid>button,
  body.medai-clinical-layout .v83-grid>.v83-card,
  #bmedCourseGrid>.v83-card,
  .public-feature-grid>article,
  .public-roles>.role{
    flex:0 0 82%!important;
    min-width:82%!important;
    max-width:82%!important;
    scroll-snap-align:start!important;
    scroll-snap-stop:always!important;
  }

  body.medai-clinical-layout .v95-summary>.v95-stat{
    flex-basis:58%!important;min-width:58%!important;max-width:58%!important;
  }
  body.medai-clinical-layout .medai-essential-grid>button{
    flex-basis:78%!important;min-width:78%!important;max-width:78%!important;
  }
  .public-feature-grid>article{
    flex-basis:76%!important;min-width:76%!important;max-width:76%!important;
  }
  .public-roles>.role{
    flex-basis:86%!important;min-width:86%!important;max-width:86%!important;
  }

  body.medai-clinical-layout .v96-grid>.v96-card,
  body.medai-clinical-layout .v83-grid>.v83-card,
  #bmedCourseGrid>.v83-card{
    min-height:178px!important;
    height:auto!important;
  }

  body.medai-clinical-layout .v95-weak>.v95-topic{
    min-height:112px!important;
    align-content:center!important;
  }

  body.medai-clinical-layout .v95-nav{
    display:flex!important;
    flex-wrap:nowrap!important;
    overflow-x:auto!important;
    gap:8px!important;
    scroll-snap-type:x proximity!important;
    scrollbar-width:none!important;
    padding-bottom:8px!important;
  }
  body.medai-clinical-layout .v95-nav::-webkit-scrollbar{display:none!important}
  body.medai-clinical-layout .v95-nav>button{
    flex:0 0 auto!important;
    scroll-snap-align:start!important;
    white-space:nowrap!important;
  }

  body.medai-clinical-layout .v96-grid>.v96-card:active,
  body.medai-clinical-layout .v83-grid>.v83-card:active,
  body.medai-clinical-layout .medai-essential-grid>button:active,
  #bmedCourseGrid>.v83-card:active,
  .public-feature-grid>article:active,
  .public-roles>.role:active{
    transform:scale(.985)!important;
  }
}

/* ===== Medical palette normalization: no aubergine/purple surfaces ===== */
:root{
  --premium-violet:#0f9f8f!important;
}
.role:nth-child(2):before{background:linear-gradient(135deg,#0f9f8f,#1769e0)!important}
.tile:nth-child(4n+3):before,.v83-card:nth-child(4n+3):before{background:#0f9f8f!important}
.bento-thera:before{background:linear-gradient(145deg,#0f9f8f,#1769e0)!important}
.bento-ai:before{background:linear-gradient(145deg,#1769e0,#14b8a6)!important}

/* ===== Strong readability guard ===== */
body.medai-clinical-layout .v96-card,
body.medai-clinical-layout .v95-stat,
body.medai-clinical-layout .v95-topic,
body.medai-clinical-layout .medai-essential-grid>button,
body.medai-clinical-layout .v83-card,
body.medai-clinical-layout .v83-panel,
body.medai-clinical-layout .v96-question,
body.medai-clinical-layout .v96-flash{
  background:#fff!important;
  color:#102f43!important;
}
body.medai-clinical-layout .v96-card b,
body.medai-clinical-layout .v95-topic b,
body.medai-clinical-layout .v95-stat b,
body.medai-clinical-layout .medai-essential-grid b,
body.medai-clinical-layout .v83-card strong,
body.medai-clinical-layout .v96-question b{
  color:#17384b!important;
}
body.medai-clinical-layout .v96-card small,
body.medai-clinical-layout .v95-stat small,
body.medai-clinical-layout .medai-essential-grid small,
body.medai-clinical-layout .v83-card small{
  color:#64748b!important;
}

/* ===== MEDAI mobile topbar + explicit light/dark medical themes ===== */
@media(max-width:760px){
  body.medai-clinical-layout>header{display:none!important}
  body.medai-clinical-layout #dash,
  body.medai-clinical-layout #dashboard{padding-top:64px!important}

  .medai-clinical-menu{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:12px!important;
    position:fixed!important;
    inset:0 0 auto 0!important;
    z-index:10030!important;
    min-height:56px!important;
    padding:8px 12px!important;
    border:0!important;
    border-bottom:1px solid rgba(111,160,177,.18)!important;
    box-shadow:0 10px 30px rgba(15,47,66,.10)!important;
    backdrop-filter:blur(22px) saturate(150%)!important;
    -webkit-backdrop-filter:blur(22px) saturate(150%)!important;
  }
  .medai-menu-open{
    display:inline-flex!important;
    align-items:center!important;
    gap:9px!important;
    min-height:40px!important;
    padding:0 10px!important;
    border:0!important;
    border-radius:12px!important;
    background:transparent!important;
    color:inherit!important;
    font:inherit!important;
    font-weight:850!important;
  }
  .medai-menu-bars{font-size:21px;line-height:1;letter-spacing:-2px}
  .medai-theme-toggle{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:3px!important;
    padding:3px!important;
    border-radius:14px!important;
    border:1px solid rgba(99,145,164,.18)!important;
    background:rgba(255,255,255,.45)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.55)!important;
  }
  .medai-theme-toggle button{
    width:38px!important;
    height:34px!important;
    display:grid!important;
    place-items:center!important;
    border:0!important;
    border-radius:10px!important;
    background:transparent!important;
    font-size:16px!important;
    transition:.18s ease!important;
  }
  .medai-theme-toggle button.active{
    background:#fff!important;
    box-shadow:0 5px 14px rgba(22,63,77,.13)!important;
    transform:translateY(-1px)!important;
  }
}

/* explicit light theme */
html[data-medai-theme="light"] body.medai-clinical-layout{
  background:
    radial-gradient(circle at 18% 0%,rgba(31,111,235,.10),transparent 28%),
    radial-gradient(circle at 88% 6%,rgba(20,184,166,.10),transparent 26%),
    linear-gradient(180deg,#eef8fb 0%,#f6fbfd 44%,#eef7f6 100%)!important;
  color:#102f43!important;
}
html[data-medai-theme="light"] body.medai-clinical-layout #dash,
html[data-medai-theme="light"] body.medai-clinical-layout #dashboard{
  background:
    linear-gradient(rgba(15,159,143,.028) 1px,transparent 1px),
    linear-gradient(90deg,rgba(23,105,224,.025) 1px,transparent 1px),
    radial-gradient(circle at 12% 6%,rgba(23,105,224,.10),transparent 24%),
    radial-gradient(circle at 90% 12%,rgba(20,184,166,.08),transparent 25%),
    linear-gradient(180deg,#f4fbfd,#edf7f8)!important;
  background-size:32px 32px,32px 32px,auto,auto,auto!important;
}
html[data-medai-theme="light"] .medai-clinical-menu{
  background:rgba(244,251,253,.93)!important;
  color:#0c5960!important;
}
html[data-medai-theme="light"] body.medai-clinical-layout .medai-clinical-hero{
  background:
    radial-gradient(circle at 80% 12%,rgba(20,184,166,.16),transparent 26%),
    radial-gradient(circle at 62% 72%,rgba(23,105,224,.10),transparent 30%),
    linear-gradient(135deg,rgba(255,255,255,.98),rgba(238,249,249,.95))!important;
  border-color:rgba(50,150,151,.18)!important;
  box-shadow:0 24px 70px rgba(16,76,92,.11),inset 0 1px 0 rgba(255,255,255,.95)!important;
}
html[data-medai-theme="light"] body.medai-clinical-layout .v83-card,
html[data-medai-theme="light"] body.medai-clinical-layout .v83-panel,
html[data-medai-theme="light"] body.medai-clinical-layout .v96-card,
html[data-medai-theme="light"] body.medai-clinical-layout .v95-stat,
html[data-medai-theme="light"] body.medai-clinical-layout .v95-topic,
html[data-medai-theme="light"] body.medai-clinical-layout .medai-essential-grid>button{
  background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(247,252,253,.95))!important;
  border-color:rgba(82,147,161,.18)!important;
  box-shadow:0 12px 34px rgba(21,74,90,.07)!important;
}

/* explicit futuristic dark theme */
html[data-medai-theme="dark"] body.medai-clinical-layout{
  background:#061521!important;
  color:#eaf6fb!important;
}
html[data-medai-theme="dark"] body.medai-clinical-layout #dash,
html[data-medai-theme="dark"] body.medai-clinical-layout #dashboard{
  background:
    linear-gradient(rgba(56,189,248,.035) 1px,transparent 1px),
    linear-gradient(90deg,rgba(20,184,166,.03) 1px,transparent 1px),
    radial-gradient(circle at 14% 8%,rgba(14,165,233,.17),transparent 25%),
    radial-gradient(circle at 88% 12%,rgba(20,184,166,.12),transparent 27%),
    linear-gradient(160deg,#061521 0%,#081d2b 50%,#06131e 100%)!important;
  background-size:34px 34px,34px 34px,auto,auto,auto!important;
  color:#eaf6fb!important;
}
html[data-medai-theme="dark"] .medai-clinical-menu{
  background:rgba(5,20,32,.92)!important;
  color:#dff8f4!important;
  border-bottom-color:rgba(74,197,190,.16)!important;
  box-shadow:0 12px 34px rgba(0,0,0,.36)!important;
}
html[data-medai-theme="dark"] .medai-theme-toggle{
  background:rgba(255,255,255,.055)!important;
  border-color:rgba(109,213,205,.15)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04)!important;
}
html[data-medai-theme="dark"] .medai-theme-toggle button{color:#c9e9ee!important}
html[data-medai-theme="dark"] .medai-theme-toggle button.active{
  background:linear-gradient(145deg,#0d3443,#0a2835)!important;
  box-shadow:0 0 0 1px rgba(64,220,205,.20),0 0 20px rgba(20,184,166,.18)!important;
}
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-clinical-hero{
  background:
    radial-gradient(circle at 82% 16%,rgba(0,203,184,.18),transparent 25%),
    radial-gradient(circle at 66% 74%,rgba(0,147,255,.17),transparent 28%),
    linear-gradient(145deg,rgba(9,34,51,.96),rgba(6,25,39,.92))!important;
  border-color:rgba(83,209,196,.20)!important;
  box-shadow:0 25px 80px rgba(0,0,0,.35),inset 0 1px 0 rgba(255,255,255,.04)!important;
}
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-hero-copy>span{color:#62e2d4!important}
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-hero-copy h2{color:#f1fbff!important;text-shadow:0 0 24px rgba(62,209,196,.08)!important}
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-hero-copy p{color:#9eb8c6!important}
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-ekg-track{stroke:#20d7c4!important;opacity:.24!important}
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-ekg-pulse{stroke:#55e6d5!important;filter:drop-shadow(0 0 8px rgba(85,230,213,.75))!important}
html[data-medai-theme="dark"] body.medai-clinical-layout .v83-card,
html[data-medai-theme="dark"] body.medai-clinical-layout .v83-panel,
html[data-medai-theme="dark"] body.medai-clinical-layout .v96-card,
html[data-medai-theme="dark"] body.medai-clinical-layout .v95-stat,
html[data-medai-theme="dark"] body.medai-clinical-layout .v95-topic,
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-essential-grid>button,
html[data-medai-theme="dark"] body.medai-clinical-layout .v96-question,
html[data-medai-theme="dark"] body.medai-clinical-layout .v96-flash{
  background:linear-gradient(145deg,rgba(11,38,55,.96),rgba(7,28,42,.95))!important;
  color:#eaf6fb!important;
  border-color:rgba(102,190,199,.16)!important;
  box-shadow:0 14px 42px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.025)!important;
}
html[data-medai-theme="dark"] body.medai-clinical-layout .v83-card strong,
html[data-medai-theme="dark"] body.medai-clinical-layout .v83-panel h1,
html[data-medai-theme="dark"] body.medai-clinical-layout .v83-panel h2,
html[data-medai-theme="dark"] body.medai-clinical-layout .v83-panel h3,
html[data-medai-theme="dark"] body.medai-clinical-layout .v96-card b,
html[data-medai-theme="dark"] body.medai-clinical-layout .v95-stat b,
html[data-medai-theme="dark"] body.medai-clinical-layout .v95-topic b,
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-essential-grid b{
  color:#f4fbff!important;
}
html[data-medai-theme="dark"] body.medai-clinical-layout .v83-card small,
html[data-medai-theme="dark"] body.medai-clinical-layout .v96-card small,
html[data-medai-theme="dark"] body.medai-clinical-layout .v95-stat small,
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-essential-grid small,
html[data-medai-theme="dark"] body.medai-clinical-layout .muted,
html[data-medai-theme="dark"] body.medai-clinical-layout .v96-muted{
  color:#95afbd!important;
}
html[data-medai-theme="dark"] body.medai-clinical-layout input,
html[data-medai-theme="dark"] body.medai-clinical-layout textarea,
html[data-medai-theme="dark"] body.medai-clinical-layout select,
html[data-medai-theme="dark"] body.medai-clinical-layout .v95-nav button,
html[data-medai-theme="dark"] body.medai-clinical-layout .v95-options button,
html[data-medai-theme="dark"] body.medai-clinical-layout .v96-ratings button,
html[data-medai-theme="dark"] body.medai-clinical-layout .v96-option{
  background:#0b2637!important;
  color:#eaf6fb!important;
  border-color:rgba(104,184,193,.22)!important;
}
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-essential-heading span{color:#eaf6fb!important}
html[data-medai-theme="dark"] body.medai-clinical-layout .medai-essential-heading small{color:#7f9aaa!important}

/* ===== MEDAI futuristic student layer ===== */
.medai-smart-layer{display:grid;gap:14px;margin:0 0 24px}
.medai-greeting-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:4px 2px}
.medai-greeting-row>div>small{font-size:10px;font-weight:900;letter-spacing:.16em;color:#0f9f8f}
.medai-greeting-row h3{margin:5px 0 0;font-size:clamp(22px,4vw,34px);letter-spacing:-.04em;color:#102f43}
.medai-live-dot{display:inline-block;width:8px;height:8px;margin-right:7px;border-radius:50%;background:#13b8a6;box-shadow:0 0 0 5px rgba(19,184,166,.10),0 0 18px rgba(19,184,166,.35)}
.medai-ai-orb{width:52px;height:52px;border:1px solid rgba(37,143,166,.20);border-radius:18px;background:linear-gradient(145deg,#0f9f8f,#1769e0);color:#fff;font-weight:950;letter-spacing:.04em;box-shadow:0 13px 30px rgba(23,105,224,.20),inset 0 1px 0 rgba(255,255,255,.25)}
.medai-smart-search{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 10px 10px 15px;border:1px solid rgba(68,139,155,.16);border-radius:18px;background:rgba(255,255,255,.90);box-shadow:0 12px 34px rgba(20,72,87,.07);backdrop-filter:blur(16px)}
.medai-smart-search>span{font-size:24px;color:#0f8e86}.medai-smart-search input{min-width:0;border:0!important;outline:0!important;background:transparent!important;color:#102f43!important;font:inherit!important;box-shadow:none!important}
.medai-smart-search>button{min-height:40px;padding:0 15px;border:0;border-radius:12px;background:linear-gradient(135deg,#0f9f8f,#1769e0);color:#fff;font-weight:850}
.medai-quick-chips{display:flex;gap:9px;overflow-x:auto;padding:1px 1px 8px;scrollbar-width:none;scroll-snap-type:x proximity}.medai-quick-chips::-webkit-scrollbar{display:none}
.medai-quick-chips button{flex:0 0 auto;min-height:38px;padding:0 13px;border:1px solid rgba(73,139,156,.15);border-radius:999px;background:rgba(255,255,255,.78);color:#174152;font-weight:780;scroll-snap-align:start;box-shadow:0 5px 16px rgba(16,70,86,.045)}
.medai-real-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.medai-real-stats article{position:relative;overflow:hidden;padding:15px;border:1px solid rgba(68,139,155,.14);border-radius:17px;background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(243,251,251,.96));box-shadow:0 9px 28px rgba(19,74,88,.06)}
.medai-real-stats article:after{content:"";position:absolute;width:70px;height:70px;right:-28px;top:-30px;border-radius:50%;background:rgba(20,184,166,.10)}
.medai-real-stats b,.medai-real-stats small{position:relative;z-index:1;display:block}.medai-real-stats b{font-size:22px;color:#0f6971}.medai-real-stats small{margin-top:5px;color:#718491;font-size:10px;line-height:1.3}
.medai-continue-card{display:flex;align-items:center;justify-content:space-between;gap:18px;width:100%;padding:18px 20px;border:1px solid rgba(47,145,155,.18);border-radius:20px;background:linear-gradient(135deg,#0d3446,#0f5660 56%,#0f8e86);color:#fff;text-align:left;box-shadow:0 18px 42px rgba(13,70,86,.16)}
.medai-continue-card span>*{display:block}.medai-continue-card small{font-size:9px;font-weight:900;letter-spacing:.15em;color:#8fe9df}.medai-continue-card b{margin-top:5px;font-size:17px}.medai-continue-card em{margin-top:4px;color:#b9d7dd;font-size:11px;font-style:normal}.medai-continue-card i{font-size:28px;font-style:normal;color:#9ff2e8}
.medai-bottom-nav{display:none}
@media(max-width:760px){
  body.medai-clinical-layout #dash,body.medai-clinical-layout #dashboard{padding-bottom:86px!important}
  .medai-smart-layer{margin-top:-4px}
  .medai-real-stats{display:flex;overflow-x:auto;gap:10px;scroll-snap-type:x mandatory;scrollbar-width:none;padding-bottom:3px}.medai-real-stats::-webkit-scrollbar{display:none}
  .medai-real-stats article{flex:0 0 42%;min-width:42%;scroll-snap-align:start}
  .medai-smart-search{grid-template-columns:auto minmax(0,1fr)}.medai-smart-search>button{grid-column:1/-1;width:100%}
  .medai-bottom-nav{position:fixed;left:12px;right:12px;bottom:calc(10px + env(safe-area-inset-bottom));z-index:10025;display:grid;grid-template-columns:repeat(4,1fr);gap:4px;padding:7px;border:1px solid rgba(90,155,169,.16);border-radius:20px;background:rgba(245,251,252,.92);box-shadow:0 18px 44px rgba(8,45,59,.20);backdrop-filter:blur(22px) saturate(150%);-webkit-backdrop-filter:blur(22px) saturate(150%)}
  .medai-bottom-nav button{display:grid;place-items:center;gap:2px;min-height:50px;border:0;border-radius:14px;background:transparent;color:#55717d}.medai-bottom-nav button:active{background:rgba(15,159,143,.09)}
  .medai-bottom-nav span{font-size:20px;line-height:1}.medai-bottom-nav small{font-size:9px;font-weight:800}
}
html[data-medai-theme="dark"] .medai-greeting-row h3{color:#f2fbff}
html[data-medai-theme="dark"] .medai-greeting-row>div>small{color:#62e2d4}
html[data-medai-theme="dark"] .medai-smart-search{background:rgba(9,32,47,.93);border-color:rgba(95,204,196,.16);box-shadow:0 14px 38px rgba(0,0,0,.24)}
html[data-medai-theme="dark"] .medai-smart-search input{color:#edf9ff!important}
html[data-medai-theme="dark"] .medai-quick-chips button{background:rgba(10,36,52,.92);border-color:rgba(92,189,192,.15);color:#d9f3f4}
html[data-medai-theme="dark"] .medai-real-stats article{background:linear-gradient(145deg,rgba(10,37,54,.98),rgba(7,27,42,.97));border-color:rgba(95,192,194,.15);box-shadow:0 14px 38px rgba(0,0,0,.18)}
html[data-medai-theme="dark"] .medai-real-stats b{color:#77e6da}html[data-medai-theme="dark"] .medai-real-stats small{color:#8caab8}
html[data-medai-theme="dark"] .medai-continue-card{background:linear-gradient(135deg,#0a2838,#0b4550 55%,#0a6f69);border-color:rgba(90,225,210,.17);box-shadow:0 16px 40px rgba(0,0,0,.28)}
@media(max-width:760px){html[data-medai-theme="dark"] .medai-bottom-nav{background:rgba(5,22,33,.92);border-color:rgba(82,197,191,.16);box-shadow:0 18px 48px rgba(0,0,0,.40)}html[data-medai-theme="dark"] .medai-bottom-nav button{color:#9db9c5}}
@media(prefers-reduced-motion:no-preference){.medai-live-dot{animation:medaiLivePulse 2s ease-in-out infinite}.medai-ai-orb{animation:medaiAIOrb 4s ease-in-out infinite}@keyframes medaiLivePulse{50%{box-shadow:0 0 0 8px rgba(19,184,166,.04),0 0 24px rgba(19,184,166,.50)}}@keyframes medaiAIOrb{50%{transform:translateY(-3px);box-shadow:0 17px 34px rgba(23,105,224,.25),0 0 22px rgba(20,184,166,.14)}}}

/* ===== iMed-style cover rails + section heads ===== */
.medai-content-rails{display:grid;gap:26px;margin:8px 0 28px}
.medai-content-section{min-width:0}
.medai-section-head{display:flex;align-items:end;justify-content:space-between;gap:16px;margin:0 2px 10px}
.medai-section-head>div>span,.medai-section-head>div>small{display:block}
.medai-section-head>div>span{font-size:18px;font-weight:900;letter-spacing:-.025em;color:#14384a}
.medai-section-head>div>small{margin-top:3px;color:#78909c;font-size:10px}
.medai-section-head>button{border:0;background:transparent;color:#0f8f88;font-weight:850;font-size:11px}
.medai-cover-rail{display:flex;gap:12px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding:2px 2px 12px}
.medai-cover-rail::-webkit-scrollbar{display:none}
.medai-cover-card{position:relative;flex:0 0 220px;min-width:220px;overflow:hidden;scroll-snap-align:start;border:1px solid rgba(80,144,157,.15);border-radius:21px;padding:0;background:linear-gradient(145deg,#fff,#f7fcfd);color:#133649;text-align:left;box-shadow:0 12px 34px rgba(17,67,82,.075);transition:transform .18s ease,box-shadow .18s ease}
.medai-cover-card:active{transform:scale(.985)}
.medai-cover-art{position:relative;height:118px;display:grid;place-items:center;overflow:hidden;font-size:48px;background:
radial-gradient(circle at 75% 22%,rgba(255,255,255,.52),transparent 24%),
linear-gradient(145deg,#dff7f3,#dcecff)}
.medai-cover-art:before,.medai-cover-art:after{content:"";position:absolute;border-radius:50%;pointer-events:none}
.medai-cover-art:before{width:112px;height:112px;left:-30px;bottom:-54px;background:rgba(15,159,143,.13)}
.medai-cover-art:after{width:86px;height:86px;right:-18px;top:-25px;background:rgba(23,105,224,.13)}
.medai-cover-art em{position:absolute;left:12px;right:12px;bottom:14px;height:2px;background:linear-gradient(90deg,transparent,#0f9f8f 12%,#0f9f8f 32%,transparent 32%,transparent 45%,#ef4f5f 45%,#ef4f5f 62%,transparent 62%);opacity:.33}
.medai-cover-card[data-tone="2"] .medai-cover-art{background:linear-gradient(145deg,#e5f4ff,#e4f8f4)}
.medai-cover-card[data-tone="3"] .medai-cover-art{background:linear-gradient(145deg,#e8f8f5,#eef5ff)}
.medai-cover-card[data-tone="4"] .medai-cover-art{background:linear-gradient(145deg,#e8f7fb,#dff6ef)}
.medai-cover-copy{display:block;padding:15px 16px 17px}
.medai-cover-copy b,.medai-cover-copy small{display:block}
.medai-cover-copy b{font-size:15px;line-height:1.2}
.medai-cover-copy small{margin-top:6px;color:#708592;font-size:10px;line-height:1.45}
.medai-cover-card>i{position:absolute;right:13px;bottom:14px;color:#6ca9a5;font-size:18px;font-style:normal}
.medai-all-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.medai-cover-card.all{width:100%;min-width:0;display:grid;grid-template-columns:90px minmax(0,1fr) 24px;align-items:center;padding:10px}
.medai-cover-card.all .medai-cover-art{height:82px;border-radius:15px;font-size:34px}
.medai-cover-card.all .medai-cover-copy{padding:10px}
.medai-cover-card.all>i{position:static}
.medai-top-actions{display:flex;align-items:center;gap:5px}
.medai-top-icon{width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:11px;background:transparent;color:inherit;font-size:16px}
.medai-top-icon:active{background:rgba(15,159,143,.10)}
@media(max-width:760px){
  .medai-cover-card{flex-basis:64%;min-width:64%}
  .medai-content-rails{gap:22px}
  .medai-section-head>div>span{font-size:17px}
  .medai-all-grid{grid-template-columns:1fr}
  .medai-top-icon{width:32px;height:32px;font-size:14px}
  .medai-theme-toggle button{width:34px!important}
}
html[data-medai-theme="dark"] .medai-section-head>div>span{color:#edf9ff}
html[data-medai-theme="dark"] .medai-section-head>div>small{color:#7894a3}
html[data-medai-theme="dark"] .medai-section-head>button{color:#67e0d4}
html[data-medai-theme="dark"] .medai-cover-card{background:linear-gradient(145deg,#0b2b3d,#081f30);border-color:rgba(96,194,197,.15);color:#eefaff;box-shadow:0 14px 38px rgba(0,0,0,.20)}
html[data-medai-theme="dark"] .medai-cover-art{background:
radial-gradient(circle at 75% 22%,rgba(82,226,212,.10),transparent 24%),
linear-gradient(145deg,#0c3a46,#0b2c45)}
html[data-medai-theme="dark"] .medai-cover-card[data-tone="2"] .medai-cover-art{background:linear-gradient(145deg,#0b344a,#0a403c)}
html[data-medai-theme="dark"] .medai-cover-card[data-tone="3"] .medai-cover-art{background:linear-gradient(145deg,#0d403b,#0a2f49)}
html[data-medai-theme="dark"] .medai-cover-card[data-tone="4"] .medai-cover-art{background:linear-gradient(145deg,#0b3342,#0a4137)}
html[data-medai-theme="dark"] .medai-cover-copy small{color:#91aeba}
html[data-medai-theme="dark"] .medai-cover-card>i{color:#74d9cf}

/* ===== Futuristic student hero HUD ===== */
.medai-future-hero{isolation:isolate;min-height:330px!important;padding-bottom:112px!important}
.medai-future-hero:before{content:"";position:absolute;inset:0;pointer-events:none;background:
linear-gradient(rgba(15,159,143,.035) 1px,transparent 1px),
linear-gradient(90deg,rgba(23,105,224,.03) 1px,transparent 1px);
background-size:28px 28px;mask-image:linear-gradient(to bottom,rgba(0,0,0,.7),transparent 92%);z-index:0}
.medai-future-hero:after{content:"";position:absolute;width:280px;height:280px;right:-60px;top:-80px;border-radius:50%;background:radial-gradient(circle,rgba(20,184,166,.18),transparent 68%);filter:blur(8px);z-index:0;pointer-events:none}
.medai-hero-hud{position:absolute;left:28px;right:28px;bottom:18px;z-index:9;display:grid;gap:10px;padding:13px 15px;border:1px solid rgba(76,153,166,.18);border-radius:18px;background:rgba(247,252,253,.82);box-shadow:0 14px 36px rgba(19,64,78,.09);backdrop-filter:blur(18px) saturate(150%);-webkit-backdrop-filter:blur(18px) saturate(150%)}
.medai-hud-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.medai-hud-live{display:inline-flex;align-items:center;gap:7px;font-size:9px;font-weight:900;letter-spacing:.14em;color:#0f847b}
.medai-hud-live i{width:7px;height:7px;border-radius:50%;background:#17c7b4;box-shadow:0 0 0 5px rgba(23,199,180,.10),0 0 14px rgba(23,199,180,.45)}
.medai-hud-time{font-size:11px;font-weight:850;color:#52717e;letter-spacing:.06em}
.medai-hud-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.medai-hud-grid>div{position:relative;overflow:hidden;padding:10px 11px;border-radius:14px;background:linear-gradient(145deg,rgba(255,255,255,.92),rgba(241,250,250,.86));border:1px solid rgba(88,154,167,.12)}
.medai-hud-grid small,.medai-hud-grid b,.medai-hud-grid em{display:block}
.medai-hud-grid small{font-size:8px;font-weight:900;letter-spacing:.10em;color:#6c8995}
.medai-hud-grid b{margin-top:4px;font-size:19px;color:#0f5f68;letter-spacing:-.03em}
.medai-hud-grid em{margin-top:1px;font-size:8px;color:#91a2aa;font-style:normal}
.medai-hud-grid>div:after{content:"";position:absolute;right:-18px;bottom:-28px;width:64px;height:64px;border-radius:50%;background:rgba(20,184,166,.08)}
.medai-hud-scan{height:3px;overflow:hidden;border-radius:999px;background:rgba(15,159,143,.08)}
.medai-hud-scan span{display:block;width:28%;height:100%;border-radius:inherit;background:linear-gradient(90deg,transparent,#14b8a6,#38bdf8,transparent);animation:medaiHudScan 2.6s linear infinite}
@keyframes medaiHudScan{from{transform:translateX(-100%)}to{transform:translateX(460%)}}
.medai-neural-orbit{position:absolute;right:8%;top:12%;z-index:1;width:170px;height:170px;border:1px solid rgba(15,159,143,.14);border-radius:50%;pointer-events:none;animation:medaiOrbitSpin 22s linear infinite}
.medai-neural-orbit:before,.medai-neural-orbit:after{content:"";position:absolute;border-radius:50%;border:1px dashed rgba(23,105,224,.12)}
.medai-neural-orbit:before{inset:22px}.medai-neural-orbit:after{inset:48px}
.medai-neural-orbit span{position:absolute;width:9px;height:9px;border-radius:50%;background:#14b8a6;box-shadow:0 0 14px rgba(20,184,166,.5)}
.medai-neural-orbit span:nth-child(1){left:50%;top:-5px}.medai-neural-orbit span:nth-child(2){right:-5px;top:50%;background:#1769e0;box-shadow:0 0 14px rgba(23,105,224,.45)}.medai-neural-orbit span:nth-child(3){left:12%;bottom:9%;background:#ef4f5f;box-shadow:0 0 14px rgba(239,79,95,.35)}
@keyframes medaiOrbitSpin{to{transform:rotate(360deg)}}
html[data-medai-theme="dark"] .medai-future-hero:before{background:
linear-gradient(rgba(56,189,248,.035) 1px,transparent 1px),
linear-gradient(90deg,rgba(20,184,166,.03) 1px,transparent 1px)}
html[data-medai-theme="dark"] .medai-future-hero:after{background:radial-gradient(circle,rgba(20,184,166,.20),transparent 68%)}
html[data-medai-theme="dark"] .medai-hero-hud{background:rgba(6,27,41,.78);border-color:rgba(90,210,202,.17);box-shadow:0 16px 42px rgba(0,0,0,.30)}
html[data-medai-theme="dark"] .medai-hud-live{color:#6ce6d8}html[data-medai-theme="dark"] .medai-hud-time{color:#87a9b7}
html[data-medai-theme="dark"] .medai-hud-grid>div{background:linear-gradient(145deg,rgba(10,42,57,.92),rgba(6,29,43,.90));border-color:rgba(92,190,194,.14)}
html[data-medai-theme="dark"] .medai-hud-grid small{color:#7ca3af}html[data-medai-theme="dark"] .medai-hud-grid b{color:#7ae5da}html[data-medai-theme="dark"] .medai-hud-grid em{color:#678490}
html[data-medai-theme="dark"] .medai-neural-orbit{border-color:rgba(92,230,216,.18);filter:drop-shadow(0 0 12px rgba(20,184,166,.09))}
@media(max-width:760px){
  .medai-future-hero{min-height:420px!important;padding-bottom:148px!important}
  .medai-hero-hud{left:14px;right:14px;bottom:12px;padding:11px;border-radius:16px}
  .medai-hud-grid{gap:6px}.medai-hud-grid>div{padding:9px 8px}.medai-hud-grid b{font-size:17px}.medai-hud-grid small{font-size:7px}.medai-hud-grid em{display:none}
  .medai-neural-orbit{width:128px;height:128px;right:4%;top:42%}
}
@media(prefers-reduced-motion:reduce){.medai-hud-scan span,.medai-neural-orbit{animation:none!important}}

/* ===== Unified student medical design system ===== */
.medai-notify-badge{
  position:absolute;right:-3px;top:-4px;min-width:17px;height:17px;padding:0 4px;
  display:grid;place-items:center;border-radius:999px;background:#ef4f5f;color:#fff;
  border:2px solid rgba(245,251,252,.96);font-size:8px;font-weight:950;line-height:1;
  box-shadow:0 5px 14px rgba(239,79,95,.32)
}
.medai-top-icon{position:relative}
.medai-bottom-nav button.active{
  background:linear-gradient(145deg,rgba(15,159,143,.12),rgba(23,105,224,.09))!important;
  color:#0f7772!important;
  box-shadow:inset 0 0 0 1px rgba(15,159,143,.10)
}
.medai-bottom-nav button.active span{transform:translateY(-1px)}
.medai-content-section,.medai-progress-rings{position:relative}
.medai-content-section:before,.medai-progress-rings:before{
  content:"";position:absolute;left:0;right:0;top:-12px;height:1px;
  background:linear-gradient(90deg,transparent,rgba(15,159,143,.18),rgba(23,105,224,.12),transparent)
}
.medai-progress-rings{margin:4px 0 28px}
.medai-ring-rail{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px
}
.medai-ring-rail article{
  display:grid;grid-template-columns:70px minmax(0,1fr);grid-template-rows:auto auto;
  align-items:center;column-gap:14px;padding:14px;border:1px solid rgba(77,144,158,.14);
  border-radius:19px;background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(244,251,252,.95));
  box-shadow:0 10px 30px rgba(18,67,82,.06)
}
.medai-ring{
  grid-row:1/3;position:relative;width:64px;height:64px;display:grid;place-items:center;border-radius:50%;
  background:conic-gradient(#0f9f8f calc(var(--p)*1%),rgba(15,159,143,.09) 0);
  box-shadow:inset 0 0 0 1px rgba(15,159,143,.08),0 8px 20px rgba(15,159,143,.08)
}
.medai-ring:before{
  content:"";position:absolute;inset:7px;border-radius:50%;background:#fff;
  box-shadow:inset 0 0 0 1px rgba(89,144,156,.10)
}
.medai-ring span{position:relative;z-index:1;font-size:12px;font-weight:950;color:#0f6570}
.medai-ring-rail article>b{align-self:end;font-size:13px;color:#17384b}
.medai-ring-rail article>small{align-self:start;margin-top:4px;font-size:9px;color:#7b8e98}
.medai-cover-card .medai-cover-art{
  isolation:isolate
}
.medai-cover-card .medai-cover-art:before{
  box-shadow:36px -18px 0 -22px rgba(23,105,224,.16),72px 7px 0 -28px rgba(239,79,95,.15)
}
.medai-cover-card .medai-cover-art:after{
  box-shadow:-56px 38px 0 -30px rgba(15,159,143,.20)
}
.medai-cover-card .medai-cover-art>em:before{
  content:"✚";position:absolute;right:2px;top:-41px;font-style:normal;font-size:26px;
  font-weight:900;color:rgba(15,159,143,.14);transform:rotate(12deg)
}
html[data-medai-theme="dark"] .medai-notify-badge{border-color:#071a27}
html[data-medai-theme="dark"] .medai-bottom-nav button.active{
  background:linear-gradient(145deg,rgba(20,184,166,.14),rgba(56,189,248,.09))!important;
  color:#6be2d7!important;box-shadow:inset 0 0 0 1px rgba(89,220,208,.13)
}
html[data-medai-theme="dark"] .medai-content-section:before,
html[data-medai-theme="dark"] .medai-progress-rings:before{
  background:linear-gradient(90deg,transparent,rgba(92,230,216,.18),rgba(56,189,248,.12),transparent)
}
html[data-medai-theme="dark"] .medai-ring-rail article{
  background:linear-gradient(145deg,rgba(9,36,52,.98),rgba(6,27,42,.96));
  border-color:rgba(95,193,195,.14);box-shadow:0 12px 34px rgba(0,0,0,.18)
}
html[data-medai-theme="dark"] .medai-ring{
  background:conic-gradient(#39d8c7 calc(var(--p)*1%),rgba(57,216,199,.08) 0)
}
html[data-medai-theme="dark"] .medai-ring:before{background:#0a2434;border-color:rgba(95,193,195,.10)}
html[data-medai-theme="dark"] .medai-ring span{color:#78e6da}
html[data-medai-theme="dark"] .medai-ring-rail article>b{color:#eefaff}
html[data-medai-theme="dark"] .medai-ring-rail article>small{color:#839eaa}
@media(max-width:760px){
  .medai-ring-rail{
    display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;padding-bottom:4px
  }
  .medai-ring-rail::-webkit-scrollbar{display:none}
  .medai-ring-rail article{flex:0 0 72%;min-width:72%;scroll-snap-align:start}
}
/* ===== Premium doctor dashboard ===== */
.medai-doctor-smart .medai-greeting-row>div>small{color:#0d8790}
.medai-doctor-smart .medai-ai-orb{background:linear-gradient(145deg,#0b6b78,#1769e0)}
.medai-doctor-section .medai-cover-art{background:radial-gradient(circle at 74% 22%,rgba(255,255,255,.58),transparent 24%),linear-gradient(145deg,#dff6f4,#e7f0ff)}
.medai-future-doctor:after{background:radial-gradient(circle,rgba(23,105,224,.16),transparent 68%)}
.medai-doctor-hud .medai-hud-live{color:#0b7d86}
.medai-doctor-orbit span:nth-child(1){background:#0f9f8f;box-shadow:0 0 14px rgba(15,159,143,.5)}
.medai-doctor-orbit span:nth-child(2){background:#1769e0;box-shadow:0 0 14px rgba(23,105,224,.48)}
.medai-doctor-orbit span:nth-child(3){background:#ef4f5f;box-shadow:0 0 14px rgba(239,79,95,.38)}
.medai-doctor-stats article{padding-left:17px}
.medai-doctor-stats article:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;border-radius:3px}
.medai-doctor-stats article:nth-child(1):before{background:#0f9f8f}
.medai-doctor-stats article:nth-child(2):before{background:#1769e0}
.medai-doctor-stats article:nth-child(3):before{background:#14b8a6}
.medai-doctor-stats article:nth-child(4):before{background:#ef4f5f}
html[data-medai-theme="dark"] .medai-doctor-smart .medai-greeting-row>div>small{color:#6ce6dc}
html[data-medai-theme="dark"] .medai-doctor-section .medai-cover-art{background:radial-gradient(circle at 72% 20%,rgba(56,189,248,.10),transparent 24%),linear-gradient(145deg,#0a3340,#0a2943)}
html[data-medai-theme="dark"] .medai-future-doctor:after{background:radial-gradient(circle,rgba(23,105,224,.20),transparent 68%)}
html[data-medai-theme="dark"] .medai-doctor-hud .medai-hud-live{color:#74e5dc}
@media(max-width:760px){.medai-doctor-section .medai-cover-card{flex-basis:70%;min-width:70%}.medai-doctor-smart .medai-real-stats article{flex-basis:46%;min-width:46%}}
/* ===== Premium user / patient dashboard ===== */
.medai-user-smart .medai-greeting-row>div>small{color:#0f8f86}
.medai-user-smart .medai-ai-orb{background:linear-gradient(145deg,#0f9f8f,#1769e0)}
.medai-user-section .medai-cover-art{background:radial-gradient(circle at 74% 22%,rgba(255,255,255,.58),transparent 24%),linear-gradient(145deg,#e4f8f4,#e7f1ff)}
.medai-future-user:after{background:radial-gradient(circle,rgba(15,159,143,.18),transparent 68%)}
.medai-user-hud .medai-hud-live{color:#0f847b}
.medai-user-orbit span:nth-child(1){background:#0f9f8f;box-shadow:0 0 14px rgba(15,159,143,.48)}
.medai-user-orbit span:nth-child(2){background:#38bdf8;box-shadow:0 0 14px rgba(56,189,248,.42)}
.medai-user-orbit span:nth-child(3){background:#1769e0;box-shadow:0 0 14px rgba(23,105,224,.40)}
.medai-user-stats article{padding-left:17px}
.medai-user-stats article:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;border-radius:3px}
.medai-user-stats article:nth-child(1):before{background:#1769e0}
.medai-user-stats article:nth-child(2):before{background:#0f9f8f}
.medai-user-stats article:nth-child(3):before{background:#14b8a6}
.medai-user-stats article:nth-child(4):before{background:#64748b}
html[data-medai-theme="dark"] .medai-user-smart .medai-greeting-row>div>small{color:#6ce6dc}
html[data-medai-theme="dark"] .medai-user-section .medai-cover-art{background:radial-gradient(circle at 72% 20%,rgba(20,184,166,.10),transparent 24%),linear-gradient(145deg,#0a3b3b,#0a2943)}
html[data-medai-theme="dark"] .medai-future-user:after{background:radial-gradient(circle,rgba(20,184,166,.20),transparent 68%)}
html[data-medai-theme="dark"] .medai-user-hud .medai-hud-live{color:#74e5dc}
@media(max-width:760px){.medai-user-section .medai-cover-card{flex-basis:70%;min-width:70%}.medai-user-smart .medai-real-stats article{flex-basis:46%;min-width:46%}}
