/* White Smile OS v3.7.1 — finishing system: readable, compact, meaningful motion */
:root{font-synthesis:none}
html,body,.app,.main,.content{min-width:0;max-width:100%}
html{overflow-x:hidden}
#toast.toast,#toast.toast.ws371-top-toast{position:fixed!important;top:max(12px,env(safe-area-inset-top))!important;bottom:auto!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important;width:min(400px,calc(100vw - 28px));z-index:9999!important;max-height:34vh;overflow:auto;box-shadow:0 18px 52px #050a2150!important;padding:12px 15px!important;font-size:13px!important;border-radius:14px!important;line-height:1.6!important}
.ws371-quote{font-size:clamp(13px,1.4vw,17px)!important;line-height:1.9!important;max-width:620px!important;font-weight:550}
.hero{position:relative;isolation:isolate;overflow:hidden}.hero>div:first-child{position:relative;z-index:2}
.hero .hero-sculpt{display:none!important}
.ws371-journey{position:absolute;z-index:1;left:0;bottom:0;width:min(45%,510px);height:140px;opacity:.52;pointer-events:none;color:#dcd4ff}
.ws371-journey svg{display:block;width:100%;height:110px;overflow:visible;fill:#fff}
.ws371-route-base{stroke:#fff;stroke-opacity:.27;stroke-width:3}
.ws371-route-active{stroke:#e7ddff;stroke-width:3.5;stroke-linecap:round;stroke-dasharray:13 20;animation:ws371Route 10s linear infinite}
.ws371-journey-steps{display:flex;justify-content:space-around;gap:8px;padding:0 20px;color:#f4eeff;font-size:10px;font-weight:700}
@keyframes ws371Route{to{stroke-dashoffset:-330}}
.ws371-coordinator-panel{background:var(--card,#fff);border:1px solid var(--line);border-radius:21px;padding:18px;margin:13px 0 18px;box-shadow:0 10px 28px #1115360a;color:var(--ink)}
.ws371-panel-top{display:flex;gap:14px;justify-content:space-between;align-items:center;flex-wrap:wrap}
.ws371-panel-top h2{font-size:19px;margin:5px 0;color:var(--ink)}.ws371-panel-top p{font-size:11px;color:var(--muted);margin:0}.ws371-panel-top small{color:#635bdf;font-size:11px;font-weight:800}
.ws371-panel-top button{background:#665deb!important;color:white!important;padding:10px 14px;border-radius:11px;min-height:39px;font-size:12px}
.ws371-panel-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-top:15px}.ws371-panel-metrics>div{border:1px solid var(--line);background:var(--base);padding:13px;border-radius:13px;min-width:0;display:grid;gap:9px}.ws371-panel-metrics span{font-size:11px;color:var(--muted)}.ws371-panel-metrics b{font-size:21px;font-variant-numeric:tabular-nums;color:var(--ink);overflow-wrap:anywhere}
/* Lead cards, status and readable message blocks */
.ws37-feed{align-items:stretch}.ws37-lead{height:100%;display:flex;flex-direction:column}
.ws37-message{margin-top:auto;background:#f3f2fd!important;border-color:#dcdcf0!important;color:#292e51!important}
.ws37-message-head{gap:8px;align-items:center}.ws37-message-head b{font-size:11px;color:inherit;line-height:1.6}
.ws37-copy{flex:0 0 auto;min-height:35px;gap:6px;border:1px solid #c8c3f6!important;color:#493cc1!important;background:#e5e1fc!important}
.ws37-badge{font-size:11px!important;display:inline-flex!important;align-items:center;justify-content:center;max-width:100%;min-height:30px;line-height:1.25;white-space:nowrap}
.ws37-badge.new{background:#c8f5df!important;color:#075b3b!important;border:1px solid #8bddb3!important}
.ws37-metric,.ws37-lead{overflow-wrap:anywhere}
.ws37-details>span{color:#3e486b}.ws37-actionbar>*{white-space:normal!important}
html[data-theme="dark"] .ws37-message{background:#2b3151!important;border-color:#525b83!important;color:#f2f3ff!important}
html[data-theme="dark"] .ws37-copy{background:#484075!important;border-color:#7064b2!important;color:#fff!important}
html[data-theme="dark"] .ws371-coordinator-panel{background:#20263d;border-color:#39425c;color:#eaf0ff}
html[data-theme="dark"] .ws371-panel-metrics>div{background:#2a304a;border-color:#424965}
html[data-theme="dark"] .ws371-panel-metrics b,html[data-theme="dark"] .ws371-panel-top h2{color:#f1f3ff}
/* Phone login: short readable hero, no color/text collision. */
.auth-art h1,.auth-art h1 em{overflow-wrap:normal!important;word-break:normal!important;text-wrap:balance}
.auth-art>div:nth-child(2){max-width:100%;min-width:0}.auth-art p{line-height:1.7!important}
@media(max-width:900px){
 .ws371-journey{width:32%;height:110px;opacity:.35}.ws371-journey svg{height:75px}
 .ws371-journey-steps{display:none}
 .ws37-feed{grid-template-columns:1fr}
 .ws37-top{align-items:stretch}
 .ws37-filters{display:grid;grid-template-columns:minmax(0,1fr);max-width:100%;gap:8px}
 .ws37-segments,.ws37-periods{width:100%;max-width:100%;display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding:5px}
 .ws37-segments::-webkit-scrollbar,.ws37-periods::-webkit-scrollbar{display:none}
 .ws37-segments button,.ws37-periods button{flex:1 0 auto;min-width:0;font-size:12px}
 .ws37-searchrow{display:flex;flex-wrap:wrap}.ws37-searchrow label{flex:1 1 190px;max-width:none}.ws37-searchrow>button{flex:0 0 auto}
 .ws37-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .ws37-metric{padding:13px;min-height:95px;gap:4px}.ws37-metric strong{font-size:23px}
 .ws37-lead{padding:14px;border-radius:18px}
 .ws37-source{width:34px;height:34px;top:14px;left:14px}.ws37-lead-heading{padding-left:39px}
 .ws37-lead-heading h3{font-size:15px;line-height:1.55}
 .ws37-actionbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.ws37-actionbar>a,.ws37-actionbar>button{padding:8px 6px;min-width:0;font-size:11px}
 .ws37-foot button{flex:1 1 40%}
 .ws371-panel-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .ws37-top{margin-top:0!important}.ws37-top h2{font-size:23px}
 /* Keep mobile nav inside device while not covering first card or actions. */
 .app:not(.hidden) .content{padding-bottom:max(125px,calc(95px + env(safe-area-inset-bottom)))!important}
 .mobile-tabs{left:8px!important;right:8px!important;bottom:max(6px,env(safe-area-inset-bottom))!important;border-radius:19px!important;z-index:48!important;padding:6px 2px!important}
 .mobile-tabs button{min-height:51px!important;gap:1px!important}
 .mobile-tabs button span{min-height:24px!important}
 .mobile-tabs button small{font-size:10px!important;max-width:100%!important;text-overflow:clip!important;white-space:nowrap!important}
 body:has(.ws37-top) #quickPatient{display:none!important}
 .auth-art{padding:16px 18px!important;min-height:125px!important;max-height:190px!important;overflow:hidden}
 .auth-art h1{font-size:clamp(19px,5.1vw,24px)!important;line-height:1.38!important;margin:6px 0 0!important}
 .auth-form{padding:15px 15px 25px!important}
 .authbox{padding:20px 18px!important}
}
@media(max-width:540px){
 .topbar{padding:8px 10px!important;gap:5px!important;min-height:56px!important}
 .topbar h2{font-size:15px!important;line-height:1.4}
 .topright{gap:3px!important}.topright #sound,.topright #globalSearch,.topright #refresh{display:none!important}
 .topright #branch{max-width:99px!important;font-size:11px!important}
 .topright .iconbtn{width:36px!important;min-width:36px!important;height:36px!important;padding:5px!important}
 .content{padding-left:12px!important;padding-right:12px!important}
 .ws37-kicker{font-size:9px!important;letter-spacing:.5px}
 .ws37-top .ws37-pill{font-size:10px}
 .ws37-searchrow>button{min-height:41px}
 .ws371-journey{display:none}
 .hero h1{font-size:23px!important}.ws371-quote{font-size:12px!important;line-height:1.8!important}
 .ws371-coordinator-panel{padding:14px;border-radius:17px}
}
@media(max-width:350px){.ws37-actionbar{grid-template-columns:1fr 1fr}.ws37-actionbar .ws37-book{grid-column:1/-1}.ws37-metric strong{font-size:19px}}
@media(prefers-reduced-motion:reduce){.ws371-route-active,.ws37-lead,.ws37-lead:hover{animation:none!important;transition:none!important;transform:none!important}}
/* On short phones, never center a tall login card into a shorter viewport. */
@media(max-width:900px){
 .auth:not(.hidden){height:100dvh;min-height:100dvh;overflow-y:auto!important;display:flex;flex-direction:column}
 .auth-form{display:flex!important;align-items:flex-start!important;justify-content:center!important;flex:1 0 auto!important;min-height:unset!important;margin:0!important;padding-top:16px!important}
 .authbox{margin:0 auto!important;max-width:450px}
}
/* Mobile login: separate brand story and form instead of letting the sheet cover text. */
@media(max-width:900px){
  .auth:not(.hidden){display:flex!important;flex-direction:column!important;height:100dvh!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important}
  .auth:not(.hidden) .auth-art{display:flex!important;position:relative!important;flex:none!important;box-sizing:border-box!important;height:auto!important;min-height:244px!important;padding:24px 25px 28px!important;justify-content:center!important;gap:8px!important;overflow:visible!important}
  .auth:not(.hidden) .auth-art>div:nth-child(2){min-width:0!important;max-width:100%!important;position:relative;z-index:1}
  .auth:not(.hidden) .auth-art>div:nth-child(2) h1{display:block!important;margin:8px 0 5px!important;font-size:clamp(24px,6.6vw,33px)!important;line-height:1.55!important;max-width:100%;overflow:visible!important;text-wrap:balance}
  .auth:not(.hidden) .auth-art>div:nth-child(2) p{display:block!important;font-size:12px!important;line-height:1.7!important;margin:4px 0 0!important;color:#e8e7ff!important}
  .auth:not(.hidden) .auth-form{box-sizing:border-box!important;position:relative!important;flex:1 0 auto!important;min-height:0!important;display:flex!important;transform:none!important;margin:0!important;padding:29px 16px 35px!important;align-items:center!important;justify-content:center!important;border-radius:0!important}
  .auth:not(.hidden) .authbox{max-width:390px;width:100%;margin:0!important;transform:none!important}
}
@media(max-width:540px){.ws371-journey{display:block!important;top:8px;bottom:auto;left:3px;width:38%;height:80px;opacity:.19}.ws371-journey svg{height:65px}.ws371-journey-steps{display:none}}
