/* Shared appearance control; the selected theme applies to login and the workspace. */
:root{color-scheme:light;--surface:#fff;--surface-raised:#f1f3f6;--accent:#c34b0a}
.theme-control{display:flex;flex-direction:row;align-items:center;gap:4px;border:1px solid var(--line);border-radius:7px;padding:0 8px;background:var(--surface);color:var(--muted);flex-shrink:0}
.theme-control svg{width:17px;height:17px;flex-shrink:0}
.theme-control select{width:auto;min-height:38px;background:transparent;border:0;padding:6px 3px;color:var(--text);font-size:12px;cursor:pointer}
.theme-control:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.theme-control select:focus-visible{outline:0}
.auth-appearance{display:flex;justify-content:flex-end;width:100%;max-width:445px;margin-bottom:16px}
@media(max-width:1050px){.topbar-right>.session-role{display:none}.topbar-right>strong{max-width:160px;overflow:hidden;text-overflow:ellipsis}}
@media(max-width:760px){.topbar-right>strong,.topbar-right>.avatar{display:none}.topbar{gap:8px}.topbar-right{gap:8px}.theme-control{padding:0 5px}.theme-control select{min-height:40px;font-size:12px}.breadcrumb{min-width:0}.breadcrumb strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.auth-appearance{margin-bottom:12px}}
@media screen{
  :root[data-theme="dark"]{color-scheme:dark;--bg:#17191c;--surface:#202327;--surface-raised:#2a2e33;--text:#edeef0;--muted:#a9afb8;--line:#383e45;--blue:#ffac78;--blue-light:#382a22;--gold:#f49a60;--accent:#ffac78;--green:#91d4ae;--danger:#ffaaa1;--amber:#edc482}
  [data-theme="dark"] body{background:var(--bg)}
  [data-theme="dark"] :is(.sidebar,.topbar,.metrics,.panel,.task,.auth-card,dialog,.model-option,.skip){background:var(--surface);color:var(--text);border-color:var(--line);box-shadow:none}
  [data-theme="dark"] :is(.brand img,.auth-card>img){content:url('assets/chilehome-dark.svg')}
  [data-theme="dark"] :is(h1,h2,h3,.page-title h1,.panel-head h2,.workspace-name strong,.sidebar-profile strong,.breadcrumb strong,.metric-value>strong,.task strong,.bar-label strong,.cost-line strong,.model-label strong,.model-label span b,.model-option strong,.result-bar strong,.chart-data strong,.empty h3){color:var(--text)}
  [data-theme="dark"] :is(.brand>span,.workspace-name small,.sidebar-search,.nav-label,.nav-item,.sidebar-profile small,.sidebar-profile>.icon,.local-status,.sidebar-bottom p,.breadcrumb,.profile-label,.session-role,.section-top,.period-control,.page-title p,.metric>span,.metric>span .icon,.metric em,.metric>small,.metric>.text-link,.panel-head p,.chart-key,.chart-details,.chart-caption,.model-label span,.model-column>strong,.model-column>span,.bar-label,.bar-percent,.panel-foot,.source-note,.task small,.task>.icon,.empty p,.empty>.icon,.page-footer,td,td small,th,.result-bar,.cost-line>span,.cost-line.small,.tabs button,.calculator,.original-total,.issue-list p,.reference-strip p,.auth-label,.auth-card>p,.auth-page>footer,.password-toggle){color:var(--muted)}
  [data-theme="dark"] :is(.btn.subtle,.text-link,td .text-link,.icon-btn,.prototype-banner .text-link){color:var(--text)}
  [data-theme="dark"] :is(.text-link:hover,.account-password-action .text-link,.tabs button.active,.center-drilldown:hover .bar-label>span,.calculator .estimate,.detail-amount){color:var(--accent)}
  [data-theme="dark"] :is(.sidebar-search,.workspace-icon,.center-icon,.center-icon.blue,.search-shortcut,.avatar,.mini-avatar,.document-indicator,.model-house,.inline-count,.task-icon.neutral,.task-icon.blue,.neutral){background:var(--surface-raised);color:var(--muted);border-color:var(--line)}
  [data-theme="dark"] :is(.nav-divider,.bar-track,.model-bar-space){background:var(--line)}
  [data-theme="dark"] :is(.nav-item:hover,.task:hover,tbody tr:hover,.btn.outline:hover,.btn.subtle:hover,.icon-btn:hover){background:var(--surface-raised);color:var(--text)}
  [data-theme="dark"] :is(.nav-item.active,.sidebar-profile .avatar,.active .nav-count,.metric:first-child,.model-option.selected,.reference-content tfoot td){background:var(--blue-light);color:var(--accent);border-color:#805237}
  [data-theme="dark"] :is(.metric:first-child .metric-value>strong,.metric:first-child>span .icon){color:var(--accent)}
  [data-theme="dark"] :is(.btn.outline,input,select,textarea,#profile,.account-form input,.account-form select,.period-control,.search,.nav-count){background:var(--surface);border-color:var(--line);color:var(--text)}
  [data-theme="dark"] :is(input::placeholder,textarea::placeholder){color:#959da8}
  [data-theme="dark"] :is(.account-form input[readonly],.segmented,.calculator,th,.panel-foot,.source-note,.dialog-foot,.notice,.prototype-banner,.upload-box){background:#25292e;color:var(--muted);border-color:var(--line)}
  [data-theme="dark"] .segmented button{color:var(--muted)}
  [data-theme="dark"] .segmented button.selected{background:#3a4048;color:var(--text);box-shadow:none}
  [data-theme="dark"] .btn.primary{background:#f5a16c;border-color:#f5a16c;color:#27190f;box-shadow:none}
  [data-theme="dark"] .btn.primary:hover{background:#ffb788;border-color:#ffb788}
  [data-theme="dark"] :is(.password-toggle:hover,.task-count,.soft-tag,.badge.blue,.blue,.calculator .center-icon){background:var(--blue-light);color:var(--accent);border-color:#805237}
  [data-theme="dark"] :is(.badge.amber,.notice.amber,.amber,.issue-number,.task-icon.amber,.reference-strip,.reference-symbol){background:#342d22;color:#edc482;border-color:#685735}
  [data-theme="dark"] :is(.badge.green,.green,.cloud-banner){background:#22332a;color:#91d4ae;border-color:#3c5c49}
  [data-theme="dark"] .badge{background:var(--surface-raised);color:var(--muted);border-color:var(--line)}
  [data-theme="dark"] .badge.green{background:#22332a;color:#91d4ae;border-color:#3c5c49}
  [data-theme="dark"] .badge.amber{background:#342d22;color:#edc482;border-color:#685735}
  [data-theme="dark"] .badge.blue{background:var(--blue-light);color:var(--accent);border-color:#805237}
  [data-theme="dark"] :is(th,td,.task+.task,.chart-details,.chart-data>div,.chart-caption,.result-bar,.center-card footer,.original-total,.movements-panel .empty,.document-card,.heading-tag){border-color:var(--line)}
  [data-theme="dark"] .chart-grid{stroke:var(--line)}
  [data-theme="dark"] :is(.chart-axis,.chart-empty-title){fill:var(--muted)}
  [data-theme="dark"] .trend-plot polygon{fill:#382a22}
  [data-theme="dark"] .chart-empty strong{background:var(--surface);color:var(--text)}
  [data-theme="dark"] .chart-empty span{background:var(--surface);color:var(--muted)}
  [data-theme="dark"] .negative{background:#3b2525;color:var(--danger)}
  [data-theme="dark"] dialog::backdrop{background:#080a0dcc}
  [data-theme="dark"] #toast{background:#f5a16c;color:#27190f;border-color:#f5a16c}
  [data-theme="dark"] .upload-box input::file-selector-button{background:var(--surface);color:var(--text);border-color:var(--line)}
  [data-theme="dark"] .theme-control select{background:transparent}
  [data-theme="dark"] input:-webkit-autofill{-webkit-text-fill-color:var(--text);box-shadow:0 0 0 100px var(--surface) inset}
}
@media print{.theme-control,.auth-appearance{display:none!important}}

/* Tooltips live outside clipped chart panels and follow the current appearance. */
.chart-tooltip{position:fixed;z-index:80;pointer-events:none;max-width:min(290px,calc(100vw - 16px));padding:12px 15px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);box-shadow:0 6px 24px #0002;line-height:1.5}
.chart-tooltip[hidden]{display:none}.chart-tooltip-title{display:block;font-size:12px;font-weight:600}.chart-tooltip-detail{display:block;font-size:11px;color:var(--muted);margin-top:2px}.chart-tooltip strong{display:block;font-size:20px;font-variant-numeric:tabular-nums;margin-top:5px;color:var(--accent)}
[data-chart-series],[data-chart-label]{cursor:crosshair}.center-drilldown[data-chart-label]{cursor:pointer}
[data-chart-series]:focus-visible,[data-chart-label]:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}
.chart-probe{pointer-events:none}.chart-probe line{stroke:var(--muted);stroke-width:1;stroke-dasharray:3 3}.chart-probe circle{fill:var(--accent);stroke:var(--surface);stroke-width:2}
.budget-chart{min-height:10px}.chart-tooltip-detail:empty{display:none}
@media print{.chart-tooltip,.chart-probe{display:none!important}}

/* Operating cost structure: shared tokens keep both appearances consistent. */
.cost-overview{display:grid;grid-template-columns:1.1fr 1fr 1fr;border-block:1px solid var(--line);margin:0 0 28px;padding:18px 0;gap:24px;align-items:center}
.cost-overview>div,.cost-overview>button{display:flex;flex-direction:column;gap:6px;text-align:left}
.cost-overview>button{border:0;border-left:1px solid var(--line);padding:0 0 0 24px;background:none;color:var(--text);cursor:pointer}
.cost-overview strong{font-size:15px}.cost-overview span,.cost-overview small{font-size:12px;color:var(--muted)}
.cost-overview>button:hover strong{color:var(--accent)}
.cost-summary{display:grid;grid-template-columns:1.15fr 1.2fr .65fr;background:var(--surface);border:1px solid var(--line);border-radius:10px;margin:22px 0 16px}
.cost-summary>div{display:flex;flex-direction:column;gap:10px;padding:24px;min-width:0}
.cost-summary>div+div{border-left:1px solid var(--line)}
.cost-summary span{font-size:13px;color:var(--muted)}.cost-summary strong{font-size:24px;letter-spacing:-.5px;line-height:1.3;color:var(--text);font-variant-numeric:tabular-nums}.cost-summary>div:first-child strong{color:var(--accent)}
.cost-summary small{font-size:11px;color:var(--muted);line-height:1.5}.cost-context{font-size:13px;color:var(--muted);line-height:1.7;max-width:95ch;margin-bottom:22px}
.cost-tabs{position:relative;z-index:1;display:flex;align-items:flex-end;gap:6px;padding:8px 8px 0;margin:0;border:0;overflow:visible;isolation:isolate}
.cost-tabs button{position:relative;min-height:48px;min-width:155px;margin-bottom:-1px;padding:13px 22px;border:1px solid var(--line);border-radius:11px 11px 0 0;background:var(--surface-raised);color:var(--muted);font-size:13px;font-weight:500;white-space:nowrap}
.cost-tabs button:hover{background:var(--bg);color:var(--text)}
.cost-tabs button.active{z-index:1;background:var(--surface);color:var(--accent);border-color:var(--line);border-bottom-color:var(--surface);box-shadow:inset 0 3px 0 var(--accent);font-weight:600}
.cost-tabs+.panel{position:relative;margin-top:0}.cost-missing{color:var(--muted);font-size:12px;font-weight:400}
.cost-services{display:grid;grid-template-columns:repeat(3,1fr);padding:0 24px 24px;gap:24px}.cost-services article{display:flex;flex-direction:column;gap:8px;padding:12px 0 0;border-top:2px solid var(--line)}.cost-services article>span{color:var(--muted);font-size:12px}
.cost-models{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px;padding:0 24px 24px}.cost-models button{display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:14px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--text);cursor:pointer}.cost-models button.selected{border-color:var(--accent);background:var(--blue-light)}.cost-models strong{font-size:18px}.cost-models span{font-size:12px}.cost-models small{font-size:10px;color:var(--muted)}
.cost-model-title{display:flex;align-items:center;justify-content:space-between;padding:18px 24px;border-top:1px solid var(--line);gap:18px}.cost-model-title h3{margin:0;font-size:16px}.cost-model-title>span{font-size:12px;color:var(--muted)}.cost-model-title strong{font-size:18px;color:var(--accent);margin-left:8px;font-variant-numeric:tabular-nums}
.cost-warning{padding:0 24px 16px;color:var(--muted);font-size:13px;line-height:1.6;margin:0}
.cost-model-empty{padding:8px 24px 28px;max-width:85ch}.cost-model-empty h3{font-size:15px;margin-bottom:10px}.cost-model-empty p{font-size:13px;color:var(--muted);line-height:1.7;margin-bottom:8px}
.cost-review{padding:0 24px 24px}.cost-review article{padding:18px 0;border-top:1px solid var(--line)}.cost-review h3{font-size:15px;margin:0 0 8px}.cost-review h3>span{float:right;margin-left:16px;color:var(--accent)}.cost-review p{font-size:13px;line-height:1.7;margin:0;max-width:85ch;color:var(--muted)}.cost-review small{display:block;color:var(--muted);margin-top:10px;font-size:11px}
.cost-origin{margin:22px 0;color:var(--muted);font-size:12px;line-height:1.7;max-width:95ch}.cost-origin summary{cursor:pointer;min-height:32px}.cost-origin p{overflow-wrap:anywhere}

/* Keep the editor's title and actions visible; only its active section can scroll. */
dialog.expense-dialog{width:min(820px,calc(100vw - 32px));height:min(680px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);overflow:hidden}
dialog.expense-dialog[open]{display:flex;flex-direction:column}
.expense-dialog .dialog-head{padding:18px 24px;flex-shrink:0}
.expense-dialog .dialog-head h2{font-size:22px}
#expense-form{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.expense-sections{display:flex;align-items:flex-end;gap:6px;padding:10px 24px 0;border-bottom:1px solid var(--line);background:var(--bg);flex-shrink:0;isolation:isolate}
.expense-sections button{position:relative;display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:11px 18px;margin-bottom:-1px;border:1px solid var(--line);border-radius:10px 10px 0 0;background:var(--surface-raised);color:var(--muted);font-size:13px;font-weight:500}
.expense-sections button:hover{background:var(--bg);color:var(--text)}
.expense-sections button.selected{z-index:1;border-bottom-color:var(--surface);background:var(--surface);color:var(--accent);box-shadow:inset 0 3px 0 var(--accent);font-weight:600}
.expense-sections .icon{width:17px;height:17px}
.expense-file-dot{width:6px;height:6px;background:var(--green);border-radius:50%}
.expense-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.expense-scroll::-webkit-scrollbar{width:6px}.expense-scroll::-webkit-scrollbar-thumb{background:var(--line);border-radius:6px}
.expense-dialog .form-body{padding:20px 24px}
.expense-dialog [hidden]{display:none!important}
.expense-dialog .form-grid{gap:15px 20px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.expense-dialog .form-grid label{font-size:12px;gap:6px}
.expense-dialog .form-intro{margin-bottom:16px}
.expense-dialog input,.expense-dialog select{min-height:42px}
.expense-dialog textarea{height:124px;min-height:124px;max-height:180px;resize:vertical;line-height:1.5;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.expense-dialog .expense-upload{display:grid;grid-template-columns:24px 1fr;align-items:center;gap:6px 12px;text-align:left;padding:14px 16px;margin:18px 0 10px}
.expense-upload-copy{display:flex;flex-direction:column;gap:4px}.expense-upload-copy strong{color:var(--text);font-size:12px}.expense-upload-copy>span{color:var(--muted);font-size:11px}
.expense-dialog .expense-upload input{grid-column:2;max-width:100%;min-height:0;font-size:11px;padding:0}
.expense-dialog .existing-file{flex-wrap:wrap;margin:10px 0}.expense-dialog .existing-file>span{overflow-wrap:anywhere;min-width:0}
.expense-dialog .expense-footer{display:flex;flex-direction:column;gap:10px;padding:14px 24px;flex-shrink:0;background:var(--surface);border-top:1px solid var(--line)}
.expense-footer .actions{justify-content:flex-end}.expense-footer .form-error{margin:0;max-height:72px;overflow:auto}
.expense-footer .btn{min-height:42px}
body:has(dialog.expense-dialog[open]){overflow:hidden}
@media(max-width:600px){dialog.expense-dialog{width:calc(100vw - 20px);height:min(690px,calc(100dvh - 20px));max-height:calc(100dvh - 20px)}.expense-dialog .dialog-head{padding:15px 18px}.expense-dialog .form-body{padding:18px}.expense-sections{padding:10px 12px 0;gap:5px}.expense-sections button{font-size:12px;gap:6px;min-height:46px;padding:10px;flex:1}.expense-sections .icon{display:none}.expense-dialog .form-grid{gap:13px;grid-template-columns:minmax(0,1fr)}.expense-dialog .span-2{grid-column:auto}.expense-dialog .expense-footer{padding:12px 18px}.expense-dialog .form-grid input,.expense-dialog .form-grid select,.expense-dialog .form-grid textarea{font-size:16px}.expense-dialog .expense-upload{padding:12px}.expense-dialog .expense-upload input{grid-column:1/-1}.expense-footer .actions{flex-wrap:nowrap}.expense-footer .actions .btn{flex:1}}
.cost-models button:focus-visible,.cost-overview button:focus-visible,.cost-tabs button:focus-visible,.cost-origin summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:1000px){.cost-summary{grid-template-columns:1fr 1fr}.cost-summary>div:last-child{grid-column:1/-1;border-left:0;border-top:1px solid var(--line);display:grid;grid-template-columns:1fr auto;gap:6px}.cost-summary>div:last-child strong{grid-column:2;grid-row:1/3}.cost-overview{grid-template-columns:1fr 1fr}.cost-overview>div{grid-column:1/-1}.cost-overview>button{border-left:0;padding:0}}
@media(max-width:600px){.cost-summary{display:block}.cost-summary>div+div{border-left:0;border-top:1px solid var(--line)}.cost-summary>div{padding:18px}.cost-summary strong{font-size:22px}.cost-services{grid-template-columns:1fr;gap:14px;padding-inline:18px}.cost-models{grid-template-columns:repeat(2,1fr);padding-inline:18px}.cost-model-title{align-items:flex-start;flex-direction:column;padding-inline:18px}.cost-overview{grid-template-columns:1fr}.cost-overview>button+button{padding-top:16px;border-top:1px solid var(--line)}.cost-review h3>span{float:none;display:block;margin:8px 0}.cost-review{padding-inline:18px}}

@media(max-width:600px){.cost-tabs{gap:4px;padding:6px 4px 0}.cost-tabs button{min-width:0;flex:1;padding:12px 8px;font-size:12px;white-space:normal;line-height:1.4}}
.cost-edit-btn{white-space:nowrap;font-size:12px;align-self:flex-start;min-height:34px}.cost-services .cost-edit-btn{margin-top:8px}.cost-model-title .actions{flex-wrap:wrap;justify-content:flex-end}.cost-editor-total{padding:10px 14px;background:var(--surface-soft);border:1px solid var(--line);border-radius:8px;font-weight:600}dialog.cost-editor-dialog[open]{display:flex;flex-direction:column;width:min(720px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:hidden}.cost-editor-dialog .dialog-head,.cost-editor-dialog .dialog-foot{flex-shrink:0}.cost-editor-dialog form{display:flex;flex-direction:column;min-height:0}.cost-editor-dialog .form-body{overflow-y:auto;min-height:0}.cost-editor-dialog .dialog-foot{flex-direction:column;align-items:stretch}.cost-editor-dialog .dialog-foot .actions{justify-content:flex-end}.cost-editor-dialog .form-error{margin:0}.cost-editor-dialog .form-intro{margin-bottom:16px}.cost-editor-dialog datalist{display:none}body:has(.cost-editor-dialog[open]){overflow:hidden}@media(max-width:600px){.cost-editor-dialog .form-grid{grid-template-columns:1fr}.cost-editor-dialog .form-body{padding:16px}.cost-editor-dialog .dialog-head,.cost-editor-dialog .dialog-foot{padding:14px 16px}.cost-model-title{flex-wrap:wrap;gap:14px}}
/* Comfortable reading at 100% browser zoom, shared by every workspace view. */
@media screen {
  :root { --ui-body:1rem; --ui-label:.9375rem; --ui-small:.875rem; --sidebar:280px; }
  :root:not([data-theme="dark"]) { --muted:#5d6673; }
  body { font-size:var(--ui-body); line-height:1.55; }
  .sidebar { overflow-y:auto; overscroll-behavior:contain; }
  .brand,.workspace-name,.sidebar-search,.sidebar-bottom { flex-shrink:0; }
  .brand { height:108px; padding:22px 26px 12px; }
  .brand img { width:208px; height:58px; }
  .brand>span,.workspace-name small,.nav-label,.sidebar-profile small,
  .local-status,.sidebar-bottom p,.nav-count { font-size:var(--ui-small); }
  .workspace-name { padding:18px 22px; }
  .workspace-name strong,.sidebar-profile strong { font-size:var(--ui-body); }
  .sidebar-search { font-size:var(--ui-label); min-height:46px; margin-bottom:22px; }
  .nav-item { font-size:var(--ui-body); min-height:50px; padding:12px; line-height:1.4; }
  .nav-item>.icon { width:22px; height:22px; flex-shrink:0; }
  .nav-divider { margin-block:20px; }
  .sidebar-bottom { padding-top:18px; }
  .topbar { min-height:72px; height:auto; padding-block:12px; }
  .breadcrumb,.topbar-right,.theme-control select,#profile { font-size:var(--ui-label); }
  .session-role,.profile-label,.prototype-banner,.prototype-banner .text-link { font-size:var(--ui-small); }
  .prototype-banner { min-height:40px; }
  .section-top,.period-control,.period-control input { font-size:var(--ui-label); }
  .section-top { gap:16px; flex-wrap:wrap; }
  .period-control input { width:182px; }
  .page-title { gap:20px; flex-wrap:wrap; }
  .page-title h1 { font-size:34px; line-height:1.2; }
  .page-title p,.settings-body>p { font-size:var(--ui-body); }
  .btn,.page-title .btn,.page-title>.actions .btn,.empty .btn,.panel-head .btn,
  .cost-edit-btn,.result-bar .btn { font-size:var(--ui-label); min-height:44px; padding:10px 16px; line-height:1.4; }
  .btn .icon,.icon { width:20px; height:20px; }
  .icon-btn { min-width:44px; min-height:44px; }
  input,select,textarea,.filters select,.search input,.account-form input,.account-form select,
  .form-grid input,.form-grid select,.form-grid textarea { font-size:var(--ui-body); }
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select { min-height:46px; }
  label,.form-grid label,.expense-dialog .form-grid label,.account-form label,.auth-card label { font-size:var(--ui-label); }
  .help,.form-intro,.eyebrow,.settings-body .help,.expense-upload-copy>span,
  .expense-dialog .expense-upload input,.existing-file,.upload-box>span,.form-error { font-size:var(--ui-small); }
  .expense-upload-copy strong { font-size:var(--ui-label); }
  .filters { gap:14px; }
  .filters select { min-width:180px; }
  .search { min-width:min(100%,320px); }
  .search .icon { width:20px; flex-shrink:0; }
  .result-bar,.chart-details,.chart-key,.chart-caption,.chart-caption .text-link,
  .panel-foot,.source-note,.page-footer { font-size:var(--ui-small); }
  .result-bar .check-label,.check-label { font-size:var(--ui-small)!important; }
  .check-label input { width:18px; height:18px; min-height:18px; flex-shrink:0; }
  .table-wrap { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
  table { min-width:860px; }
  th { font-size:var(--ui-small); color:var(--muted); }
  td,td .text-link,.reference-content td { font-size:var(--ui-body); line-height:1.55; }
  td { color:var(--text); }
  th,td { padding:18px 22px; }
  td small,.reference-content th { font-size:var(--ui-small); color:var(--muted); }
  .badge,.soft-tag,.inline-count,.task-count { font-size:.8125rem; padding:5px 9px; }
  .mini-avatar { width:28px; height:28px; font-size:13px; }
  .panel-head h2,.center-card h2 { font-size:20px; }
  .panel-head p { font-size:var(--ui-small); line-height:1.6; }
  .panel-head { flex-wrap:wrap; }
  .metric>span,.metric em { font-size:var(--ui-label); }
  .metric>small,.metric>.text-link { font-size:var(--ui-small); line-height:1.5; }
  .metric-value>strong { font-size:36px; }
  .segmented button { min-height:40px; font-size:var(--ui-small); padding:8px 12px; }
  .chart-axis { font-size:15px; }
  .chart-empty strong,.model-label span,.model-label strong,.bar-label,.bar-label strong,
  .task strong,.document-card h3,.profile-row strong,.empty p { font-size:var(--ui-body); }
  .chart-empty span,.bar-percent,.task small,.document-card p,.profile-row small { font-size:var(--ui-small); }
  .empty h3 { font-size:20px; }
  .cost-line { font-size:var(--ui-label); }
  .cost-line.small,.cost-line.small strong,.center-card footer .text-link { font-size:var(--ui-small); }
  .cost-overview strong,.cost-services strong { font-size:18px; }
  .cost-overview span,.cost-overview small,.cost-summary small,.cost-missing,
  .cost-models small,.cost-review small,.cost-origin { font-size:var(--ui-small); }
  .cost-summary span,.cost-context,.cost-warning,.cost-services article>span,
  .cost-services article>small,.cost-models span,.cost-model-title>span,
  .cost-model-empty p,.cost-review p { font-size:var(--ui-body); }
  .cost-summary strong { font-size:28px; }
  .cost-models { grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); gap:12px; }
  .cost-models button { padding:16px; text-align:left; }
  .cost-models strong,.cost-model-title strong { font-size:22px; }
  .cost-model-title h3,.cost-model-empty h3,.cost-review h3 { font-size:19px; }
  .tabs button,.cost-tabs button,.expense-sections button { font-size:var(--ui-label); min-height:48px; }
  .chart-tooltip-title,.chart-tooltip-detail { font-size:var(--ui-small); }
  .chart-tooltip strong { font-size:24px; }
  .dialog-head h2,.expense-dialog .dialog-head h2 { font-size:26px; }
  .detail-grid dt { font-size:var(--ui-small); }
  .detail-grid dd,.detail-note,.notice { font-size:var(--ui-body); }
  .auth-card { max-width:500px; }
  .auth-card>p { font-size:var(--ui-body); }
  .auth-label,.auth-card .auth-help,.auth-page>footer { font-size:var(--ui-small); }
  .auth-appearance { max-width:500px; }
  .cost-editor-total { background:var(--surface-raised); }
  @media (max-width:1200px) {
    :root { --sidebar:256px; }
    .brand img { width:192px; }
    .nav-item { font-size:var(--ui-label); }
    .topbar-right>strong { display:none; }
    .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .metric:nth-child(2):after { display:none; }
    .metric:nth-child(-n+2) { border-bottom:1px solid var(--line); }
    .analysis-grid,.overview-grid { grid-template-columns:1fr; }
  }
  @media (max-width:760px) {
    :root { --sidebar:0px; }
    .sidebar { top:72px; width:min(292px,calc(100vw - 24px)); }
    .topbar { height:72px; padding:10px 16px; }
    .breadcrumb { font-size:var(--ui-small); gap:6px; }
    .theme-control select { font-size:var(--ui-small); min-height:44px; }
    .topbar-right { gap:4px; }
    .topbar-right .btn { padding-inline:10px; }
    .page-title h1 { font-size:30px; }
    .page-title>.actions { margin-top:0; }
    .section-top>span { max-width:none; }
    .period-control { width:100%; justify-content:space-between; }
    .filters select { min-width:calc(50% - 14px); }
    .search { min-width:100%; }
    .metric-value>strong { font-size:30px; }
    .panel-head h2 { font-size:20px; }
    .panel-head .btn { white-space:normal; }
    .cost-models { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .cost-tabs button { min-width:0; padding:12px 8px; }
    .dialog-head h2,.expense-dialog .dialog-head h2 { font-size:23px; }
  }
  @media (max-width:480px) {
    .metrics { grid-template-columns:1fr; }
    .metric:not(:last-child) { border-bottom:1px solid var(--line); }
    .metric:after { display:none; }
    .metric-value>strong { font-size:34px; }
    .filters select { flex-basis:100%; }
  }
}
