/* Shared refinements preserve the original care palette and page structure. */
:where(button,a,input,textarea,select,summary):focus-visible{outline:3px solid var(--green-deep);outline-offset:3px}
button.primary,button.secondary,.actions>button,.dialog-head button,.export-actions a,.sidebar nav button,.card-head>button,.history-pagination button{min-height:44px}
.text-button{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
.sidebar-bottom .text-button{justify-content:flex-start}
.sidebar nav button{transition:background-color .15s ease,color .15s ease}
.sidebar nav button:hover{background:#f0f2e8}
.sidebar nav button.active:hover{background:var(--green-bg)}
.sidebar nav button[aria-current="page"]{background:var(--green-bg);color:var(--green-deep);font-weight:600}
.topbar>div,.page-heading>div,.card-head>div,.summary-banner>div{min-width:0}
.topbar strong,.page-heading h1,.card-head h3,.summary-banner h2{overflow-wrap:anywhere}
.page-heading .actions{flex-shrink:0}
.table-wrap{overflow:auto;max-height:560px;overscroll-behavior-x:contain;scrollbar-width:thin;border-radius:10px}
.table-wrap:focus-visible{outline:3px solid var(--green-deep);outline-offset:3px}
table th{white-space:nowrap;position:sticky;top:0;z-index:1}
table td{line-height:1.75}
table td button{min-height:44px}
table td:has(button){min-width:110px}
table tbody tr:hover{background:#fbfcf8}
.stat{min-width:0;position:relative}
button.stat,.stat[data-tab]{width:100%;text-align:left;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}
button.stat:hover,.stat[data-tab]:hover{border-color:#a6b99b;background:#fbfcf7}
button.stat:focus-visible,.stat[data-tab]:focus-visible{outline:3px solid var(--green-deep);outline-offset:3px}
.stat b{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.stat b small{font-size:13px;color:var(--gray);font-weight:400}
.stat .stat-link{display:block;margin-top:8px;color:var(--green-deep);font-size:12px}
.todo-list,.task-board{display:grid;gap:10px}
.todo-item,.task-item{display:flex;align-items:center;gap:16px;padding:16px 18px;background:#fafbf6;border:1px solid var(--line);border-radius:14px;min-width:0;text-align:left}
button.todo-item:hover,button.task-item:hover{border-color:#a6b99b;background:#f4f7ef}
.todo-item .todo-copy,.task-item .todo-copy{flex:1;min-width:0}
.todo-copy strong,.todo-copy p,.todo-meta{overflow-wrap:anywhere}
.todo-copy strong{display:block;font-size:15px}
.todo-copy p{font-size:13px;color:var(--gray);margin:4px 0 0}
.todo-meta{display:block;font-size:12px;color:var(--gray);margin-top:6px}
.todo-kind{flex:0 0 auto;display:inline-flex;justify-content:center;align-items:center;min-width:62px;min-height:32px;padding:5px 10px;background:var(--green-bg);border-radius:8px;color:var(--green-deep);font-size:12px;font-weight:600;white-space:nowrap}
.todo-count{padding:3px 10px;background:var(--green-bg);color:var(--green-deep);border-radius:12px;font-size:12px;font-weight:500}
.todo-empty{padding:28px 18px;text-align:center;color:var(--gray);background:#fafbf7;border-radius:14px}
.todo-item.is-urgent,.task-item.is-urgent{border-color:#edc8bd;background:#fff8f5}
.todo-item.is-urgent .todo-kind,.task-item.is-urgent .todo-kind{background:#fceee8;color:var(--red)}
.metric-filters,.metric-filter{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;margin:18px 0}
.metric-filters label,.metric-filter label{min-width:145px;flex:1;margin:0}
.metric-filters button,.metric-filter button{min-height:48px}
.filter-summary{font-size:13px;color:var(--gray);margin:10px 0 18px}
.metric-item{min-width:0}
.metric-item b,.metric-item small{overflow-wrap:anywhere}
#metricHistory table{min-width:820px}
#metricHistory th:nth-child(1),#metricHistory td:nth-child(1){min-width:75px;white-space:nowrap}
#metricHistory th:nth-child(2),#metricHistory td:nth-child(2){min-width:70px;white-space:nowrap}
#metricHistory td:nth-child(3){min-width:135px}
#metricHistory td:nth-child(4),#metricHistory td:nth-child(6){min-width:150px}
#metricHistory td:nth-child(5){min-width:180px;max-width:320px}
dialog{scrollbar-gutter:stable;overscroll-behavior:contain}
.dialog-head button{width:44px;height:44px;flex-shrink:0;border-radius:10px}
.dialog-head button:hover{background:var(--green-bg)}
.auth-shell,.auth-panel,.auth-story{min-width:0}
.auth-tabs button{min-height:44px}
.auth-panel input{min-height:48px}
.auth-panel .primary{min-height:48px}
.auth-panel .device-entry{min-height:44px}
.auth-panel #authSubtitle{min-height:24px}
.auth-panel #passwordHelp{margin-top:-8px}
.password-field{position:relative;margin-bottom:16px}
.password-field label{margin-bottom:0}
.password-field label input{padding-right:76px}
.password-toggle{position:absolute;right:4px;bottom:2px;min-width:60px;min-height:44px;padding:7px 12px;border-radius:8px;font-size:13px;color:var(--green-deep)}
.password-toggle:hover{background:var(--green-bg)}
.auth-tabs button:disabled{cursor:wait}
.auth-help .text-button{font-size:13px}
.auth-help{margin-top:12px}
.auth-panel .error{font-size:14px}
@media(max-width:980px){.auth-story{padding:36px}.auth-story h1{font-size:33px}.auth-panel{padding:40px 32px}.page-heading .actions{flex-shrink:1}.stats{grid-template-columns:1fr 1fr}}
@media(max-width:740px){
  .auth-story{padding:24px}.auth-panel{padding:28px 24px}.auth-tabs{margin-bottom:26px}
  .topbar{align-items:flex-start}.topbar>div{flex:1}.topbar strong{display:block}
  .elder-picker{flex-shrink:0}.elder-picker select{min-height:44px;max-width:38vw}
  .page-heading .actions{width:100%}.page-heading .actions button{min-height:44px;font-size:13px}
  .stat{padding:17px}.stat span{display:block}.stat .stat-link{font-size:11px}
  .todo-item,.task-item{padding:14px 12px;gap:12px;flex-wrap:wrap}
  .todo-item>.actions,.task-item>.actions{margin-left:auto}
  .metric-filters,.metric-filter{gap:12px}.metric-filters label,.metric-filter label{min-width:125px}
  .metric-filters button,.metric-filter button{flex:1;min-width:120px}
  .row time{white-space:normal}.loading{padding:50px 18px}
}
@media(max-width:400px){
  .auth-page{padding:12px}.auth-panel{padding:25px 20px}.auth-story{padding:22px 20px}.auth-tabs{gap:22px}
  .auth-story .brand{font-size:27px;gap:10px}.auth-story .brand span{font-size:11px;padding-left:10px}
  .topbar{gap:12px}.topbar small{font-size:11px}.elder-picker select{width:106px}
  #content{padding-left:14px;padding-right:14px}.card{padding:16px}.summary-banner{padding:18px;gap:14px}
  .stats{gap:10px}.stat{padding:14px}.stat b{font-size:25px}
  .metric-list{grid-template-columns:1fr}.metric-filters label,.metric-filter label{flex-basis:100%}
  .todo-kind{min-width:58px;padding:5px 8px}
}
@media(prefers-reduced-motion:reduce){.sidebar nav button,button.stat,.stat[data-tab],.portal-toast{transition:none}}
