/* Device appearance is independent of photo and plan rendering. */
html{min-height:100%}body{min-height:100vh;min-height:100dvh;box-sizing:border-box}
html[data-theme] :is(.plan-inspector,.plan-details){background:var(--fw-surface);border-color:var(--fw-edge);color:var(--fw-ink)}html[data-theme] :is(.plan-inspector,.plan-details,.reference-search){--office-border:var(--fw-edge);--office-muted:var(--fw-muted);--office-accent:var(--fw-accent)}html[data-theme] :is(.plan-details input,.reference-search input,.inspect-toolbar select){background:var(--fw-inset);border-color:var(--fw-edge);color:var(--fw-ink)}html[data-theme] :is(.inspect-thumb,.reference-result){background:var(--fw-raised);border-color:var(--fw-edge);color:var(--fw-ink)}html[data-theme] .inspect-thumb[aria-pressed=true]{background:var(--fw-tint);border-color:var(--fw-accent);color:var(--fw-accent)}
html[data-theme] { --fw-bg:#0a141d;--fw-surface:#14232c;--fw-raised:#1c303a;--fw-inset:#0c1921;--fw-edge:#35505b;--fw-ink:#eef6f3;--fw-muted:#a5bac4;--fw-accent:#96dfbc;--fw-on-accent:#12372b;--fw-tint:#223d32;--fw-accent-weak:#9be5be14; }
html[data-theme=ocean] { --fw-bg:#0b1522;--fw-surface:#15293a;--fw-raised:#1c354b;--fw-inset:#0b1d2d;--fw-edge:#3c5a72;--fw-ink:#eff6ff;--fw-muted:#adc2d5;--fw-accent:#9cd5fc;--fw-on-accent:#102d43;--fw-tint:#213f56;--fw-accent-weak:#a6d8ff14; }
html[data-theme=violet] { --fw-bg:#17121f;--fw-surface:#282034;--fw-raised:#372d45;--fw-inset:#1d1728;--fw-edge:#5b486c;--fw-ink:#f7f0ff;--fw-muted:#c1afce;--fw-accent:#d9b2fa;--fw-on-accent:#342040;--fw-tint:#463151;--fw-accent-weak:#d9b2fa14; }
html[data-theme=graphite] { --fw-bg:#171b1e;--fw-surface:#262d32;--fw-raised:#333c42;--fw-inset:#1a2228;--fw-edge:#56646d;--fw-ink:#f1f6f8;--fw-muted:#b7c4cc;--fw-accent:#d0dee6;--fw-on-accent:#25313a;--fw-tint:#3d4a53;--fw-accent-weak:#d0dee614; }
html[data-theme] body { background:var(--fw-bg);color:var(--fw-ink); }
html[data-theme] .auth-page { background:radial-gradient(ellipse at 50% 0,var(--fw-tint),transparent 60%),var(--fw-bg); }
html[data-theme] :is(.office-shell,.field-settings-shell,.auth-shell) :is(h1,h2),html[data-theme] .page-header-title { color:var(--fw-ink); }
html[data-theme] :is(.settings-card,.office-panel,.field-settings-card,.auth-tabs,.job-delete-dialog,.filter-sheet,.map-layer-menu,.map-jobs-sheet,.device-queue-row) { background:var(--fw-surface);border-color:var(--fw-edge);color:var(--fw-ink); }
html[data-theme] .office-shell .office-stats > div { background:linear-gradient(135deg,var(--fw-raised),var(--fw-surface));border-color:var(--fw-edge); }
html[data-theme] #field-capture .field-nav-grid a { background:var(--fw-surface);border-color:var(--fw-edge);color:var(--fw-ink); }
html[data-theme] #field-capture .field-nav-grid a .ui-icon { color:var(--fw-accent);background:var(--fw-accent-weak); }
html[data-theme] #field-capture :is(.current-job,.last-capture) { background:var(--fw-surface);border-color:var(--fw-edge); }
html[data-theme] #field-capture #current-job { color:var(--fw-ink); }
html[data-theme] :is(.page-back,.nav-filter,.office-action,.office-icon-nav a,.job-rename summary,.settings-actions .office-action,.map-tool,.map-job-option,.device-setting button,.field-settings-header a) { background:var(--fw-raised);border-color:var(--fw-edge);color:var(--fw-ink); }
html[data-theme] .office-shell :is(.button-link,.secondary,.row-icon),html[data-theme] .auth-tabs { background:var(--fw-surface);border-color:var(--fw-edge);color:var(--fw-ink); }
html[data-theme] .auth-tabs [aria-current],html[data-theme] .office-shell .office-drive-link { background:var(--fw-tint);border-color:var(--fw-edge);color:var(--fw-accent); }
html[data-theme] :is(.login-form,.office-login) { background:var(--fw-surface);border-color:var(--fw-edge); }
html[data-theme] .auth-page :is(#pin,#password),html[data-theme] :is(.office-shell,.field-settings-shell,.filter-sheet) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select,textarea),html[data-theme] .date-input-wrap { background:var(--fw-inset);border-color:var(--fw-edge);color:var(--fw-ink); }
html[data-theme] .office-shell :is(.job-create button,.job-rename form button,.plan-primary),html[data-theme] .auth-page :is(.login-form button[type=submit],.office-login button),html[data-theme] .filter-sheet .filter-apply { background:var(--fw-accent);border-color:var(--fw-accent);color:var(--fw-on-accent); }
html[data-theme] :is(.office-eyebrow,.job-caption,.field-settings-card a,.settings-link) { color:var(--fw-accent)!important; }
html[data-theme] :is(.page-header-title p,.field-build,.device-status,.office-shell .document-info p,.office-shell .hint,.office-shell .settings-card small) { color:var(--fw-muted); }
html[data-theme] .filter-sheet-footer { background:var(--fw-surface);border-color:var(--fw-edge); }
html[data-theme] .plan-menu-option[aria-pressed=true] { color:var(--fw-accent);background:var(--fw-tint); }
html[data-theme] .map-tool.following,html[data-theme] .nav-filter.has-filter { color:var(--fw-accent);background:var(--fw-tint);border-color:var(--fw-accent); }
html[data-theme] .jobs-shell .job-delete { color:#dcb1a6;background:#2c2426;border-color:#694c48; }
html[data-theme] .selection-bar { background:var(--fw-inset);border-color:var(--fw-edge); }
html[data-theme] .device-queue-dialog { background:var(--fw-bg);color:var(--fw-ink); }
html[data-theme] .job-delete-dialog p { color:var(--fw-muted); }
html[data-theme] .office-shell .drive-status-bar:is([data-state=empty],[data-state=inactive],[data-state=checking]) { background:var(--fw-surface);border-color:var(--fw-edge); }
html[data-theme] .office-shell .selection-bar button,html[data-theme] .office-shell .settings-card form > button:not(.secondary) { background:var(--fw-accent);border-color:var(--fw-accent);color:var(--fw-on-accent); }
html[data-theme] .office-shell .quality-option:has(:checked) { background:var(--fw-tint);border-color:var(--fw-accent); }
.theme-options { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0;padding:0;border:0;min-width:0; }
.theme-option { display:block!important;min-width:0;margin:0!important;position:relative;cursor:pointer; }
.theme-option input { position:absolute;opacity:0;width:1px;height:1px; }
.theme-choice { display:flex;align-items:center;gap:10px;min-height:58px;padding:12px;border:1px solid var(--fw-edge);border-radius:12px;background:var(--fw-inset);color:var(--fw-ink);font-size:12px; }
.theme-swatch { display:flex;gap:3px;flex:0 0 auto; }
.theme-swatch i { width:9px;height:25px;border-radius:5px;background:#14232c; }
.theme-swatch i:nth-child(2) { background:#35505b; }.theme-swatch i:nth-child(3) { background:#96dfbc; }
[data-preview-theme=ocean] i { background:#15293a; }[data-preview-theme=ocean] i:nth-child(2) { background:#3c5a72; }[data-preview-theme=ocean] i:nth-child(3) { background:#9cd5fc; }
[data-preview-theme=violet] i { background:#282034; }[data-preview-theme=violet] i:nth-child(2) { background:#5b486c; }[data-preview-theme=violet] i:nth-child(3) { background:#d9b2fa; }
[data-preview-theme=graphite] i { background:#262d32; }[data-preview-theme=graphite] i:nth-child(2) { background:#56646d; }[data-preview-theme=graphite] i:nth-child(3) { background:#d0dee6; }
[data-preview-theme=white] i { background:#fff;border:1px solid #80939f; }[data-preview-theme=white] i:nth-child(2) { background:#b3c5ce; }[data-preview-theme=white] i:nth-child(3) { background:#086451;border:0; }
.theme-option input:checked + .theme-choice { border-color:var(--fw-accent);box-shadow:inset 0 0 0 1px var(--fw-accent); }
.theme-option input:focus-visible + .theme-choice { outline:2px solid var(--fw-accent);outline-offset:3px; }
.theme-status { font-size:11px;line-height:1.5;color:var(--fw-muted);margin:12px 0 0; }.theme-status:empty { display:none; }
@media(max-width:360px) { .theme-choice { padding:11px 9px;gap:8px; } }

html[data-theme=white] {
  color-scheme: light;
  --fw-bg: #f7f9fb;
  --fw-surface: #fff;
  --fw-raised: #eef3f6;
  --fw-inset: #f3f6f8;
  --fw-edge: #a2b3bd;
  --fw-ink: #172e3a;
  --fw-muted: #465e6d;
  --fw-accent: #086451;
  --fw-on-accent: #fff;
  --fw-tint: #e4f3ed;
  --fw-accent-weak: #08645112;
  --fw-warning: #795014;
  --fw-warning-bg: #fff4e2;
  --fw-warning-edge: #bb955d;
  --fw-danger: #962e3a;
  --fw-danger-bg: #fff1f2;
  --fw-danger-edge: #c89499;
  --mint: var(--fw-accent);
  --muted: var(--fw-muted);
  --line: var(--fw-edge);
  --panel: var(--fw-surface);
  --text: var(--fw-ink);
  --office-surface: var(--fw-surface);
  --office-border: var(--fw-edge);
  --office-muted: var(--fw-muted);
  --office-accent: var(--fw-accent);
  background: var(--fw-bg);
  color: var(--fw-ink);
}
html[data-theme=white] .office-shell {
  --office-surface: var(--fw-surface);
  --office-border: var(--fw-edge);
  --office-muted: var(--fw-muted);
  --office-accent: var(--fw-accent);
}
html[data-theme=white] :is(.header-brand-custom,.settings-card img[src^="brand.php"]) {
  background: #111e29;
  border-radius: 7px;
  box-shadow: 0 0 0 3px #111e29;
}
html[data-theme=white] .header-brand-symbol { filter: brightness(.46) saturate(1.15); }
html[data-theme=white] :is(button,a,input,select,textarea,summary):focus-visible { outline-color: var(--fw-accent); }
html[data-theme=white] :is(.auth-shell,.office-shell) :is(p,.hint,.eyebrow,.document-info small,.pagination span,.user-form label,.user-heading small,.settings-card label),
html[data-theme=white] :is(.auth-tabs a,.login-form label,.office-login label,.job-state-label,.job-caption,.plan-hint,.plan-notice,.plan-empty,.alignment-status,.align-toolbar p,.alignment-review label,.coordinate-jump,#drawing-quality,.point-residual,.filter-eyebrow,.filter-section legend,.filter-sheet .date-field,.filter-sheet .filter-select-label,.date-display,.photo-list-info p,.last-photo-heading h2,.device-queue-heading p,.device-queue-row small,.queue-storage-note,.build-stamp,.dashboard-stats span,.current-job > .ui-icon,.job-chevron) {
  color: var(--fw-muted);
}
html[data-theme=white] :is(.login-form > a,.document-links a,.office-shell .user-delete button.secondary,.job-start-set,.plan-state.published,#alignment-quality,.auth-tabs [aria-current]) { color: var(--fw-accent); }
html[data-theme=white] :is(.job-actions form,.plan-card,.plan-job-option,.alignment-review,.plan-group-admin,.photo-list-item,.capture-feedback,.map-toast,.gps-map-status,.job-start-hint,#map-share-dialog,.office-shell .settings-card .quality-option) {
  background: var(--fw-surface);
  border-color: var(--fw-edge);
  color: var(--fw-ink);
}
html[data-theme=white] :is(.date-presets button,.filter-sheet .row-icon,.filter-reset,.device-queue-tools button,.device-queue-row .row-icon,.photo-list-actions .row-icon,.map-header .page-header-actions > .row-icon,.photo-pagination a,.last-photo-actions button,.plan-secondary,.office-shell .badge,.document-thumb,.alignment-steps span) {
  background: var(--fw-raised);
  border-color: var(--fw-edge);
  color: var(--fw-ink);
}
html[data-theme=white] :is(#field-capture #open-last-photo,.device-queue-heading .plain-icon) {
  background: var(--fw-raised);
  border-color: var(--fw-edge);
  color: var(--fw-ink);
}
html[data-theme=white] :is(.filter-sheet .date-input-wrap input[type=date],#current-job) { color-scheme: light; }
html[data-theme=white] :is(.date-input-wrap:focus-within,.current-job:focus-within) { outline-color: var(--fw-accent); }
html[data-theme=white] :is(.date-display[data-selected=true],.date-input-wrap .ui-icon,.plan-card p,.control-points li,.device-queue-tools > span,.office-shell .quality-option) { color: var(--fw-muted); }
html[data-theme=white] :is(.date-presets button[aria-pressed=true],.map-job-option[aria-pressed=true],.map-header #open-map-jobs.jobs-active,.alignment-steps span[data-active=true],.jobs-shell .job-symbol,.jobs-shell .job-state-label.active,.plan-state.published,.office-shell .settings-card .quality-option:has(:checked),.plan-tree-sheet:has(input:checked),.plan-tree-group-label:has(:checked),.plan-tree-group-label:has(:indeterminate)) {
  background: var(--fw-tint);
  border-color: var(--fw-accent);
  color: var(--fw-accent);
}
html[data-theme=white] :is(.jobs-shell .job-state-label:not(.active),#inspect-thumbs) { background: var(--fw-inset); }
html[data-theme=white] :is(.plan-tree-sheet,.plan-tree-group-label,.plan-tree-expand):hover { background: var(--fw-inset); }
html[data-theme=white] :is(.plan-tree-group,.plan-tree-children,.device-setting + .device-setting,.document-row,.user-row,.control-points li,.map-job-footer) { border-color: var(--fw-edge); }
html[data-theme=white] :is(.map-page .leaflet-popup-content-wrapper,.map-page .leaflet-popup-tip,.map-popup) { color: var(--fw-ink); }
html[data-theme=white] :is(.map-page .leaflet-popup-content-wrapper,.map-page .leaflet-popup-tip) { background: var(--fw-surface); }
html[data-theme=white] .map-popup p { color: var(--fw-muted); }
html[data-theme=white] .map-popup a { color: var(--fw-accent); }
html[data-theme=white] .filter-count { box-shadow: 0 0 0 3px var(--fw-bg); }
html[data-theme=white] :is(.office-shell .alert,.photo-sync-state[data-state=verified],.gps-map-status[data-quality=good]) {
  color: var(--fw-accent);
  border-color: var(--fw-edge);
}
html[data-theme=white] :is(.office-shell .alert,.device-queue-banner[data-state=done]) { background: var(--fw-tint);color:var(--fw-accent); }
html[data-theme=white] :is(.plan-state:not(.published),.map-notices :is([data-state=offline],[data-state=stale],[data-state=limited]),.device-queue-banner:not([data-state=done],[data-state=resolved]),.point-residual-high .point-residual,.control-points li.point-residual-high) {
  background: var(--fw-warning-bg);
  border-color: var(--fw-warning-edge);
  color: var(--fw-warning);
}
html[data-theme=white] :is(.job-status,.filter-date-error,#alignment-quality[data-warning=true],.photo-sync-state[data-state=local],.gps-map-status[data-quality=weak]) { color: var(--fw-warning); }
html[data-theme=white] #field-capture :is(.device-queue-banner small,.location-indicator[data-quality=weak],#queue-status:not(.sr-only)) { color: var(--fw-warning); }
html[data-theme=white] #field-capture :is(.device-queue-banner[data-state=done] small,.location-indicator[data-quality=good]) { color: var(--fw-accent); }
html[data-theme=white] #field-capture .device-queue-banner[data-state=resolved] { background:var(--fw-raised);border-color:var(--fw-edge);color:var(--fw-ink); }
html[data-theme=white] #field-capture .device-queue-banner[data-state=resolved] small { color: var(--fw-muted); }
html[data-theme=white] :is(.office-shell .alert.error,.jobs-shell .job-delete,.plan-danger,.control-points li.point-invalid,.alignment-steps[data-error=true] span[data-active=true]) {
  background: var(--fw-danger-bg);
  border-color: var(--fw-danger-edge);
  color: var(--fw-danger);
}
html[data-theme=white] :is(.auth-page .error:not(:empty),.auth-page .alert,.alignment-status.error,.plan-notice.error,#details-error,#group-error,.queue-row-error,.user-delete summary,.danger-zone summary,.gps-map-status[data-quality=bad]),
html[data-theme=white] #field-capture .location-indicator[data-quality=none] { color: var(--fw-danger); }
html[data-theme=white] .uploader-name { color:var(--fw-accent)!important; }
html[data-theme=white] :is(#live-camera,.comment-dialog,#photo-preview) {
  --fw-accent: #8cddba;
  color-scheme: dark;
}
