:root{font-family:system-ui,-apple-system,"Microsoft JhengHei",sans-serif;color:#20332d;background:#f5f7f5;font-size:16px;line-height:1.6;--green:#1b604d;--border:#d7e0da}*{box-sizing:border-box}body{margin:0}.trial{background:#faf0d9;color:#654e17;text-align:center;font-size:.85rem;padding:7px 12px}header{background:white;border-bottom:1px solid var(--border);padding:18px max(20px,calc((100vw - 1080px)/2));display:flex;align-items:center;justify-content:space-between;gap:16px}header strong{font-size:1.25rem}.sub{display:block;font-size:.8rem;color:#60736a}main{max-width:1080px;margin:24px auto;padding:0 20px;min-height:65vh}h1{font-size:1.65rem;line-height:1.35;margin:0 0 12px}h2{font-size:1.15rem;margin:0 0 14px}h3{font-size:1rem;margin:4px 0}p{margin:8px 0 16px}.muted,small{color:#66796e}.card{background:white;border:1px solid var(--border);border-radius:10px;padding:22px;margin:16px 0}.login{max-width:430px;margin:48px auto}.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.between{justify-content:space-between}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.field{display:block;margin-bottom:14px}.field>span{display:block;font-size:.9rem;font-weight:600;margin-bottom:5px}input,select,textarea,button{font:inherit}input:not([type=checkbox]),select,textarea{display:block;width:100%;padding:10px 12px;border:1px solid #b6c7bc;border-radius:6px;background:white;color:inherit}textarea{min-height:100px;resize:vertical}button{border:1px solid var(--green);border-radius:6px;padding:9px 15px;min-height:44px;background:var(--green);color:white;cursor:pointer}button.secondary{background:white;color:var(--green);border-color:#b6c7bc}button.small{padding:5px 10px;font-size:.85rem;min-height:36px}button:disabled{opacity:.5;cursor:wait}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #80bda5;outline-offset:2px}.toolbar{display:flex;justify-content:space-between;align-items:end;gap:16px;margin-bottom:20px}.toolbar .field{min-width:230px;margin:0}.badge{display:inline-block;border-radius:4px;background:#e7f1eb;color:#315c49;padding:2px 8px;font-size:.8rem}.badge.attention{background:#fff0cf;color:#79530e}.list{list-style:none;padding:0;margin:0}.item{border-top:1px solid #e4ebe5;padding:16px 0}.item:first-child{border-top:0;padding-top:0}.item:last-child{padding-bottom:0}.item p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.meta{font-size:.8rem;color:#66796e}.empty{border:1px dashed var(--border);padding:18px;border-radius:6px;color:#66796e}details{margin:12px 0}summary{cursor:pointer;font-weight:600}dialog{border:1px solid var(--border);border-radius:12px;max-width:720px;width:calc(100% - 28px);max-height:90vh;padding:24px;color:inherit}dialog::backdrop{background:#152e25aa}dialog h2{font-size:1.3rem}.dialog-actions{position:sticky;bottom:-24px;background:white;border-top:1px solid var(--border);padding:16px 0 0;margin-top:18px}.checklist label{display:flex;gap:10px;align-items:center;margin:7px 0}.checklist input{width:18px;height:18px}#notice{max-width:1040px;margin:auto;padding:0 12px}#notice:not(:empty){margin-top:14px;padding:12px 16px;background:#e6f3e9;border-radius:6px}#notice.error{background:#fff0e9;color:#8c321b}footer{text-align:center;font-size:.78rem;padding:24px;color:#6a7a70}.report{font-size:.85rem}.report h1{font-size:1.45rem}.report table{width:100%;border-collapse:collapse;font-size:.8rem}.report th,.report td{text-align:left;vertical-align:top;border-bottom:1px solid #d6ddd8;padding:7px 5px;overflow-wrap:anywhere}.report p{white-space:pre-wrap}.report .report-note{border-left:3px solid var(--green);padding-left:12px}.guide-step{display:grid;grid-template-columns:36px 1fr;gap:12px;margin:20px 0}.step-number{width:32px;height:32px;text-align:center;border:1px solid var(--green);border-radius:50%;color:var(--green)}.guide-step p{margin:2px 0}.illustration{background:#f2f6f3;border:1px solid var(--border);padding:10px 14px;margin-top:8px;font-size:.9rem}.account{border-top:1px solid var(--border);padding:14px 0}.account:first-child{border:0}@media(max-width:650px){header{padding:14px 16px;align-items:start}.sub{max-width:190px}.grid{grid-template-columns:1fr}main{padding:0 14px;margin-top:18px}.card{padding:17px}.toolbar{align-items:stretch;flex-direction:column}.toolbar .field{min-width:0}.identity-name{display:block}.row button{flex-shrink:0}h1{font-size:1.4rem}dialog{padding:18px}.dialog-actions{bottom:-18px}.report table{font-size:.7rem}}@media print{body{background:white;font-size:10pt}body>header,body>main,body>.trial,body>footer,body>#notice{display:none!important}dialog[open]{display:block!important;position:static;max-width:none;max-height:none;width:100%;margin:0;padding:0;border:0;overflow:visible}dialog::backdrop,.no-print{display:none!important}.report{font-size:9pt}.report h1{font-size:15pt}.report table{font-size:8pt}.report th,.report td{padding:4px}.report h2{font-size:11pt;margin-top:12px}.report .card{padding:8px}.report tr{break-inside:avoid}@page{size:A4;margin:12mm}}
.report-summary{border:1px solid var(--border);padding:16px;margin-bottom:24px}.summary-block{margin:16px 0;overflow-wrap:anywhere}.summary-block:first-child{margin-top:0}.summary-block:last-child{margin-bottom:0}.summary-readings table,.appendix-records{table-layout:fixed}.summary-readings th:first-child{width:18%}.summary-readings th:nth-child(2){width:28%}.summary-readings th:nth-child(3){width:26%}.summary-readings th:nth-child(4){width:28%}.summary-readings p,.summary-footer p{font-size:.8rem}.report-appendix{border-top:2px solid var(--green);padding-top:20px}.record-source{width:25%}.record-detail{width:60%}.record-state{width:15%}.record-content{white-space:pre-wrap}.report-appendix p{overflow-wrap:anywhere}@media print{:root{background:white}.report-summary{height:263mm;display:grid;grid-template-rows:30mm 42mm 95mm 34mm 30mm 14mm;gap:3mm;padding:0;margin:0;border:0;break-after:page;page-break-after:always}.report-summary .summary-block{margin:0;min-width:0;font-size:9pt;line-height:1.4}.report-summary h1{font-size:15pt;line-height:1.2;margin:1mm 0 2mm}.report-summary h2{font-size:11pt;line-height:1.3;margin:0 0 2mm}.report-summary p{font-size:9pt;line-height:1.4;margin:0 0 2mm;white-space:normal}.report-summary small,.report-summary .summary-footer p{font-size:8pt;line-height:1.3}.summary-readings table{font-size:8pt;line-height:1.4}.summary-readings td,.summary-readings th{padding:1.5mm 1mm}.summary-readings tbody tr{height:16mm}.report-appendix{border:0;padding:0}.report-appendix h1{margin-top:0}.report-appendix thead{display:table-header-group}}
/* v4.3 visual continuity; functional data stays in the existing Worker API. */
@media screen {
:root{--green:#e2691c;--border:#ebe2d8;background:#faf7f3;color:#1e1a17;font-family:system-ui,"Microsoft JhengHei",sans-serif}
body{color:#1e1a17;background:#faf7f3}header{padding:16px max(20px,calc((100vw - 1080px)/2));border-bottom:1px solid #ebe2d8;box-shadow:0 1px 4px #1e1a1708}.brand{display:flex;align-items:center;gap:12px}.brand-mark,.login-mark{display:grid;place-items:center;width:52px;height:52px;border-radius:17px;background:#e2691c;color:white;font-size:1.8rem;font-weight:800}.sub,.muted,small,.meta{color:#756758}.trial{background:#fdf3ea;color:#8a3b08;font-size:.8rem}#identity{display:flex;align-items:center;gap:10px;max-width:52%}.identity-name{font-size:.9rem}.portrait{width:52px;height:52px;flex:none;border-radius:15px}.line-icon{width:23px;height:23px;flex:none;vertical-align:middle}.fiction-badge{display:inline-block;border:1px solid #d8ccbd;border-radius:99px;color:#756758;padding:1px 7px;font-size:.7rem;white-space:nowrap}.person-name{font-weight:750}.badge{border-radius:7px;background:#f5f0e9;color:#5f5347}.badge.attention{background:#fff4e1;color:#8a5200}.badge.handled,.badge.done{background:#e8f5ec;color:#137a43}.card{border-radius:20px;box-shadow:0 1px 3px #1e1a1708;border-color:#ebe2d8}.login{margin:18px auto 40px}.login-intro{text-align:center;max-width:500px;margin:38px auto 16px}.login-mark{margin:0 auto 12px;width:68px;height:68px;border-radius:22px;box-shadow:0 8px 20px #e2691c30}.login-intro h1{margin-bottom:6px}.role-intro{display:flex;gap:16px;justify-content:center;flex-wrap:wrap;color:#756758;font-size:.8rem}.role-intro span{display:flex;align-items:center;gap:5px}.role-intro .line-icon{width:18px;height:18px}button{border-radius:12px;min-height:48px;font-weight:700}button:hover{filter:brightness(.96)}button.secondary{border-color:#d8ccbd;color:#5f5347}.field input,.field select,.field textarea{border-color:#d8ccbd;border-radius:12px}.primary-nav,.section-nav{display:flex;gap:8px;padding:7px;background:#f5f0e9;border-radius:16px;margin-bottom:24px}.primary-nav button,.section-nav button{display:flex;align-items:center;justify-content:center;gap:8px;flex:1;background:transparent;border-color:transparent;color:#756758}.primary-nav [aria-current=page],.section-nav [aria-current=page]{background:white;border-color:#ebe2d8;color:#b8500f;box-shadow:0 1px 3px #1e1a170a}.section-nav{margin:20px 0 16px;position:sticky;top:0;z-index:2;background:#faf7f3f5;border:1px solid #ebe2d8}.section-nav button{font-size:.9rem}.toolbar h1{letter-spacing:.01em}.toolbar button .line-icon{margin-right:6px}.elder-toolbar .field{flex:1;max-width:430px}.elder-banner{border:1px solid #ebe2d8;background:#fff;border-radius:20px;padding:18px 20px}.elder-banner .portrait{width:68px;height:68px;border-radius:20px}.elder-banner h2{margin:0 0 6px}.elder-banner p{margin:0;color:#756758}.person-row{display:flex;gap:14px;align-items:center;min-width:0}.person-row>span,.person-row>div{flex:1;min-width:0;overflow-wrap:anywhere}.person-row small{display:block;margin-top:3px;font-weight:400}.person-list{border:1px solid #ebe2d8;border-radius:16px;overflow:hidden;margin-top:16px}.person-list .person-row{padding:15px;background:white;border:0;border-radius:0;border-bottom:1px solid #ebe2d8;width:100%;text-align:left;color:#1e1a17}.person-list .person-row:last-child{border:0}.person-list button:hover{background:#fdf3ea}.overview-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0}.overview-counts>div{background:#fff;border:1px solid #ebe2d8;border-radius:16px;padding:16px}.overview-counts strong{display:block;font-size:1.8rem;color:#b8500f}.overview-counts span{font-size:.85rem;color:#756758}.quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.action-tile{display:flex;align-items:center;gap:12px;text-align:left;min-height:90px;padding:16px;background:#fff;color:#1e1a17;border:1px solid #d8ccbd;border-radius:20px}.action-tile>span:nth-child(2){flex:1}.action-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;background:#fdf3ea;color:#b8500f}.now-card{background:linear-gradient(180deg,#fff9f3,#fdf3ea);border:1px solid #f9e3ce;border-radius:26px;padding:22px;margin-top:18px}.now-card h2{font-size:1.55rem;margin:12px 0}.now-card button{width:100%;min-height:64px;font-size:1.15rem}.now-card small{display:block;margin-top:12px}.eyebrow{font-size:.85rem;font-weight:750;letter-spacing:.04em}.family-card{background:linear-gradient(150deg,#332c26,#241f1b);color:#fff;border-radius:26px;padding:24px;margin-top:18px}.family-card h2{font-size:1.6rem;margin-top:10px}.family-card p{color:#e2d5c7}.family-card .action-tile{background:#fff}.timeline .item{position:relative;padding-left:20px;border-left:2px solid #f9e3ce}.timeline .item:before{content:"";position:absolute;left:-6px;top:20px;width:10px;height:10px;border-radius:50%;background:#e2691c;border:2px solid #fff}.timeline .item:first-child:before{top:7px}.reading-value{font-size:1.25rem;font-weight:750;color:#5f5347}.reading-value span{font-size:.9rem;font-weight:400}.profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.profile-grid dt{font-size:.85rem;color:#756758}.profile-grid dd{margin:4px 0;white-space:pre-wrap;overflow-wrap:anywhere}.section-panel[hidden]{display:none}.illustration{background:#fdf3ea;border-color:#f9e3ce}.auth-identifier{font-family:ui-monospace,monospace}dialog{border-radius:22px;border-color:#d8ccbd}dialog::backdrop{background:#241f1b90}.account{border-color:#ebe2d8}.report{color:#20332d;line-height:1.6}.report .report-note{border-color:#b8500f}
@media(min-width:800px){body[data-role=care] main,body[data-role=home] main{max-width:560px}.mobile-workspace .section-nav{display:grid;grid-template-columns:1fr 1fr}.mobile-workspace .section-nav button{min-height:52px}}
@media(max-width:650px){header{background:#e2691c;color:white;padding:12px 14px;gap:8px}.brand-mark{width:38px;height:38px;font-size:1.4rem;background:#ffffff24;border-radius:12px}.brand{gap:8px}header strong{font-size:1rem}.sub{color:#fff4e1;font-size:.68rem;max-width:140px}#identity{gap:7px;max-width:49%;flex-wrap:wrap;justify-content:flex-end}#identity .portrait{display:none}#identity .badge{background:#ffffff24;color:white;font-size:.65rem}#identity .fiction-badge{display:none}#identity button{min-height:34px;background:#ffffff20;border-color:#ffffff50;color:white;padding:3px 8px}.identity-name{font-size:.8rem}.toolbar{flex-direction:row;align-items:center;gap:10px}.toolbar button{font-size:.8rem;padding:8px}.toolbar button .line-icon{display:none}.toolbar h1{font-size:1.4rem}.toolbar .muted{font-size:.75rem}.elder-toolbar{align-items:stretch}.elder-toolbar .field{max-width:none}.elder-toolbar button{max-width:92px}.card{padding:18px}.elder-banner{padding:16px}.elder-banner .portrait{width:58px;height:58px}.elder-banner h2{font-size:1.1rem}.person-row{gap:10px}.overview-counts{gap:7px}.overview-counts>div{padding:12px 9px}.overview-counts strong{font-size:1.5rem}.overview-counts span{font-size:.7rem}.primary-nav{gap:3px;padding:4px}.primary-nav button{font-size:.8rem;padding:8px 4px;gap:4px}.primary-nav .line-icon{width:19px;height:19px}.section-nav{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:5px}.section-nav button{padding:9px 5px;min-height:45px;font-size:.85rem}.quick-actions{grid-template-columns:1fr}.action-tile{min-height:76px}.family-card{padding:20px}.family-card h2{font-size:1.4rem}.profile-grid{grid-template-columns:1fr}.role-intro{gap:10px}.login-intro{margin-top:25px}.login-intro h1{font-size:1.6rem}.login{margin-top:18px}dialog{padding:18px}.person-list .person-row{padding:13px 10px}.card .row.between h2{margin-bottom:0}}
}
@media screen{.primary-nav [aria-current=page]{background:#e2691c;color:white;border-color:#e2691c;box-shadow:0 2px 6px #e2691c30}.desk-body{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px}.desk-main{min-width:0}.desk-main .section-nav{display:grid;grid-template-columns:1fr 1fr}.desk-aside{min-width:0}.desk-aside .card{padding:18px}.desk-aside .portrait{width:44px;height:44px}.desk-aside .person-row{flex-wrap:wrap}.desk-aside .person-row .line-icon{display:none}.desk-aside .muted{font-size:.8rem}.attention-link{display:block;background:#fdf3ea;border:1px solid #f9e3ce;width:100%;text-align:left;color:#5f5347;margin-top:10px;overflow-wrap:anywhere}.attention-link span,.attention-link strong,.attention-link small{display:block}.attention-link strong{font-size:.95rem;margin:6px 0}.desk-aside .person-name{font-size:.95rem}@media(max-width:1000px){.desk-body{grid-template-columns:minmax(0,1fr)}.desk-aside{display:grid;grid-template-columns:1fr 1fr;gap:14px}}@media(max-width:650px){.desk-aside{display:block}}}
/* Simple variant: one task at a time, secondary tools expand on demand. */
@media screen {
 main{max-width:840px}
 .focus-card{margin:18px 0;background:#fff3e7;border:1px solid #f1d0b2;border-radius:22px;padding:24px}
 .focus-card h2{font-size:1.55rem;margin:8px 0}
 .focus-card button,.family-card>button{width:100%;min-height:60px;font-size:1.1rem}
 .focus-card small{display:block;margin-top:14px}
 .focus-excerpt{white-space:pre-wrap;overflow-wrap:anywhere;border-left:3px solid #e2691c;padding-left:12px;margin-bottom:0}
 .primary-nav{align-items:start;justify-content:space-between;background:none;padding:0;border-bottom:1px solid #ebe2d8;border-radius:0;padding-bottom:12px}
 .primary-nav>button{flex:0 1 auto;padding:9px 20px}
 .primary-nav details{max-width:65%;text-align:right;margin:0}
 .primary-nav details .row{justify-content:flex-end;margin-top:10px}
 summary{padding:12px 4px;min-height:48px;color:#655545}
 .more-nav,.extra-actions{border:1px solid #e7dbcc;border-radius:14px;padding:0 14px;background:#fff}
 .more-nav>.row{padding-bottom:14px}
 .more-nav button{background:#fff;color:#7c451e;border-color:#dccab9;flex:1}
 .section-nav{position:static;display:flex!important;margin:22px 0 10px;background:#f0e8de}
 .section-nav button{min-height:52px;font-size:1rem}
 .extra-actions button{margin:0 6px 12px 0}
 .quick-actions{grid-template-columns:1fr 1fr;align-items:start}
 .quick-actions .action-tile{min-height:70px;background:#e2691c;color:#fff;border-color:#e2691c}
 .quick-actions .action-icon{display:none}
 .quick-actions .extra-actions{margin:0}
 .quick-actions summary{min-height:68px;display:flex;align-items:center;justify-content:center}
 .care-hint{margin:0}
 .care-hint summary{font-size:.9rem;padding:4px 0;min-height:32px}
 .record-tools{margin-bottom:0}
 .record-tools summary{font-size:.85rem;font-weight:500;padding:8px 0}
 .record-tools[hidden]{display:none}
 .record-options{border-top:1px solid #ebe2d8}
 button.small{min-height:44px}
 @media(max-width:650px){
  .quick-actions{grid-template-columns:1fr 1fr;gap:8px}
  .quick-actions .action-tile{padding:10px;font-size:.95rem;gap:4px}
  .extra-actions{padding:0 10px}
  .primary-nav summary{font-size:.9rem}
  .primary-nav details .row{gap:6px}
  .focus-card{padding:20px}
  .elder-banner .portrait{width:48px;height:48px}
  .elder-banner .person-row{align-items:start}
  .elder-banner h2 .badge{font-size:.7rem}
  .elder-banner h2 .fiction-badge{font-size:.65rem}
  .section-nav button{padding:10px;min-height:54px}
 }
}

@media screen{.mapped-workspace{min-width:0}.app-topbar{position:sticky;top:0;z-index:15;background:#faf7f3f5;padding:6px 0 10px;backdrop-filter:blur(8px)}.top-nav{display:flex;gap:6px;padding:6px;background:#f5f0e9;border:1px solid #ebe2d8;border-radius:16px;margin-bottom:10px}.top-nav button{flex:1;min-width:0;padding:10px 8px;background:transparent;color:#756758;border-color:transparent}.top-nav [aria-current=page]{background:#e2691c;color:white;border-color:#e2691c}.selected-context{border:1px solid #ebe2d8;border-radius:16px;background:white;padding:12px 14px}.selection-fields{display:grid;grid-template-columns:1fr 1.35fr;gap:12px}.selection-fields .field{margin:0 0 8px}.selection-fields input,.selection-fields select{padding:8px 10px}.selected-name{gap:10px}.selected-name button{min-height:46px;white-space:nowrap}.selected-context small{display:block;margin-top:5px}.page-heading{margin:20px 0}.detail-content{white-space:pre-wrap;overflow-wrap:anywhere}.scope-remark{padding:14px;border-left:3px solid #e2691c;background:#fdf3ea}.guide-list{padding-left:24px}.guide-list li{margin:12px 0}.work-elder{margin:8px 0}.mapped-workspace .item p{overflow-wrap:anywhere}.mapped-workspace .card h2{margin-bottom:12px}.mapped-workspace .card h3{margin-top:16px}.mapped-workspace .person-row small{display:block}.mapped-workspace details.card summary{margin-bottom:8px}@media(max-width:650px){.top-nav button{font-size:.82rem;padding:10px 3px;min-height:44px}.selection-fields{grid-template-columns:1fr;gap:0}.selection-fields .field>span{font-size:.76rem;margin-bottom:2px}.selected-context{padding:9px 11px}.selected-context small{font-size:.68rem}.selected-name .person-name{font-size:.92rem}.selected-name .badge,.selected-name .fiction-badge{font-size:.62rem}.selected-name button{font-size:.85rem;padding:8px;min-height:42px}.selected-name button .line-icon{width:17px;height:17px}.app-topbar{padding-top:3px}.selected-context .selection-fields input,.selected-context .selection-fields select{padding:7px 9px;min-height:38px}.page-heading h1{font-size:1.35rem}.mapped-workspace .account{flex-wrap:wrap}}}

@media screen{.account-badge{display:inline-block;font-size:.7rem;line-height:1.4;padding:2px 6px;border:1px solid #c0d9f1;border-radius:6px;background:#ebf3fb;color:#15558f;max-width:100%;vertical-align:middle}.identity-name .account-badge{font-size:.65rem}.selected-name .account-badge{font-size:.65rem}@media(max-width:650px){#identity .account-badge{font-size:.58rem;background:#ffffff20;color:white;border-color:#ffffff50}.selected-name>span{min-width:0;flex:1}}}
/* One role-scoped overview. Detail pages keep ordinary document scrolling. */
@media screen{
 body[data-view=overview] main{max-width:1080px;min-height:0;margin:14px auto 0}
 body[data-view=overview] header{padding-top:10px;padding-bottom:10px}
 body[data-view=overview] #identity .account-badge{display:none}
 body[data-view=overview] #notice:not(:empty){margin-top:8px;padding:7px 12px;font-size:.9rem}
 body[data-view=overview] footer{padding:16px 20px;font-size:.8rem}
 .app-topbar{position:static;padding:0;background:transparent;backdrop-filter:none}
 .top-nav{margin-bottom:14px;padding:4px;gap:4px}
 .top-nav button{min-height:44px;padding:8px 6px}
 .dashboard-heading{display:flex;gap:12px;align-items:center;margin:18px 0}
 .dashboard-heading .portrait{width:48px;height:48px;border-radius:14px}
 .dashboard-heading h1{font-size:1.5rem;margin:0 0 3px}
 .dashboard-heading p{margin:0;color:#5f5347;line-height:1.45}
 .dashboard-heading time{font-size:.875rem;color:#756758}
 .dashboard-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
 .overview-card{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 10px;align-content:start;text-align:left;min-width:0;padding:20px;background:white;border:1px solid #e7dacf;border-radius:18px;color:#28211c;font-weight:400;box-shadow:0 2px 5px #332c2605}
 .overview-card:hover{background:#fffaf6;filter:none;border-color:#dfbfa5}
 .overview-card-title{font-weight:700;font-size:1rem;grid-column:1;grid-row:1}
 .overview-card strong{grid-column:2;grid-row:1 / span 2;font-size:1.9rem;line-height:1.2;color:#b8500f;white-space:nowrap;font-variant-numeric:tabular-nums}
 .overview-card strong span{font-size:.9rem;margin-left:5px;font-weight:400}
 .overview-card p{grid-column:1;grid-row:2;font-size:.9rem;line-height:1.5;color:#756758;margin:0}
 .overview-card small{grid-column:1 / -1;grid-row:3;display:block;font-size:.875rem;line-height:1.5;color:#5f5347;margin-right:19px;overflow-wrap:anywhere}
 .overview-card>.line-icon{position:absolute;right:16px;bottom:19px;width:17px;height:17px;color:#b8500f}
 .appointment-card strong{font-size:1.45rem;align-self:start}
 .dashboard-primary{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:50px;margin-top:18px}
 .detail-heading{margin:18px 0}
 .detail-heading h1{margin:14px 0 5px}
 .detail-heading p{margin:0}
 .compact-scope{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}
 .text-back{background:transparent;color:#8b4618;border:0;padding:5px 0;min-height:44px;font-size:.9rem}
 .focused-appointment{border-left:3px solid #e2691c;padding-left:14px;background:#fffaf6}
 @media(max-width:750px){
  body[data-view=overview] main{padding:0 14px;margin-top:10px}
  body[data-view=overview] header{padding:9px 14px}
  body[data-view=overview] header .brand-mark{width:32px;height:32px;border-radius:10px;font-size:1.25rem}
  body[data-view=overview] header .sub{font-size:.68rem}
  body[data-view=overview] #identity{max-width:53%;gap:5px}
  body[data-view=overview] footer{padding:12px 14px;line-height:1.45}
  .dashboard-heading{margin:13px 0;gap:10px}
  .dashboard-heading h1{font-size:1.35rem}
  .dashboard-heading p{font-size:.9rem}
  .dashboard-heading .portrait{width:42px;height:42px}
  .dashboard-cards{grid-template-columns:1fr;gap:10px}
  .overview-card{padding:14px 16px;gap:3px 8px;border-radius:16px}
  .overview-card strong{font-size:1.7rem}
  .overview-card small{font-size:.875rem}
  .overview-card p{font-size:.875rem}
  .appointment-card strong{font-size:1.35rem}
  .dashboard-primary{margin-top:13px;min-height:48px}
  .top-nav button{font-size:.875rem}
  .compact-scope{display:block}
  .compact-scope .row{margin-top:9px}
 }
}
@media screen{
 .report-variant-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
 .recent-records-card{grid-column:1 / -1;background:white;border:1px solid #e7dacf;border-radius:18px;padding:12px 16px}
 .recent-records-card h2{font-size:1rem;margin:0 0 4px}
 .recent-records-card p{margin:5px 0;font-size:.9rem}
 .recent-record-entry{display:flex;justify-content:space-between;align-items:center;gap:10px;width:100%;text-align:left;border:0;border-radius:8px;background:transparent;color:#28211c;padding:7px 0;min-height:48px;font-weight:400}
 .recent-record-entry+.recent-record-entry{border-top:1px solid #f0e7df}
 .recent-record-entry strong{display:block;font-size:.9rem;font-weight:600}
 .recent-record-entry small{display:block;font-size:.875rem;color:#756758;line-height:1.4}
 .recent-record-entry>.line-icon{width:17px;height:17px;color:#b8500f}
 .care-report-tools>summary{margin-bottom:12px}
 .care-report-tools h3{margin-top:18px}
 .legacy-notes{margin-top:20px}
 .form-error{color:#9c341c}
 .auto-summary .daily-fact{margin-bottom:8px}
 .auto-summary .activity-excerpt{margin:3px 0}
 .auto-summary .measurement-facts table{table-layout:fixed}
 .auto-summary .measurement-facts th{width:25%}
 @media(max-width:750px){.report-variant-cards{grid-template-columns:1fr}.recent-records-card{padding:11px 16px}.dashboard-heading{margin:10px 0}.dashboard-cards{gap:9px}.recent-record-entry{padding:5px 0;min-height:45px}.recent-record-entry strong{font-size:.875rem}.care-report-tools .row{align-items:stretch;flex-direction:column}.care-report-tools .row button{width:100%}}
}
@media print{
 .auto-summary{grid-template-rows:38mm 46mm 36mm 78mm 38mm 12mm;gap:3mm}
 .auto-summary .summary-block{font-size:9pt;line-height:1.35}
 .auto-summary .summary-header p{margin:0 0 1mm}
 .auto-summary .daily-fact{font-size:9pt;line-height:1.35;margin:0 0 2mm}
 .auto-summary .daily-fact small{font-size:8.5pt;line-height:1.3}
 .auto-summary .activity-excerpt{margin:0 0 1mm}
 .auto-summary .measurement-facts table{table-layout:fixed;font-size:8pt;line-height:1.25}
 .auto-summary .measurement-facts th{width:25%}
 .auto-summary .measurement-facts td,.auto-summary .measurement-facts th{padding:1mm .8mm}
 .auto-summary .measurement-facts tbody tr{height:auto}
 .auto-summary .measurement-facts small{display:block;margin-top:1mm}
 .auto-summary .reply-facts p{margin:0 0 2mm}
 .auto-care-report .report-appendix .legacy-report,.auto-care-report .report-appendix .appendix-reply{break-inside:auto}
}
@media screen and (max-width:750px){
 body[data-view=overview] footer{padding:10px 14px}
 .recent-record-entry{padding:4px 0}
}
@media screen{
 .nav-report-continuation{display:inline}
 .report-period-form>button{min-width:190px}
 .chief-comment-panel form>small{display:block;margin-top:10px}
 .chief-comment-audit{margin-top:14px}
 .report-working-view,.chief-comment-panel,.doctor-reply-panel{min-width:0}
 @media(max-width:750px){
  .top-nav button[data-page=overview]{flex:.9}
  .top-nav button[data-page=records],.top-nav button[data-page=manage]{flex:1.15}
  .top-nav button[data-page=care-report]{flex:2;white-space:normal;line-height:1.45}
  .nav-report-continuation{display:block}
  .top-nav{margin-bottom:10px}
  .dashboard-heading{margin:8px 0}
  .dashboard-primary{margin-top:10px}
  body[data-view=overview] footer{padding:8px 14px}
  .report-working-view>form>button{width:100%}
  .doctor-reply-panel>.row{align-items:start;flex-direction:column}
 }
}
@media print{
 .auto-summary{grid-template-rows:38mm 23mm 42mm 32mm 66mm 34mm 10mm;gap:3mm}
 .chief-comment-summary p{margin:0 0 1mm}
 .chief-comment-summary small{font-size:8pt;line-height:1.3}
}
@media print{
 .auto-summary .daily-fact{margin-bottom:1.2mm}
 .auto-summary .measurement-facts table{line-height:1.15}
 .auto-summary .measurement-facts th:first-child{width:23%}
 .auto-summary .measurement-facts th:nth-child(2){width:42%}
 .auto-summary .measurement-facts th:nth-child(3){width:35%}
 .auto-summary .measurement-facts td,.auto-summary .measurement-facts th{padding:.7mm .8mm}
}

/* Comfortable screen reading; the established A4 print rules stay independent. */
@media screen {
 :root{--ui-body:20px;--ui-secondary:18px;--ui-control:20px;--ui-heading:32px;--ui-subheading:26px;font-size:20px;line-height:1.65}
 body[data-role=home]{--ui-body:22px;--ui-secondary:20px;--ui-control:22px;--ui-heading:34px;--ui-subheading:28px}
 body{font-size:var(--ui-body);overflow-wrap:anywhere}
 p,li,dd,label,.detail-content,.person-name,.identity-name,.overview-card-title,.recent-record-entry strong{font-size:var(--ui-body)!important;line-height:1.65}
 small,.meta,.muted,.sub,.badge,.account-badge,.trial,footer,.role-intro,.dashboard-heading time,.overview-card p,.overview-card small,.overview-card strong span,.recent-record-entry small,.toolbar .muted,.field>span,.profile-grid dt,.reading-value span,.summary-footer p,.report small,.record-pagination p{font-size:var(--ui-secondary)!important;line-height:1.6}
 button,button.small,input,select,textarea,summary,.top-nav button,.selected-name button{font-size:var(--ui-control)!important;line-height:1.5;min-height:48px}
 input:not([type=checkbox]):not([type=hidden]),select,textarea{padding:10px 12px}
 input[type=checkbox]{min-height:24px;min-width:24px}
 h1,.page-heading h1,.dashboard-heading h1,.detail-heading h1{font-size:var(--ui-heading);line-height:1.4}h2,dialog h2,.recent-records-card h2{font-size:var(--ui-subheading);line-height:1.45}h3{font-size:22px;line-height:1.5}
 .report table,.report th,.report td,.summary-block,.daily-fact{font-size:var(--ui-body)!important;line-height:1.65}
 .brand{min-width:0}.brand-mark{flex:none}.brand-mark .line-icon{width:30px;height:30px}.login-mark .line-icon{width:40px;height:40px}
 header strong{font-size:24px;line-height:1.4;display:block}.brand>div{min-width:0}#identity{flex-wrap:wrap}.identity-name{min-width:0}
 .overview-card,.recent-record-entry{height:auto}.recent-record-entry{padding:12px 0}
 .personal-overview-cards .recent-records-card{grid-column:auto}
 .task-section h2{margin:0}.task-section .row.between{margin-bottom:16px}.task-section{border-width:2px}
 .dashboard,.dashboard-cards,.overview-card,.recent-record-entry>span{min-width:0}
 dialog{width:min(960px,calc(100% - 24px));max-height:90dvh;overflow-y:auto}
 .row{flex-wrap:wrap}.report{overflow-x:auto}
 @media(max-width:750px){
  header,body[data-view=overview] header{flex-wrap:wrap;align-items:center;padding:14px}
  header .brand{width:100%}header .sub{max-width:none}
  header #identity,body[data-view=overview] #identity{max-width:100%;width:100%;justify-content:flex-start;gap:10px}
  #identity button{min-height:48px;padding:8px 12px}header .brand-mark,body[data-view=overview] header .brand-mark{width:44px;height:44px}
  .top-nav{flex-wrap:wrap}.top-nav button{flex:1 1 auto!important;padding:12px 8px}
  .selection-fields{grid-template-columns:1fr}.selected-name{align-items:flex-start}.selected-name>span{flex:1 1 100%}
  .selected-context .selection-fields input,.selected-context .selection-fields select{min-height:48px}
  .dashboard-cards{grid-template-columns:1fr}.toolbar{flex-wrap:wrap}.profile-grid{grid-template-columns:1fr}
 }
}

@media screen {
 .selected-person{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
 .selected-name .change-elder{background:transparent;border:0;color:#8b4618;font-size:var(--ui-secondary)!important;font-weight:500;padding:8px;min-height:48px;text-decoration:underline;text-underline-offset:3px}
 .selected-name>button[data-action=new-record]{margin-left:auto}
 dialog[data-kind=elder-picker]{width:min(560px,calc(100% - 24px));max-height:85dvh}
 .elder-picker-list{list-style:none;margin:0;padding:0}.elder-picker-list li{margin:0}
 .elder-picker-list button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:14px 12px;min-height:56px;text-align:left;color:#28211c;background:white;border:1px solid #d8ccbd;margin-bottom:8px;font-weight:500}
 .elder-picker-list [aria-pressed=true]{border:2px solid #b8500f;background:#fff3e7}
 .elder-picker button:focus-visible,.change-elder:focus-visible{outline:3px solid #195b8a;outline-offset:3px}
 @media(max-width:750px){.selected-name{align-items:center;gap:8px}.selected-person{flex:1;gap:2px 6px}.selected-name>button[data-action=new-record]{padding:10px;white-space:normal}.selected-context{padding:10px 12px}}
}

.routine-days{display:flex;flex-wrap:wrap;gap:12px;margin:16px 0;padding:12px;border:1px solid var(--border,#ddd);border-radius:8px}.routine-days label{display:flex;align-items:center;gap:6px;min-height:44px}.routine-days input{width:20px;height:20px}.routine-tools>summary{font-weight:600;cursor:pointer}.routine-tools>button{margin-top:12px}

.record-pagination{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:16px}.record-pagination p{margin:0;font-size:16px}.record-pagination button{min-height:44px;min-width:88px}.record-pagination .row{flex-wrap:wrap}.record-pagination [tabindex="-1"]:focus{outline:none}

@media screen{
 .selected-person>.portrait{width:44px;height:44px;flex:none}
 .identity-menu{position:relative;min-width:0;max-width:100%}
 #identity .identity-trigger{display:flex;align-items:center;gap:8px;min-height:48px;max-width:100%;padding:4px;background:transparent;color:inherit;border:0;text-align:left}
 .identity-trigger .identity-name{min-width:0;overflow-wrap:anywhere}
 .menu-chevron{width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin:0 6px;flex:none}
 .user-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:30;min-width:160px;max-width:calc(100vw - 28px);padding:6px;background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 24px #30201424}
 .user-menu[hidden]{display:none}
 #identity .user-menu button{display:block;width:100%;min-height:48px;padding:10px 14px;text-align:left;background:#fff;color:#503c2b;border:0}
 #identity .user-menu button:hover{background:#f6efe7}
 .record-timeline>summary{font-weight:600;min-height:48px}
}
@media screen and (max-width:750px){.identity-menu .user-menu{left:0;right:auto}}
