/* TEKSEN design tokens. Every screen uses the same light/dark colour roles. */
:root {
  color-scheme: light;
  --ground:#f1f4f7; --surface:#ffffff; --surface-soft:#f7f9fb; --active:#e7ecf1;
  --text:#182230; --muted:#526174; --dim:#627084; --border:#e0e5eb; --rule:#edf0f3;
  --control:#a8b4c4; --accent:#285c9a; --accent-soft:#edf3fa; --primary:#244b78; --on-primary:#ffffff;
  --focus:#2869ac; --positive:#206542; --positive-bg:#e8f3ec; --negative:#9c2635; --negative-bg:#fbeaec;
  --warning:#80510e; --warning-bg:#fff3d9; --overlay:rgba(12,18,26,.48); --radius:12px;
  --font:"Segoe UI",-apple-system,BlinkMacSystemFont,Arial,sans-serif;
  font-family:var(--font); color:var(--text); background:var(--ground); font-size:14px;
}
:root[data-theme="dark"] {
  color-scheme:dark;
  --ground:#111315; --surface:#191c20; --surface-soft:#23272b; --active:#30363d;
  --text:#eff2f6; --muted:#b5beca; --dim:#a4aebb; --border:#343a42; --rule:#2b3036;
  --control:#637080; --accent:#8cb9ea; --accent-soft:#233347; --primary:#cad7e7; --on-primary:#162334;
  --focus:#8cb9ea; --positive:#8cd5a8; --positive-bg:#20372b; --negative:#ffb0b7; --negative-bg:#45272e;
  --warning:#f0cf8a; --warning-bg:#3c3220; --overlay:rgba(0,0,0,.6);
}
* { box-sizing:border-box; }
html { scrollbar-gutter:stable; scroll-padding-top:80px; }
body { margin:0; color:var(--text); background:var(--ground); font-family:var(--font); line-height:1.5; }
button,input,select,textarea { font:inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.65; }
[hidden] { display:none!important; }
:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
input,select,textarea { color:var(--text); background:var(--surface); border:1px solid var(--control); border-radius:8px; caret-color:var(--accent); }
input::placeholder,textarea::placeholder { color:var(--dim); opacity:1; }
::selection { color:var(--on-primary); background:var(--primary); }
* { scrollbar-color:var(--control) transparent; scrollbar-width:thin; }
h1,h2,h3,p { overflow-wrap:break-word; }
h1,h2,h3 { color:var(--text); text-wrap:balance; letter-spacing:-.02em; }
small { color:var(--muted); }
a { color:var(--accent); text-underline-offset:3px; }
svg { flex-shrink:0; }
button svg,.icon-button svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.skip-link { position:fixed; top:-80px; left:16px; z-index:200; padding:12px 20px; color:var(--on-primary); background:var(--primary); border-radius:8px; }
.skip-link:focus { top:12px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.company-list { max-height:none; overflow:visible; }
.people-panel .card-head p { display:none; }
.people-export { display:inline-flex; margin:8px 0 16px; }
.icon-button { display:inline-flex; align-items:center; justify-content:center; flex:none; width:40px; height:40px; min-width:40px; padding:8px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text); }
.icon-button:hover { background:var(--active); }
.menu-toggle,.drawer-heading,.mobile-wordmark { display:none; }
.nav-backdrop { position:fixed; inset:0; width:100%; height:100dvh; background:var(--overlay); border:0; z-index:80; border-radius:0; }
.menu-open { overflow:hidden; }
.theme-toggle { margin:0; }
.app { display:flex; min-height:100dvh; }
.sidebar { width:240px; height:100dvh; padding:24px 14px 16px; position:sticky; top:0; overflow-y:auto; background:var(--ground); border:0; color:var(--text); box-shadow:none; }
.brand { display:flex; align-items:center; gap:10px; padding:0 8px 24px; }
.brand-logo { width:80px; height:54px; object-fit:contain; background:#fff; border:0; border-radius:6px; padding:4px; filter:none; }
.brand strong { display:block; font-size:15px; letter-spacing:0; line-height:1.3; color:var(--text); }
.brand span { display:block; margin-top:4px; color:var(--muted); font-size:12px; opacity:1; }
.side-label { padding:0 12px; margin:8px 0 10px; color:var(--muted); font-size:12px; font-weight:500; letter-spacing:0; text-transform:none; }
.side-link,.company-nav,.project-nav { width:100%; display:flex; align-items:center; gap:10px; min-height:40px; padding:9px 12px; margin:2px 0; color:var(--muted); background:transparent; border:0; border-radius:7px; font-size:14px; font-weight:500; text-align:left; letter-spacing:0; }
.side-link.active,.company-nav.active,.project-nav.active { color:var(--text); background:var(--active); box-shadow:none; border-left:0; }
.side-link:hover,.company-nav:hover,.project-nav:hover { color:var(--text); background:var(--active); }
.side-link .icon { width:18px; height:18px; }
.company-nav small,.project-nav small { color:var(--muted); margin-left:auto; font-variant-numeric:tabular-nums; }
.project-nav { padding-left:24px; }
.sidebar-divider { height:1px; margin:18px 10px; background:var(--border); }
.sidebar .side-footer { margin-top:24px; padding:16px 10px 0; border-top:1px solid var(--border); color:var(--muted); font-size:12px; }
.side-footer strong,.side-footer small { display:block; font-size:12px; font-weight:400; margin:0; color:var(--muted); }
.main { flex:1; min-width:0; background:var(--ground); }
.main:focus { outline:none; }
.topbar { position:relative; height:64px; padding:0 24px; border:0; background:var(--ground); display:flex; justify-content:space-between; gap:16px; }
.topbar-leading { display:flex; align-items:center; gap:12px; min-width:0; }
.breadcrumb { display:flex; align-items:center; min-width:0; font-size:13px; color:var(--muted); }
.breadcrumb button { background:transparent; border:0; padding:6px 0; color:var(--muted); white-space:nowrap; }
.breadcrumb strong { color:var(--text); max-width:360px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.breadcrumb span { margin:0 10px; color:var(--muted); }
.top-actions { display:flex; align-items:center; gap:8px; flex:none; }
.today { color:var(--muted); font-size:12px; margin-right:8px; }
.top-help { background:transparent; border:1px solid var(--border); color:var(--text); border-radius:8px; padding:8px 12px; min-height:40px; font-size:13px; font-weight:500; }
.top-help:hover { background:var(--active); }
#signedInName { font-size:12px; color:var(--muted); max-width:160px; overflow:hidden; text-overflow:ellipsis; }
/* At 1440px: 240px navigation + 1192px sheet + 8px inset; sheet gutters are 24px. */
.content { max-width:none; margin:0 8px 8px 0; padding:28px 24px 40px; min-height:calc(100dvh - 72px); background:var(--surface); border:1px solid var(--border); border-radius:16px; }
.heading { gap:20px; align-items:flex-start; margin-bottom:24px; }
.heading h1 { margin:0 0 6px; font-size:26px; line-height:1.25; font-weight:650; color:var(--text); }
.heading h1:focus { outline:none; }
.heading p,.card-head p,.workspace-head p,.tool-head p { font-size:14px; line-height:1.6; color:var(--muted); margin:5px 0 0; max-width:70ch; }
.prep-hero-icon,.hero-logo { display:none; }
.primary,.button,.task-action,.text-button,.certificate-store,.sql-preset,.certificate-action { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:38px; padding:8px 12px; border-radius:8px; font-size:13px; font-weight:550; line-height:1.4; text-decoration:none; transition:background-color .15s ease,border-color .15s ease; }
.primary { color:var(--on-primary); background:var(--primary); border:1px solid var(--primary); box-shadow:none; }
.primary:hover { background:var(--text); border-color:var(--text); }
.button,.task-action,.certificate-store,.sql-preset,.certificate-action { color:var(--text); border:1px solid var(--control); background:var(--surface); }
.button:hover,.task-action:hover,.certificate-store:hover,.sql-preset:hover,.certificate-action:hover { background:var(--active); }
.text-button { color:var(--accent); background:transparent; border:0; }
.text-button:hover { background:var(--accent-soft); }
.button.small { min-height:32px; font-size:12px; padding:6px 10px; }
.button.danger,.delete-row { color:var(--negative); background:transparent; }
.button.danger:hover,.delete-row:hover { background:var(--negative-bg); }
.scope-summary { background:var(--surface-soft); border:1px solid var(--border); border-radius:var(--radius); box-shadow:none; padding:16px 20px; margin-bottom:20px; }
.scope-summary h2 { font-size:16px; margin:0 0 4px; color:var(--text); }
.scope-summary p { color:var(--muted); font-size:13px; margin:0; }
.scope-summary { display:none; }
.loading-state { padding:16px; margin:0 0 20px; background:var(--surface-soft); color:var(--muted); border-radius:8px; }
.dashboard-bottom { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start; }
.dashboard-bottom .file-row { display:block; }
.dashboard-bottom .file-actions { margin-top:12px; }
.dashboard-bottom .file-meta { display:none; }
.dashboard-bottom .file-actions .button:first-child { display:none; }
.dashboard-bottom .task-action { margin-left:56px; }
.dashboard-bottom .task-row { flex-wrap:wrap; }
.dashboard-bottom .task-body { flex:1 1 calc(100% - 68px); }
.dashboard-bottom .card-head { align-items:flex-start; flex-wrap:wrap; }
.dashboard-bottom .card-head-actions { gap:4px; }
.dashboard-bottom .card-head-actions .text-button { padding:4px 6px; font-size:12px; }
.dashboard-bottom .task-row:nth-child(n+4) { display:none; }
.store-progress { height:6px; background:var(--active); border-radius:3px; overflow:hidden; margin:12px 0 8px; }
.store-progress span { display:block; height:100%; background:var(--accent); }
.store-completion,.store-next { margin:6px 0; font-size:12px; color:var(--muted); }
.store-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:16px; }
.store-actions .text-button { margin:0; padding:8px; }
.metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin-bottom:24px; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.metric { min-width:0; min-height:108px; padding:18px 20px; background:var(--surface); border:0; border-right:1px solid var(--border); border-radius:0; box-shadow:none; }
.metric:last-child { border-right:0; }
.metric .label { font-size:13px; color:var(--muted); letter-spacing:0; text-transform:none; font-weight:500; }
.metric strong { display:block; color:var(--text); font-size:28px; font-weight:600; letter-spacing:-.02em; font-variant-numeric:tabular-nums; margin:4px 0; }
.metric .foot { color:var(--muted); font-size:12px; }
.metric .bar { display:none; }
.panel-card,.workspace-card,.tool-card,.workbook-overview { border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); padding:20px; box-shadow:none; color:var(--text); }
.panel-card { margin-bottom:20px; }
.card-head { gap:16px; margin-bottom:16px; }
.card-head h2,.workspace-head h2,.tool-head h2 { font-size:17px; margin:0; color:var(--text); }
.growth-cards { gap:16px; grid-template-columns:repeat(3,minmax(0,1fr)); }
.growth-card { padding:0 20px; background:transparent; border:0; border-right:1px solid var(--border); border-radius:0; }
.growth-card:first-child { padding-left:0; }
.growth-card:last-child { border:0; padding-right:0; }
.growth-store-name { font-size:14px; margin:0 0 10px; font-weight:550; }
.growth-count strong { color:var(--text); font-size:30px; font-variant-numeric:tabular-nums; font-weight:600; }
.growth-count span,.growth-change { color:var(--muted); font-size:13px; }
.growth-change.positive,.growth-change.negative { color:var(--muted); }
.company-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.company-card { display:flex; flex-direction:column; align-items:flex-start; text-align:left; color:var(--text); min-width:0; padding:18px; background:var(--surface-soft); border:1px solid var(--border); border-radius:10px; box-shadow:none; }
.company-card:hover { background:var(--active); border-color:var(--control); }
.company-card .company-icon { display:none; }
.company-card strong { color:var(--text); font-size:15px; }
.company-card span,.company-card .project-next { color:var(--muted); font-size:12px; }
.file-row,.activity-row,.task-row,.account-row,.version-row { border-color:var(--rule); }
.file-main strong,.activity-body strong,.task-body strong,.detail strong { color:var(--text); }
.file-main strong { font-size:14px; line-height:1.5; }
.file-main small,.file-meta,.file-meta small,.activity-body span,.activity-row time,.task-body small,.task-detail,.detail span { color:var(--muted); font-size:12px; }
.file-icon,.company-icon,.activity-mark,.certificate-vault-symbol { color:var(--muted); background:transparent; border:0; }
.file-row { gap:16px; grid-template-columns:minmax(0,1fr) 120px 120px auto; padding:16px 0; }
.file-actions { display:flex; flex-direction:row; gap:8px; }
.file-main { min-width:0; }
.file-main strong { overflow-wrap:anywhere; }
.detail { background:var(--surface-soft); border-color:var(--border); }
.detail strong.pending,.prep-check.pending { color:var(--warning); }
.form-field label { color:var(--text); font-size:14px; }
.form-field input,.form-field select,.form-field textarea,.people-toolbar input,.people-toolbar select,.search-wrap input,.select,.tool-card textarea { background:var(--surface); color:var(--text); border:1px solid var(--control); font-size:14px; min-height:40px; border-radius:8px; }
.form-field input:focus,.form-field select:focus,.search-wrap input:focus { outline:2px solid var(--focus); outline-offset:2px; }
.search-wrap { min-width:0; }
.search-wrap span { color:var(--muted); }
.search-wrap .search-icon { position:absolute; left:12px; top:11px; width:18px; height:18px; fill:none; stroke:var(--muted); stroke-width:1.7; }
.toolbar,.workspace-head,.workspace-head p,.toolbar-right,.table-footer,.people-pagination,.certificate-footer,.certificate-context,.certificate-explain { color:var(--muted); }
.tabs { border-bottom:1px solid var(--border); gap:4px; overflow-x:auto; }
.tab { background:transparent; color:var(--muted); border:0; border-bottom:2px solid transparent; border-radius:0; min-height:42px; }
.tab.active { color:var(--accent); background:transparent; border-bottom:2px solid var(--accent); }
table { color:var(--text); font-variant-numeric:tabular-nums; }
.grid-wrap,.people-table-wrap,.certificate-table-wrap,.sql-result-wrap,.bulk-people-table-wrap { max-width:100%; overscroll-behavior-x:contain; }
.grid { min-width:600px; }
.grid th,.grid td { background:var(--surface); color:var(--text); border-color:var(--rule); font-size:13px; }
.grid thead th,.grid thead .row-num { color:var(--muted); background:var(--surface-soft); font-size:12px; }
.grid .row-num { position:sticky; left:0; z-index:1; background:var(--surface-soft); color:var(--muted); }
.grid thead .row-num { z-index:3; }
.grid tbody tr:hover td { background:var(--surface-soft); }
.grid td.editable:focus-visible { outline:2px solid var(--focus); outline-offset:-2px; }
.grid td input,.status-select { background:var(--surface); color:var(--text); border:1px solid var(--control); font-size:14px; }
.status-select { max-width:100%; min-height:32px; border-radius:5px; }
.grid .status.done,.status.done,.person-badge.completed,.report-check.ready,.prep-check.ready,.prep-success { color:var(--positive); background:var(--positive-bg); }
.status.done .status-select { color:var(--positive); background:var(--positive-bg); }
.grid .status.absent,.status.absent,.person-badge.absent { color:var(--negative); background:var(--negative-bg); }
.status.absent .status-select { color:var(--negative); background:var(--negative-bg); }
.grid .status.progress,.status.progress,.person-badge.progress,.report-check.pending { color:var(--warning); background:var(--warning-bg); }
.status.progress .status-select { color:var(--warning); background:var(--warning-bg); }
.status.attended,.person-badge.attended,.certificate-file-badge { color:var(--accent); background:var(--accent-soft); }
.person-badge.archive,.status { color:var(--muted); background:var(--active); }
.person-badge,.status,.report-check { font-size:12px; font-weight:500; border-radius:5px; padding:4px 8px; white-space:nowrap; }
.status::before { display:none; }
.people-table th,.certificate-table th,.result-table th,.viewer-table th { font-size:12px; font-weight:550; letter-spacing:0; text-transform:none; color:var(--muted); background:var(--surface); padding:13px 12px; }
.people-table td,.certificate-table td,.result-table td,.viewer-table td { color:var(--text); font-size:14px; border-color:var(--rule); padding:14px 12px; }
.people-table tr:hover,.certificate-table tr:hover td,.viewer-table tbody tr:hover,.result-table tbody tr:hover { background:var(--surface-soft); }
.people-table th,.certificate-table th { position:sticky; top:0; z-index:1; }
.sql-result-wrap .result-table tbody tr:nth-child(even) { background:transparent; }
.people-summary,.people-pagination,.certificate-footer,.certificate-context,.certificate-explain { font-size:13px; }
.people-toolbar label { font-size:13px; font-weight:500; }
.people-head-actions { gap:8px; }
.prior-dot { color:var(--warning); text-shadow:none; }
.certificate-stores,.certificate-toolbar { gap:8px; }
.mobile-cert-filter { display:none; }
.certificate-store.active,.certificate-filters .button.active,.sql-preset.active { color:var(--text); background:var(--active); border-color:var(--control); }
.certificate-metrics { gap:0; border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.certificate-metrics .metric { border-right:1px solid var(--border); }
.certificate-explain { line-height:1.65; }
.certificate-archive { margin-bottom:20px; border:1px solid var(--border); border-radius:10px; padding:12px 16px; background:var(--surface-soft); }
.certificate-archive>summary,.usage-help>summary { cursor:pointer; color:var(--text); font-size:14px; min-height:24px; font-weight:500; }
.certificate-archive[open]>summary { margin-bottom:16px; }
.certificate-archive .certificate-vault-panel { margin-bottom:0; }
.usage-help { margin:16px 0; padding:10px 0; color:var(--muted); }
.usage-help>summary { font-size:13px; color:var(--muted); }
.location-edit { display:flex; padding:4px 0; min-height:32px; font-size:12px; }
.certificate-state.ready { color:var(--positive); background:var(--positive-bg); }
.certificate-state.pending { color:var(--warning); background:var(--warning-bg); }
.certificate-vault-card { grid-template-columns:1fr; background:var(--surface-soft); border:1px solid var(--border); border-radius:10px; }
.certificate-vault-card.active { background:var(--accent-soft); border-color:var(--control); box-shadow:none; }
.certificate-vault-symbol { display:none; }
.certificate-vault-info strong,.certificate-vault-list-head strong,.certificate-vault-file-detail strong,.certificate-table .certificate-name { color:var(--text); }
.certificate-vault-info span,.certificate-vault-list-head span,.certificate-vault-file-detail small { color:var(--muted); font-size:12px; }
.certificate-vault-empty,.bulk-people-summary,.schedule-note { background:var(--surface-soft); color:var(--muted); border-color:var(--border); font-size:13px; }
.certificate-vault-pdf { background:var(--negative-bg); color:var(--negative); border-color:var(--border); font-size:12px; }
.certificate-vault-file { border-color:var(--rule); }
.certificate-file-badge { border:1px solid var(--border); font-size:12px; }
.certificate-vault-add { background:var(--primary); color:var(--on-primary); }
.certificate-action { background:var(--surface); color:var(--text); border-color:var(--control); font-size:12px; }
.prep-hero { padding:0 0 20px; background:transparent; border:0; border-radius:0; box-shadow:none; }
.prep-hero h2 { font-size:18px; margin:0 0 6px; }
.prep-hero p { color:var(--muted); font-size:14px; }
.prep-card,.prep-day { background:var(--surface); color:var(--text); border-color:var(--border); }
.prep-day.active { background:var(--active); }
.prep-day span,.prep-day small,.prep-file small,.prep-deadline,.prep-stats,.prep-message,.prep-record { color:var(--muted); font-size:13px; }
.prep-file strong,.prep-card h3,.prep-day strong { color:var(--text); }
.prep-check,.prep-success { font-size:13px; }
.task-date { background:var(--surface-soft); color:var(--text); border:1px solid var(--border); border-radius:8px; }
.task-date strong { color:var(--text); }
.task-date span { color:var(--muted); }
.task-action.done { background:var(--positive-bg); color:var(--positive); }
.calendar-weekdays { color:var(--muted); font-size:12px; }
.calendar-day { background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:7px; }
.calendar-day:hover,.calendar-day.has-event { background:var(--surface-soft); }
.calendar-day.outside { color:var(--dim); }
.calendar-day.today { outline:1px solid var(--accent); outline-offset:-2px; }
.calendar-day.selected { color:var(--on-primary); background:var(--primary); }
.calendar-dots i { background:var(--accent); }
.calendar-dots i.complete { background:var(--positive); }
.calendar-day.selected .calendar-dots i { background:var(--on-primary); }
.badge,.sql-tip { color:var(--muted); background:var(--surface-soft); font-size:12px; border-color:var(--border); }
.sql-tip { line-height:1.6; }
code { color:var(--accent); }
.sql-summary-grid { gap:16px; }
.sql-summary-card { background:var(--surface-soft); border-color:var(--border); }
.sql-summary-store { color:var(--text); }
.sql-summary-total strong { color:var(--text); }
.sql-summary-total span,.sql-summary-metric span,.sql-context,.sql-actions { color:var(--muted); font-size:13px; }
.sql-summary-metric:last-child { background:var(--warning-bg); }
.sql-summary-metric:last-child strong { color:var(--warning); }
.sql-summary-empty { background:var(--surface-soft); color:var(--muted); }
.result-table th:not(:first-child),.result-table td:not(:first-child) { text-align:right; }
dialog { color:var(--text); background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:24px; max-height:calc(100dvh - 32px); max-width:calc(100vw - 32px); box-shadow:0 20px 60px rgba(0,0,0,.2); }
dialog::backdrop { background:var(--overlay); }
.dialog-head h2 { font-size:22px; margin:0; color:var(--text); }
.close { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; min-width:40px; color:var(--muted); background:var(--surface-soft); border:1px solid var(--border); border-radius:8px; }
.dialog-note,#formDescription,.version-row small { color:var(--muted); font-size:13px; }
.history-item strong,.version-row strong { color:var(--text); }
.history-item small,.history-item time { color:var(--muted); }
dialog pre { background:var(--surface-soft); color:var(--text); }
.bulk-people-table-wrap .bulk-invalid { background:var(--negative-bg); }
.bulk-people-table-wrap .bulk-repeated { background:var(--warning-bg); }
.bulk-people-table-wrap .bulk-repeated td:last-child { color:var(--warning); }
#toast { max-width:min(480px,calc(100vw - 32px)); bottom:max(20px,env(safe-area-inset-bottom)); background:var(--text); color:var(--surface); border:0; border-radius:8px; font-size:14px; box-shadow:0 6px 24px rgba(0,0,0,.15); }
#toast.error { background:var(--negative); color:var(--surface); }
.app-error { position:fixed; z-index:60; bottom:20px; right:24px; left:auto; max-width:min(600px,calc(100vw - 32px)); display:flex; gap:16px; align-items:center; background:var(--negative-bg); color:var(--negative); border:1px solid var(--negative); border-radius:10px; padding:16px; }
.manager-report { background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:var(--radius); box-shadow:none; padding:24px; }
.report-actions p,.report-brand p,.report-asof small,.report-kpi span,.report-kpi small,.report-section-title p,.report-count span,.report-change,.report-rate,.report-line span,.report-source,.report-footer p { color:var(--muted); font-size:12px; }
.report-brand img { filter:none; background:#fff; padding:4px; border-radius:6px; }
/* The source logo already has alpha: preserve its exact shape and render white ink on dark surfaces. */
:root[data-theme="dark"] :is(.brand-logo,.auth-brand img,.report-brand img,.hero-logo) {
  background:transparent;
  filter:brightness(0) invert(1);
  border:0;
  border-radius:0;
  box-shadow:none;
  padding:0;
}
.report-brand h2,.report-asof strong,.report-section-title h3,.report-store-name,.report-count strong,.report-line strong,.report-footer strong { color:var(--text); }
.report-header,.report-details,.report-footer { border-color:var(--border); }
.report-brand span,.report-asof span,.report-section-title span { color:var(--muted); font-size:12px; letter-spacing:0; }
.report-kpi,.report-store,.report-figures .report-kpi { background:var(--surface-soft); border:1px solid var(--border); border-radius:8px; }
.report-kpi strong,.report-figures .report-kpi strong { color:var(--text); font-variant-numeric:tabular-nums; }
.report-figures .report-kpi:last-child strong { color:var(--warning); }
.report-progress { background:var(--active); }
.report-progress i { background:var(--accent); }
.report-change.positive,.report-change.negative { color:var(--muted); }
.completion-date { color:var(--positive)!important; }
.completion-empty,.empty { color:var(--muted)!important; }
.viewer-side-note,.viewer-nav-active { background:var(--surface-soft); border-color:var(--border); color:var(--text); box-shadow:none; }
.viewer-side-note p,.viewer-side-footer,.viewer-meta,.viewer-more,.viewer-nav-label { color:var(--muted); }
.viewer-breadcrumb { color:var(--muted); }
.viewer-breadcrumb strong { color:var(--text); }
.error { color:var(--negative); }
@media(min-width:1024px) {
  .sidebar { transform:none!important; visibility:visible!important; }
  .nav-backdrop { display:none!important; }
}
@media(max-width:1199px) {
  .today,#signedInName { display:none; }
  .file-row { grid-template-columns:minmax(0,1fr) auto; }
  .file-meta { display:none; }
  .report-stores { grid-template-columns:1fr; }
}
@media(max-width:1023px) {
  .sidebar { position:fixed; z-index:90; inset:0 auto 0 0; height:100dvh; width:min(320px,calc(100vw - 48px)); transform:translateX(-105%); visibility:hidden; padding:16px 14px max(20px,env(safe-area-inset-bottom)); background:var(--surface); border-right:1px solid var(--border); transition:transform .2s ease; }
  .menu-open .sidebar { transform:translateX(0); visibility:visible; }
  .drawer-heading { display:flex; justify-content:space-between; align-items:center; color:var(--muted); padding:0 6px 18px; font-size:14px; }
  .menu-toggle { display:inline-flex; }
  .mobile-wordmark { display:block; font-weight:700; font-size:16px; letter-spacing:.01em; white-space:nowrap; }
  .mobile-wordmark span { font-weight:400; color:var(--muted); }
  .sidebar .brand>div:last-child,.sidebar .side-label,.sidebar .side-link,.sidebar .company-list,.sidebar .sidebar-divider,.sidebar .side-footer { display:block; }
  .sidebar .side-link { display:flex; font-size:15px; min-height:44px; }
  .sidebar .brand { display:flex; }
  .sidebar .brand-logo { width:80px; height:54px; }
  .sidebar .company-nav,.sidebar .project-nav { display:flex; min-height:44px; font-size:15px; }
  .sidebar .company-nav::before,.sidebar .project-nav::before { display:none; }
  .sidebar .company-nav small,.sidebar .project-nav small { display:block; }
  .main { width:100%; }
  .topbar { height:64px; padding:0 16px; gap:8px; }
  .topbar .breadcrumb { display:none; }
  .content { margin:0 8px 8px; padding:24px 20px; }
  .growth-cards { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .company-cards { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .calendar-layout,.prep-layout { grid-template-columns:1fr; }
}
@media(max-width:640px) {
  [data-view="certificates"] #pageSubtitle { display:none; }
  .certificate-archive { margin-bottom:12px; }
  .certificate-metrics .metric { min-height:0; padding:10px 12px; }
  .certificate-metrics .metric strong { font-size:24px; line-height:1.2; margin:4px 0 0; }
  .certificate-metrics .metric .foot { display:none; }
  .certificate-metrics .metric .label { font-size:12px; }
  .certificate-stores { margin-bottom:12px; }
  .certificate-toolbar { display:grid; grid-template-columns:minmax(0,1fr) 144px; margin:16px 0 12px; }
  .certificate-toolbar #certificateFilters { display:none; }
  .certificate-toolbar .search-wrap { grid-column:1; grid-row:1; width:100%; }
  .mobile-cert-filter { display:block; grid-column:2; grid-row:1; font-size:16px; min-width:0; width:100%; min-height:44px; padding:6px; }
  .certificate-location-filter { grid-column:1 / -1; grid-row:2; width:100%; min-height:44px; font-size:16px; }
  .certificate-context { font-size:13px; margin-bottom:12px; }
  .certificate-archive>summary,.usage-help>summary { min-height:44px; display:list-item; align-content:center; }
  .certificate-archive { padding:4px 14px; }
  .location-edit { min-height:44px; }
  .dashboard-bottom { grid-template-columns:1fr; }
  #dashboardSchedule { order:0; }
  .dashboard-bottom .recent-files { order:1; }
  .store-progress,.store-completion,.store-next,.store-actions { grid-column:1 / -1; }
  .store-actions .button,.store-actions .text-button { min-height:44px; }
  .store-progress { margin:8px 0 0; }
  .topbar { padding:0 12px; }
  .topbar-leading { gap:8px; }
  .top-actions { gap:6px; }
  .icon-button { width:44px; height:44px; min-width:44px; }
  #refreshData { display:none; }
  .top-help { min-height:44px; padding:8px 10px; }
  .mobile-wordmark { font-size:15px; }
  .mobile-wordmark span { display:none; }
  .content { margin:0; border:0; border-radius:0; padding:24px 16px 40px; min-height:calc(100dvh - 64px); }
  .heading { flex-direction:column; gap:16px; margin-bottom:20px; }
  .heading h1 { font-size:24px; }
  .heading p { font-size:14px; }
  .heading .primary { width:100%; }
  .scope-summary { padding:14px 16px; margin-bottom:16px; }
  .scope-summary p { font-size:13px; }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:20px; }
  .metric { padding:16px; min-height:104px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); }
  .metric:nth-child(2n) { border-right:0; }
  .metric:nth-last-child(-n+2) { border-bottom:0; }
  .metric strong { font-size:26px; }
  .panel-card,.workspace-card,.tool-card,.workbook-overview { padding:16px; }
  .card-head,.workspace-head,.workbook-title-row { flex-direction:column; align-items:stretch; gap:12px; }
  .card-head h2,.workspace-head h2 { font-size:17px; }
  .growth-cards { grid-template-columns:1fr; gap:0; }
  .growth-card,.growth-card:first-child,.growth-card:last-child { padding:14px 0; display:grid; grid-template-columns:1fr auto; align-items:center; gap:4px 16px; border:0; border-bottom:1px solid var(--rule); }
  .growth-card:last-child { border-bottom:0; }
  .growth-store-name { margin:0; }
  .growth-count { grid-column:2; grid-row:1 / span 2; }
  .growth-count strong { font-size:26px; }
  .growth-card .text-button { margin:0; padding:4px 0; min-height:36px; justify-self:start; }
  .growth-change { grid-column:1 / -1; }
  .company-cards { grid-template-columns:1fr; gap:12px; }
  .company-card { padding:16px; }
  .file-row { display:flex; flex-wrap:wrap; gap:12px; }
  .file-main { width:100%; flex:1 1 100%; }
  .file-actions { margin-left:0; flex-direction:row; }
  .file-actions .button { min-height:44px; }
  .task-row { align-items:flex-start; gap:12px; flex-wrap:wrap; }
  .task-body { min-width:0; flex:1 1 calc(100% - 68px); }
  .task-action { margin-left:56px; min-height:44px; }
  .task-body strong { font-size:14px; }
  .people-head-actions,.card-head-actions,.report-actions { display:flex; flex-wrap:wrap; width:100%; }
  .people-head-actions .button,.people-head-actions .primary { flex:1 1 auto; }
  .people-toolbar { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }
  .people-toolbar label,.people-toolbar label:nth-child(2) { min-width:0; }
  .people-toolbar label:nth-child(2) { grid-column:1 / -1; grid-row:1; }
  .people-toolbar .people-export { grid-column:1 / -1; min-height:44px; }
  input,select,textarea,.form-field input,.form-field select,.form-field textarea,.people-toolbar input,.people-toolbar select,.search-wrap input { font-size:16px; min-height:44px; }
  .people-table-wrap,.certificate-table-wrap { overflow:visible; border:0; }
  .people-table,.certificate-table,.certificate-table.has-location,.viewer-table { display:block; min-width:0; width:100%; }
  .people-table thead,.certificate-table thead,.viewer-table thead { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .people-table tbody,.certificate-table tbody,.viewer-table tbody { display:block; }
  .people-table tbody tr,.certificate-table tbody tr,.viewer-table tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 16px; border:1px solid var(--border); border-radius:10px; padding:16px; margin-bottom:12px; }
  .people-table td,.certificate-table td,.viewer-table td { display:block; padding:0; border:0; min-width:0!important; max-width:none; white-space:normal; overflow-wrap:anywhere; font-size:14px; }
  .people-table td::before,.certificate-table td::before,.viewer-table td::before { display:block; content:attr(data-label); font-size:12px; color:var(--muted); font-weight:400; margin-bottom:4px; }
  .people-table td:first-child,.people-table td:nth-child(2),.people-table td:last-child,.certificate-table td:first-child,.certificate-table td:last-child,.viewer-table td:first-child,.viewer-table td:nth-child(2) { grid-column:1 / -1; }
  td[colspan] { grid-column:1 / -1; }
  td[colspan]::before { display:none; }
  .people-table td .button,.certificate-action { min-height:44px; font-size:13px; margin:2px 4px 2px 0; }
  .people-pagination,.certificate-footer,.table-footer { align-items:flex-start; flex-direction:column; gap:12px; font-size:13px; }
  .people-pagination>div,.certificate-footer>div,.table-footer>div { display:flex; gap:8px; width:100%; }
  .people-pagination .button,.certificate-footer .button,.table-footer .button { flex:1; min-height:44px; }
  .certificate-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .certificate-vault-cards { grid-template-columns:1fr; }
  .certificate-stores .certificate-store { flex:1; min-height:44px; }
  .certificate-toolbar { align-items:stretch; flex-direction:column; }
  .certificate-filters { display:flex; }
  .certificate-filters .button { flex:1; min-height:44px; }
  .certificate-explain { font-size:13px; }
  .certificate-vault-file-actions .button { min-height:44px; }
  .sql-presets { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sql-preset { min-height:44px; }
  .sql-summary-grid { grid-template-columns:1fr; }
  .sql-summary-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sql-tip { overflow-wrap:anywhere; }
  .tool-card textarea { font-size:14px; }
  .calendar-card { min-height:0; }
  .calendar-day { min-height:44px; padding:6px 2px; font-size:14px; }
  .calendar-weekdays,.calendar-grid { gap:4px; }
  .calendar-weekdays { font-size:12px; }
  .calendar-arrows .button { min-width:44px; min-height:44px; }
  .report-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .manager-report { padding:16px; }
  .report-header,.report-section-title { flex-direction:column; align-items:flex-start; gap:16px; }
  .report-asof { text-align:left; }
  .report-brand { gap:12px; }
  .report-brand h2 { font-size:20px; }
  .report-brand img { width:70px; }
  .report-figures { grid-template-columns:1fr; }
  .report-figures .report-kpi { display:flex; justify-content:space-between; align-items:center; }
  .report-figures .report-kpi span { min-height:0; font-size:12px; }
  .report-footer { grid-template-columns:1fr; }
  .account-row>div { flex-basis:100%; min-width:0; }
  .account-row .button { min-height:44px; }
  dialog { padding:20px; width:calc(100vw - 24px); max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); }
  .dialog-actions { display:flex; gap:8px; }
  .dialog-actions>button { flex:1; min-height:44px; }
  .workbook-actions { gap:8px; }
  .workbook-actions .button { min-height:44px; flex:1 1 auto; }
  .detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .toolbar { flex-wrap:wrap; }
  .toolbar .search-wrap { width:100%; }
  .prep-card-head { gap:8px; }
  .prep-layout aside { min-width:0; }
  .prep-actions .button,.prep-actions .primary { min-height:44px; }
  #toast { left:16px; right:16px; transform:translateY(18px); }
  #toast.show { transform:translateY(0); }
  .app-error { left:16px; right:16px; flex-direction:column; align-items:stretch; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; }
}
@media(max-width:640px) {
  .primary,.button,.text-button,.growth-card .text-button,.certificate-vault-actions .button,.close { min-height:44px; }
  .close { min-width:44px; width:44px; height:44px; }
  .file-main strong { white-space:normal; }
}
@media(forced-colors:active) {
  .side-link.active { outline:1px solid Highlight; }
  .primary,.button,.icon-button { border:1px solid ButtonText; }
}
@media print {
  :root[data-theme="dark"] .report-brand img { filter:none; background:transparent; }
  .sidebar,.topbar,.heading,.report-actions,#toast,dialog { display:none!important; }
  .app,.main,.content { display:block!important; width:100%!important; max-width:none!important; min-height:0!important; margin:0!important; padding:0!important; border:0!important; border-radius:0!important; }
  :root,:root[data-theme="dark"] { --ground:#fff; --surface:#fff; --surface-soft:#f5f6f7; --text:#17202b; --muted:#465466; --border:#d7dee6; --accent:#244b78; --warning:#80510e; --positive:#206542; --on-primary:#fff; }
  .theme-toggle,.menu-toggle,.nav-backdrop,.app-error,.skip-link { display:none!important; }
  .manager-report { border:0; }
  .report-stores { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .report-kpis { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
