:root {
  color-scheme: dark;
  --bg: #0c0f12;
  --surface: #14181c;
  --surface-2: #1b2025;
  --surface-3: #242a30;
  --line: #30373d;
  --line-soft: #252b30;
  --text: #f3f6f8;
  --muted: #98a4ad;
  --accent: #45c6c8;
  --accent-strong: #1da3a6;
  --accent-soft: rgba(69, 198, 200, .14);
  --yellow: #ffb42b;
  --danger: #f36166;
  --success: #5ed196;
  --warning: #ffc867;
  --shadow: 0 22px 70px rgba(0, 0, 0, .36);
  --radius: 16px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #edf1f2;
  --surface: #ffffff;
  --surface-2: #f5f8f8;
  --surface-3: #e8eeee;
  --line: #d1dada;
  --line-soft: #e1e7e7;
  --text: #1d2529;
  --muted: #68757c;
  --accent: #159da1;
  --accent-strong: #0d7e82;
  --accent-soft: rgba(21, 157, 161, .12);
  --danger: #c73d45;
  --success: #268b5c;
  --shadow: 0 22px 70px rgba(36, 52, 58, .14);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { letter-spacing: -.04em; }
h2 { letter-spacing: -.025em; }
small, .muted { color: var(--muted); }

.topbar {
  position: sticky; top: 0; z-index: 40; height: 68px; padding: 0 clamp(18px, 4vw, 58px);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line-soft); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.topbar-actions > a { padding: 10px 12px; color: var(--muted); border-radius: 8px; font-size: 14px; }
.topbar-actions > a:hover { color: var(--text); background: var(--surface-2); }
.topbar-actions form { margin: 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.045em; }
.brand-name { color: #082846; }
.brand-name strong { color: #169b79; font-weight: 850; }
.topbar .brand-name { color: var(--text); }
.topbar .brand-name strong { color: #35d6a5; }
.brand-small { font-size: 23px; }
.brand-large { justify-content: center; font-size: clamp(38px, 7vw, 56px); margin-bottom: 24px; }
.brand-mark-image { width: 1.7em; height: 1.7em; padding: .1em; display: block; flex: 0 0 auto; border-radius: .32em; background: #f7f6f1; }

.button, .icon-button {
  border: 0; border-radius: 9px; cursor: pointer; color: var(--text); transition: .18s ease;
}
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 15px; font-weight: 700; font-size: 14px; }
.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: #071113; }
.button-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.button-quiet { background: var(--surface-3); color: var(--text); }
.button-danger { background: rgba(243, 97, 102, .12); color: var(--danger); }
.button-large { min-height: 50px; }
.icon-button { width: 40px; height: 40px; background: transparent; font-size: 20px; }
.icon-button:hover { background: var(--surface-3); }
.theme-switch-control {
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
.theme-switch-control:hover {
  border-color: var(--line);
  color: var(--accent);
  background: var(--surface-3);
  transform: none;
}
.theme-switch-control:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-mode-icon {
  width: 21px;
  height: 21px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.theme-icon-sun, .theme-icon-moon {
  transform-origin: 12px 12px;
  transition: opacity .18s ease, transform .28s cubic-bezier(.2, .8, .2, 1);
}
html[data-theme="dark"] .theme-icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
html[data-theme="dark"] .theme-icon-moon { opacity: 0; transform: rotate(-35deg) scale(.55); }
html[data-theme="light"] .theme-icon-sun { opacity: 0; transform: rotate(35deg) scale(.55); }
html[data-theme="light"] .theme-icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }
.eyebrow { margin-bottom: 7px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }

input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px;
  background: var(--surface-2); color: var(--text); outline: none;
}
textarea { min-height: 108px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 0; }
legend { padding: 0 8px; color: var(--text); font-weight: 750; }
.stack { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.choice-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 15px; }
.check-choice { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface-2); }
.check-choice input, .checkbox-option input { width: auto; accent-color: var(--accent); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 20% 0%, rgba(69,198,200,.13), transparent 36%), radial-gradient(circle at 90% 100%, rgba(255,180,43,.07), transparent 30%), var(--bg); }
.login-card { width: min(430px, 100%); padding: clamp(26px, 6vw, 46px); border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, var(--surface-2), var(--surface)); box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 9px; font-size: 32px; text-align: center; }
.login-card > p { text-align: center; }
.notice { padding: 12px 14px; border-radius: 9px; margin: 16px 0; }
.notice-error { background: rgba(243,97,102,.12); color: var(--danger); border: 1px solid rgba(243,97,102,.25); }

.dashboard-page, .content-page, .admin-page { width: min(1480px, 100%); margin: 0 auto; padding: clamp(26px, 5vw, 70px); }
.dashboard-hero { display: flex; gap: 30px; align-items: end; justify-content: space-between; margin-bottom: 38px; }
.dashboard-hero h1 { max-width: 720px; margin-bottom: 12px; font-size: clamp(34px, 5vw, 62px); line-height: 1.02; }
.dashboard-hero p:not(.eyebrow) { max-width: 680px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.sync-pill { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 100px; color: var(--muted); font-size: 12px; font-weight: 700; background: var(--surface); }
.sync-pill span, .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(94,209,150,.1); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 24px; }
.action-panel, .recent-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.legacy-action { width: 100%; display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: center; padding: 19px 20px; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.legacy-action:last-child { border-bottom: 0; }
.legacy-action:hover { background: var(--surface-2); }
.legacy-action strong, .legacy-action small { display: block; }
.legacy-action strong { margin-bottom: 4px; font-size: 15px; }
.legacy-action > span:last-child { color: var(--muted); font-size: 25px; }
.action-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-size: 19px; }
.static-action { cursor: default; }
.recent-panel { padding: 24px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; }
.panel-heading a { color: var(--accent); font-size: 13px; font-weight: 750; }
.recent-list { display: grid; gap: 8px; }
.recent-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid transparent; border-radius: 11px; }
.recent-card:hover { border-color: var(--line); background: var(--surface-2); }
.recent-card strong, .recent-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-card strong { margin-bottom: 4px; font-size: 14px; }
.report-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(145deg, var(--accent), var(--accent-strong)); color: #071113; font-weight: 900; }
.empty-state { min-height: 240px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.empty-state > span { font-size: 38px; color: var(--accent); }
.empty-state h3, .empty-state h2 { color: var(--text); margin: 10px 0 5px; }
.empty-state p { margin-bottom: 18px; }
.empty-state.large { min-height: 450px; border: 1px dashed var(--line); border-radius: var(--radius); }

.modal-dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.modal-dialog::backdrop { background: rgba(2, 5, 7, .72); backdrop-filter: blur(5px); }
.inspection-wizard { display: grid; gap: 22px; padding: 25px; }
.inspection-wizard > header, .inspection-wizard > footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.inspection-wizard h2 { margin: 0; }
.inspection-wizard > footer { justify-content: end; padding-top: 5px; }
.utility-dialog { width: min(540px, calc(100% - 24px)); border-radius: 0; color: #f1f1f1; background: #4b4b4b; }
.utility-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: none; }
.utility-dialog-form { gap: 16px; padding: 22px 26px 18px; }
.utility-dialog-help { max-height: 45vh; margin: 0; overflow: auto; color: #ddd; white-space: pre-wrap; line-height: 1.5; }
.utility-dialog-field { display: grid; gap: 7px; color: #eee; }
.utility-dialog-field input { width: 100%; min-height: 38px; padding: 7px 4px; border: 0; border-bottom: 1px solid #aaa; border-radius: 0; color: #fff; background: transparent; }
.utility-danger-action { color: #ffb9b9; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 34px; }
.page-heading h1 { margin-bottom: 8px; font-size: clamp(32px, 5vw, 50px); }
.page-heading p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.report-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.report-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; color: var(--muted); font-size: 12px; }
.report-status { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; }
.report-card h2 { margin-bottom: 7px; font-size: 21px; }
.report-card > p { color: var(--muted); min-height: 22px; }
.report-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 0; margin: 18px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.report-card dl div, .detail-list div { display: grid; gap: 4px; }
.report-card dt, .detail-list dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.report-card dd, .detail-list dd { margin: 0; font-size: 13px; }
.report-card footer { display: flex; flex-wrap: wrap; gap: 8px; }
.narrow-page { width: min(980px, 100%); }
.settings-list { display: grid; gap: 10px; }
.settings-list article { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.settings-list h2 { margin-bottom: 5px; font-size: 17px; }
.settings-list p { margin: 0; color: var(--muted); font-size: 13px; }
.settings-list select { width: 180px; }
.setting-value { color: var(--muted); font-size: 13px; }

/* Administration */
.admin-page { max-width: 1580px; }
.save-state { padding: 8px 12px; border-radius: 100px; color: var(--success); background: rgba(94,209,150,.09); font-size: 12px; font-weight: 750; }
.save-state.saving { color: var(--warning); background: rgba(255,200,103,.1); }
.save-state.error { color: var(--danger); background: rgba(243,97,102,.1); }
.admin-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 660px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.admin-nav { padding: 14px; border-right: 1px solid var(--line); background: var(--surface-2); }
.admin-nav button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.admin-nav button:hover { color: var(--text); }
.admin-nav button.active { background: var(--accent-soft); color: var(--accent); }
.admin-content { min-width: 0; padding: clamp(20px, 4vw, 38px); }
.admin-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.admin-section-heading h2 { margin-bottom: 5px; font-size: 28px; }
.admin-section-heading p { margin: 0; color: var(--muted); }
.admin-form-card { max-width: 900px; display: grid; gap: 18px; }
.branding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 900px; margin-top: 24px; }
.branding-card { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.branding-preview { height: 90px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 9px; overflow: hidden; color: var(--muted); font-size: 11px; letter-spacing: .12em; background: var(--surface); }
.branding-preview img { width: 100%; height: 100%; object-fit: contain; }
.branding-card h3 { margin-bottom: 5px; }
.branding-card p { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.branding-actions { display: flex; gap: 7px; }
.branding-actions label { display: inline-flex; color: var(--text); }
.branding-actions input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.service-list, .comment-list { display: grid; gap: 9px; }
.service-row, .comment-row { display: grid; grid-template-columns: 1fr 130px auto auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.toggle { position: relative; width: 46px; height: 26px; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 100px; background: var(--surface-3); border: 1px solid var(--line); cursor: pointer; }
.toggle span::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 4px; border-radius: 50%; background: var(--muted); transition: .18s ease; }
.toggle input:checked + span { background: var(--accent-soft); border-color: var(--accent); }
.toggle input:checked + span::after { left: 23px; background: var(--accent); }
.comment-row { grid-template-columns: 130px 1fr auto auto; }
.comment-row strong, .comment-row small { display: block; }
.comment-row small { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-admin { display: grid; grid-template-columns: minmax(220px, .34fr) minmax(0, .66fr); gap: 18px; }
.template-list, .template-editor { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.template-list header, .template-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.template-list-items { padding: 8px; }
.template-list-item { width: 100%; display: flex; justify-content: space-between; gap: 10px; padding: 11px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.template-list-item:hover, .template-list-item.active { background: var(--surface-3); }
.template-list-item small { font-size: 10px; }
.template-editor-body { display: grid; gap: 10px; padding: 13px; max-height: 650px; overflow: auto; }
.template-section-card { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.template-section-card > header { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; padding: 10px; }
.mini-actions { display: flex; gap: 5px; }
.mini-button { min-width: 31px; height: 31px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border: 0; border-radius: 7px; background: var(--surface-3); color: var(--muted); cursor: pointer; text-decoration: none; }
.mini-button:hover { color: var(--text); }
.template-items { display: grid; gap: 7px; padding: 0 10px 10px; }
.template-item-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 9px; border: 1px solid var(--line-soft); border-radius: 8px; }
.template-item-row .field-summary { color: var(--muted); font-size: 11px; }
.inline-editor { display: grid; gap: 12px; }
.inline-editor footer { display: flex; justify-content: end; gap: 8px; }

/* Inspection field workspace */
.inspection-page { height: calc(100vh - 68px); overflow: hidden; }
.inspection-shell { height: 100%; display: grid; grid-template-columns: 270px minmax(0, 1fr); background: var(--bg); }
.inspection-sidebar { min-height: 0; display: grid; grid-template-rows: auto 1fr auto; border-right: 1px solid var(--line); background: var(--surface); }
.inspection-sidebar-header { padding: 17px; border-bottom: 1px solid var(--line); }
.inspection-sidebar-header strong, .inspection-sidebar-header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspection-sidebar-header strong { margin-bottom: 4px; }
.inspection-sidebar-nav { overflow: auto; padding: 8px; }
.inspection-nav-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.inspection-nav-item:hover { color: var(--text); background: var(--surface-2); }
.inspection-nav-item.active { color: #061012; background: var(--accent); }
.completion-icon { font-weight: 900; }
.completion-icon.complete { color: var(--success); }
.completion-icon.incomplete { color: var(--danger); }
.inspection-nav-item.active .completion-icon { color: #061012; }
.inspection-sidebar-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 12px; border-top: 1px solid var(--line); }
.inspection-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr; }
.inspection-toolbar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.inspection-toolbar h1 { margin: 0; font-size: 20px; }
.inspection-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.toolbar-actions { display: flex; align-items: center; gap: 7px; }
.mobile-menu-button { display: none; }
.save-indicator { color: var(--success); font-size: 12px; font-weight: 700; }
.save-indicator.saving { color: var(--warning); }
.save-indicator.error { color: var(--danger); }
.inspection-content { min-width: 0; min-height: 0; overflow: auto; padding: clamp(16px, 3vw, 30px); }
.workspace { width: min(1120px, 100%); margin: 0 auto; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.workspace-heading h2 { margin-bottom: 5px; font-size: 28px; }
.workspace-heading p { margin: 0; color: var(--muted); }
.workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.workspace-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.workspace-card h3 { margin-bottom: 16px; }
.workspace-card.span-2 { grid-column: span 2; }
.workspace-card .form-grid { gap: 12px; }
.subnav { display: flex; gap: 6px; margin-bottom: 20px; }
.subnav button { padding: 9px 13px; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface); cursor: pointer; }
.subnav button.active { color: #061012; background: var(--accent); }
.item-tabs { position: sticky; top: -1px; z-index: 4; display: flex; gap: 6px; padding: 6px 0 13px; margin-bottom: 14px; overflow-x: auto; background: var(--bg); }
.item-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; }
.item-tab.active { background: var(--accent); border-color: var(--accent); color: #061012; }
.item-tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.item-tab.complete .dot { background: var(--success); }
.field-section { padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.field-section > label { margin-bottom: 11px; color: var(--text); font-size: 14px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-option { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 13px; }
.checkbox-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.status-button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); cursor: pointer; }
.status-button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.comments-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.completion-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 9px; color: var(--danger); background: rgba(243,97,102,.08); }
.completion-banner.complete { color: var(--success); background: rgba(94,209,150,.08); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.photo-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.photo-open-link { display: block; color: inherit; }
.photo-card-body { display: grid; gap: 8px; padding: 10px; }
.photo-card-body p { margin: 0; min-height: 34px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.photo-card-actions { display: flex; gap: 6px; }
.upload-drop { position: relative; min-height: 145px; display: grid; place-items: center; align-content: center; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); background: var(--surface-2); text-align: center; cursor: pointer; }
.upload-drop:hover { border-color: var(--accent); color: var(--text); }
.upload-drop strong { color: var(--text); margin-bottom: 5px; }
.photo-add-launch { width: 100%; padding: 14px; font: inherit; }
.photo-add-launch svg { width: 28px; height: 28px; margin-bottom: 5px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.photo-add-launch strong, .photo-add-launch small { display: block; }
.photo-source-dialog { width: min(560px, calc(100% - 24px)) !important; }
.photo-source-options { display: grid; }
.photo-source-options > button { min-height: 64px; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 4px; border: 0; border-bottom: 1px solid #666; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.photo-source-options > button:hover, .photo-source-options > button:focus-visible { color: #9ae6e7; background: rgba(255,255,255,.05); outline: 0; }
.photo-source-options strong, .photo-source-options small { display: block; }
.photo-source-options strong { margin-bottom: 4px; font-size: 16px; font-weight: 400; }
.photo-source-options small { color: #c5c5c5; }
.photo-source-icon { display: grid; place-items: center; color: #84d0d1; font-size: 27px; }
.preserve-original-option { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 11px; margin: 14px 0 7px; padding: 12px; border: 1px solid #666; color: #eee; background: rgba(255,255,255,.035); cursor: pointer; }
.preserve-original-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #84d0d1; }
.preserve-original-option strong, .preserve-original-option small { display: block; }
.preserve-original-option strong { margin-bottom: 4px; font-size: 14px; font-weight: 500; }
.preserve-original-option small, .photo-processing-note { color: #c5c5c5; font-size: 12px; line-height: 1.45; }
.photo-processing-note { margin: 0 0 4px; }
.camera-dialog { width: min(960px, calc(100% - 24px)) !important; background: #171717 !important; }
.camera-shell { min-height: min(760px, calc(100vh - 30px)); display: grid; grid-template-rows: auto minmax(220px, 1fr) auto auto; }
.camera-shell > header, .camera-shell > footer { min-height: 64px; display: flex; align-items: center; gap: 14px; padding: 11px 18px; background: #202020; }
.camera-shell > header { justify-content: space-between; }
.camera-shell > header h2 { margin: 0; font-size: 20px; font-weight: 500; }
.camera-shell > footer { display: grid; grid-template-columns: auto 1fr auto auto; }
.camera-preview { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #050505; }
.camera-preview video { width: 100%; height: 100%; max-height: calc(100vh - 170px); object-fit: contain; }
.camera-waiting { position: absolute; inset: 0; display: grid; place-items: center; color: #ddd; background: #101010; }
.camera-waiting[hidden] { display: none; }
.camera-fallback { padding: 12px 18px; color: #ddd; background: #292929; }
.camera-fallback[hidden] { display: none; }
.camera-fallback p { margin: 0 0 9px; }
.camera-shutter { width: 58px; height: 58px; display: grid; place-items: center; padding: 0; border: 3px solid #f5f5f5; border-radius: 50%; background: transparent; cursor: pointer; }
.camera-shutter span { width: 40px; height: 40px; border-radius: 50%; background: #f5f5f5; }
.camera-shutter:hover span { background: #84d0d1; }
.camera-shutter:disabled { opacity: .35; cursor: wait; }
.summary-category-list { display: grid; gap: 14px; }
.summary-category { border-left: 3px solid var(--accent); padding-left: 15px; }
.summary-category h3 { margin-bottom: 9px; }
.summary-finding { padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.summary-finding strong, .summary-finding small { display: block; }
.summary-finding p { margin: 8px 0 0; color: var(--muted); }
.invoice-lines { width: 100%; border-collapse: collapse; }
.invoice-lines th, .invoice-lines td { padding: 11px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.invoice-lines th:last-child, .invoice-lines td:last-child { text-align: right; }
.invoice-total { display: flex; justify-content: space-between; padding: 18px 8px 0; font-size: 24px; font-weight: 850; }
.saved-comment-picker { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.saved-comment-option { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.saved-comment-option:hover { border-color: var(--accent); }
.saved-comment-option strong, .saved-comment-option small { display: block; }

.markup-dialog { width: min(980px, calc(100% - 24px)); }
.markup-shell { display: grid; grid-template-rows: auto 1fr auto; min-height: min(760px, calc(100vh - 40px)); }
.markup-shell header, .markup-shell footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px; border-bottom: 1px solid var(--line); }
.markup-shell footer { justify-content: end; border-top: 1px solid var(--line); border-bottom: 0; }
.markup-canvas-wrap { position: relative; display: grid; place-items: center; min-height: 0; padding: 12px; overflow: auto; background: #080a0b; }
.markup-stage { position: relative; max-width: 100%; max-height: 100%; }
.markup-stage img { max-height: calc(100vh - 190px); object-fit: contain; user-select: none; }
.markup-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.tool-group { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-button.active { background: var(--accent); color: #061012; }
.markup-help { margin: 0; color: var(--muted); font-size: 12px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 230px; max-width: 380px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-3); box-shadow: var(--shadow); font-size: 13px; }
.toast.error { border-color: rgba(243,97,102,.45); color: var(--danger); }

@media (max-width: 680px) {
  .toast-region { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .toast { width: 100%; min-width: 0; max-width: none; }
}

/* Printable report */
.print-report { width: min(1040px, 100%); margin: 0 auto; padding: 30px; }
.report-toolbar { display: flex; justify-content: space-between; margin-bottom: 18px; }
.report-sheet { min-height: 1120px; padding: 58px; margin-bottom: 24px; background: #fff; color: #172126; box-shadow: var(--shadow); page-break-after: always; }
.report-sheet:last-child { page-break-after: auto; }
.formal-header { display: flex; align-items: start; justify-content: space-between; gap: 30px; padding-bottom: 22px; border-bottom: 2px solid #dfe7e8; }
.report-company-logo { width: auto; max-width: 240px; height: 62px; object-fit: contain; object-position: left center; }
.company-block { display: grid; gap: 3px; text-align: right; font-size: 12px; color: #5c686e; }
.company-block strong { color: #172126; font-size: 15px; }
.report-cover-image, .report-cover-placeholder { height: 480px; margin: 42px 0 36px; border-radius: 8px; overflow: hidden; background: #e8eeee; }
.report-cover-image img { width: 100%; height: 100%; object-fit: cover; }
.report-cover-placeholder { display: grid; place-items: center; font-size: 100px; color: #9bacb2; }
.cover-title h1 { margin-bottom: 8px; font-size: 42px; }
.cover-title > p { color: #607077; }
.cover-title dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 35px; padding-top: 20px; border-top: 1px solid #dfe7e8; }
.cover-title dl div { display: grid; gap: 5px; }
.cover-title dt { color: #718087; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.cover-title dd { margin: 0; font-size: 13px; font-weight: 700; }
.report-sheet > h1, .report-section > header h1 { font-size: 34px; }
.report-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 35px 0; }
.detail-list { display: grid; gap: 12px; }
.detail-list div { grid-template-columns: 130px 1fr; padding-bottom: 10px; border-bottom: 1px solid #e8eeee; }
.narrative-block { padding: 22px; margin-top: 30px; border-left: 4px solid #159da1; background: #f1f7f7; }
.narrative-block h2 { margin-bottom: 9px; }
.narrative-block p { margin: 0; line-height: 1.65; }
.summary-report-list { display: grid; gap: 14px; margin-top: 30px; }
.summary-report-item { padding: 18px; border: 1px solid #dfe7e8; border-left: 5px solid #e7a22b; border-radius: 7px; }
.summary-report-item h2 { margin-bottom: 8px; font-size: 18px; }
.summary-report-item p:last-child { margin: 0; color: #55656c; line-height: 1.55; }
.empty-report-note { margin-top: 30px; padding: 30px; border: 1px dashed #cbd7da; color: #6d7b82; text-align: center; }
.report-section > header { padding-bottom: 16px; margin-bottom: 8px; border-bottom: 3px solid #159da1; }
.report-item { padding: 18px 0; border-bottom: 1px solid #dfe7e8; break-inside: avoid; }
.report-item-heading { display: flex; justify-content: space-between; gap: 20px; }
.report-item h2 { font-size: 18px; }
.field-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.field-report-grid div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.field-report-grid dt { color: #738189; font-size: 11px; text-transform: uppercase; }
.field-report-grid dd { margin: 0; font-size: 13px; }
.item-comment { padding: 12px; margin: 14px 0 0; border-radius: 5px; background: #f1f5f5; line-height: 1.55; }
.report-photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 26px; }
.report-photo-grid figure { margin: 0; break-inside: avoid; }
.report-photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.report-photo-grid figcaption { padding: 9px 0; color: #526168; font-size: 12px; }
.annotated-image { position: relative; }
.annotated-image svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.invoice-table { width: 100%; border-collapse: collapse; margin-top: 30px; }
.invoice-table th, .invoice-table td { padding: 13px; border-bottom: 1px solid #dfe7e8; text-align: left; }
.invoice-table th:last-child, .invoice-table td:last-child { text-align: right; }
.invoice-table tfoot { font-size: 20px; }
.signature-block { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-top: 55px; padding-top: 22px; border-top: 1px solid #dfe7e8; }
.signature-block img { width: 230px; max-height: 100px; object-fit: contain; object-position: left bottom; }
.signature-block div { display: grid; gap: 4px; text-align: right; }
.signature-block span { color: #637178; font-size: 12px; }

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav button { flex: 0 0 auto; width: auto; }
  .template-admin { grid-template-columns: 1fr; }
  .branding-grid { grid-template-columns: 1fr; }
  .inspection-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .workspace-grid { grid-template-columns: 1fr; }
  .workspace-card.span-2 { grid-column: auto; }
}

@media (max-width: 680px) {
  .topbar { height: 58px; padding: 0 12px; }
  .topbar-actions > a { display: none; }
  .brand-small { font-size: 19px; }
  .dashboard-page, .content-page, .admin-page { padding: 24px 14px; }
  .dashboard-hero, .page-heading { align-items: start; flex-direction: column; }
  .dashboard-hero h1 { font-size: 39px; }
  .two-columns, .three-columns { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .inspection-page { height: calc(100vh - 58px); }
  .inspection-shell { display: block; position: relative; }
  .inspection-sidebar { position: fixed; z-index: 30; inset: 58px auto 0 0; width: min(82vw, 290px); transform: translateX(-105%); transition: .2s ease; box-shadow: var(--shadow); }
  .inspection-shell.sidebar-open .inspection-sidebar { transform: none; }
  .inspection-main { height: 100%; }
  .inspection-toolbar { min-height: 58px; padding: 9px 12px; }
  .mobile-menu-button { display: inline-grid; place-items: center; }
  .inspection-toolbar h1 { font-size: 16px; }
  .inspection-toolbar .button { padding: 8px 10px; font-size: 12px; }
  .inspection-content { padding: 13px; }
  .workspace-heading { align-items: start; flex-direction: column; }
  .comments-actions { grid-template-columns: 1fr; }
  .service-row { grid-template-columns: 1fr 90px auto auto; }
  .comment-row { grid-template-columns: 1fr auto auto; }
  .comment-row > span { display: none; }
  .report-card footer .button { flex: 1; }
  .settings-list article { align-items: start; flex-direction: column; }
  .print-report { padding: 0; }
  .report-sheet { min-height: auto; padding: 26px; margin: 0; box-shadow: none; }
  .report-two-column, .report-photo-grid, .field-report-grid, .cover-title dl { grid-template-columns: 1fr; }
}

@media print {
  :root { color-scheme: light; }
  @page { size: letter; margin: 0; }
  body { background: #fff !important; }
  .no-print, .topbar, .toast-region { display: none !important; }
  .print-report { width: 100%; padding: 0; }
  .report-sheet { width: 8.5in; min-height: 11in; padding: .55in; margin: 0; box-shadow: none; }
}

/* Legacy tablet visual-fidelity layer
   The field UI follows the original product walkthrough,
   excluding the Android device chrome. Report output keeps its print styles. */

body[data-page="home"],
body[data-page="admin"],
body[data-page="inspection"],
body[data-page="reports"],
body[data-page="settings"],
body[data-page="login"] {
  --bg: #2f2f2f;
  --surface: #2f2f2f;
  --surface-2: #353535;
  --surface-3: #414141;
  --line: #414141;
  --line-soft: #393939;
  --text: #ededed;
  --muted: #c9c9c9;
  --accent: #78c5c5;
  --accent-strong: #0b9296;
  --accent-soft: rgba(118, 199, 201, .17);
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
  background: #2f2f2f;
}

body[data-page="home"] > .topbar,
body[data-page="admin"] > .topbar,
body[data-page="inspection"] > .topbar,
body[data-page="reports"] > .topbar,
body[data-page="settings"] > .topbar,
body[data-page="report"] > .topbar { display: none; }

/* Home launcher */
.legacy-home-page { min-height: 100vh; background: #2f2f2f; }
.legacy-home-shell { width: 100%; min-height: 100vh; padding: 15px 15px 30px; }
.product-wordmark {
  width: min(460px, 100%);
  height: 92px;
  min-height: 0;
  margin: 0 0 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border: 2px solid #071c31;
  border-radius: 9px;
  color: #082846;
  background: #f7f6f1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 7px rgba(0,0,0,.55);
}
.inspector-station-logo {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: stretch;
}
.inspector-station-logo img {
  width: 100%;
  height: 100%;
  grid-area: 1 / 1;
  display: block;
  transition: opacity .18s ease;
}
.inspector-station-logo-dark { opacity: 0; }
.inspector-station-name {
  display: flex;
  align-items: baseline;
  gap: .2em;
  color: #082846;
  white-space: nowrap;
  letter-spacing: -.045em;
  font-size: 34px;
  font-weight: 420;
  line-height: .95;
}
.inspector-station-name strong { color: #082846; font-weight: 820; }
html[data-theme="dark"] .product-wordmark {
  border-width: 1px;
  border-color: #526060;
  color: #ededed;
  background: #292929;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    inset 0 0 0 1px rgba(120, 197, 197, .06),
    0 4px 13px rgba(0, 0, 0, .32);
}
html[data-theme="dark"] .inspector-station-logo-light { opacity: 0; }
html[data-theme="dark"] .inspector-station-logo-dark { opacity: 1; }
html[data-theme="dark"] .inspector-station-name {
  color: #ededed;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .28);
}
html[data-theme="dark"] .inspector-station-name strong { color: #78c5c5; }
.legacy-home-menu { width: 100%; }
.legacy-menu-row {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  display: grid;
  grid-template-columns: 31px 1fr auto;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #414141;
  border-radius: 0;
  color: #d5d5d5;
  background: transparent;
  text-align: left;
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
}
.legacy-menu-row:hover, .legacy-menu-row:focus-visible { color: #fff; background: #353535; outline: none; }
.legacy-menu-icon { width: 24px; color: #f0f0f0; text-align: center; font-size: 22px; line-height: 1; }
.legacy-sync-row { cursor: default; }
.legacy-menu-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.legacy-menu-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legacy-menu-copy small { display: block; overflow: hidden; color: #aaa; font-size: 11px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.legacy-sync-row small { display: block; }
.legacy-sync-row.is-offline .legacy-menu-icon,
.legacy-sync-row.is-pending .legacy-menu-icon { color: #d59a13; }
.legacy-sync-row.is-syncing .legacy-menu-icon { color: #79c9ca; animation: sync-pulse 1.1s ease-in-out infinite; }
.android-download-row { min-height: 58px; height: auto; }
.android-download-icon svg { width: 23px; height: 23px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.android-download-icon svg circle { fill: currentColor; stroke: none; }
.legacy-version { margin: 17px 13px 0; color: #d0d0d0; font-size: 17px; }

@keyframes sync-pulse {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}

.offline-status-banner {
  position: fixed;
  z-index: 900;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  min-height: 38px;
  max-width: min(430px, calc(100vw - 28px));
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #5e5e5e;
  border-radius: 2px;
  color: #eee;
  background: #303030;
  box-shadow: 0 5px 18px rgba(0,0,0,.45);
  font-size: 13px;
  pointer-events: none;
}
.offline-status-banner[hidden] { display: none !important; }
.offline-status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #d39a18; }
.offline-status-banner.is-syncing .offline-status-dot { background: #79c9ca; animation: sync-pulse 1.1s ease-in-out infinite; }
.save-indicator.offline { color: #dda72b; }
.photo-card-offline { border-color: #b68119; }
.annotated-image { position: relative; }
.photo-offline-badge {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  background: rgba(57,43,12,.9);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.photo-evidence-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  background: rgba(28,67,68,.92);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* Android-style New Inspection dialog */
body[data-page="home"] .modal-dialog {
  width: min(452px, calc(100% - 24px));
  max-height: calc(100vh - 52px);
  border: 0;
  border-radius: 0;
  color: #f4f4f4;
  background: #414141;
  box-shadow: 0 14px 50px rgba(0,0,0,.7);
}
body[data-page="home"] .modal-dialog::backdrop { background: rgba(0,0,0,.74); backdrop-filter: none; }
body[data-page="home"] .inspection-wizard { gap: 0; padding: 18px 26px 15px; }
body[data-page="home"] .inspection-wizard > header { min-height: 38px; margin-bottom: 8px; }
body[data-page="home"] .inspection-wizard h2 { font-size: 20px; font-weight: 600; letter-spacing: 0; }
.legacy-dialog-close { color: #ddd; }
.legacy-dialog-close { display: none; }
.legacy-dialog-fields { display: grid; gap: 11px; }
.legacy-dialog-fields label {
  min-height: 33px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: end;
  gap: 6px;
  color: #d0d0d0;
  font-size: 16px;
  font-weight: 400;
}
.legacy-dialog-fields input, .legacy-dialog-fields select {
  height: 34px;
  padding: 3px 5px;
  border: 0;
  border-bottom: 1px solid #999;
  border-radius: 0;
  color: #f4f4f4;
  background: transparent;
  box-shadow: none;
}
.legacy-dialog-fields input:focus, .legacy-dialog-fields select:focus { border-color: #79c6c6; box-shadow: none; }
.legacy-dialog-fields option { color: #111; background: #fff; }
.legacy-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.legacy-select {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 34px;
  border-bottom: 1px solid #999;
}
.legacy-select-trigger {
  width: 100%;
  height: 33px;
  padding: 3px 28px 3px 5px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: #f4f4f4;
  background: transparent;
  font-weight: 400;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.legacy-select-trigger::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 7px;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-top-color: #d8d8d8;
}
.legacy-select-trigger:focus-visible,
.legacy-select.open { outline: none; border-bottom-color: #79c6c6; }
.legacy-select-trigger:disabled { color: #8f8f8f; cursor: default; }
.legacy-select-menu {
  position: absolute;
  z-index: 500;
  top: 100%;
  right: 36px;
  left: 0;
  max-height: min(420px, calc(100vh - 20px));
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: #414141;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .52);
  scrollbar-color: #aaa transparent;
  scrollbar-width: thin;
}
.legacy-select.opens-up .legacy-select-menu { top: auto; bottom: 0; }
.legacy-select-menu::-webkit-scrollbar { width: 4px; }
.legacy-select-menu::-webkit-scrollbar-track { background: transparent; }
.legacy-select-menu::-webkit-scrollbar-thumb { background: #aaa; }
.legacy-select-option {
  width: 100%;
  height: 44px;
  padding: 0 9px;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: #f1f1f1;
  background: transparent;
  font-weight: 400;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.legacy-select-option:hover,
.legacy-select-option:focus-visible { outline: none; background: #555; }
.legacy-select-option[aria-selected="true"] { background: #4a4a4a; }
.legacy-select-option:disabled { color: #888; cursor: default; }
.legacy-property-fields { margin-top: 20px; padding: 0; border: 0; }
.legacy-property-fields legend { margin-bottom: 12px; padding: 0; color: #f1f1f1; font-size: 21px; font-weight: 400; }
body[data-page="home"] .inspection-wizard > footer { gap: 18px; margin-top: 30px; padding: 0 0 4px; }
.legacy-text-button { padding: 7px 0; border: 0; color: #83d1d2; background: transparent; text-transform: uppercase; font-size: 13px; cursor: pointer; }
body[data-page="home"] .modal-dialog { overflow: visible; }

/* Shared compact action bar */
.legacy-actionbar {
  height: 62px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #252525;
  background: #1f1f1f;
  color: #f5f5f5;
}
.legacy-actionbar-brand { display: flex; align-items: center; gap: 16px; font-size: 18px; }
.legacy-actionbar-leading { min-width: 0; display: flex; align-items: center; gap: 8px; }
.mobile-drawer-toggle, .mobile-drawer-scrim { display: none; }
.mobile-drawer-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.mobile-drawer-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.mobile-drawer-toggle:hover, .mobile-drawer-toggle:focus-visible { color: #7ad0d2; border-color: #555; background: #333; outline: none; }
.admin-back-menu { margin-right: 2px; }
.admin-back-menu svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.admin-mobile-navigation { display: none; }

@media (max-width: 680px) {
  #admin-back-menu { display: none !important; }
}
.mini-emblem {
  width: 39px;
  height: 39px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 3px;
  overflow: hidden;
  border: 1px solid #64717d;
  border-radius: 9px;
  background: #f7f6f1;
}
.mini-emblem img { width: 100%; height: 100%; display: block; }
html[data-theme="dark"] .mini-emblem {
  border-color: #526060;
  background: #292929 url("inspector-station-mark-dark.svg") center / 100% 100% no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
html[data-theme="dark"] .mini-emblem img { opacity: 0; }
.legacy-actionbar-tools { display: flex; align-items: center; gap: 16px; color: #f5f5f5; }
.legacy-actionbar-tools #admin-save-state { color: #aeb8b8; font-size: 11px; }
.legacy-actionbar-tools form { margin: 0; }
.legacy-actionbar-tools button, .legacy-actionbar-tools a { padding: 2px; border: 0; color: inherit; background: transparent; font-size: 22px; cursor: pointer; }
.legacy-actionbar .legacy-actionbar-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
}
.legacy-actionbar .legacy-actionbar-icon:hover,
.legacy-actionbar .legacy-actionbar-icon:focus-visible { color: #7ad0d2; background: #333; outline: none; }
.legacy-actionbar .legacy-actionbar-icon:focus-visible { border-color: #79c6c6; }
.legacy-actionbar .legacy-actionbar-icon > svg:not(.theme-mode-icon) {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Existing reports */
.legacy-reports-page {
  width: 100%;
  min-height: calc(100vh - 62px);
  padding: 10px 14px 40px;
  background: #2f2f2f;
}
.legacy-reports-actionbar .legacy-actionbar-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
}
.legacy-reports-actionbar .legacy-actionbar-icon:hover,
.legacy-reports-actionbar .legacy-actionbar-icon:focus-visible { color: #7ad0d2; background: #333; outline: none; }
.legacy-reports-actionbar .legacy-actionbar-icon:focus-visible { border-color: #79c6c6; }
.legacy-reports-actionbar .legacy-actionbar-icon > svg:not(.theme-mode-icon) {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.legacy-reports-actionbar .legacy-actionbar-icon > svg.legacy-solid-icon { fill: currentColor; stroke: none; }
.legacy-report-list { width: 100%; }
.legacy-report-row {
  position: relative;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  border-bottom: 1px solid #414141;
}
.legacy-report-row:hover, .legacy-report-row:focus-within { background: #353535; }
.legacy-report-open {
  min-width: 0;
  padding: 8px 8px 8px 5px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  outline: none;
}
.legacy-report-pencil {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #f1f1f1;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.legacy-report-copy { min-width: 0; display: grid; gap: 4px; }
.legacy-report-copy strong {
  overflow: hidden;
  color: #e5e5e5;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legacy-report-copy small {
  overflow: hidden;
  color: #aaa;
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legacy-report-state { padding-left: 14px; color: #bbb; font-size: 12px; white-space: nowrap; }
.legacy-report-more {
  width: 46px;
  min-height: 63px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: #eee;
  background: transparent;
  cursor: pointer;
}
.legacy-report-more:hover, .legacy-report-more:focus-visible { color: #fff; background: #414141; outline: none; }
.legacy-report-more svg { width: 22px; height: 22px; fill: currentColor; }
.legacy-report-menu {
  position: absolute;
  z-index: 80;
  top: 48px;
  right: 5px;
  width: 205px;
  padding: 6px 0;
  background: #414141;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .58);
}
.legacy-report-menu[hidden] { display: none; }
.legacy-report-menu a, .legacy-report-menu button {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  color: #f1f1f1;
  background: transparent;
  text-align: left;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
}
.legacy-report-menu a:hover, .legacy-report-menu a:focus-visible,
.legacy-report-menu button:hover, .legacy-report-menu button:focus-visible { background: #555; outline: none; }
.legacy-reports-empty {
  min-height: 320px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
  color: #aaa;
}
.legacy-reports-empty svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.legacy-reports-empty p { margin: 0; font-size: 17px; }
.legacy-reports-empty a { color: #7ccacc; font-size: 14px; text-transform: uppercase; }

/* Settings */
.legacy-current-user { max-width: 180px; overflow: hidden; color: #b9c2c2; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.legacy-settings-page { min-height: calc(100vh - 62px); background: #2f2f2f; }
.legacy-settings-shell {
  min-height: calc(100vh - 62px);
  display: grid;
  grid-template-columns: minmax(250px, 32%) minmax(0, 1fr);
}
.legacy-settings-nav { border-right: 1px solid #414141; }
.legacy-settings-nav button {
  width: 100%;
  height: 47px;
  padding: 0 15px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid #414141;
  border-radius: 0;
  color: #e1e1e1;
  background: transparent;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}
.legacy-settings-nav button:hover, .legacy-settings-nav button:focus-visible { color: #fff; background: #383838; outline: none; }
.legacy-settings-nav button.active { color: #112526; background: #78c7c9; }
.legacy-settings-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.legacy-settings-detail { min-width: 0; padding: 12px 14px 28px; background: #2f2f2f; }
.legacy-settings-panel[hidden] { display: none; }
.legacy-settings-panel h1 {
  min-height: 35px;
  margin: 0;
  padding: 6px 8px 9px;
  border-bottom: 1px solid #424242;
  color: #dfdfdf;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
}
.legacy-preference-row {
  min-height: 62px;
  padding: 9px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  border-bottom: 1px solid #424242;
  color: #eee;
}
.legacy-preference-row > div, .legacy-preference-row > span:first-child { min-width: 0; display: grid; gap: 4px; }
.legacy-preference-row strong { font-size: 14px; font-weight: 400; }
.legacy-preference-row small { color: #aaa; font-size: 11px; font-weight: 400; }
.legacy-preference-row > span:last-child, .legacy-preference-row > a { flex: 0 0 auto; color: #aeb7b7; font-size: 12px; }
.legacy-preference-row > a { color: #82d0d1; text-transform: uppercase; }
.legacy-preference-select { display: flex; color: #eee; font-weight: 400; }
.legacy-preference-select .legacy-select { width: 190px; flex: 0 0 auto; }
.legacy-preference-select > select { width: 190px; }
.legacy-connected { color: #82d0d1 !important; }

/* Sign in */
.legacy-login-page { min-height: 100vh; padding: 28px 15px; display: grid; place-items: center; background: #2f2f2f; }
.legacy-login-shell { width: min(620px, 100%); }
.legacy-login-wordmark { width: min(440px, calc(100% - 24px)); margin: 0 auto 14px; }
.legacy-login-dialog {
  width: min(440px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 26px 14px;
  color: #eee;
  background: #414141;
  box-shadow: 0 17px 44px rgba(0,0,0,.55);
}
.legacy-login-dialog h1 { margin: 0 0 18px; font-size: 20px; font-weight: 500; letter-spacing: 0; }
.legacy-login-dialog label {
  min-height: 50px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #eee;
  font-size: 14px;
  font-weight: 400;
}
.legacy-login-dialog input {
  height: 38px;
  padding: 7px 5px 4px;
  border: 0;
  border-bottom: 1px solid #aaa;
  border-radius: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
}
.legacy-login-dialog input:focus { border-bottom-color: #82d0d1; box-shadow: none; }
.legacy-password-control { position: relative; min-width: 0; display: block; }
.legacy-password-control input { width: 100%; padding-right: 39px; }
.legacy-password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #d8d8d8;
  background: transparent;
  cursor: pointer;
}
.legacy-password-toggle:hover { background: rgba(255,255,255,.08); }
.legacy-password-toggle:focus-visible { outline: 2px solid #82d0d1; outline-offset: -2px; }
.legacy-password-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.legacy-password-toggle .password-eye-closed { display: none; }
.legacy-password-toggle[aria-pressed="true"] .password-eye-open { display: none; }
.legacy-password-toggle[aria-pressed="true"] .password-eye-closed { display: block; }
.legacy-login-dialog footer { display: flex; justify-content: flex-end; padding-top: 15px; }
.legacy-login-error { margin: -4px 0 12px 118px; color: #ff9a9e; font-size: 12px; }

/* Report preview keeps the printable document but uses the same app chrome. */
body[data-page="report"] { background: #c8c8c8; font-family: Roboto, "Segoe UI", Arial, sans-serif; }
.legacy-report-actionbar { position: sticky; top: 0; z-index: 40; }
.legacy-report-actionbar + .print-report { padding-top: 24px; }

/* Administration */
body[data-page="admin"] .admin-page { width: 100%; max-width: none; min-height: calc(100vh - 62px); padding: 0; }
.legacy-admin-menu { padding: 14px 15px 0; }
.legacy-admin-menu button {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  display: block;
  border: 0;
  border-bottom: 1px solid #434343;
  border-radius: 0;
  color: #d5d5d5;
  background: transparent;
  text-align: left;
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
}
.legacy-admin-menu button:hover, .legacy-admin-menu button:focus-visible { color: #fff; background: #353535; outline: none; }
body[data-page="admin"] .admin-shell {
  min-height: calc(100vh - 62px);
  grid-template-columns: 235px minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: #2f2f2f;
}
body[data-page="admin"] .admin-nav { padding: 0; border-right: 1px solid #414141; background: #2f2f2f; }
body[data-page="admin"] .admin-nav button { min-height: 47px; padding: 0 14px; border-bottom: 1px solid #3f3f3f; border-radius: 0; color: #ddd; font-size: 15px; }
body[data-page="admin"] .admin-nav button.active { color: #102224; background: #75c7c9; }
body[data-page="admin"] .admin-content { padding: 17px 15px; }
.legacy-admin-detail { min-height: calc(100vh - 62px); }
body[data-page="admin"] .admin-section-heading { margin-bottom: 15px; }
body[data-page="admin"] .admin-section-heading h2 { margin: 0; font-size: 21px; font-weight: 500; letter-spacing: 0; }
body[data-page="admin"] .admin-section-heading p { display: none; }
body[data-page="admin"] input, body[data-page="admin"] textarea, body[data-page="admin"] select {
  padding: 8px 5px;
  border: 0;
  border-bottom: 1px solid #777;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-page="admin"] .service-list, body[data-page="admin"] .comment-list { gap: 0; }
body[data-page="admin"] .service-row, body[data-page="admin"] .comment-row {
  min-height: 51px;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid #424242;
  border-radius: 0;
  background: transparent;
}
body[data-page="admin"] .template-admin { gap: 0; border-top: 1px solid #454545; }
body[data-page="admin"] .template-list, body[data-page="admin"] .template-editor,
body[data-page="admin"] .template-section-card, body[data-page="admin"] .template-item-row,
body[data-page="admin"] .branding-card, body[data-page="admin"] .branding-preview {
  border-radius: 0;
  background: transparent;
}
body[data-page="admin"] .template-list-item { border-radius: 0; }
body[data-page="admin"] .button,
body[data-page="admin"] .icon-button { border-radius: 0; box-shadow: none; }
.legacy-template-index { position: relative; min-height: calc(100vh - 120px); }
.legacy-template-add {
  position: fixed;
  z-index: 50;
  top: 40px;
  right: 50px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  color: #f5f5f5;
  background: transparent;
  font-size: 25px;
  cursor: pointer;
}
.legacy-template-rows { display: grid; }
.legacy-template-row {
  width: 100%;
  min-height: 42px;
  padding: 0 7px;
  display: grid;
  grid-template-columns: 32px 1fr 36px;
  align-items: center;
  border: 0;
  border-radius: 0;
  color: #ddd;
  background: transparent;
  text-align: left;
  font-size: 17px;
  cursor: pointer;
}
.legacy-template-row:hover, .legacy-template-row:focus-visible { color: #fff; background: #353535; outline: none; }
.legacy-template-lock, .legacy-template-row-action { position: relative; width: 22px; height: 24px; color: #f4f4f4; }
.legacy-template-lock.locked::before { content: ""; position: absolute; left: 5px; top: 10px; width: 10px; height: 9px; border: 2px solid #eee; border-radius: 1px; }
.legacy-template-lock.locked::after { content: ""; position: absolute; left: 7px; top: 4px; width: 7px; height: 8px; border: 2px solid #eee; border-bottom: 0; border-radius: 6px 6px 0 0; }
.legacy-template-row-action.copy::before, .legacy-template-row-action.copy::after { content: ""; position: absolute; width: 11px; height: 14px; border: 2px solid #eee; }
.legacy-template-row-action.copy::before { left: 3px; top: 3px; }
.legacy-template-row-action.copy::after { left: 7px; top: 7px; background: #2f2f2f; }
.legacy-template-row-action.delete::before { content: ""; position: absolute; left: 6px; top: 8px; width: 10px; height: 12px; border-radius: 1px; background: #eee; }
.legacy-template-row-action.delete::after { content: ""; position: absolute; left: 5px; top: 5px; width: 12px; height: 2px; background: #eee; box-shadow: 3px -2px 0 -1px #eee; }
.legacy-template-row { grid-template-columns: minmax(0, 1fr) 36px; padding: 0; }
.legacy-template-row > button:first-child {
  min-width: 0; min-height: 42px; padding: 0 7px; display: grid;
  grid-template-columns: 32px minmax(0, 1fr); align-items: center; border: 0;
  color: inherit; background: transparent; text-align: left; font: inherit; cursor: pointer;
}
.legacy-template-row > .legacy-template-row-action { margin: 0 7px 0 0; padding: 0; border: 0; background: transparent; cursor: pointer; }
.legacy-admin-tabs { display: flex; border-bottom: 1px solid #505050; }
.legacy-admin-tabs button { min-width: 170px; padding: 12px 18px; border: 0; border-bottom: 3px solid transparent; color: #ccc; background: transparent; text-transform: uppercase; cursor: pointer; }
.legacy-admin-tabs button.active { color: #7fd0d2; border-bottom-color: #7fd0d2; }
.legacy-comment-tools { display: grid; grid-template-columns: 220px minmax(240px, 1fr); gap: 16px; margin: 0 0 14px; }
.legacy-config-list, .legacy-reorder-list { display: grid; max-width: 920px; }
.lookup-row { padding: 12px 8px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: start; border-bottom: 1px solid #4a4a4a; }
.lookup-row textarea { min-height: 58px; }
.legacy-template-toolbar { position: sticky; z-index: 5; top: 0; padding: 8px; display: flex; flex-wrap: wrap; gap: 5px; border-bottom: 1px solid #555; background: #292929; }
.legacy-template-toolbar select { min-width: 175px; }
.legacy-template-toolbar button { padding: 8px 10px; border: 0; color: #eee; background: #4a4a4a; cursor: pointer; }
.legacy-template-toolbar button:hover, .legacy-template-toolbar button:focus-visible { color: #152526; background: #77c9cb; }
.drag-handle { color: #bbb; font-size: 20px; }

/* Inspection workspace */
body[data-page="inspection"] .inspection-page { height: 100vh; }
.inspection-workbench { height: 100%; display: grid; grid-template-rows: 62px minmax(0, 1fr); }
body[data-page="inspection"] .inspection-toolbar {
  min-height: 62px;
  padding: 0 22px;
  border-bottom: 1px solid #252525;
  background: #1f1f1f;
}
.inspection-toolbar-brand { min-width: 0; display: flex; align-items: center; gap: 16px; }
.inspection-toolbar-brand h1 { margin: 0; color: #f5f5f5; font-size: 18px; font-weight: 600; letter-spacing: 0; }
.inspection-toolbar-brand p { max-width: 420px; overflow: hidden; color: #aaa; text-overflow: ellipsis; white-space: nowrap; }
.legacy-tool-button {
  width: 30px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 0;
  color: #f3f3f3;
  background: transparent;
  font-size: 21px;
  cursor: pointer;
}
body[data-page="inspection"] .theme-switch-control { width: 36px; border: 1px solid transparent; border-radius: 50%; }
body[data-page="inspection"] .theme-switch-control:hover { border-color: #535353; color: #7ad0d2; background: #333; }
body[data-page="inspection"] .save-indicator { color: #a8b5b5; font-size: 10px; font-weight: 400; }
body[data-page="inspection"] .inspection-shell { min-height: 0; grid-template-columns: minmax(238px, 32.8%) minmax(0, 1fr); }
body[data-page="inspection"] .inspection-sidebar { grid-template-rows: 1fr auto; border-right: 1px solid #414141; background: #2f2f2f; }
body[data-page="inspection"] .inspection-sidebar-nav { padding: 0 4px; }
body[data-page="inspection"] .inspection-nav-item {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 0;
  color: #f0f0f0;
  font-size: 17px;
  font-weight: 400;
}
body[data-page="inspection"] .inspection-nav-item:hover { background: #373737; }
body[data-page="inspection"] .inspection-nav-item.active { color: #142627; background: #78c7c9; }
body[data-page="inspection"] .completion-icon.incomplete { color: #ff1010; font-size: 23px; font-weight: 400; }
body[data-page="inspection"] .completion-icon.complete { color: #50d596; }
body[data-page="inspection"] .inspection-sidebar-footer { padding: 5px; border-top: 1px solid #454545; }
body[data-page="inspection"] .inspection-sidebar-footer .button { min-height: 34px; border-radius: 0; font-size: 12px; }
body[data-page="inspection"] .inspection-main { display: block; min-height: 0; }
body[data-page="inspection"] .inspection-content { height: 100%; padding: 4px 7px 0 10px; }
body[data-page="inspection"] .workspace { width: 100%; max-width: none; min-height: 100%; margin: 0; }
body[data-page="inspection"] .workspace-heading { display: none; }
body[data-page="inspection"] .workspace-grid { grid-template-columns: 1fr; gap: 0; }
body[data-page="inspection"] .workspace-card {
  padding: 0;
  margin: 0 0 11px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body[data-page="inspection"] .workspace-card.span-2 { grid-column: auto; }
body[data-page="inspection"] .workspace-card h3,
body[data-page="inspection"] .field-section > label {
  min-height: 34px;
  margin: 0;
  padding: 6px 5px;
  display: block;
  color: #d9d9d9;
  background: #414141;
  font-size: 16px;
  font-weight: 400;
}
body[data-page="inspection"] .field-section {
  padding: 0;
  margin: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body[data-page="inspection"] .check-grid { gap: 6px 16px; padding: 8px 5px 3px; }
body[data-page="inspection"] .checkbox-option {
  min-height: 27px;
  padding: 1px 0;
  border: 0;
  border-radius: 0;
  color: #f0f0f0;
  background: transparent;
  font-size: 16px;
  font-weight: 400;
}
body[data-page="inspection"] .checkbox-option:has(input:checked) { color: #fff; background: transparent; }
body[data-page="inspection"] input[type="checkbox"] { width: 18px; height: 18px; accent-color: #149a9d; }
body[data-page="inspection"] .status-row { min-height: 43px; gap: 18px; margin: 0; padding: 8px 5px; }
body[data-page="inspection"] .status-button {
  padding: 1px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  color: #f1f1f1;
  background: transparent;
  font-size: 16px;
}
body[data-page="inspection"] .status-button::before { content: ""; width: 18px; height: 18px; border: 2px solid #bdbdbd; background: transparent; }
body[data-page="inspection"] .status-button.active::before { border-color: #79c6c6; background: #138f93; box-shadow: inset 0 0 0 3px #2f2f2f; }
body[data-page="inspection"] .status-button.active { color: #fff; background: transparent; }
body[data-page="inspection"] input:not([type="checkbox"]):not([type="file"]),
body[data-page="inspection"] select {
  min-height: 34px;
  padding: 5px;
  border: 0;
  border-bottom: 1px solid #858585;
  border-radius: 0;
  color: #f2f2f2;
  background: transparent;
  box-shadow: none;
}
body[data-page="inspection"] textarea {
  min-height: 72px;
  padding: 5px;
  border: 1px solid #b9b9b9;
  border-radius: 0;
  color: #111;
  background: #fff;
  box-shadow: none;
}
body[data-page="inspection"] .comments-actions { grid-template-columns: 1fr 1fr; gap: 3px; }
body[data-page="inspection"] .comments-actions .button {
  min-height: 43px;
  border-radius: 0;
  color: #fff;
  background: #5d5d5d;
  text-transform: uppercase;
  font-size: 12px;
}
body[data-page="inspection"] .comments-actions label { color: #bbb; font-size: 11px; }
body[data-page="inspection"] .upload-drop { min-height: 76px; border-radius: 0; background: #383838; }
body[data-page="inspection"] .photo-workspace-card { margin-bottom: 70px; }
body[data-page="inspection"] .item-tabs {
  position: fixed;
  z-index: 8;
  top: auto;
  right: 0;
  bottom: 0;
  left: 32.8%;
  gap: 0;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border-top: 1px solid #494949;
  background: #2f2f2f;
}
body[data-page="inspection"] .item-tab {
  min-height: 43px;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  color: #f0f0f0;
  background: transparent;
  font-size: 16px;
  font-weight: 400;
}
body[data-page="inspection"] .item-tab.active { color: #142526; background: #74c7c9; }
body[data-page="inspection"] .item-tab.complete:not(.active) { color: #a4dfc1; }
body[data-page="inspection"] .completion-banner { display: none; }

.legacy-detail-groups { width: 100%; }
.legacy-detail-groups details { border-bottom: 1px solid #4a4a4a; }
.legacy-detail-groups summary {
  height: 44px;
  padding: 10px 8px;
  color: #d9d9d9;
  list-style: none;
  cursor: pointer;
  font-size: 17px;
}
.legacy-detail-groups summary::-webkit-details-marker { display: none; }
.legacy-detail-groups details[open] > summary { color: #162526; background: #76c7c9; }
.legacy-detail-panel { padding: 12px 8px 20px; }
.legacy-detail-navigation { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #494949; background: #303030; }
.legacy-detail-navigation button { min-height: 48px; border: 0; color: #eee; background: transparent; text-transform: uppercase; cursor: pointer; }
.legacy-detail-navigation button:hover { color: #132526; background: #76c7c9; }
.client-summary-card p { min-height: 28px; color: #ddd; line-height: 1.55; }
.legacy-round-add { width: 42px; height: 42px; border: 2px solid #ddd; border-radius: 50%; color: #eee; background: transparent; font-size: 25px; cursor: pointer; }
body[data-page="inspection"] .modal-dialog { width: min(685px, calc(100% - 24px)); border: 0; border-radius: 0; color: #f1f1f1; background: #4b4b4b; box-shadow: 0 14px 38px rgba(0,0,0,.55); }
body[data-page="inspection"] .modal-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: none; }
body[data-page="inspection"] .inspection-wizard { padding: 26px 34px 20px; }
body[data-page="inspection"] .inspection-wizard header h2 { font-size: 22px; font-weight: 500; }
body[data-page="inspection"] .inspection-wizard footer { display: flex; justify-content: flex-end; gap: 22px; }
.client-dialog-fields label { grid-template-columns: 120px minmax(0, 1fr); }
.generate-options { display: grid; padding: 8px 0 18px; }
.generate-options label { min-height: 46px; padding: 0 8px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid #5d5d5d; cursor: pointer; }
.generate-options input { width: 19px; height: 19px; accent-color: #78cbcd; }

/* Installable web app and device-local workflow */
.legacy-menu-row.pwa-install-row { min-height: 58px; height: auto; }
.legacy-sync-row { cursor: pointer; }
.legacy-sync-row.is-local-only .legacy-menu-icon { color: #e1ad35; }
.pwa-switch { position: relative; width: 46px; height: 28px; display: inline-block; }
.pwa-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pwa-switch > span {
  position: absolute;
  inset: 3px 1px;
  border: 1px solid #777;
  border-radius: 15px;
  background: #252525;
  transition: background .16s ease, border-color .16s ease;
}
.pwa-switch > span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #aaa;
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
  transition: transform .16s ease, background .16s ease;
}
.pwa-switch input:checked + span { border-color: #6fc4c6; background: #366d6f; }
.pwa-switch input:checked + span::after { transform: translateX(20px); background: #8bdddf; }
.pwa-switch input:focus-visible + span { outline: 2px solid #8bdddf; outline-offset: 2px; }
.pwa-switch input:disabled + span { opacity: .55; }
.pwa-install-icon { color: #7bcdcf; font-size: 25px; }
.offline-status-banner.is-local-only .offline-status-dot { background: #e1ad35; }

body[data-page="home"] .pwa-install-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100vh - 28px);
  overflow: auto;
}
body[data-page="home"] .pwa-install-dialog .inspection-wizard { padding: 22px 26px 18px; }
body[data-page="home"] .pwa-install-dialog .inspection-wizard > header { margin-bottom: 12px; }
body[data-page="home"] .pwa-install-dialog .inspection-wizard > footer { margin-top: 16px; }
.pwa-install-content { display: grid; gap: 15px; }
.pwa-install-lead, .pwa-install-note, .pwa-local-note { margin: 0; color: #d7d7d7; line-height: 1.48; }
.pwa-install-note { font-size: 13px; color: #b9b9b9; }
.pwa-browser-install { justify-self: start; border-radius: 2px; }
.pwa-device-guides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pwa-device-guides section, .pwa-offline-card, .pwa-local-note {
  padding: 14px 16px;
  border: 1px solid #666;
  background: #373737;
}
.pwa-device-guides ol { margin: 10px 0 0; padding-left: 22px; color: #e7e7e7; line-height: 1.48; }
.pwa-device-guides li + li { margin-top: 5px; }
.pwa-device-label { display: block; color: #86d4d6; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pwa-offline-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pwa-offline-heading strong { display: block; margin-top: 5px; color: #f1f1f1; font-size: 15px; }
.pwa-offline-stats { margin: 14px 0 9px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; }
.pwa-offline-stats div { min-width: 0; padding-top: 8px; border-top: 1px solid #595959; }
.pwa-offline-stats dt { color: #aaa; font-size: 11px; text-transform: uppercase; }
.pwa-offline-stats dd { margin: 4px 0 0; overflow-wrap: anywhere; color: #eee; font-size: 13px; }
.pwa-offline-card > p { margin: 8px 0 0; color: #bbb; font-size: 12px; }
.pwa-local-note { border-left: 3px solid #c68d00; font-size: 13px; }

.legacy-report-state { display: grid; justify-items: end; gap: 3px; }
.legacy-report-state em { color: #e1ad35; font-size: 10px; font-style: normal; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.legacy-report-row.is-local-report { box-shadow: inset 3px 0 0 #c68d00; }
.generate-options .include-remarks { margin-top: 10px; border-bottom: 0; color: #bfe9ea; }
#services-dialog .checkbox-option { min-height: 52px; grid-template-columns: minmax(0, 1fr) auto 26px; }
#services-dialog .checkbox-option input { order: 3; width: 20px; height: 20px; }
.photo-card-actions { flex-wrap: wrap; }
.annotated-image { overflow: hidden; }
.annotated-image img, .annotated-image svg { transition: transform .18s ease; transform-origin: center; }
.legacy-generated-document .agreement-signatures { margin-top: 70px; display: grid; gap: 38px; }
.legacy-generated-document .report-note { margin-top: 28px; padding: 14px; border-left: 4px solid #45c6c8; background: #eef7f7; }

html[data-theme="light"] body[data-page="home"],
html[data-theme="light"] body[data-page="admin"],
html[data-theme="light"] body[data-page="inspection"],
html[data-theme="light"] body[data-page="reports"],
html[data-theme="light"] body[data-page="settings"],
html[data-theme="light"] body[data-page="login"] {
  --bg: #f8f8f8;
  --surface: #fff;
  --surface-2: #f3f3f3;
  --surface-3: #dedede;
  --line: #d3d3d3;
  --line-soft: #e4e4e4;
  --text: #171717;
  --muted: #666;
  background: #fafafa;
}
html[data-theme="light"] body[data-page="home"] .legacy-home-page,
html[data-theme="light"] body[data-page="home"] .legacy-home-shell { background: #fafafa; }
html[data-theme="light"] body[data-page="home"] .legacy-menu-row { color: #333; border-color: #ddd; }
html[data-theme="light"] body[data-page="home"] .legacy-menu-row:hover,
html[data-theme="light"] body[data-page="home"] .legacy-menu-row:focus-visible { color: #111; background: #eee; }
html[data-theme="light"] body[data-page="home"] .legacy-menu-icon { color: #333; }
html[data-theme="light"] body[data-page="home"] .legacy-version { color: #555; }
html[data-theme="light"] body[data-page="home"] .modal-dialog { color: #222; background: #fff; }
html[data-theme="light"] body[data-page="home"] .legacy-dialog-fields label { color: #555; }
html[data-theme="light"] body[data-page="home"] .legacy-dialog-fields input,
html[data-theme="light"] body[data-page="home"] .legacy-dialog-fields select { color: #222; border-color: #999; }
html[data-theme="light"] body[data-page="home"] .legacy-property-fields legend { color: #222; }
html[data-theme="light"] .pwa-switch > span { border-color: #aaa; background: #ddd; }
html[data-theme="light"] .pwa-switch > span::after { background: #777; }
html[data-theme="light"] .pwa-switch input:checked + span { border-color: #278f92; background: #71c7c9; }
html[data-theme="light"] .pwa-switch input:checked + span::after { background: #173f40; }
html[data-theme="light"] body[data-page="home"] .pwa-install-lead,
html[data-theme="light"] body[data-page="home"] .pwa-install-note,
html[data-theme="light"] body[data-page="home"] .pwa-local-note { color: #444; }
html[data-theme="light"] body[data-page="home"] .pwa-device-guides section,
html[data-theme="light"] body[data-page="home"] .pwa-offline-card,
html[data-theme="light"] body[data-page="home"] .pwa-local-note { border-color: #bbb; background: #f3f3f3; }
html[data-theme="light"] body[data-page="home"] .pwa-device-guides ol,
html[data-theme="light"] body[data-page="home"] .pwa-offline-heading strong,
html[data-theme="light"] body[data-page="home"] .pwa-offline-stats dd { color: #222; }
html[data-theme="light"] body[data-page="home"] .pwa-offline-stats div { border-color: #ccc; }
html[data-theme="light"] body[data-page="home"] .pwa-offline-stats dt,
html[data-theme="light"] body[data-page="home"] .pwa-offline-card > p { color: #666; }
html[data-theme="light"] .legacy-select { border-bottom-color: #999; }
html[data-theme="light"] .legacy-select-trigger { color: #222; }
html[data-theme="light"] .legacy-select-trigger::after { border-top-color: #666; }
html[data-theme="light"] .legacy-select-menu { background: #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, .24); }
html[data-theme="light"] .legacy-select-option { color: #222; }
html[data-theme="light"] .legacy-select-option:hover,
html[data-theme="light"] .legacy-select-option:focus-visible { background: #e7e7e7; }
html[data-theme="light"] .legacy-select-option[aria-selected="true"] { background: #ddd; }

html[data-theme="light"] body[data-page="reports"] .legacy-actionbar { color: #222; border-color: #d4d4d4; background: #f5f5f5; }
html[data-theme="light"] body[data-page="reports"] .mini-emblem { color: #d39300; border-color: #777; background: #fff; }
html[data-theme="light"] body[data-page="reports"] .legacy-reports-page { background: #fafafa; }
html[data-theme="light"] body[data-page="reports"] .legacy-report-row { border-color: #ddd; }
html[data-theme="light"] body[data-page="reports"] .legacy-report-row:hover,
html[data-theme="light"] body[data-page="reports"] .legacy-report-row:focus-within { background: #eee; }
html[data-theme="light"] body[data-page="reports"] .legacy-report-pencil { stroke: #333; }
html[data-theme="light"] body[data-page="reports"] .legacy-report-copy strong { color: #222; }
html[data-theme="light"] body[data-page="reports"] .legacy-report-copy small,
html[data-theme="light"] body[data-page="reports"] .legacy-report-state { color: #666; }
html[data-theme="light"] body[data-page="reports"] .legacy-report-more { color: #333; }
html[data-theme="light"] body[data-page="reports"] .legacy-report-more:hover,
html[data-theme="light"] body[data-page="reports"] .legacy-report-more:focus-visible { background: #ddd; }
html[data-theme="light"] body[data-page="reports"] .legacy-report-menu { background: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .28); }
html[data-theme="light"] body[data-page="reports"] .legacy-report-menu a,
html[data-theme="light"] body[data-page="reports"] .legacy-report-menu button { color: #222; }
html[data-theme="light"] body[data-page="reports"] .legacy-report-menu a:hover,
html[data-theme="light"] body[data-page="reports"] .legacy-report-menu a:focus-visible,
html[data-theme="light"] body[data-page="reports"] .legacy-report-menu button:hover,
html[data-theme="light"] body[data-page="reports"] .legacy-report-menu button:focus-visible { background: #e7e7e7; }

html[data-theme="light"] body[data-page="settings"] .legacy-actionbar { color: #222; border-color: #d4d4d4; background: #f5f5f5; }
html[data-theme="light"] .legacy-actionbar .legacy-actionbar-tools { color: #222; }
html[data-theme="light"] body[data-page="settings"] .legacy-current-user { color: #666; }
html[data-theme="light"] body[data-page="settings"] .mini-emblem { color: #d39300; border-color: #777; background: #fff; }
html[data-theme="light"] body[data-page="settings"] .legacy-settings-page,
html[data-theme="light"] body[data-page="settings"] .legacy-settings-detail { background: #fafafa; }
html[data-theme="light"] body[data-page="settings"] .legacy-settings-nav { border-color: #d8d8d8; background: #fafafa; }
html[data-theme="light"] body[data-page="settings"] .legacy-settings-nav button { color: #333; border-color: #ddd; }
html[data-theme="light"] body[data-page="settings"] .legacy-settings-nav button:hover,
html[data-theme="light"] body[data-page="settings"] .legacy-settings-nav button:focus-visible { color: #111; background: #eee; }
html[data-theme="light"] body[data-page="settings"] .legacy-settings-nav button.active { color: #102224; background: #75c7c9; }
html[data-theme="light"] body[data-page="settings"] .legacy-settings-panel h1,
html[data-theme="light"] body[data-page="settings"] .legacy-preference-row { color: #222; border-color: #ddd; }
html[data-theme="light"] body[data-page="settings"] .legacy-preference-row small { color: #666; }
html[data-theme="light"] body[data-page="settings"] .legacy-preference-row > span:last-child { color: #555; }

html[data-theme="light"] body[data-page="login"] .legacy-login-page { background: #fafafa; }
html[data-theme="light"] body[data-page="login"] .legacy-login-dialog { color: #222; background: #fff; }
html[data-theme="light"] body[data-page="login"] .legacy-login-dialog label,
html[data-theme="light"] body[data-page="login"] .legacy-login-dialog input { color: #222; }
html[data-theme="light"] body[data-page="login"] .legacy-login-dialog input { border-color: #888; }
html[data-theme="light"] body[data-page="login"] .legacy-password-toggle { color: #454545; }
html[data-theme="light"] body[data-page="login"] .legacy-password-toggle:hover { background: rgba(0,0,0,.07); }

html[data-theme="light"] body[data-page="admin"] .legacy-actionbar { color: #222; border-color: #d4d4d4; background: #f5f5f5; }
html[data-theme="light"] body[data-page="admin"] .legacy-actionbar-tools { color: #222; }
html[data-theme="light"] body[data-page="admin"] .legacy-actionbar-tools #admin-save-state { color: #666; }
html[data-theme="light"] body[data-page="admin"] .mini-emblem { color: #d39300; border-color: #777; background: #fff; }
html[data-theme="light"] body[data-page="admin"] .admin-page,
html[data-theme="light"] body[data-page="admin"] .legacy-admin-detail { background: #fafafa; }
html[data-theme="light"] body[data-page="admin"] .legacy-admin-menu button { color: #444; border-color: #ddd; }
html[data-theme="light"] body[data-page="admin"] .legacy-admin-menu button:hover,
html[data-theme="light"] body[data-page="admin"] .legacy-admin-menu button:focus-visible { color: #111; background: #eee; }
html[data-theme="light"] body[data-page="admin"] .legacy-template-row { color: #333; }
html[data-theme="light"] body[data-page="admin"] .legacy-template-row:hover,
html[data-theme="light"] body[data-page="admin"] .legacy-template-row:focus-visible { color: #111; background: #eee; }
html[data-theme="light"] body[data-page="admin"] .legacy-template-lock.locked::before,
html[data-theme="light"] body[data-page="admin"] .legacy-template-lock.locked::after,
html[data-theme="light"] body[data-page="admin"] .legacy-template-row-action.copy::before,
html[data-theme="light"] body[data-page="admin"] .legacy-template-row-action.copy::after { border-color: #333; }
html[data-theme="light"] body[data-page="admin"] .legacy-template-row-action.copy::after { background: #fafafa; }
html[data-theme="light"] body[data-page="admin"] .legacy-template-row-action.delete::before,
html[data-theme="light"] body[data-page="admin"] .legacy-template-row-action.delete::after { background: #333; }
html[data-theme="light"] body[data-page="admin"] .admin-mobile-navigation { color: #222; border-color: #d4d4d4; background: #fafafa; }
html[data-theme="light"] body[data-page="admin"] .admin-mobile-navigation button { color: #333; border-color: #ddd; }
html[data-theme="light"] body[data-page="admin"] .admin-mobile-navigation button:hover,
html[data-theme="light"] body[data-page="admin"] .admin-mobile-navigation button:focus-visible { color: #111; background: #eee; }
html[data-theme="light"] body[data-page="admin"] .admin-mobile-navigation button[aria-current="page"] { color: #102224; background: #75c7c9; }

html[data-theme="light"] body[data-page="inspection"] .inspection-toolbar { border-color: #d4d4d4; background: #f5f5f5; }
html[data-theme="light"] body[data-page="inspection"] .inspection-toolbar-brand h1,
html[data-theme="light"] body[data-page="inspection"] .legacy-tool-button { color: #222; }
html[data-theme="light"] body[data-page="inspection"] .theme-switch-control:hover { border-color: #bbb; color: #087f83; background: #e5e5e5; }
html[data-theme="light"] body[data-page="inspection"] .inspection-toolbar-brand p,
html[data-theme="light"] body[data-page="inspection"] .save-indicator { color: #666; }
html[data-theme="light"] body[data-page="inspection"] .inspection-sidebar,
html[data-theme="light"] body[data-page="inspection"] .item-tabs { background: #fafafa; }
html[data-theme="light"] body[data-page="inspection"] .inspection-nav-item,
html[data-theme="light"] body[data-page="inspection"] .checkbox-option,
html[data-theme="light"] body[data-page="inspection"] .status-button,
html[data-theme="light"] body[data-page="inspection"] input:not([type="checkbox"]):not([type="file"]),
html[data-theme="light"] body[data-page="inspection"] select,
html[data-theme="light"] body[data-page="inspection"] .item-tab { color: #222; }
html[data-theme="light"] body[data-page="inspection"] .workspace-card h3,
html[data-theme="light"] body[data-page="inspection"] .field-section > label { color: #666; background: #eee; }
html[data-theme="light"] body[data-page="inspection"] .status-button.active::before { box-shadow: inset 0 0 0 3px #fafafa; }
html[data-theme="light"] body[data-page="inspection"] .legacy-detail-groups summary { color: #333; }

@media (max-width: 680px) {
  body.mobile-drawer-open { overflow: hidden; }
  .product-wordmark { width: 100%; height: 78px; padding: 8px 12px; gap: 8px; }
  .inspector-station-logo { width: 56px; height: 56px; }
  .inspector-station-name { min-width: 0; flex-direction: row; align-items: baseline; gap: .2em; white-space: nowrap; letter-spacing: -.04em; font-size: clamp(22px, 6.5vw, 28px); line-height: 1; }
  .legacy-menu-row { height: 48px; font-size: 16px; }
  .legacy-menu-row.android-download-row,
  .legacy-menu-row.legacy-sync-row,
  .legacy-menu-row.pwa-install-row { min-height: 56px; height: auto; }
  body[data-page="home"] .pwa-install-dialog { width: calc(100% - 12px); max-height: calc(100vh - 12px); }
  body[data-page="home"] .pwa-install-dialog .inspection-wizard { padding: 18px 15px 14px; }
  .pwa-device-guides { grid-template-columns: 1fr; }
  .pwa-offline-heading { align-items: flex-start; flex-direction: column; }
  .pwa-offline-heading .button { width: 100%; }
  .pwa-offline-stats { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .offline-status-banner { right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); max-width: calc(100vw - 16px); }
  body[data-page="inspection"] .offline-status-banner { top: 64px; bottom: auto; }
  .legacy-actionbar { height: 56px; padding: 0 8px; }
  .legacy-settings-actionbar,
  .legacy-admin-actionbar,
  .legacy-reports-actionbar { position: sticky; z-index: 70; top: 0; }
  .mobile-drawer-toggle:not([hidden]) { display: inline-grid; }
  .legacy-settings-actionbar .mini-emblem,
  .legacy-admin-actionbar .mini-emblem { display: none; }
  .legacy-settings-actionbar .legacy-actionbar-brand,
  .legacy-admin-actionbar .legacy-actionbar-brand { gap: 0; }
  .legacy-settings-actionbar .legacy-actionbar-brand strong,
  .legacy-admin-actionbar .legacy-actionbar-brand strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .legacy-settings-actionbar .legacy-actionbar-tools,
  .legacy-admin-actionbar .legacy-actionbar-tools { gap: 6px; }
  body[data-page="admin"] #admin-save-state { display: none; }
  .mobile-drawer-scrim {
    position: fixed;
    z-index: 50;
    inset: 56px 0 0 min(86vw, 320px);
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    opacity: 0;
    display: block;
    pointer-events: none;
    background: rgba(0, 0, 0, .58);
    transition: opacity .2s ease;
  }
  .legacy-reports-page { min-height: calc(100vh - 56px); padding: 4px 6px 28px; }
  .legacy-reports-actionbar .legacy-actionbar-tools { gap: 4px; }
  .legacy-report-row { min-height: 66px; }
  .legacy-report-open { grid-template-columns: 27px minmax(0, 1fr); gap: 7px; }
  .legacy-report-state { display: none; }
  .legacy-report-copy strong { font-size: 16px; }
  .legacy-report-copy small { font-size: 11px; }
  .legacy-current-user { display: none; }
  .legacy-settings-page, .legacy-settings-shell { min-height: calc(100vh - 56px); }
  .legacy-settings-shell { display: block; position: relative; }
  .legacy-settings-nav {
    position: fixed;
    z-index: 60;
    inset: 56px auto 0 0;
    width: min(86vw, 320px);
    overflow-y: auto;
    border-right: 1px solid #414141;
    background: #2f2f2f;
    box-shadow: 8px 0 22px rgba(0,0,0,.35);
    transform: translateX(-105%);
    transition: transform .2s ease;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .legacy-settings-shell.sidebar-open .legacy-settings-nav { transform: none; }
  .legacy-settings-shell.sidebar-open .settings-drawer-scrim { opacity: 1; pointer-events: auto; }
  .legacy-settings-nav button { min-height: 50px; height: auto; padding: 8px 14px; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; font-size: 14px; }
  .legacy-settings-nav svg { width: 18px; height: 18px; }
  .legacy-settings-detail { min-height: calc(100vh - 56px); padding: 10px 12px 28px; }
  .legacy-settings-panel h1 { font-size: 17px; }
  .legacy-preference-row { min-height: 68px; padding: 10px 7px; align-items: flex-start; flex-direction: column; gap: 9px; }
  .legacy-preference-select .legacy-select, .legacy-preference-select > select { width: 100%; }
  .legacy-login-page { padding: 18px 8px; }
  .legacy-login-wordmark { width: calc(100% - 12px); margin: 0 auto 12px; }
  .legacy-login-dialog { width: calc(100% - 12px); padding: 18px 19px 13px; }
  .legacy-login-dialog label { grid-template-columns: 86px minmax(0, 1fr); }
  .legacy-login-error { margin-left: 94px; }
  body[data-page="admin"] .admin-page { min-height: calc(100vh - 56px); }
  .admin-mobile-drawer-shell { min-height: calc(100vh - 56px); display: block; }
  .admin-mobile-navigation {
    position: fixed;
    z-index: 60;
    inset: 56px auto 0 0;
    width: min(86vw, 320px);
    display: block;
    overflow-y: auto;
    border-right: 1px solid #414141;
    color: #eee;
    background: #2f2f2f;
    box-shadow: 8px 0 22px rgba(0,0,0,.35);
    transform: translateX(-105%);
    transition: transform .2s ease;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .admin-mobile-navigation nav { display: grid; }
  .admin-mobile-navigation button {
    width: 100%;
    min-height: 50px;
    padding: 8px 14px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 0;
    border-bottom: 1px solid #414141;
    border-radius: 0;
    color: #eee;
    background: transparent;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
  }
  .admin-mobile-navigation button:hover,
  .admin-mobile-navigation button:focus-visible { color: #fff; background: #383838; outline: none; }
  .admin-mobile-navigation button[aria-current="page"] { color: #102224; background: #75c7c9; }
  .admin-mobile-drawer-shell.sidebar-open .admin-mobile-navigation { transform: none; }
  .admin-mobile-drawer-shell.sidebar-open .admin-drawer-scrim { opacity: 1; pointer-events: auto; }
  body[data-page="admin"] .admin-content { min-height: calc(100vh - 56px); padding: 14px 12px 30px; }
  body[data-page="admin"] .legacy-template-add { z-index: 75; top: 11px; right: 74px; }
  .legacy-admin-tabs { overflow-x: auto; }
  .legacy-admin-tabs button { min-width: 145px; flex: 0 0 auto; }
  .legacy-comment-tools, .lookup-row { grid-template-columns: 1fr; gap: 8px; }
  .legacy-template-toolbar select { min-width: 0; flex: 1 1 180px; }
  .legacy-template-toolbar button { flex: 1 1 135px; }
  .inspection-workbench { grid-template-rows: 56px minmax(0, 1fr); }
  body[data-page="inspection"] .inspection-toolbar { position: relative; z-index: 70; min-height: 56px; padding: 0 9px; }
  body[data-page="inspection"] .inspection-shell { display: block; position: relative; }
  body[data-page="inspection"] .inspection-sidebar { position: fixed; z-index: 60; inset: 56px auto 0 0; width: min(86vw, 320px); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 8px 0 22px rgba(0,0,0,.35); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  body[data-page="inspection"] .inspection-shell.sidebar-open .inspection-sidebar { transform: none; }
  body[data-page="inspection"] .inspection-shell.sidebar-open .inspection-drawer-scrim { opacity: 1; pointer-events: auto; }
  body[data-page="inspection"] .inspection-main { height: 100%; }
  body[data-page="inspection"] .mobile-menu-button { display: inline-grid; place-items: center; }
  body[data-page="inspection"] .inspection-nav-item { min-height: 48px; }
  body[data-page="inspection"] .inspection-toolbar-brand { gap: 8px; }
  body[data-page="inspection"] .inspection-toolbar-brand .mini-emblem { display: none; }
  body[data-page="inspection"] .inspection-toolbar-brand p { max-width: 160px; }
  body[data-page="inspection"] .save-indicator { display: none; }
  body[data-page="inspection"] .legacy-tool-button { width: 26px; font-size: 18px; }
  body[data-page="inspection"] .theme-switch-control { width: 32px; }
  body[data-page="inspection"] .modal-dialog { width: calc(100% - 16px); max-height: calc(100vh - 16px); }
  body[data-page="inspection"] .inspection-wizard { gap: 14px; padding: 18px 15px 14px; }
  body[data-page="inspection"] .client-dialog-fields label { grid-template-columns: 1fr; gap: 4px; }
  body[data-page="inspection"] .camera-dialog { width: 100% !important; max-height: 100vh; }
  body[data-page="inspection"] .camera-shell { min-height: 100vh; }
  body[data-page="inspection"] .camera-shell > footer { grid-template-columns: auto 1fr auto auto; padding: 8px 10px; }
  body[data-page="inspection"] .camera-shell > footer .button { padding-inline: 9px; font-size: 11px; }
  body[data-page="inspection"] .camera-shutter { width: 52px; height: 52px; }
  body[data-page="inspection"] .camera-shutter span { width: 36px; height: 36px; }
  body[data-page="inspection"] .markup-shell header { align-items: flex-start; }
  body[data-page="inspection"] .markup-shell .tool-group .button { padding: 7px 8px; font-size: 11px; }
  body[data-page="inspection"] .photo-card-actions .mini-button { flex: 1 1 132px; }
  body[data-page="inspection"] .comments-actions { grid-template-columns: 1fr; }
  body[data-page="inspection"] .item-tabs { left: 0; }
}

@media (max-width: 360px) {
  .legacy-settings-actionbar .legacy-actionbar-brand strong { max-width: 125px; }
  .legacy-admin-actionbar .legacy-actionbar-brand strong { max-width: 140px; font-size: 16px; }
  body[data-page="inspection"] .inspection-toolbar-brand p { max-width: 122px; }
  body[data-page="inspection"] .legacy-tool-button { width: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-icon-sun, .theme-icon-moon { transition: none; }
  .legacy-settings-nav, .admin-mobile-navigation,
  body[data-page="inspection"] .inspection-sidebar,
  .mobile-drawer-scrim { transition: none; }
}
