@import url("/app-theme-legacy.css?v=20261020-2") screen;
/* Screen canvas only. Documents keep their existing white paper and print styles. */
@media screen {
  :root {
    --canvas: #f1f3f5;
    --card: #ffffff;
    --muted: #526170;
    --line: #86939f;
  }
  html { background: var(--canvas); }
  body { min-height: 100vh; background: var(--canvas) !important; }
  .login-screen.start-login { background: var(--canvas); }
  .topbar { background: var(--card); }
}

/* Shared app chrome: viewport and interaction capabilities only. */
@media screen {
  :root { --surface: #ffffff; --surface-soft: #f4f8fb; --focus: #007b87; }
  :root[data-app-theme="dark"] {
    color-scheme: dark;
    --canvas: #111923; --card: #1b2835; --surface: #1b2835;
    --surface-soft: #243545; --soft: #243545; --ink: #e5edf5;
    --muted: #b2c2d2; --line: #73879a; --focus: #75e5ed;
    --shadow: 0 22px 70px #0006;
  }
  .app-preferences { display:flex; gap:8px; align-items:center; padding:10px 14px; background:var(--card); color:var(--ink); border-bottom:1px solid var(--line); }
  .app-preferences label { display:flex; gap:8px; align-items:center; margin:0; font-size:.875rem; }
  .app-preferences select, .app-menu-toggle { min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:10px; background:var(--card); color:var(--ink); }
  .app-menu-toggle { display:none; }
  :is(input,select,textarea) { color:var(--ink); }
  :is(button,a,input,select,textarea,summary):focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
  :root[data-app-theme="dark"] :is(.workspace,.main-content,.content,.topbar,.panel,.card,.login-card,dialog,.project-card,.project-dialog-section,.day-agenda-dialog,.project-activity-row,.project-activity-body,.calendar-day,.calendar-header,.calendar-weekdays,.notification-card,.stat-card,.metric-card,.filters,.toolbar,.table-wrap,.table-wrapper) { background:var(--card); color:var(--ink); border-color:var(--line); }
  :root[data-app-theme="dark"] :is(input,select,textarea,option,table,thead,tbody,tr,th,td) { background-color:var(--card); color:var(--ink); border-color:var(--line); }
  :root[data-app-theme="dark"] :is(th,tr:nth-child(even),.secondary-button,.ghost-button) { background-color:var(--surface-soft); color:var(--ink); }
  :root[data-app-theme="dark"] :is(.quote-sheet,.quote-page,.print-page,.document-page,.receipt-paper) { background:#fff; color:#24303d; color-scheme:light; }
  :is(.table-wrap,.table-wrapper,.table-container) { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
  dialog { max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:auto; overscroll-behavior:contain; }
}
@media screen and (max-width:768px) {
  .app-menu-toggle { display:inline-flex; align-items:center; }
  .app-preferences { position:sticky; top:0; z-index:45; justify-content:space-between; }
  html.app-menu-ready .sidebar { display:none; }
  html.app-menu-ready.app-menu-open .sidebar { display:flex; max-height:calc(100dvh - 65px); overflow:auto; }
  .app > *, :is(.workspace,.main-content,.content) > * { min-width:0; }
  :is(input,select,textarea) { max-width:100%; font-size:16px; }
  :is(button,.primary-button,.secondary-button,.ghost-button,.sidebar nav a,.sidebar summary) { min-height:44px; }
  :is(.actions,.form-actions,.toolbar) { flex-wrap:wrap; }
  :is(.table-wrap,.table-wrapper,.table-container):focus-visible { outline:3px solid var(--focus); }
}
@media screen and (pointer:coarse) {
  :is(button,.primary-button,.secondary-button,.sidebar nav a,.sidebar summary) { min-height:44px; }
}
@media print { .app-preferences { display:none !important; } }

@media screen {
 :root[data-app-theme="dark"] :is(.project-summary-heading strong,.project-expand-label,.activity-summary strong,.project-dialog legend,.project-dialog .field-hint,.project-dialog .activity-schedule-label) { color:var(--ink); }
 :root[data-app-theme="dark"] .project-dialog :is(small,legend) { color:var(--muted); }
}
@media screen {
 :root[data-app-theme="dark"] :is(.app,.inventory-app,.fabrication-app,.analytics-app) { background:var(--canvas); }
 :root[data-app-theme="dark"] .app :is(article,section.panel,.inventory-legend span,.performance-kpis article) { background-color:var(--card); color:var(--ink); }
 :root[data-app-theme="dark"] :is(.performance-track,.performance-month-row.is-selected) { background:var(--surface-soft); }
 :root[data-app-theme="dark"] .performance-track.invoiced i { background:#70c4f4; }
 :root[data-app-theme="dark"] .performance-track.recognized i { background:#becad3; }
}
/* Business document paper is independent of application appearance. */
@media screen {
 :root[data-app-theme="dark"] :is(.quote-preview,.quote-sheet,.quote-page,.print-page,.document-page,.receipt-paper,.act-public-sheet,#document,[data-theme-paper]) {
  --card:#fff; --surface:#fff; --surface-soft:#f4f8fb; --soft:#f4f8fb;
  --ink:#24303d; --muted:#526170; --line:#86939f;
  color-scheme:light; background:#fff; color:#24303d;
 }
 :root[data-app-theme="dark"] canvas[id*="signature"] { background:#fff; color:#24303d; color-scheme:light; }
}

@media screen {
 :root[data-app-theme="dark"] {
  --theme-accent-text:#75e5ed;
  --theme-neutral-text:#e5edf5; --theme-neutral-surface:#243545;
  --theme-red-text:#ffb8b5; --theme-red-surface:#4c252b;
  --theme-amber-text:#ffdb94; --theme-amber-surface:#49381e;
  --theme-green-text:#9ce9bf; --theme-green-surface:#193e34;
  --theme-blue-text:#aed5ff; --theme-blue-surface:#213b56;
  --theme-cyan-text:#9aebed; --theme-cyan-surface:#163e49;
  --theme-violet-text:#e0c4ff; --theme-violet-surface:#3c2e50;
  --analytics-green:#9ce9bf; --analytics-amber:#ffdb94; --analytics-red:#ffb8b5; --analytics-soft:#163e49;
 }
 :root[data-app-theme="dark"] body { color:var(--ink); }
 :root[data-app-theme="dark"] :is(.primary-button,button.primary-button) { background:var(--cyan); color:#071c2d; }
 :root[data-app-theme="dark"] :is(input,select,textarea) { color:var(--ink); background-color:var(--card); }
 :root[data-app-theme="dark"] ::placeholder { color:var(--muted); opacity:1; }
}
@media screen {
 /* Readable accents on the retained light canvas; bright cyan stays on buttons. */
 :root:not([data-app-theme="dark"]) :is(.eyebrow,#profile-label,.home-card-detail,.home-metric-index,.home-summary-note,.home-insights-status,#project-notification-count) { color:#42606a; }
 :root:not([data-app-theme="dark"]) .calendar-day-number { color:#42606a; }
 .calendar-day.is-today .calendar-day-number { color:#071c2d !important; }
 :root:not([data-app-theme="dark"]) .top.topbar { background:var(--navy); color:white; }
 :root[data-app-theme="dark"] :is(.start-login,#home) { --start-ink:var(--ink); --start-muted:var(--muted); --start-accent:var(--theme-accent-text); }
 :root[data-app-theme="dark"] :is(.login-story,#home .home-welcome)::before { opacity:.06; }
 :root[data-app-theme="dark"] :is(.leaflet-control-zoom a,.leaflet-control-attribution,.leaflet-control-attribution a,.leaflet-control-zoom span) { background:var(--card); color:var(--ink); }
 .quote-preview .eyebrow { color:#00666d; }
 :root:not([data-app-theme="dark"]) body[data-page="booking"] :is(h1,p) { color:var(--ink); }
 :root:not([data-app-theme="dark"]) :is(.payment-brand p,.payment-result .eyebrow) { color:#00666d; }
 /* Desktop grids must permit the existing table scroll container to shrink. */
 :is(.inventory-workspace,.fabrication-workspace) { min-width:0; }
 :is(.inventory-workspace,.fabrication-workspace) > * { min-width:0; }
}
@media screen {
 :root:not([data-app-theme="dark"]) .calendar-day-number { background:#fff; color:#24303d; }
 :root:not([data-app-theme="dark"]) .metric.highlight span { color:#d7e5ed; }
 :root:not([data-app-theme="dark"]) .analytics-table th { color:#fff; }
 :root:not([data-app-theme="dark"]) .appointment-public .booking-hero :is(h1,p) { color:#24303d; }
 :root:not([data-app-theme="dark"]) .appointment-status[data-type="ok"] { color:#126244; }
 :root:not([data-app-theme="dark"]) .brand-header p { color:#00666d; }
}
@media screen {
 .calendar-day.is-today .calendar-day-number { background:var(--cyan); color:#071c2d !important; }
 :is(.table-wrap,.table-wrapper,.table-container,.scroll,.items-shell,.table-scroll) { min-width:0; max-width:100%; overflow-x:auto; }
}
@media screen { .app-preferences [hidden] { display:none !important; } }
@media screen {
 :root:not([data-app-theme="dark"]) .home-section-hint { color:#42606a; }
 :root[data-app-theme="dark"] { --text:var(--ink); --cyan-dark:#75e5ed; --success:#9ce9bf; --danger:#ffb8b5; }
 :root[data-app-theme="dark"] :is(.quote-preview,#document,.act-public-sheet,[data-theme-paper]) { --success:#166534; --danger:#9f1239; }
}
@media screen {
 ::placeholder { color:var(--muted); opacity:1; }
 :root[data-app-theme="dark"] :is(.wordmark-electric,.wordmark-access) { background:none !important; color:var(--ink) !important; -webkit-text-fill-color:var(--ink); }
 :root[data-app-theme="dark"] .wordmark-access { color:var(--theme-accent-text) !important; -webkit-text-fill-color:var(--theme-accent-text); }
}
@media screen and (max-width:768px), screen and (pointer:coarse) {
 :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select) { min-height:44px; }
}
@media screen {
 :root[data-app-theme="dark"] .primary-button { background:var(--cyan) !important; color:#071c2d !important; }
 :root[data-app-theme="dark"][data-app-theme-sheets~="remissions"] :is(button,.button):not(.secondary):not(.danger) { color:#071c2d !important; }
 :root:not([data-app-theme="dark"]) .quote-view-tag.is-unviewed { color:#526170; }
}
@media screen {
 :root[data-app-theme="dark"] .calendar-day { background:var(--card) !important; }
 :root:not([data-app-theme="dark"]) .priority-badge { color:#24303d; }
}
@media screen {
 html.app-theme-changing *, html.app-theme-changing *::before, html.app-theme-changing *::after { transition:none !important; }
}
@media screen {
 /* Let native date controls shrink to their assigned mobile grid/flex cell. */
 :is(input,select,textarea) { min-width:0; }
}

@media screen {
  .app-preferences #app-theme.app-theme-toggle { display:inline-flex; align-items:center; justify-content:center; flex:0 0 44px; width:44px; height:44px; min-height:44px; padding:0; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--ink) !important; cursor:pointer; }
  .app-preferences .app-theme-toggle:hover { background:var(--surface-soft); border-color:var(--line); }
  .app-preferences .app-theme-toggle:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
  .app-preferences .app-theme-toggle svg { display:block; width:20px; height:20px; pointer-events:none; }
}
