/* ===== Sami Aid — Light / Dark mode =====
   Light mode = the original design (nothing changes).
   Dark mode is applied only when <html data-theme="dark"> (set by assets/js/theme.js). */

/* ---- toggle button (header, desktop/tablet) ---- */
.theme-toggle{width:42px;height:42px;border-radius:50%;border:1.5px solid var(--line);background:#fff;color:var(--navy);display:grid;place-items:center;cursor:pointer;flex:none;padding:0;transition:background .2s,border-color .2s,transform .2s;-webkit-tap-highlight-color:transparent}
.theme-toggle:hover{background:var(--sky)}
.theme-toggle:active{transform:scale(.94)}
.theme-toggle:focus-visible{outline:3px solid var(--blue2);outline-offset:3px}
.theme-toggle .i{width:20px;height:20px}
.theme-toggle .i-sun{display:none}
html[data-theme=dark] .theme-toggle .i-sun{display:block}
html[data-theme=dark] .theme-toggle .i-moon{display:none}

/* ---- toggle row inside the mobile menu (phones only) ---- */
.theme-li{display:none}
.theme-li .theme-toggle{width:100%;height:auto;border:0;border-radius:12px;background:transparent;display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:13px 12px;font:inherit;font-size:1.02rem;font-weight:600;color:var(--navy);text-align:left}
.theme-li .theme-toggle:hover{background:var(--sky);color:var(--blue)}
.theme-li .tl-d,.theme-li .tl-l{display:inline}
html:not([data-theme=dark]) .theme-li .tl-l,html[data-theme=dark] .theme-li .tl-d{display:none!important}
@media(max-width:760px){
 /* phones: toggle sits in the header, just left of Patient Login (not inside the menu) */
 .theme-li{display:none!important}
 .hact .sbtn{order:1}
 .hact .lang{order:2}
 .hact .theme-toggle{order:3;width:38px;height:38px}
 .hact .theme-toggle .i{width:18px;height:18px}
 .hact .sa-patient-login{order:4}
 .hact .burger{order:5}
}
/* keep every header item on screen on small phones */
@media(max-width:760px){
 .hact{gap:4px}
 .hact .sbtn,.hact .theme-toggle{width:34px;height:34px}
 .hact .sbtn .i,.hact .theme-toggle .i{width:17px;height:17px}
 .hact .lang span{padding:3px 6px;font-size:.74rem}
 .hact .sa-patient-login{padding:0 9px;height:36px;gap:4px;font-size:.74rem}
 .hact .sa-patient-login .i{width:14px;height:14px}
 .hact .burger{width:36px;height:36px}
 .hact .burger span{width:18px;margin:4px auto}
 .nav{gap:6px}
}
@media(max-width:380px){
 .hact{gap:3px}
 .hact .sbtn,.hact .theme-toggle{width:32px;height:32px}
 .hact .lang span{padding:3px 5px;font-size:.7rem}
 .hact .sa-patient-login{padding:0 8px;font-size:.7rem}
 .hact .sa-patient-login .i{display:none}
 .hact .burger{width:34px;height:34px}
}

/* ===================== DARK MODE ===================== */
html[data-theme=dark]{
 color-scheme:dark;
 --navy:#eaf1ff;           /* headings / strong text */
 --sky:#15294d;            /* soft surfaces */
 --sky2:#10213f;
 --line:#26406e;
 --text:#c9d7f0;
 --mute:#9db0d4;
 --sf:#111f3a;             /* card surface */
 --lt:#7db6ff;             /* blue used for text/links on dark */
 --sh:0 1px 2px rgba(0,0,0,.4),0 12px 30px rgba(0,0,0,.32);
 --sh2:0 22px 50px rgba(0,0,0,.5);
}
html[data-theme=dark] body{background:#0b1426;color:var(--text)}
:where(html[data-theme=dark]) a{color:var(--lt)}

/* page-top sections with light gradients */
html[data-theme=dark] .bnr{background:linear-gradient(180deg,#0f1f3d,#0d1a33 70%,#0b1426)}
html[data-theme=dark] .banner-hero{background:radial-gradient(900px 420px at 90% 0,rgba(42,139,255,.14),transparent 60%),linear-gradient(180deg,#0f1f3d,#0b1426)}
html[data-theme=dark] .phero{background:radial-gradient(700px 380px at 92% 0,rgba(42,139,255,.16),transparent 62%),radial-gradient(500px 300px at 0 100%,rgba(16,179,163,.10),transparent 60%),linear-gradient(180deg,#0f1f3d,#0b1730);border-bottom-color:var(--line)}
html[data-theme=dark] .hero2{background:radial-gradient(900px 480px at 88% -10%,rgba(42,139,255,.16),transparent 60%),linear-gradient(180deg,#0f1f3d,#0b1426)}
html[data-theme=dark] .sky{background:linear-gradient(180deg,#0e1b35,#12254a)}

/* header */
html[data-theme=dark] header{background:rgba(11,20,38,.96);border-bottom-color:var(--line)}
html[data-theme=dark] header nav a:hover{background:var(--sky);color:#9cc8ff}
html[data-theme=dark] header nav a[aria-current=page]{background:var(--blue);color:#fff}
html[data-theme=dark] header nav .dd.active>a{color:#9cc8ff}
html[data-theme=dark] header nav .dd.active>a[aria-current=page]{color:#fff}
html[data-theme=dark] .sub{background:var(--sf);border-color:var(--line);box-shadow:0 24px 60px rgba(0,0,0,.55)}
html[data-theme=dark] .brand small{color:var(--lt)}
html[data-theme=dark] header .brand img{background:#fff;border-radius:50%}
html[data-theme=dark] .lang,html[data-theme=dark] .sbtn,html[data-theme=dark] .theme-toggle{background:var(--sf);border-color:var(--line);color:var(--navy)}
html[data-theme=dark] .sbtn:hover,html[data-theme=dark] .theme-toggle:hover{background:var(--sky)}
html[data-theme=dark] .theme-li .theme-toggle{background:transparent;border:0}
html[data-theme=dark] .theme-li .theme-toggle:hover{background:var(--sky);color:#9cc8ff}
html[data-theme=dark] .burger{background:var(--sky)}
html[data-theme=dark] .callbtn{background:linear-gradient(135deg,#0d3b8c,#0b63e5);color:#fff}
@media(max-width:1360px){
 html[data-theme=dark] header nav{background:var(--sf);border-bottom-color:var(--line);box-shadow:0 30px 50px rgba(0,0,0,.55)}
 html[data-theme=dark] .sub{background:var(--sky2);box-shadow:none}
}

/* search panel */
html[data-theme=dark] .swrap{background:var(--sf)}
html[data-theme=dark] .sform{background:var(--sky2);border-color:var(--blue2)}
html[data-theme=dark] .sform input{color:var(--navy)}
html[data-theme=dark] .sclose{background:var(--sky);color:var(--navy)}
html[data-theme=dark] .shint button{background:var(--sky);border-color:var(--line);color:var(--lt)}
html[data-theme=dark] .sres a{color:var(--navy)}
html[data-theme=dark] .sres a:hover,html[data-theme=dark] .sres a:focus{background:var(--sky);border-color:var(--line)}
html[data-theme=dark] .sres .rk{background:var(--sky);color:var(--lt)}

/* surfaces */
html[data-theme=dark] :is(.card,.benefit,.abt-why,.split .why>div,.svc,.aud,details,.empty,.pinfo .cardlg,.spec div,.prod,.sa-card,.sa-modal,.chipf){background:var(--sf);border-color:var(--line)}
html[data-theme=dark] .spec div:nth-child(odd){background:var(--sky2)}
html[data-theme=dark] a.card:hover{border-color:#3b5d9a}
html[data-theme=dark] .eyebrow{background:var(--sf);border-color:var(--line);color:var(--lt)}
html[data-theme=dark] .note{background:var(--sky);border-left-color:var(--blue2)}
html[data-theme=dark] .tbl{border-color:var(--line)}
html[data-theme=dark] .tbl th{background:var(--sky)}
html[data-theme=dark] .prod .kind{background:var(--sky);color:var(--lt)}
html[data-theme=dark] .empty{border-color:#35558f}
html[data-theme=dark] .ibox{background:linear-gradient(135deg,#17305c,#12403f);color:var(--lt)}
html[data-theme=dark] .chk li:before{background-color:rgba(16,179,163,.22)}
html[data-theme=dark] .pcard.c1{background:#12264a}
html[data-theme=dark] .pcard.c2{background:#0f2f2e}
html[data-theme=dark] .pcard.c3{background:#231f45}
html[data-theme=dark] .pcard.c4{background:#3a2a14}
/* product photos keep a light stage so their white backgrounds look right */
html[data-theme=dark] .gal,html[data-theme=dark] .gal-slide img,html[data-theme=dark] .pslide{background:#fff}

/* blue text accents */
html[data-theme=dark] :is(.more,.tag,.crumb a,.bt,.num,.btn-g,.btn-o,.dd.active>a,summary:after,.cnum .chip.c){color:var(--lt)}
html[data-theme=dark] .btn-g{background:var(--sf);border-color:var(--line)}
html[data-theme=dark] .btn-o{border-color:#3b5d9a}
html[data-theme=dark] .btn-o:hover{background:var(--sky)}
html[data-theme=dark] .btn-p,html[data-theme=dark] .btn-w,html[data-theme=dark] .abt-call,html[data-theme=dark] .callbtn{color:#fff}
html[data-theme=dark] .hero h2.sl{background:linear-gradient(90deg,#8fc0ff,var(--teal));-webkit-background-clip:text;background-clip:text;color:transparent}
html[data-theme=dark] .abt-call{background:linear-gradient(135deg,#0d3b8c,#0b63e5)}
html[data-theme=dark] .ft{background:#1d3a72}
html[data-theme=dark] .skip{background:#1d3a72}
html[data-theme=dark] .chip{background:var(--sf);border-color:var(--line);color:var(--navy)}
html[data-theme=dark] .chip.on{background:var(--blue);border-color:var(--blue);color:#fff}
html[data-theme=dark] .cnum .chip.w{background:#0f2f22;border-color:#1f5a3c;color:#6fe0a0}
html[data-theme=dark] .cnum .chip.c{background:var(--sky);border-color:var(--line)}

/* controls / forms */
html[data-theme=dark] :is(input,textarea,select){background-color:var(--sky2);color:var(--navy);border-color:var(--line)}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#7f93bb}
html[data-theme=dark] .pfilter,html[data-theme=dark] .tools input{background-color:var(--sky2);color:var(--navy);border-color:var(--line)}
html[data-theme=dark] .sl-btn,html[data-theme=dark] .bpause{background:var(--sf);border-color:var(--line);color:var(--navy)}
html[data-theme=dark] .sl-btn:hover{background:var(--sky)}
html[data-theme=dark] .gal-btn,html[data-theme=dark] .barrow{background:rgba(17,31,58,.9);color:var(--navy)}
html[data-theme=dark] .gal-btn:hover,html[data-theme=dark] .barrow:hover{background:var(--sf)}
html[data-theme=dark] .sa-modal input{background:var(--sky2)}
html[data-theme=dark] .sa-modal-close,html[data-theme=dark] .dx,html[data-theme=dark] .sa-mini{background:var(--sky);color:var(--navy)}
html[data-theme=dark] .sa-logout{color:var(--navy);border-color:var(--line)}
html[data-theme=dark] .sa-pill.inv{background:#15335e;color:#8fc0ff}
html[data-theme=dark] .sa-pill.rep{background:#0f3524;color:#6fe0a0}
html[data-theme=dark] .sa-del{background:#3b1b1b;color:#ff9a8c}
html[data-theme=dark] .sa-msg.ok{background:#0f3524;color:#6fe0a0}
html[data-theme=dark] .sa-msg.err,html[data-theme=dark] .sa-modal .sa-modal-err{background:#3b1b1b;color:#ff9a8c}
html[data-theme=dark] .sa-wa-box{background:#0f2f22;border-color:#1f5a3c}
html[data-theme=dark] .sa-table th,html[data-theme=dark] .sa-table td{border-bottom-color:var(--line)}
html[data-theme=dark] dialog{background:var(--sf);color:var(--text)}
html[data-theme=dark] dialog::backdrop{background:rgba(2,8,22,.65)}
html[data-theme=dark] .story:before{background:var(--line)}
html[data-theme=dark] .st:before{background:var(--sf)}
html[data-theme=dark] hr{border-color:var(--line)}
html[data-theme=dark] ::selection{background:#1f5fd0;color:#fff}

/* buttons that sit on the always-dark blue banners keep their original look */
html[data-theme=dark] :is(.cta,.hl,.hs .big) .btn-g{background:#fff;border-color:#fff;color:var(--blue)}
html[data-theme=dark] :is(.cta,.hl) .btn-o{color:#fff;border-color:rgba(255,255,255,.5)}
html[data-theme=dark] :is(.cta,.hl) .btn-o:hover{background:rgba(255,255,255,.14)}
html[data-theme=dark] :is(.cta,.hl) a:not(.btn){color:#fff}

/* AEO blocks (quick answer / FAQ) under the footer */
html[data-theme=dark] :is(.aeo-block,.aeo-faq){background:var(--sf);border-color:var(--line)}
html[data-theme=dark] :is(.aeo-block h2,.aeo-faq h2){color:var(--navy)}
html[data-theme=dark] .aeo-faq details{border-top-color:var(--line);background:transparent}
html[data-theme=dark] .aeo-note{color:var(--mute)}

/* smooth switch between modes */
html.theme-anim,html.theme-anim *,html.theme-anim *:before,html.theme-anim *:after{transition:background-color .25s ease,color .25s ease,border-color .25s ease!important}
@media(prefers-reduced-motion:reduce){html.theme-anim,html.theme-anim *{transition:none!important}}

/* ===== Bug fix: nav item for the page you are on (Sleep Care / Hearing Care / CPAP & BiPAP / Learn).
   `.dd.active>a{color:blue}` was overriding the white text of the blue "current page" pill,
   so the label became blue-on-blue and could not be read. ===== */
header nav .dd.active>a[aria-current=page],
header nav .dd.active>a[aria-current=page]:hover,
header nav .dd.active>a[aria-current=page]:focus{background:var(--blue);color:#fff}
header nav a{-webkit-tap-highlight-color:transparent}

/* Hearing Care dropdown: room for the longer "Impedance / Tympanometry Test" label (desktop only) */
@media(min-width:1361px){header nav .sub{min-width:300px}}
