:root{
  --forest:#2E3B2A; --forest-2:#3B4A35; --moss:#5C6B3C; --olive:#8A8650;
  --tan:#CDB98C; --tan-2:#E4D7B5; --canvas:#F4EFE3; --paper:#FBF8F1;
  --bark:#4A3828; --blaze:#E3611B; --blaze-dark:#B84A10;
  --ink:#23281F; --muted:#5E6155; --line:#DCD2B9; --r:14px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{min-height:100%}
body{font-family:"Source Sans 3",system-ui,-apple-system,sans-serif;background:var(--canvas);color:var(--ink);font-size:17px;-webkit-text-size-adjust:100%}
h1,h2,h3{font-family:Oswald,sans-serif;letter-spacing:.02em;font-weight:600}
button,input{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0}
[hidden]{display:none!important}
svg{flex-shrink:0}
.topo{position:absolute;inset:0;width:100%;height:100%;opacity:.12;pointer-events:none}

/* ---------- sign-in ---------- */
.signin{min-height:100vh;display:flex;flex-direction:column}
.signin .brand{background:var(--forest);color:#fff;text-align:center;padding:calc(env(safe-area-inset-top) + 48px) 16px 40px;position:relative;overflow:hidden}
.signin .brand h1{font-size:34px;position:relative}
.wrap{max-width:560px;width:100%;margin:0 auto;padding:20px 16px 48px}
.hello{color:var(--forest);margin-bottom:14px}

/* ---------- forms ---------- */
.card{background:var(--paper);border:1px solid var(--line);border-radius:var(--r);padding:20px}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}
.field label{font:600 15px "Source Sans 3";color:var(--forest)}
.field input{padding:13px 14px;border:2px solid var(--tan);border-radius:12px;background:#fff;color:var(--ink);font-size:17px;width:100%}
.field input:focus{outline:none;border-color:var(--moss)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:13px 18px;border-radius:12px;border:0;font:600 17px "Source Sans 3";text-decoration:none}
.btn svg{width:20px;height:20px}
.btn.orange{background:var(--blaze);color:#fff}
.btn.orange:disabled{opacity:.6}
.btn.light{background:#fff;color:var(--forest);border:1px solid var(--line)}
.btn.small{padding:8px 12px;font-size:15px;border-radius:10px}
.btn.full{width:100%}
.err{color:var(--blaze-dark);font-weight:600;margin-bottom:12px;min-height:1px}
.stack{display:flex;flex-direction:column;gap:10px;margin-top:16px}

/* ---------- layout (phone first) ---------- */
.layout{min-height:100vh;padding-bottom:calc(84px + env(safe-area-inset-bottom))}
.topbar{background:var(--forest);color:#fff;padding:calc(env(safe-area-inset-top) + 8px) 16px 12px;display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:5;overflow:hidden}
.topbar .ttl{flex:1;text-align:center;font-size:22px;position:relative;line-height:1.2}
.topbar .who{display:block;font:600 14px "Source Sans 3";letter-spacing:.02em;opacity:.8;margin-top:1px}
.topbar .who:empty{display:none}
.iconbtn{width:44px;height:44px;border-radius:12px;background:rgba(255,255,255,.1);color:#fff;display:grid;place-items:center;position:relative;flex-shrink:0}
.iconbtn svg{width:24px;height:24px}
.spacer{width:44px;flex-shrink:0}
.desk-only{display:none!important}
.main{min-width:0}
.page{max-width:620px;margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:14px}
.ptitle{font-size:30px;color:var(--forest);text-align:center;margin:4px 0 6px}

/* search */
.search{display:flex;align-items:center;gap:10px;background:#fff;border:2px solid var(--tan);border-radius:14px;padding:10px 14px}
.search svg{width:22px;height:22px;color:var(--moss)}
.search input{flex:1;border:0;outline:0;background:transparent;font-size:17px;min-width:0;-webkit-appearance:none}
.search .mic{color:var(--blaze);display:grid}

/* sections, lists, tiles */
.sectionhead{font:600 15px Oswald;text-transform:uppercase;letter-spacing:.08em;color:var(--moss);margin:6px 0 -4px 2px}
.list{background:var(--paper);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.row{display:flex;gap:12px;align-items:center;padding:14px;border-bottom:1px solid var(--line);width:100%;text-align:left}
.row:last-child{border-bottom:0}
.row .ic,.tile .ic,.opt .ic{width:40px;height:40px;border-radius:10px;background:var(--tan-2);color:var(--forest);display:grid;place-items:center;flex-shrink:0}
.row .ic svg,.tile .ic svg{width:21px;height:21px}
.row .t{font:600 17px "Source Sans 3";flex:1}
.row .chev{color:var(--olive);display:grid}
.row .chev svg{width:20px;height:20px}
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tile{background:var(--paper);border:1px solid var(--line);border-radius:var(--r);padding:14px;display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-height:104px;text-align:left;font:600 17px "Source Sans 3";line-height:1.2}
.tile:hover,.row:hover{border-color:var(--moss)}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px}
.chip{flex-shrink:0;padding:9px 14px;border-radius:999px;border:1px solid var(--line);background:#fff;font:600 15px "Source Sans 3"}
.chip.on{background:var(--forest);color:#fff;border-color:var(--forest)}
.pick{display:flex;align-items:center;gap:14px;padding:14px;border-bottom:1px solid var(--line);font:600 17px "Source Sans 3"}
.pick:last-child{border-bottom:0}
.pick input{width:24px;height:24px;accent-color:var(--moss);flex-shrink:0}

/* documents */
.stackgap{display:flex;flex-direction:column;gap:14px}
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.card-pick{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:10px 6px;display:flex;flex-direction:column;align-items:center;gap:6px;font:600 15px "Source Sans 3";line-height:1.15;text-align:center}
.card-pick .ic{width:34px;height:34px;border-radius:9px;background:var(--tan-2);color:var(--forest);display:grid;place-items:center}
.card-pick .ic svg{width:19px;height:19px}
.card-pick.on{background:var(--forest);color:#fff;border-color:var(--forest)}
.card-pick.on .ic{background:rgba(255,255,255,.16);color:#fff}
.row.doc .t{font-size:16px;line-height:1.3;word-break:break-word}
.row .sub{display:block;font:400 14px "Source Sans 3";color:var(--muted);margin-top:2px}
.row .why{display:block;font:400 14px "Source Sans 3";color:var(--blaze-dark);margin-top:2px}
.docname{font:600 19px "Source Sans 3";line-height:1.3;color:var(--ink);word-break:break-word}
.viewer{width:100%;height:calc(100vh - 260px);min-height:420px;border:1px solid var(--line);border-radius:var(--r);background:#fff}
.empty{text-align:center;color:var(--muted);padding:20px}
.impline{font-size:17px;padding:4px 0}
.impline b{font-family:Oswald;font-size:20px;color:var(--forest);display:inline-block;min-width:36px}
.field input[type=file]{padding:10px;font-size:15px}
a.btn{cursor:pointer}

/* blood work dashboard */
.hero{background:var(--forest);color:#fff;border-radius:16px;padding:16px;position:relative;overflow:hidden;display:flex;flex-direction:column;align-items:flex-start;text-align:left;width:100%}
.hero>span{position:relative}
.hero .k{font:600 13px Oswald;text-transform:uppercase;letter-spacing:.08em;opacity:.75}
.hero .d{font:700 26px Oswald;margin-top:2px}
.hero .s{font-size:15px;opacity:.85}
.hero .n{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.hero .n span{background:rgba(255,255,255,.14);border-radius:999px;padding:5px 12px;font:600 14px "Source Sans 3"}
.hero .n .w{background:var(--blaze)}
.arow{display:flex;align-items:center;gap:10px;padding:11px 14px;border-bottom:1px solid var(--line)}
.arow:last-child{border-bottom:0}
.an{flex:1;display:flex;flex-direction:column;min-width:0}
.an b{font:600 16px "Source Sans 3"}
.an span{font-size:13px;color:var(--muted)}
.av{font:700 18px Oswald;white-space:nowrap}
.av small{font:400 12px "Source Sans 3";color:var(--muted)}
.arr{font-size:11px;margin-right:4px;vertical-align:2px;color:var(--muted)}
.flag{font:700 11px "Source Sans 3";text-transform:uppercase;letter-spacing:.05em;padding:3px 8px;border-radius:6px;min-width:44px;text-align:center}
.flag.high{background:#FCE3D3;color:var(--blaze-dark)}
.flag.low{background:#DCE7EF;color:#2f5d7c}
.seeall{display:block;width:100%;padding:12px;text-align:center;font:600 15px "Source Sans 3";color:var(--forest);border-top:1px solid var(--line)}
.cats{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.cat{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:12px;display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-align:left}
.cat:hover{border-color:var(--moss)}
.ci{width:36px;height:36px;border-radius:10px;background:var(--tan-2);color:var(--forest);display:grid;place-items:center;margin-bottom:4px}
.ci svg{width:20px;height:20px}
.cn{font:600 17px "Source Sans 3";line-height:1.15}
.cd{font-size:13px;color:var(--muted)}
.st{font:700 12px "Source Sans 3";margin-top:4px;padding:2px 8px;border-radius:6px}
.st.ok{background:#DDE5CF;color:var(--moss)}
.st.warn{background:#FCE3D3;color:var(--blaze-dark)}
.row .cnt{color:var(--muted);font-size:14px}
.cat.big{min-height:116px;padding:14px;gap:8px;position:relative}
.cat.big .ci{width:40px;height:40px}
.cat.big .cn{font-size:18px;margin-top:auto}
.cat.big .cs{font:400 14px "Source Sans 3";color:var(--muted);line-height:1.3;margin-top:-4px}
.cat .cc{position:absolute;top:14px;right:14px;min-width:30px;height:30px;border-radius:15px;background:var(--blaze);color:#fff;font:700 16px Oswald;display:grid;place-items:center;padding:0 8px}
.report{display:flex;flex-direction:column;gap:10px}
.report .sectionhead{margin:10px 2px 0}
.rt{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:14px 16px}
.rn{font:600 19px "Source Sans 3"}
.rv{display:flex;align-items:baseline;gap:8px;margin-top:4px}
.rv b{font:700 34px Oswald;line-height:1}
.rv small{font-size:15px;color:var(--muted)}
.rv .flag{align-self:center;font-size:13px}
.rr{font-size:16px;color:var(--muted);margin-top:6px}
.rt details{margin-top:10px;border-top:1px solid var(--line);padding-top:8px}
.rt summary{font:600 16px "Source Sans 3";color:var(--forest);cursor:pointer}
.rh{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--line);font-size:17px}
.rh:last-child{border-bottom:0}
.rh>span:first-child{flex:1;color:var(--muted)}
.rh b{font:700 19px Oswald;min-width:56px;text-align:right}
.rh .flag{min-width:52px}
.pc{background:var(--paper);border:1px solid var(--line);border-radius:16px;padding:14px 16px}
.ph{font:600 22px Oswald;color:var(--forest);display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}
.ph .cc{min-width:30px;height:30px;border-radius:15px;background:var(--blaze);color:#fff;font:700 16px Oswald;display:grid;place-items:center;padding:0 8px}
.pr{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.pn{flex:1;font:600 17px "Source Sans 3";min-width:0}
.pv{white-space:nowrap}
.pv b{font:700 22px Oswald}
.pv small{font-size:13px;color:var(--muted);margin-left:4px}
.pr .flag{min-width:52px;font-size:12px}
.pc details{margin-top:6px}
.pc summary{font:600 17px "Source Sans 3";color:var(--forest);cursor:pointer;padding:10px 0 4px}
.pt{border-top:1px solid var(--line);padding:14px 0 6px}
.pt:first-of-type{border-top:0}
.ptn{font:600 18px "Source Sans 3";display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 10px}
.ptn span{font:400 15px "Source Sans 3";color:var(--muted)}
.chart{width:100%;height:auto;display:block;margin:8px 0 4px}
.chart .band{fill:#DDE5CF}
.chart .ln{fill:none;stroke:var(--forest);stroke-width:2}
.chart circle.hi{fill:var(--blaze-dark)}
.chart circle.lo{fill:#2f5d7c}
.chart circle.ok{fill:var(--moss)}
.chart .ax{font:13px "Source Sans 3";fill:var(--muted)}
.page.full{max-width:none;padding:0;gap:0}
.fullview,.fullframe{display:block;width:100%;border:0;background:#fff}
.fullframe{height:calc(100vh - 148px - env(safe-area-inset-top) - env(safe-area-inset-bottom));height:calc(100dvh - 148px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
.floatback{display:none}
.layout.immersive{padding-bottom:0}
.layout.immersive .topbar,.layout.immersive .tabbar{display:none}
.layout.immersive .fullframe{height:calc(100vh - env(safe-area-inset-top));height:calc(100dvh - env(safe-area-inset-top))}
.layout.immersive .fullview{padding-top:env(safe-area-inset-top)}
.layout.immersive .floatback{display:grid;place-items:center;position:fixed;z-index:7;left:14px;bottom:calc(env(safe-area-inset-bottom) + 16px);width:52px;height:52px;border-radius:26px;background:var(--forest);color:#fff;box-shadow:0 2px 8px rgba(0,0,0,.25)}
.layout.immersive .floatback svg{width:24px;height:24px}

/* people */
.person{padding:16px;border-bottom:1px solid var(--line)}
.person:last-child{border-bottom:0}
.person .t{font:600 18px "Source Sans 3"}
.person .m{font-size:15px;color:var(--muted);margin-top:2px}
.tag{display:inline-block;font:700 12px "Source Sans 3";text-transform:uppercase;letter-spacing:.05em;padding:2px 8px;border-radius:6px;margin-left:8px;vertical-align:2px}
.tag.ok{background:#DDE5CF;color:var(--moss)}
.tag.wait{background:#FCE3D3;color:var(--blaze-dark)}
.device{display:flex;align-items:center;gap:10px;margin-top:10px;font-size:15px}
.device span{flex:1}
.linkbox{margin-top:12px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:14px;word-break:break-all}
.row-actions{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}

/* bottom tab bar */
.tabbar{position:fixed;bottom:0;left:0;right:0;height:calc(84px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:var(--paper);border-top:1px solid var(--line);display:flex;justify-content:space-around;align-items:flex-start;padding-top:8px;z-index:6}
.tabbar button{display:flex;flex-direction:column;align-items:center;gap:3px;font:600 12px "Source Sans 3";color:var(--muted);width:64px}
.tabbar button svg{width:26px;height:26px}
.tabbar button.on{color:var(--forest)}
.tabbar .add{margin-top:-22px}
.tabbar .add .plus{width:60px;height:60px;border-radius:50%;background:var(--blaze);color:#fff;display:grid;place-items:center;box-shadow:0 4px 12px rgba(227,97,27,.4);border:4px solid var(--paper)}
.tabbar .add .plus svg{width:28px;height:28px}

/* drawer and sheet */
.scrim{position:fixed;inset:0;background:rgba(20,24,18,.45);z-index:20;display:none}
.scrim.on{display:block}
.drawer{position:fixed;top:0;bottom:0;left:0;width:min(86%,340px);background:var(--paper);z-index:21;transform:translateX(-100%);transition:transform .25s;display:flex;flex-direction:column}
.drawer.on{transform:none}
.drawer .head{background:var(--forest);color:#fff;padding:calc(env(safe-area-inset-top) + 24px) 18px 18px;position:relative;overflow:hidden}
.drawer .head h2{font-size:24px;position:relative}
.drawer .items{overflow-y:auto;padding:8px 0 24px}
.mi{display:flex;align-items:center;gap:12px;padding:12px 18px;font:600 17px "Source Sans 3";text-align:left;color:var(--ink);width:100%;border-left:4px solid transparent}
.mi:hover{background:var(--tan-2)}
.mi.on{background:var(--tan-2);border-left-color:var(--blaze)}
.mi svg{width:20px;height:20px;color:var(--moss)}
.mi .n{font:600 14px Oswald;color:var(--olive);width:22px;flex-shrink:0}
.mi.full{color:var(--blaze-dark)}
.divider{font:600 13px Oswald;text-transform:uppercase;letter-spacing:.08em;color:var(--olive);padding:14px 18px 4px}
.sheet{position:fixed;left:0;right:0;bottom:0;background:var(--paper);border-radius:22px 22px 0 0;z-index:21;padding:10px 16px calc(28px + env(safe-area-inset-bottom));transform:translateY(105%);transition:transform .25s}
.sheet.on{transform:none}
.sheet .grab{width:44px;height:5px;border-radius:3px;background:var(--line);margin:0 auto 14px}
.sheet h3{font-size:22px;color:var(--forest);margin-bottom:12px}
.opt{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid var(--line);border-radius:14px;margin-bottom:10px;background:#fff;width:100%;text-align:left;font:600 18px "Source Sans 3"}

/* ---------- computer ---------- */
@media (min-width:900px) and (hover:hover) and (pointer:fine){
  .phone-only{display:none!important}
  .desk-only{display:revert!important}
  .layout{display:grid;grid-template-columns:280px 1fr;grid-template-rows:auto 1fr;height:100vh;padding-bottom:0}
  .topbar{grid-column:1/-1;padding:12px 24px;gap:20px}
  .topbar .ttl{display:none}
  .topbar .brand{display:block!important;font:700 24px Oswald;letter-spacing:.02em;position:relative;min-width:236px}
  .topbar .brand .who{margin-top:-2px}
  .desknav{display:flex!important;gap:4px;margin-left:auto;position:relative}
  .desknav button{display:flex;align-items:center;gap:8px;color:#fff;font:600 16px "Source Sans 3";padding:10px 14px;border-radius:10px;opacity:.85}
  .desknav button svg{width:20px;height:20px}
  .desknav button:hover{background:rgba(255,255,255,.1);opacity:1}
  .desknav button.on{background:rgba(255,255,255,.16);opacity:1}
  .topbtn{display:flex!important;align-items:center;gap:8px;position:relative;color:#fff;background:var(--blaze);font:600 16px "Source Sans 3";padding:10px 14px;border-radius:10px;white-space:nowrap}
  .topbtn svg{width:20px;height:20px}
  .topbtn:hover{background:var(--blaze-dark)}
  .tiles.four{grid-template-columns:repeat(4,1fr)}
  .shareopts{display:grid!important;grid-template-columns:repeat(3,1fr);gap:10px}
  .shareopts .opt{margin-bottom:0}
  .side{display:block!important;background:var(--paper);border-right:1px solid var(--line);overflow-y:auto;padding:14px 0}
  .main{overflow-y:auto}
  .page{max-width:1100px;padding:28px 32px 48px}
  .ptitle{display:block!important}
  .tiles{grid-template-columns:repeat(4,1fr)}
  .tile{flex-direction:row;align-items:center;min-height:0;padding:18px}
  .sheet{left:50%;right:auto;bottom:auto;top:50%;width:520px;border-radius:18px;transform:translate(-50%,-50%) scale(.96);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
  .sheet.on{transform:translate(-50%,-50%);opacity:1;pointer-events:auto}
  .sheet .grab{display:none}
  .list,.search,.chips,.stack{max-width:none}
  .viewer{height:calc(100vh - 250px)}
  .cats{grid-template-columns:repeat(4,1fr)}
  .page.full{padding:0}
  .fullframe{height:calc(100vh - 68px)}
  .main{position:relative}
  .layout.fullpage .floatback{display:grid;place-items:center;position:fixed;z-index:7;left:300px;bottom:24px;width:52px;height:52px;border-radius:26px;background:var(--forest);color:#fff;box-shadow:0 2px 8px rgba(0,0,0,.25)}
  .layout.fullpage .floatback svg{width:24px;height:24px}
}

/* ---------- care team ---------- */
.tplace{display:flex;flex-direction:column;gap:10px}
.tname{font:600 21px Oswald;color:var(--forest);letter-spacing:.02em}
.tinfo{color:var(--muted);font-size:16px;line-height:1.35}
.tinfo .tf{color:var(--ink)}
.trow{padding:13px 16px;border-bottom:1px solid var(--line);line-height:1.35}
.trow:last-child{border-bottom:0}
.trow .tl{color:var(--muted);font-size:15px;margin-top:2px}
.callbtn{display:inline-flex;align-items:center;gap:8px;margin:6px 0 2px;padding:10px 16px;border-radius:12px;background:var(--blaze);color:#fff;font:600 16px "Source Sans 3";text-decoration:none;white-space:nowrap}
.callbtn svg{width:18px;height:18px}
.profbtn{display:inline-flex;align-items:center;margin-top:10px;padding:9px 14px;border-radius:12px;border:1px solid var(--forest);color:var(--forest);background:#fff;font:600 15px "Source Sans 3"}
.pop{position:fixed;inset:0;z-index:30;background:rgba(20,24,18,.45);display:flex;align-items:center;justify-content:center;padding:16px}
.popcard{position:relative;background:var(--paper);border-radius:18px;width:100%;max-width:560px;max-height:85vh;overflow-y:auto;padding:22px 20px 24px;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.popx{position:absolute;top:10px;right:10px;width:40px;height:40px;border-radius:20px;background:var(--tan-2);color:var(--forest);font:600 26px/1 "Source Sans 3";display:grid;place-items:center}
.popbody{display:flex;flex-direction:column;gap:8px;font-size:16px;line-height:1.45}
.popbody h3{font-size:22px;color:var(--forest);padding-right:44px}
.popbody .sectionhead{margin:10px 0 0}
.popbody ul{padding-left:20px;display:flex;flex-direction:column;gap:4px}
.popbody hr{border:0;border-top:1px solid var(--line);margin:8px 0}
.ptable{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fff}
.prow{padding:10px 14px;border-bottom:1px solid var(--line)}
.prow:last-child{border-bottom:0}
.pfl{font:600 13px Oswald;text-transform:uppercase;letter-spacing:.06em;color:var(--moss);margin-bottom:3px}
.pfv{display:flex;flex-direction:column;gap:3px}
.popbody a{color:var(--forest);font-weight:600}
.popbody hr~p{font-size:13px;color:var(--muted)}

/* ---------- medications ---------- */
.medwrap{overflow-x:auto;background:var(--paper);border:1px solid var(--line);border-radius:14px;-webkit-overflow-scrolling:touch}
.medtable{border-collapse:separate;border-spacing:0;width:100%;min-width:900px}
.medtable th,.medtable td{text-align:left;vertical-align:top;padding:12px 14px;border-bottom:1px solid var(--line);font-size:16px;line-height:1.35}
.medtable th{background:#fff;font:600 13px Oswald;text-transform:uppercase;letter-spacing:.06em;color:var(--moss)}
.medtable tr:last-child td{border-bottom:0}
.medtable td:first-child,.medtable th:first-child{position:sticky;left:0;background:var(--paper);width:160px;min-width:160px;box-shadow:1px 0 0 var(--line);z-index:1}
.medtable th:first-child{background:#fff}
.medtable td:first-child b{display:block;font-size:17px}
.medtable td:first-child span{display:block;color:var(--muted);font-size:14px}
.medtable .chg{color:var(--blaze-dark);font-weight:600}
.medtable .small{color:var(--muted);font-size:14px}
.medstop details{background:var(--paper);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.medstop summary{list-style:none;cursor:pointer;padding:14px 16px;display:flex;align-items:center;gap:6px 12px;flex-wrap:wrap}
.medstop summary::-webkit-details-marker{display:none}
.medstop summary::after{content:"\25B8";margin-left:auto;color:var(--olive);font-size:18px}
.medstop details[open] summary::after{content:"\25BE"}
.medstop summary b{font-size:17px}
.medstop .when{color:var(--muted);font-size:15px}
.medstop .dbody{padding:12px 16px 16px;display:grid;grid-template-columns:110px 1fr;gap:8px 14px;border-top:1px solid var(--line)}
.medstop .dbody div:nth-child(odd){font:600 13px Oswald;text-transform:uppercase;letter-spacing:.06em;color:var(--moss);padding-top:3px}
.medtable td:nth-child(2){min-width:120px}
.medtable td:nth-child(3){min-width:240px}
.medtable td:nth-child(4),.medtable td:nth-child(5),.medtable td:nth-child(6){min-width:170px}
.medstop .slist{border-top:1px solid var(--line);padding:4px 16px 10px}
.medstop .slist div{padding:9px 0;border-bottom:1px solid var(--line)}
.medstop .slist div:last-child{border-bottom:0}

/* ---------- add ---------- */
body.adding .tabbar{z-index:22}
body.adding .tabbar .add .plus svg{transform:rotate(45deg)}
.sheet{bottom:calc(84px + env(safe-area-inset-bottom));padding-bottom:20px;transform:translateY(calc(100% + 120px));visibility:hidden;pointer-events:none;transition:transform .25s,visibility .25s}
.sheet.on{visibility:visible;pointer-events:auto}
.addtwo{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.addbig{background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px 12px;display:flex;flex-direction:column;align-items:center;gap:12px;font:600 19px "Source Sans 3"}
.addbig .bi{width:64px;height:64px;border-radius:50%;background:var(--blaze);color:#fff;display:grid;place-items:center}
.addbig .bi.g{background:var(--forest)}
.addbig .bi svg{width:30px;height:30px}
label.opt{cursor:pointer}
.rec{display:flex;flex-direction:column;align-items:center;gap:12px;padding:10px 0 6px}
.recbtn{width:110px;height:110px;border-radius:50%;background:var(--blaze);color:#fff;display:grid;place-items:center;box-shadow:0 8px 24px rgba(227,97,27,.35)}
.recbtn svg{width:52px;height:52px}
.rectime{font:600 22px Oswald;color:var(--forest)}
.drop{display:flex;flex-direction:column;align-items:center;gap:8px;padding:28px 16px;border:2px dashed var(--tan);border-radius:16px;background:#fff;margin-bottom:10px;cursor:pointer;text-align:center}
.drop.over{border-color:var(--blaze);background:#FFF6EF}
.drop b{font:600 18px "Source Sans 3"}
.drop .ic{width:48px;height:48px;border-radius:12px;background:var(--tan-2);color:var(--forest);display:grid;place-items:center}
.drop .ic svg{width:24px;height:24px}
.pastebox{width:100%;border:2px solid var(--tan);border-radius:12px;padding:12px;font:17px/1.4 "Source Sans 3";margin-bottom:12px;resize:vertical;background:#fff}
@media (min-width:900px) and (hover:hover) and (pointer:fine){
  .sheet{left:auto;right:24px;top:70px;bottom:auto;width:360px;transform:translateY(-6px);opacity:0;pointer-events:none;transition:opacity .15s,transform .15s;padding:12px 12px 14px;box-shadow:0 12px 30px rgba(0,0,0,.2);border:1px solid var(--line)}
  .sheet.on{transform:none;opacity:1;pointer-events:auto}
  .scrim.on{background:transparent}
}

/* ---------- home: search arrow, Next Appointment and Urgent ---------- */
.search .arrow{color:var(--olive);display:grid}
.search .arrow svg{width:20px;height:20px}
.glances{display:flex;flex-direction:column;gap:10px}
.glances[hidden]{display:none!important}
.glance{background:var(--paper);border:1px solid var(--line);border-radius:var(--r);padding:10px 12px 8px}
.glance .gh{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}
.glance .gh span{font:600 14px Oswald;text-transform:uppercase;letter-spacing:.08em;color:var(--moss)}
.glance .gh.urgent span{color:var(--blaze-dark)}
.glance .gx{width:30px;height:30px;border-radius:15px;background:var(--tan-2);color:var(--forest);font:600 20px/1 "Source Sans 3";display:grid;place-items:center}
.gline{display:flex;align-items:center;gap:10px;padding:7px 0;border-top:1px solid var(--line);font:600 16px "Source Sans 3";line-height:1.25}
.gline:first-of-type{border-top:0}
.gline .sm{display:block;font:400 14px "Source Sans 3";color:var(--muted)}
.gline svg{width:20px;height:20px;color:var(--forest);flex-shrink:0}
.gline .box{width:22px;height:22px;border:2px solid var(--moss);border-radius:6px;flex-shrink:0}
.gline .box.u{border-color:var(--blaze)}
.gsub{font:600 13px "Source Sans 3";text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:8px 0 0}

/* ---------- Share My Chart ---------- */
.ck{display:flex;align-items:center;gap:12px;padding:13px 14px;border-bottom:1px solid var(--line);font:600 17px "Source Sans 3";cursor:pointer}
.ck:last-child{border-bottom:0}
.ck.sub{padding-left:46px;font-weight:400;font-size:16px}
.ck.all{background:var(--tan-2)}
.ck .bx{width:24px;height:24px;border:2px solid var(--moss);border-radius:6px;display:grid;place-items:center;flex-shrink:0;background:#fff;color:#fff}
.ck .bx svg{width:16px;height:16px;opacity:0}
.ck .bx.on{background:var(--moss)}
.ck .bx.on svg{opacity:1}
.seg{display:grid;grid-template-columns:1fr 1fr;background:#fff;border:2px solid var(--tan);border-radius:12px;overflow:hidden}
.seg button{padding:11px;font:600 16px "Source Sans 3";color:var(--forest)}
.seg button.on{background:var(--forest);color:#fff}
.dates{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.dates[hidden]{display:none}
.dates label{display:flex;flex-direction:column;gap:4px;font:600 14px "Source Sans 3";color:var(--forest)}
.dates input{padding:11px;border:2px solid var(--tan);border-radius:12px;font-size:16px;background:#fff;min-width:0}
.sharebar{position:sticky;bottom:calc(84px + env(safe-area-inset-bottom));padding:12px 0 4px;background:var(--canvas)}
@media (min-width:900px) and (hover:hover) and (pointer:fine){
  .glances{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start}
  .tile.desk-only{display:flex!important}
}
.opt .ic svg{width:21px;height:21px}

/* ---------- hospital and provider notes ---------- */
.vhead{background:var(--forest);color:#fff;border-radius:16px;padding:14px 16px;position:relative;overflow:hidden}
.vhead>div{position:relative}
.vhead .k{font:600 13px Oswald;text-transform:uppercase;letter-spacing:.08em;opacity:.75}
.vhead .d{font:700 24px Oswald;margin-top:2px}
.vhead .s{font-size:16px;opacity:.9}
.grp{background:var(--paper);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.grp summary{list-style:none;cursor:pointer;padding:14px 16px;display:flex;align-items:center;font:600 17px "Source Sans 3"}
.grp summary::-webkit-details-marker{display:none}
.grp summary::after{content:"\25B8";margin-left:auto;color:var(--olive);font-size:18px}
.grp[open] summary::after{content:"\25BE"}
.grp .list{border:0;border-top:1px solid var(--line);border-radius:0}

/* ---------- back arrow on the computer, PDF reader ---------- */
.phead{position:relative}
.pback{position:absolute;left:0;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:22px;background:var(--forest);color:#fff;display:grid;place-items:center}
.pback svg{width:22px;height:22px}
.phead .ptitle{padding:0 56px}
.pdfview{background:#E4DFD3;padding:12px 8px 96px;min-height:100vh}
.pdfview canvas{display:block;width:100%;max-width:900px;height:auto;margin:0 auto 12px;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.2)}
@media (min-width:900px) and (hover:hover) and (pointer:fine){
  .pdfview{padding:24px 24px 96px;min-height:calc(100vh - 68px)}
}

/* ---------- back button: always top left, stays in view while scrolling ---------- */
.layout.immersive .floatback{top:calc(env(safe-area-inset-top) + 12px);bottom:auto;left:12px}
.layout.immersive .fullview{padding-top:calc(env(safe-area-inset-top) + 72px)}
.layout.immersive .fullframe{height:calc(100vh - env(safe-area-inset-top) - 72px);height:calc(100dvh - env(safe-area-inset-top) - 72px)}
.phead{position:sticky;top:0;z-index:4;background:var(--canvas);padding:6px 0}
@media (min-width:900px) and (hover:hover) and (pointer:fine){
  .layout.fullpage .floatback{top:92px;bottom:auto;left:300px}
}

/* ---------- print and download ---------- */
.doctools{display:none}
.layout.immersive .doctools,.layout.fullpage .doctools{display:flex;gap:10px;position:fixed;z-index:7;top:calc(env(safe-area-inset-top) + 12px);right:12px}
.toolbtn{width:52px;height:52px;border-radius:26px;background:var(--forest);color:#fff;display:grid;place-items:center;box-shadow:0 2px 8px rgba(0,0,0,.25)}
.toolbtn svg{width:24px;height:24px}
.pdfview img{display:block;max-width:100%;max-width:min(100%,900px);height:auto;margin:0 auto;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.2)}
@media (min-width:900px) and (hover:hover) and (pointer:fine){
  .layout.fullpage .doctools{top:92px;right:24px}
}
@media print{
  .topbar,.tabbar,.side,.floatback,.doctools,.scrim,.drawer,.sheet{display:none!important}
  html,body,.layout,.main{display:block!important;height:auto!important;overflow:visible!important;background:#fff!important;padding:0!important}
  .layout.immersive .fullview,.fullview{padding:0!important}
  .pdfview{background:none;padding:0;min-height:0}
  .pdfview canvas,.pdfview img{box-shadow:none;margin:0 auto;width:auto;max-width:100%;max-height:96vh;break-after:page}
  @page{margin:10mm}
  .pdfview canvas:last-child{break-after:auto}
}

/* ---------- page title and search bar on every page ---------- */
.pbody{display:contents}
.phead{position:static;padding:0}
.pback{display:none}
.phead .ptitle{padding:0;margin:2px 0 0}
@media (min-width:900px) and (hover:hover) and (pointer:fine){
  .phead{position:sticky;padding:6px 0}
  .pback{display:grid}
  .phead .ptitle{padding:0 56px;margin:4px 0 6px}
}

/* ---------- print button on a page ---------- */
.pprint{position:absolute;right:0;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:22px;background:var(--forest);color:#fff;display:grid;place-items:center}
.pprint svg{width:22px;height:22px}
.phead.hasprint .ptitle{padding:0 56px}
@media print{
  .phead .pback,.phead .pprint,.page>.search,#results{display:none!important}
  .phead{position:static!important}
  .page{max-width:none!important;padding:0!important}
  .medwrap{overflow:visible!important;border:0}
  .medtable{min-width:0!important}
  .medtable td:first-child,.medtable th:first-child{position:static;box-shadow:none}
  .medstop summary::after{content:""!important}
}

/* ---------- care team: Call buttons line up at the right ---------- */
.tf:has(.callbtn),.tl:has(.callbtn){display:flex;align-items:center;flex-wrap:wrap;column-gap:10px}
.tf .callbtn,.tl .callbtn{margin-left:auto}

/* ---------- calendar and appointments ---------- */
.calbar{display:flex;gap:10px;align-items:center}
.calbar .seg{flex:1}
.seg.three{grid-template-columns:1fr 1fr 1fr}
.addcal{display:flex;align-items:center;gap:8px;background:var(--blaze);color:#fff;font:600 16px "Source Sans 3";padding:11px 14px;border-radius:12px;white-space:nowrap}
.addcal svg{width:20px;height:20px}
.calnav{display:flex;align-items:center;justify-content:space-between}
.calnav b{font:600 20px Oswald;color:var(--forest);text-align:center}
.calnav button{width:40px;height:40px;border-radius:20px;background:var(--tan-2);color:var(--forest);display:grid;place-items:center}
.calnav svg{width:20px;height:20px}
.mgrid{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:10px;display:grid;grid-template-columns:repeat(7,1fr);gap:4px;text-align:center}
.mgrid .dw{font:600 12px "Source Sans 3";color:var(--muted);text-transform:uppercase;padding-bottom:4px}
.mday{font:600 16px "Source Sans 3";padding:8px 0 10px;border-radius:10px;position:relative;min-height:44px;cursor:pointer}
.mday.o{color:#b9b3a3}
.mday.t{outline:2px solid var(--forest);outline-offset:-2px}
.mday.sel{background:var(--forest);color:#fff}
.mday .dot{position:absolute;left:50%;bottom:5px;width:7px;height:7px;margin-left:-3.5px;border-radius:4px;background:var(--blaze)}
.mday .chip{display:none}
.ev{display:flex;gap:12px;align-items:flex-start;padding:14px;border-bottom:1px solid var(--line);width:100%;text-align:left}
.ev:last-child{border-bottom:0}
.ev .tm{font:600 15px "Source Sans 3";color:var(--forest);min-width:72px;padding-top:2px}
.ev .tm:empty{display:none}
.ev .bar{width:4px;align-self:stretch;border-radius:2px;background:var(--blaze)}
.ev .bar.fam{background:var(--moss)}
.ev .t{font:600 17px "Source Sans 3";flex:1;line-height:1.25}
.ev .sub{display:block;font:400 14px "Source Sans 3";color:var(--muted);margin-top:2px}
.ev .chev{color:var(--olive);display:grid}
.ev .chev svg{width:20px;height:20px}
.wk .wd{display:flex;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line)}
.wk .wd:last-child{border-bottom:0}
.wk .wn{min-width:54px;font:600 14px "Source Sans 3";color:var(--muted);text-transform:uppercase}
.wk .wn b{display:block;font:600 22px Oswald;color:var(--forest)}
.wk .wd.t .wn b{color:var(--blaze-dark)}
.wk .wi{flex:1;display:flex;flex-direction:column;gap:6px;min-width:0}
.wk .wi .ev,.hours .hr .ev{padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:#fff}
.hours .hr{display:flex;gap:10px;min-height:44px;border-top:1px solid var(--line);padding:6px 14px}
.hours .hr:first-child{border-top:0}
.hours .hl{min-width:64px;font:600 13px "Source Sans 3";color:var(--muted);padding-top:2px}
.hours .hr .ev{flex:1}
.ftext{font:600 15px "Source Sans 3";color:var(--forest);display:flex;flex-direction:column;gap:4px}
.ftext input{padding:11px;border:2px solid var(--tan);border-radius:12px;font:16px "Source Sans 3";background:#fff;min-width:0}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (min-width:900px) and (hover:hover) and (pointer:fine){
  .calbar .seg{flex:0 0 360px}
  .calbar .addcal{margin-left:auto}
  .mgrid{gap:0;padding:0;overflow:hidden}
  .mgrid .dw{padding:10px 0;border-bottom:1px solid var(--line)}
  .mday{min-height:110px;border-radius:0;text-align:left;padding:8px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
  .mday:nth-child(7n){border-right:0}
  .mday.sel{background:var(--tan-2);color:var(--ink)}
  .mday .dot{display:none}
  .mday .chip{display:block;margin-top:6px;background:#FCE3D3;color:var(--blaze-dark);font:600 13px "Source Sans 3";border-radius:6px;padding:4px 6px;line-height:1.2;cursor:pointer}
  .mday .chip.fam{background:#DDE5CF;color:var(--moss)}
  .wk{display:grid;grid-template-columns:repeat(7,1fr)}
  .wk .wd{flex-direction:column;border-bottom:0;border-right:1px solid var(--line);min-height:360px}
  .wk .wd:last-child{border-right:0}
  .wk .wi .ev{flex-direction:column;gap:2px}
  .wk .wi .ev .bar,.wk .wi .ev .chev{display:none}
}

/* ---------- add to calendar: confirm, reading, recording, longer forms ---------- */
.cfcard{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 16px;display:flex;flex-direction:column;gap:3px;margin-bottom:12px;font-size:16px;line-height:1.35}
.cfcard b{font:600 19px "Source Sans 3";color:var(--forest)}
.cfcard .s{color:var(--muted)}
.btnrow{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.reading{display:grid;place-items:center;padding:28px 0}
.spin{width:44px;height:44px;border-radius:50%;border:4px solid var(--tan-2);border-top-color:var(--blaze);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.recbtn.on{background:var(--blaze-dark);animation:pulse 1.2s ease-in-out infinite}
@keyframes pulse{50%{box-shadow:0 0 0 14px rgba(227,97,27,.18)}}
.sheet{max-height:calc(100vh - 110px - env(safe-area-inset-bottom));overflow-y:auto}
.sheet .err:empty{display:none}
@media (min-width:900px) and (hover:hover) and (pointer:fine){
  .sheet{max-height:calc(100vh - 90px)}
}

/* ---------- adding files and the Inbox ---------- */
.minispin{display:inline-block;width:16px;height:16px;border-radius:50%;border:3px solid var(--tan-2);border-top-color:var(--blaze);animation:spin .8s linear infinite;vertical-align:-3px}
.revbar{display:flex;gap:8px;align-items:center;margin-top:10px;flex-wrap:wrap}
.revsel{flex:1;min-width:160px;padding:9px 10px;border:2px solid var(--tan);border-radius:10px;background:#fff;font:16px "Source Sans 3"}
.trow .err:empty{display:none}
.trow .err{margin:6px 0 0}

/* ---------- scanned pages before saving ---------- */
.pages{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:10px;margin-bottom:12px}
.pages:empty{display:none}
.pg{position:relative;background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden;min-height:96px;display:grid;place-items:center}
.pg img{display:block;width:100%;height:auto}
.pg .pgn{position:absolute;left:6px;bottom:6px;background:var(--forest);color:#fff;font:600 13px "Source Sans 3";border-radius:10px;padding:1px 8px}
.pg .pgx{position:absolute;top:4px;right:4px;width:28px;height:28px;border-radius:14px;background:rgba(255,255,255,.92);color:var(--forest);font:600 20px/1 "Source Sans 3";display:grid;place-items:center}
.btn:disabled{opacity:.55}
.donebtn{margin-top:12px}
.row.revname{padding:0;border:0}
.gline[data-nav]{cursor:pointer}
.layout.immersive ~ .sheet{bottom:0;padding-bottom:calc(20px + env(safe-area-inset-bottom))}
