:root{--bg:#f6f7f3;--ink:#233e39;--muted:#78817c;--green:#215b50;--line:#e5e8e1;--pale:#eaf0e6;--rose:#bc7173}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-size:14px}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #acbd7c;outline-offset:3px}aside{position:fixed;width:240px;height:100dvh;padding:38px 24px 24px;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-size:21px;font-weight:650;letter-spacing:-1px}.brand-icon{display:grid;place-items:center;background:var(--green);color:white;width:37px;height:42px;border-radius:15px 15px 15px 4px;font-family:Georgia;font-style:italic;font-size:30px}.brand small{display:block;font-size:8px;letter-spacing:1.7px;margin-top:6px;color:var(--muted)}.nav-label{font-size:10px;letter-spacing:1.5px;color:#929a91;margin:55px 13px 18px}nav{display:grid;gap:7px}nav button{display:flex;gap:13px;align-items:center;border:0;background:none;color:#69766e;padding:14px 12px;text-align:left;border-radius:8px;font-size:19px}nav button span{font-size:13px}nav button.active{background:var(--pale);color:var(--green);font-weight:600}.aside-note{margin-top:auto;background:#f6f7f1;padding:21px;border-radius:12px}.leaf{font-size:27px;color:#8c9d70}.aside-note h3{font-family:Georgia;font-weight:400;font-size:21px;margin:12px 0}.aside-note p{font-size:12px;line-height:1.8;color:#7a8274}.local-label{font-size:10px;color:#7d8a76;margin:25px 4px 0}main{margin-left:240px;padding:0 46px;max-width:1560px}header{height:83px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted)}.page-title{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:38px 0 30px}.eyebrow{font-size:10px;letter-spacing:2px;color:#89947f;font-weight:600}h1{font-family:Georgia,serif;font-weight:400;letter-spacing:-1.8px;font-size:43px;margin:10px 0 12px}p{line-height:1.6}.page-title p{color:var(--muted);margin:0;font-size:13px}.primary,.outline{border-radius:7px;padding:13px 20px;border:1px solid transparent;white-space:nowrap}.primary{background:var(--green);color:#fff;box-shadow:0 3px 7px #215b5012}.primary:hover{background:#17473e}.outline{background:transparent;border-color:#dce2d8;color:var(--ink)}.small{padding:9px 13px;font-size:11px}.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:19px;font-weight:600;font-size:13px}.month-picker{display:flex;align-items:center;gap:10px;font-weight:400;color:var(--muted);font-size:11px}.month-picker input{width:158px;padding:8px;border:1px solid var(--line);border-radius:6px;background:white;color:var(--ink)}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-bottom:24px}.stat{background:white;border:1px solid var(--line);border-radius:11px;padding:21px}.stat-label{color:var(--muted);font-size:11px;display:flex;justify-content:space-between}.stat-label span{color:#849d83;font-size:15px}.stat strong{font-family:Georgia,serif;display:block;font-size:36px;font-weight:400;line-height:1;margin:19px 0 12px}.stat strong small{font-family:inherit;font-size:17px;color:#8c9689}.stat p{font-size:10px;color:#929b90;margin:0}.columns{display:grid;grid-template-columns:1.5fr 1fr;gap:24px}.card{background:white;border:1px solid var(--line);border-radius:12px;padding:24px;margin-bottom:23px}.card-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:24px}.card h2{font-size:15px;font-weight:600;margin:0}.subtle{font-size:11px;color:var(--muted);margin:7px 0 0}.calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:7px}.weekday{text-align:center;color:#98a092;font-size:10px;padding:4px 0 10px}.day{border:0;background:#f7f8f4;border-radius:6px;min-height:47px;position:relative;color:#586450;font-size:12px}.day:hover{box-shadow:inset 0 0 0 1px #9cac8b}.day.today{outline:1px solid #718c62;outline-offset:1px}.day.level1{background:#ecdfc1}.day.level2{background:#e4bc90}.day.level3{background:#cb9290;color:#472d32}.day i{position:absolute;width:4px;height:4px;border-radius:50%;background:currentColor;bottom:6px;left:calc(50% - 2px)}.legend{display:flex;flex-wrap:wrap;gap:14px;margin-top:20px;font-size:10px;color:#838b7d}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:5px}.insight{background:#edf1e7;border-color:#e1e9d8}.insight h2{font-family:Georgia;font-weight:400;font-size:24px;margin:16px 0 12px}.insight p{font-size:12px;color:#738269}.mini-chart{height:90px;display:flex;align-items:end;gap:8px;margin:25px 0 12px}.bar-wrap{flex:1;text-align:center;height:100%;display:flex;flex-direction:column;justify-content:end;gap:8px;color:var(--muted);font-size:10px}.bar{background:#a4b993;border-radius:4px 4px 0 0;min-height:2px}.empty{text-align:center;padding:25px 12px 30px;color:var(--muted)}.empty .symbol{font-size:30px;color:#a8b49d}.empty h3{font-family:Georgia;font-size:23px;font-weight:400;color:var(--ink);margin:13px 0 8px}.empty p{font-size:12px;max-width:300px;margin:0 auto 17px}.text-button{background:none;border:0;color:var(--green);font-size:12px;padding:6px}.entry{display:flex;align-items:center;gap:14px;border-top:1px solid var(--line);padding:17px 0}.entry:first-child{border-top:0}.pain{width:39px;height:42px;border-radius:8px;background:#f1e1d4;display:grid;place-items:center;color:#a77954;font-size:18px;font-family:Georgia}.entry-text{flex:1;min-width:0}.entry-text strong{font-size:12px;font-weight:600}.entry-text p{font-size:11px;color:var(--muted);margin:5px 0 0;overflow-wrap:anywhere}.badge{font-size:9px;padding:4px 6px;border-radius:4px;background:#f0e0d0;color:#986b44}.entry-actions{display:flex;gap:4px}.icon-button{background:none;border:0;color:var(--muted);padding:6px;font-size:23px}.rank{margin:18px 0}.rank-label{display:flex;justify-content:space-between;font-size:12px;margin-bottom:9px}.track{background:#f3f5ee;height:6px;border-radius:10px;overflow:hidden}.fill{background:#a7b893;height:100%}.data-actions{display:flex;gap:12px;flex-wrap:wrap;margin:20px 0}.file-label{cursor:pointer;display:inline-block}.hint,.muted{font-size:11px;color:var(--muted)}.warning{padding:13px;border-radius:8px;background:#fff1da;color:#805f29;font-size:12px}footer{padding:25px 0 30px;font-size:10px;color:#98a08f}dialog{border:0;border-radius:17px;max-width:650px;width:calc(100% - 28px);padding:28px;color:var(--ink);box-shadow:0 25px 100px #18382d33}dialog::backdrop{background:#233e3966;backdrop-filter:blur(3px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}h2{letter-spacing:-.3px}.dialog-head h2{font-family:Georgia;font-size:28px;font-weight:400;margin:10px 0 0}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}form label{display:block;font-size:12px;margin:13px 0 8px}form input:not([type=range]):not([type=checkbox]):not([type=hidden]),form select,form textarea{display:block;width:100%;margin-top:8px;border:1px solid #dce2d6;padding:11px;border-radius:7px;background:#fcfdfa;color:var(--ink)}form fieldset{border:0;margin:23px 0 14px;padding:0}legend{font-size:12px;margin-bottom:10px}.chips{display:flex;flex-wrap:wrap;gap:7px}.chips label{margin:0;cursor:pointer}.chips input{position:absolute;opacity:0;width:1px;height:1px}.chips span{display:block;padding:8px 10px;border:1px solid #e1e5db;border-radius:20px;font-size:11px;color:#7e8876}.chips input:checked+span{background:#e9f0e0;border-color:#92a47c;color:var(--green)}.chips input:focus-visible+span{outline:2px solid var(--green)}.intensity-label{display:flex;justify-content:space-between;align-items:center;margin-top:15px}.intensity-label strong{font-family:Georgia;font-size:28px}.intensity-label small{font-size:14px;color:var(--muted)}input[type=range]{width:100%;accent-color:#7e986a}.range-labels{display:flex;justify-content:space-between;font-size:10px;color:var(--muted);margin-top:4px}.dialog-actions{display:flex;justify-content:end;gap:10px;margin-top:25px}#form-error{color:#a84848;font-size:12px}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:var(--green);color:white;padding:13px 24px;border-radius:8px;box-shadow:0 3px 20px #0002;display:none;z-index:10}table{width:100%;border-collapse:collapse;font-size:11px}th,td{text-align:left;padding:12px 8px;border-bottom:1px solid var(--line)}.scroll{overflow-x:auto}#storage-warning{padding:15px;background:#f9dfca;margin-bottom:18px}.print-only{display:none}
@media(min-width:1450px){main{padding:0 65px}.day{min-height:57px}}@media(max-width:1050px){aside{width:190px;padding:30px 17px}main{margin-left:190px;padding:0 25px}.columns{grid-template-columns:1fr}.stats{gap:9px}.stat{padding:15px}.brand{font-size:18px}.aside-note{padding:16px}}@media(max-width:680px){aside{height:65px;width:100%;bottom:0;top:auto;padding:5px 10px;border-top:1px solid var(--line);z-index:3}.brand,.nav-label,.aside-note,.local-label{display:none}nav{display:grid;grid-template-columns:repeat(4,1fr);gap:0}nav button{display:flex;flex-direction:column;gap:4px;padding:6px 1px;border-radius:5px}nav button span{font-size:9px}main{margin-left:0;padding:0 18px 65px}header{height:62px;font-size:10px}.page-title{display:block;margin:25px 0}h1{font-size:35px}.page-title .primary{margin-top:20px;width:100%}.stats{grid-template-columns:repeat(2,1fr);gap:10px}.stat strong{font-size:32px}.card{padding:19px}.toolbar{font-size:11px}.month-picker{gap:5px}.month-picker input{width:142px}.form-grid{grid-template-columns:1fr;gap:0}.entry-actions{flex-direction:column}.day{min-height:40px}.dialog-actions{position:sticky;bottom:-28px;background:white;padding:15px 0}.eyebrow{font-size:9px}.page-title p{font-size:12px}}
@media print{aside,header,.page-title .primary,.toolbar,.entry-actions,.text-button,footer,#toast,dialog,.data-actions{display:none!important}body{background:white}main{margin:0;padding:0}.page-title{margin:0 0 20px}.card{break-inside:avoid}.columns{display:block}.stats{grid-template-columns:repeat(4,1fr)}.print-only{display:block}.no-print{display:none}}
.medication-row{background:#f6f8f2;border:1px solid #e1e6d9;border-radius:9px;padding:5px 13px 12px;margin-bottom:12px}.remove-med{align-self:end;margin-bottom:10px}#preventive-error,#report-error{color:#a84848;font-size:12px}#report-dialog{max-width:1000px}#report-preview{margin-top:25px}.doctor-report{background:#fff;padding:15px}.doctor-report table{min-width:450px}#report-preview{overflow-x:auto}#report-actions[hidden]{display:none}#report-output{display:none}.report-section svg{min-width:550px}#report-preview .doctor-report{min-width:600px}.report-heading p{font-size:12px}.report-totals{display:flex;gap:12px;margin:24px 0}.report-totals>div{flex:1;border:1px solid var(--line);padding:14px;border-radius:8px}.report-totals strong{display:block;font:28px Georgia}.report-totals span{font-size:11px}.report-entry p{white-space:pre-wrap}.report-note{font-size:11px;color:var(--muted)}
@media(max-width:680px){nav{grid-template-columns:repeat(5,1fr)}nav button span{font-size:8px}.card-head{flex-wrap:wrap}.medication-row .form-grid{grid-template-columns:1fr}.report-section svg{min-width:0}}
@media print{body.printing-report>main,body.printing-report>aside,body.printing-report>footer{display:none!important}body.printing-report>#report-output{display:block}#report-output .doctor-report{padding:0;margin:0;max-width:none}#report-output svg{min-width:0;width:100%;break-inside:avoid}#report-output table{min-width:0}#report-output .report-section{break-inside:auto}#report-output tr,#report-output .report-entry{break-inside:avoid}*{-webkit-print-color-adjust:exact;print-color-adjust:exact}}

.phq-option{display:flex;align-items:center;gap:10px;padding:10px 0}.phq-option input{width:auto}#phq-dialog{max-width:680px}#phq-items legend{font-weight:600;line-height:1.5}

/* Shared app layout */
:root{--muted:#5e716a;--bg:#f3f6f3;--line:#dfe7e2}
body{font-size:15px;line-height:1.5}
main{padding-bottom:32px}
header{height:76px}
h1{font-size:clamp(30px,3.5vw,44px);letter-spacing:-1.2px;line-height:1.12}
.page-title{margin:32px 0 26px}
.page-title p{max-width:540px;font-size:14px}
.card,.stat{border-radius:18px;box-shadow:0 4px 20px #233e3905}
.card{padding:24px}
.card h2{font-size:17px}
.primary,.outline{min-height:46px;border-radius:12px;font-weight:600;transition:background .16s,box-shadow .16s,transform .16s}
button:active{transform:translateY(1px)}
button:disabled{cursor:wait;opacity:.6}
.text-button{min-height:40px;font-size:13px;font-weight:550}
nav button{min-height:48px;border-radius:12px}
nav button span{font-size:14px}
nav button.active{box-shadow:inset 3px 0 var(--green)}
.stat{padding:20px}
.stat-label{color:#52685f;font-size:12px;font-weight:550}
.stat strong{font-family:inherit;font-size:34px;font-weight:600;letter-spacing:-1px}
.stat p,.hint,.subtle{font-size:12px;color:var(--muted)}
.entry-text strong{font-size:14px}
.entry-text p{font-size:13px}
.badge{font-size:11px}
.today-panel{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 28px;border-radius:20px;background:#e5eee7;margin-bottom:16px;border:1px solid #d8e6da}
.today-panel h2{font:500 25px/1.2 Georgia,serif;margin:6px 0 10px}
.today-panel p{margin:0;color:#476459;font-size:14px}
.today-panel .eyebrow{font-size:10px;letter-spacing:1.5px}
.quick-links{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:0 0 26px}
.quick-links button{display:flex;align-items:center;gap:14px;text-align:left;background:#fff;border:1px solid var(--line);border-radius:16px;padding:17px;color:var(--ink)}
.quick-links button>span:nth-child(2){flex:1}
.quick-links strong,.quick-links small{display:block}
.quick-links strong{font-size:14px;font-weight:600}
.quick-links small{font-size:12px;color:var(--muted);margin-top:4px}
.quick-icon{display:grid;place-items:center;background:#edf3ef;border-radius:12px;width:40px;height:42px;font-size:23px;color:var(--green)}
.toolbar[hidden],#new[hidden]{display:none!important}
form label,legend{font-size:14px}
form input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=hidden]),form select,form textarea{font-size:16px;min-height:46px;border-radius:10px}
.chips span{font-size:13px;padding:10px 13px}
dialog{max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain}
.dialog-head{gap:12px}
.dialog-head h2{font-size:28px}
.phq-progress{position:sticky;top:-28px;background:#fff;padding:14px 0;z-index:1;border-bottom:1px solid var(--line)}
.phq-progress span{font-size:12px;color:var(--muted)}
.phq-progress progress{display:block;width:100%;height:7px;accent-color:var(--green);margin-top:8px}
#phq-items fieldset{border:1px solid var(--line);border-radius:14px;padding:14px;margin:22px 0}
#phq-items legend{padding:0 6px;font-size:14px;line-height:1.6}
#phq-items .phq-option{display:flex;gap:12px;padding:11px 12px;margin:5px 0;border:1px solid transparent;border-radius:10px;min-height:46px;font-size:14px;cursor:pointer}
#phq-items .phq-option:has(input:checked){background:#eaf2ed;border-color:#afc8b8}
#phq-items input[type=radio]{appearance:auto;display:inline-block;width:18px;min-width:18px;height:18px;padding:0;margin:0;accent-color:var(--green)}
#phq-consent{accent-color:var(--green)}
#toast{max-width:calc(100vw - 32px);width:max-content;text-align:center;z-index:20}
@media (prefers-reduced-motion:no-preference){#content{animation:content-appear .18s ease-out}dialog[open]{animation:dialog-appear .18s ease-out}@keyframes content-appear{from{opacity:.65;transform:translateY(4px)}to{opacity:1;transform:none}}@keyframes dialog-appear{from{opacity:.7;transform:translateY(8px)}to{opacity:1;transform:none}}}
@media(max-width:680px){
 aside{height:auto;padding:6px 6px calc(6px + env(safe-area-inset-bottom));background:#fffffffa;box-shadow:0 -3px 18px #233e3908}
 nav{grid-template-columns:repeat(6,minmax(0,1fr));gap:2px}
 nav button{font-size:21px;min-height:54px;gap:3px;padding:6px 1px;justify-content:center}
 nav button span{font-size:10px;line-height:1.2;white-space:nowrap;letter-spacing:-.2px}
 nav button.active{box-shadow:none;background:#e6efe8}
 main{padding:0 16px calc(90px + env(safe-area-inset-bottom))}
 header{height:58px;font-size:11px}
 header .outline{padding:8px 11px;font-size:12px;min-height:40px}
 .page-title{margin:24px 0}
 .page-title h1{font-size:32px;line-height:1.15}
 .page-title p{font-size:14px}
 .page-title .primary{margin-top:18px;min-height:50px}
 .today-panel{padding:20px;display:block}
 .today-panel h2{font-size:23px}
 .today-panel .primary{margin-top:16px;width:100%}
 .quick-links{gap:9px;margin-bottom:22px}
 .quick-links button{align-items:flex-start;gap:9px;flex-wrap:wrap;padding:14px 12px;min-width:0}
 .quick-links button>span:last-child{display:none}
 .quick-icon{width:32px;height:32px;border-radius:9px;font-size:20px}
 .quick-links button>span:nth-child(2){flex-basis:100%}
 .quick-links strong{font-size:13px}
 .quick-links small{font-size:12px}
 .card{padding:20px;border-radius:16px}
 .stat{padding:16px;border-radius:16px}
 .stat strong{font-size:30px;margin:16px 0 10px}
 .stat-label{font-size:12px}
 .stat p{font-size:11px}
 .card-head{margin-bottom:18px}
 .day{min-height:42px;font-size:13px}
 .calendar{gap:5px}
 .toolbar{gap:10px;font-size:12px}
 .month-picker label{display:none}
 .month-picker input{font-size:14px;width:142px}
 .entry{gap:10px}
 .entry-text p{font-size:12px}
 .entry-actions .text-button{font-size:12px}
 .dialog-actions{bottom:-20px;padding-bottom:calc(14px + env(safe-area-inset-bottom));gap:8px}
 dialog{padding:20px;max-height:calc(100dvh - 24px);border-radius:20px}
 .phq-progress{top:-20px}
 .dialog-head h2{font-size:25px}
 #phq-submit{width:100%;position:sticky;bottom:-20px;box-shadow:0 -8px 16px #fff}
 #toast{bottom:calc(88px + env(safe-area-inset-bottom))}
}
@media print{.quick-links,.today-panel,.phq-progress{display:none!important}}

.resource-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.resource-card{display:flex;flex-direction:column;margin:0}
.resource-card h2{line-height:1.45;font-size:20px}
.resource-card .data-actions{margin-top:auto;padding-top:18px}
.resource-card .primary{text-decoration:none;display:inline-flex;align-items:center;font-size:14px}
.resource-author{font-size:14px;font-weight:600;margin:12px 0 0}
.resource-filters{display:flex;gap:10px;margin:0 0 20px}
.resource-filters [aria-pressed=true]{background:var(--green);color:#fff}
.resource-source{font-size:12px;color:var(--green);line-height:1.5}
@media(max-width:680px){nav{grid-template-columns:repeat(7,minmax(0,1fr))}nav button span{font-size:9px}.resource-grid{grid-template-columns:1fr}.resource-card h2{font-size:20px}.resource-card .data-actions{gap:8px}.resource-card .data-actions>*{flex:1;justify-content:center;padding:12px 10px}}
