/* Shared production theme. The approved comparison's navigation experiments
   are intentionally excluded: the standard navigation remains authoritative. */
@font-face {
  font-family: 'Public Sans'; font-style: normal; font-weight: 100 900;
  font-display: swap; src: url('./fonts/PublicSans-variable.ttf') format('truetype');
}
:root {
  --ink: #202735; --muted: #5d6779; --paper: #eef2f7; --card: #fff;
  --deep: #202735; --teal: #4d6c8c; --teal-soft: #edf2f7;
  --line: #d8dee9; --surface: #fff; --surface-soft: #f2f5fa; --border: #d8dee9;
  --control-border: #a9b4c6; --control-radius: 5px; --control-padding-x: 10px;
  --radius-sm: 5px; --radius-md: 12px; --radius-lg: 12px;
  --shadow-sm: none; --shadow: 0 8px 24px rgb(32 39 53 / 12%);
  --focus-ring: 0 0 0 3px #4d6c8c26; --field-gap: 4px; --section-gap: 24px;
  --accent: #4d6c8c;
  font-family: 'Public Sans', 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}
:root body { background: var(--paper); line-height: 1.45; }
:root ::selection { color: var(--deep); background: #dce5ee; }
:root :is(input, textarea) { caret-color: var(--teal); }
:root :is(input, textarea)::placeholder { color: #5d6779; opacity: 1; }
:root :is(h1, h2, h3, h4) { color: var(--ink); font-weight: 650; letter-spacing: -.02em; }
:root :is(button, input, select, textarea) { font-family: inherit; }
:root :is(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--teal); outline-offset: 3px; box-shadow: none;
}
:root :is(button, input, select, textarea):disabled { opacity: .6; cursor: not-allowed; }
:root :is(input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']), select, textarea) { border-radius: var(--control-radius); }
:root :is(input[type='number'], output, td, .tablet-work-row) { font-variant-numeric: tabular-nums; }
:root :is(input, select, textarea)[aria-invalid='true'] { border-color: var(--danger); }
:root :is(.primary, .primary-action, .secondary, .quiet, .back-link, .text-button) { font-weight: 600; }
:root :is(.primary, .primary-action, .secondary, .quiet) { border-radius: 5px; }
:root :is(.primary, .primary-action):hover:not(:disabled) { color: #fff; background: #3f5a76; }
:root .primary-action.secondary:hover:not(:disabled) { color: var(--teal); background: var(--teal-soft); }
:root .error:empty { min-height: 0; margin: 0; }
:root .shell { padding-bottom: 80px; }
:root .app-header {
  height: 64px; gap: 12px; padding: 10px 24px; background: var(--deep);
  backdrop-filter: none; border-color: var(--line); box-shadow: none;
}
:root .app-header .overline { display: none; }
:root .app-header h1 { margin: 0; color: #fff; font-size: 18px; line-height: 1.25; }
:root :is(.icon-button, .avatar-button) { border-radius: 5px; box-shadow: none; }
:root .avatar-button { color: #fff; background: var(--teal); }
:root .main { max-width: 1280px; padding: 20px 24px 80px; }
:root .scope-compact-header {
  flex: 1; min-width: 0; margin: 0 0 20px; padding: 0; border: 0; border-radius: 0; background: transparent;
}
:root .scope-compact-header .overline { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
:root .scope-compact-header h2 { margin: 4px 0; font-size: 28px; line-height: 1.25; }
:root .scope-compact-header p:not(.overline) { max-width: 65ch; font-size: 12px; }
:root .scope-compact-header > span { padding: 4px 0; color: var(--muted); background: transparent; font-size: 12px; font-weight: 500; }
:root .scope-quick-actions { flex: 0 0 auto; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
:root .scope-quick-actions .primary-action { min-height: 40px; padding: 8px 12px; font-size: 12px; }
:root .scope-quick-actions .secondary { border-color: var(--control-border); color: var(--ink); background: #fff; }
:root .drawer { box-shadow: 8px 0 36px rgb(16 42 44 / 16%); }
:root .drawer .overline { display: none; }
:root .profile-popover { border: 0; border-radius: 12px; box-shadow: 0 8px 36px rgb(16 42 44 / 18%); }
:root :is(.tablet-work-panel, .tablet-room-panel, .compact-room-group, .phone-work-overview) {
  border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: none;
}
:root :is(.tablet-work-panel, .tablet-room-panel) { overflow: hidden; }
:root :is(.tablet-work-panel > header, .tablet-room-panel > header, .phone-work-overview > header) { padding: 12px 16px; background: #fff; }
:root :is(.tablet-work-panel h3, .tablet-room-panel h3) { font-size: 15px; }
:root :is(.tablet-work-panel p, .tablet-room-panel > header > span) { font-size: 11px; }
:root :is(.tablet-work-head, .tablet-room-head) {
  min-height: 32px; color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 600; text-transform: none;
}
:root :is(.tablet-work-row, .tablet-room-row) { min-height: 56px; }
:root .tablet-work-row > :is(output, strong), :root .tablet-room-row > :is(span, strong) { font-size: 12px; }
:root .tablet-work-row > output { margin: 0; padding: 8px 4px; background: transparent; border-radius: 0; }
:root .tablet-work-title { margin: 0; padding: 8px; border: 0; border-radius: 0; background: transparent; font-size: 12px; line-height: 1.4; }
:root .tablet-work-title:hover { color: var(--teal); background: var(--surface-soft); }
:root .tablet-work-room { padding-left: 12px; }
:root .tablet-work-row input:not([type='checkbox']) { height: 36px !important; min-height: 36px !important; max-height: 36px; padding: 6px !important; font-size: 12px; border-radius: 5px !important; }
:root .tablet-work-row > label { height: 36px !important; min-height: 36px !important; max-height: 36px !important; }
:root .tablet-work-row > :is(output, .tablet-work-title) { height: 36px !important; min-height: 36px !important; max-height: 36px !important; }
:root .tablet-work-row .tablet-work-quantity input:not([type='checkbox']) { border-radius: 5px 0 0 5px !important; }
:root .tablet-work-row .tablet-work-quantity b { height: 36px; border-radius: 0 5px 5px 0 !important; font-size: 10px; }
:root .tablet-work-toolbar > button { min-height: 36px; border-color: var(--line); background: #fff; color: var(--ink); border-radius: 5px; font-size: 11px; font-weight: 500; }
:root .tablet-completed-toggle { font-size: 11px; font-weight: 500; }
:root .tablet-room-measure b { font-size: 12px; color: var(--teal); }
:root .compact-room-group > summary { padding: 12px; background: var(--surface-soft); }
:root .compact-room-group > summary strong { font-size: 14px; font-weight: 650; }
:root .compact-room-actions { padding: 4px 12px; background: #fff; }
:root .compact-room-actions .back-link { min-height: 36px; font-size: 11px; font-weight: 600; }
:root .phone-work-card { gap: 8px; padding: 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; box-shadow: none; }
:root .phone-work-title { font-size: 13px; font-weight: 600; }
:root .phone-work-title > span { border-radius: 4px; background: var(--teal-soft); color: var(--teal); font-weight: 600; }
:root .phone-work-facts > span { padding: 0; border-radius: 0; background: transparent; font-size: 12px; }
:root .phone-work-facts small { font-size: 10px; font-weight: 500; }
:root .phone-work-inputs label > span:first-child { font-size: 10px; font-weight: 500; text-transform: none; }
:root .phone-work-card .phone-work-inputs input:not([type='checkbox']) { min-height: 40px; height: 40px; font-size: 14px; border-radius: 5px; }
:root .phone-work-quantity { height: 40px; border-radius: 5px; }
:root .phone-work-card .phone-work-quantity input:not([type='checkbox']) { min-height: 38px; height: 38px; border-radius: 0; }
:root .phone-work-save { min-height: 36px; border-radius: 5px; font-size: 12px; font-weight: 600; }
:root .app-record-section { padding: 16px; border-radius: 12px; box-shadow: none; }
:root .app-record-section > :is(h2, h3):first-child { padding: 0; margin: 0 0 12px; border: 0; font-size: 16px; }
:root .mobile-today-work { margin-top: 24px; padding: 0; border: 0; background: transparent; }
:root .mobile-today-work > :is(h2, h3):first-child { font-size: 14px; }
:root .mobile-today-work > p { margin: 0; font-size: 12px; color: var(--muted); }
:root .welcome.compact-welcome {
  min-height: 0; margin: 0 0 20px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--ink);
}
:root .welcome.compact-welcome h2 { margin: 4px 0; color: var(--ink); font-size: 26px; }
:root .welcome.compact-welcome p { max-width: 70ch; color: var(--muted); font-size: 13px; }
:root .welcome .overline { display: none; }
:root .welcome.compact-welcome .overline { display: none; }
:root .asset-file-row.document-file-row { gap: 12px; padding: 14px 0; }
:root .document-file-info > strong { font-size: 14px; font-weight: 650; }
:root .document-file-meta { gap: 4px 12px; }
:root .document-file-meta > small { font-size: 10px; }
:root .document-row-actions > button { min-height: 36px; border-color: var(--line); border-radius: 5px; font-size: 11px; font-weight: 500; }
:root .document-row-actions > button:not(.primary-action) { background: #fff; color: var(--ink); }
:root .generated-order-documents { padding: 0; border: 0; background: transparent; }
:root .generated-order-documents .overline { display: none; }
:root .generated-document-actions { gap: 8px; }
:root .app-detail-grid { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 12px 0 24px; }
:root .app-detail-grid > article { display: flex; align-items: baseline; gap: 8px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
:root .app-detail-grid > article > span { margin: 0; font-size: 12px; }
:root .app-detail-grid > article > strong { font-size: 14px; }
:root .form-template-launcher { gap: 16px; }
:root .form-template-launcher .section-heading .overline { display: none; }
:root .form-template-launcher h3 { margin: 0; font-size: 16px; }
:root .form-template-group > header h4 { font-size: 12px; color: var(--muted); font-weight: 600; }
:root .form-template-group > header span { display: none; }
:root .form-template-grid { grid-template-columns: 1fr; gap: 0; }
:root .form-template-card {
  grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  min-height: 64px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff;
}
:root .form-template-group.required .form-template-card { border-left: 0; background: #fff; }
:root .form-template-card > span { display: none; }
:root .form-template-card > strong { grid-column: 1; font-size: 14px; font-weight: 600; }
:root .form-template-card > small { grid-column: 1; font-size: 11px; color: var(--muted); }
:root .form-template-card > b { grid-column: 2; grid-row: 1 / 3; padding: 8px 12px; border-radius: 5px; color: var(--teal); background: var(--teal-soft); font-size: 11px; font-weight: 600; }
:root .dynamic-order-form [data-form-field][data-required-state] { border-width: 1px; box-shadow: none; border-radius: 5px; }
:root .measurement-point-list { gap: 20px; }
:root .measurement-point-card { padding: 16px; border-radius: 12px; box-shadow: none; }
:root .measurement-point-card > header { padding-bottom: 12px; }
:root .measurement-point-card h3 { font-size: 18px; }
:root .measurement-point-card header em { padding: 4px 8px; border-radius: 4px; color: var(--teal); background: var(--teal-soft); font-size: 11px; }
:root .tablet-measurement-entry { padding: 0; border: 0; border-radius: 0; background: transparent; }
:root .tablet-measurement-entry > h4 { margin: 4px 0; color: var(--ink); font-size: 14px; }
:root .tablet-measurement-form { padding: 12px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
:root .tablet-measurement-form > strong { color: var(--ink); font-size: 12px; font-weight: 600; }
:root .tablet-measurement-values label { grid-template-rows: 20px 36px; border: 0; border-radius: 0; overflow: visible; background: transparent; }
:root .tablet-measurement-values label > span { padding: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 500; }
:root .tablet-measurement-values > label { grid-template-rows: 20px 36px !important; height: 56px !important; min-height: 56px !important; max-height: 56px !important; }
:root .tablet-measurement-values input { height: 36px !important; min-height: 36px !important; max-height: 36px; border: 1px solid var(--control-border); border-radius: 5px !important; font-size: 13px; }
:root .measurement-climate-preview output { grid-template-rows: 20px 36px; border: 0; border-radius: 0; background: transparent; }
:root .measurement-climate-preview output > span { padding: 0; color: var(--muted); background: transparent; font-size: 10px; font-weight: 500; }
:root .measurement-climate-preview output > b { background: var(--surface-soft); border-radius: 5px 0 0 5px; }
:root .measurement-climate-preview output > small { background: var(--surface-soft); border-radius: 0 5px 5px 0; }
:root .tablet-measurement-form > input { font-size: 12px; height: 36px; border-radius: 5px; }
:root .tablet-measurement-form > .primary-action { height: 36px; min-height: 36px; border-radius: 5px; font-size: 11px; font-weight: 600; }
:root :is(.measurement-create-panel, .measurement-add-reading) { padding: 0; border-radius: 5px; box-shadow: none; }
:root :is(.measurement-create-panel, .measurement-add-reading) > summary { min-height: 44px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
:root :is(.measurement-create-panel, .measurement-add-reading) > form { margin: 0; padding: 12px; }
:root :is(.panel, .card, .detail-card, .content-card, .auth-card) { box-shadow: none; border-radius: 12px; }
:root .welcome:not(.compact-welcome) { padding: 24px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--ink); }
:root .welcome:not(.compact-welcome) h2 { color: var(--ink); font-size: 28px; }
:root .welcome:not(.compact-welcome) p { color: var(--muted); }
:root .tile-grid { gap: 10px; border: 0; }
:root .tile { display: grid; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; align-items: center; gap: 3px 10px; min-height: 84px; padding: 12px; border: 1px solid var(--control-border); border-radius: 12px; background: #fff; box-shadow: none; text-align: left; }
:root .tile-icon { grid-row: 1 / 3; width: 32px; height: 32px; border-radius: 8px; background: var(--teal-soft); color: var(--teal); }
:root .tile strong { min-width: 0; margin: 0; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
:root .tile small { min-width: 0; margin: 0; font-size: 11px; color: var(--muted); }
:root .tile:hover:not(:disabled) { border-color: var(--teal); background: #f8fafc; }
@media (min-width: 900px) {
:root .shell { padding-bottom: 0; }
:root .app-header { padding-left: 20px; }
:root .form-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
:root .tablet-measurement-form {
    grid-template-columns: 84px minmax(0, 1fr) minmax(116px, .5fr) 82px; grid-template-rows: auto 36px;
  }
:root .tablet-measurement-form > strong { grid-column: 1; grid-row: 1 / 3; }
:root .tablet-measurement-values { grid-column: 2 / 4; grid-row: 1; }
:root .tablet-measurement-form > .primary-action { grid-column: 4; grid-row: 1; }
:root .tablet-measurement-form > input[name='measuredAt'] { grid-column: 2; grid-row: 2; }
:root .tablet-measurement-form > input[name='readingNote'] { grid-column: 3 / 5; grid-row: 2; }
:root .tablet-measurement-form > .error { grid-column: 2 / 5; }
}
@media (max-width: 1100px) and (min-width: 641px) {
:root .scope-compact-header { width: 100%; }
:root .tablet-work-toolbar > button span { display: none; }
:root .tablet-work-head, :root .tablet-work-row {
    grid-template-columns: minmax(82px, .9fr) 32px minmax(132px, 2fr) 36px 40px minmax(82px, .9fr) 48px 50px 34px;
  }
:root .tablet-work-row > :is(output, strong), :root .tablet-room-row > :is(span, strong) { font-size: 11px; }
:root .tablet-work-head, :root .tablet-room-head { font-size: 9px; }
:root .tablet-work-title { font-size: 11px; }
}
@media (max-width: 640px) {
:root .app-header { height: 56px; padding: 8px 12px; }
:root .app-header h1 { font-size: 16px; }
:root .main { padding: 12px 12px 96px; }
:root .scope-compact-header { display: block; margin-bottom: 16px; }
:root .scope-compact-header h2, :root .welcome.compact-welcome h2 { font-size: 22px; }
:root .scope-compact-header > span { display: block; margin-top: 4px; font-size: 11px; }
:root .scope-quick-actions { display: flex; }
:root .scope-quick-actions .primary-action { flex: 1; min-height: 40px; padding: 8px; font-size: 12px; }
:root .phone-work-overview > header { padding: 10px 12px; }
:root .phone-work-overview .tablet-work-toolbar { gap: 8px; }
:root .phone-work-overview .tablet-work-toolbar > button { min-height: 36px; }
:root .phone-work-overview .tablet-completed-toggle { font-size: 10px; }
:root .app-detail-grid { gap: 8px 16px; margin-bottom: 16px; }
:root .app-detail-grid > article { gap: 4px; }
:root .app-record-section { padding: 12px; }
:root .document-file-row .document-row-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:root .document-file-row .document-row-actions > button { min-height: 40px; font-size: 11px; }
:root .measurement-point-card { padding: 12px; }
}

:root body { font-weight: 400; }
:root :is(input, select, textarea):focus { border-color: var(--teal); box-shadow: none; }
:root .app-header { border-bottom-color: #202735; }
:root .app-header .icon-button { color: #fff; background: transparent; }
:root .app-header :is(.icon-button, .avatar-button):focus-visible { outline-color: #bacbdd; }
:root :is(.tablet-work-panel > header, .tablet-room-panel > header) { padding-block: 14px; }
:root :is(.tablet-work-panel h3, .tablet-room-panel h3) { font-size: 16px; font-weight: 650; }
:root :is(.tablet-work-head, .tablet-room-head) { color: #4d586c; background: #f4f6fa; font-size: 10px; }
:root .tablet-work-title { color: var(--ink); font-weight: 500; }
:root .tablet-work-row > output { color: var(--ink); }
:root :is(.tablet-work-row, .phone-work-card) { transition: none; }
:root .tablet-work-row:focus-within .tablet-work-title { background: transparent; }
:root :is(.tablet-work-save, .phone-work-save) { color: #fff; background: var(--teal); }
:root :is(.tablet-history-button, .tablet-room-edit, .phone-work-icon) { border-color: #ced8e3; color: var(--teal); background: #f4f7fa; }
:root :is(.tablet-room-check, .phone-room-features input, input[type='checkbox'], input[type='radio']) { accent-color: var(--teal); }
:root :is(.tablet-work-quantity b, .phone-work-quantity b) { color: #4d586c; background: #f4f6fa; }
:root .compact-room-group > summary { background: #f4f6fa; }
:root .phone-room-details { background: #fafbfc; }
:root .phone-room-features label { background: #f0f3f9; }
:root .phone-work-title > span { color: #fff; background: var(--teal); }
:root .measurement-reading { padding: 10px 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; }
:root .measurement-reading > strong { font-size: 13px; font-weight: 600; }
:root .measurement-photo-capture label { border-color: var(--line); color: var(--ink); background: #fff; border-radius: 5px; }
:root .measurement-climate-preview output > :is(b, small) { background: #f0f3f9; }
:root .form-template-card > b { color: var(--teal); background: var(--teal-soft); }
:root .form-template-card:hover { background: #f6f8fa; }
:root .document-row-actions > button.primary-action { color: #fff; border-color: var(--teal); background: var(--teal); }
:root .document-row-actions > button:hover:not(:disabled) { border-color: var(--teal); }
:root :is(.pill, .measurement-point-card header em) { color: #496581; background: #edf2f7; border-radius: 4px; }
:root .auth-screen { background: #e9eef7; }
:root .auth-card { border: 1px solid var(--line); }
:root .auth-card > .overline,
:root .login-card > .eyebrow { display: none; }
:root .auth-card h1 { font-size: 30px; letter-spacing: -.03em; }
:root .login-card { box-shadow: none; border-radius: 12px; }
:root .topbar {
  min-height: 64px; height: auto; padding-block: 12px; border-bottom: 1px solid var(--deep);
  color: #fff; background: var(--deep); backdrop-filter: none; box-shadow: none;
}
:root .topbar h1 { color: #fff; font-size: 22px; }
:root .topbar .eyebrow { display: none; }
:root[data-admin-view='overview'] #content .eyebrow { display: none; }
:root[data-admin-view='overview'] #content .hero {
  padding: 0 0 24px; border-radius: 0; border: 0; background: transparent; box-shadow: none; color: var(--ink);
}
:root[data-admin-view='overview'] #content .hero p { color: var(--muted); max-width: 65ch; }
:root[data-admin-view='overview'] #content .metric {
  border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none;
}
:root[data-admin-view='overview'] #content .metric strong { color: var(--ink); font-size: 26px; letter-spacing: -.02em; }
:root[data-admin-view='overview'] #content .metric::before { display: none; }
:root .topbar .status-dot { box-shadow: none; }
@media (max-width: 640px) {
:root .scope-compact-header > span { max-width: none; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
:root *, :root *::before, :root *::after { scroll-behavior: auto; transition-duration: 0s; }
}


:is(.tablet-work-head, .tablet-work-row, .tablet-room-head, .tablet-room-row) {
  box-sizing: border-box; padding-inline: 10px;
}
.tablet-room-row.is-saving { background: #fff; }
.tablet-room-row.is-saving .tablet-room-check:disabled,
.phone-room-features.is-saving input:disabled { opacity: 1; }
input[data-tablet-room-feature][aria-busy='true'] {
  outline: 2px solid var(--teal); outline-offset: 2px;
}
:root {
  --control-height: 32px; --control-radius: 4px; --button-height: 32px;
  --field-gap: 4px; --section-gap: 16px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
}
:root :is(.main, #content, dialog, .auth-card, .login-card) input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='hidden']),
:root :is(.main, #content, dialog, .auth-card, .login-card) select {
  box-sizing: border-box; height: var(--control-height) !important; min-height: var(--control-height) !important;
  max-height: none; padding-block: 4px !important; border-radius: 4px !important; font-size: 12px;
}
:root :is(.main, #content, dialog, .auth-card, .login-card) textarea {
  min-height: 64px !important; height: auto !important; padding: 8px 10px; border-radius: 4px !important;
}
:root :is(.main, #content, dialog, .auth-card, .login-card) button {
  min-height: var(--button-height) !important; padding-block: 5px; border-radius: 4px; font-size: 12px; line-height: 1.3;
}
:root :is(.main, #content) :is(th, td):not(.tiptap *) {
  padding: 6px 8px; line-height: 1.35;
}
:root :is(.main, #content) :is(.app-record-section, .card, .panel, .detail-card, .content-card, .measurement-point-card, .mobile-room-card) {
  padding: 12px;
}
:root :is(.main, #content) :is(.card-list, .app-record-list, .detail-grid, .work-detail-grid, .app-detail-grid) { gap: 12px; }
:root #content :is(.finance-source-transfer, .finance-setting-actions) button { height: var(--button-height) !important; min-height: var(--button-height) !important; max-height: var(--button-height) !important; }
:root :is(.tablet-work-panel > header, .tablet-room-panel > header, .phone-work-overview > header) { padding: 7px 12px; }
:root :is(.tablet-work-panel h3, .tablet-room-panel h3) { font-size: 14px; }
:root :is(.tablet-work-head, .tablet-room-head) { min-height: 24px; }
:root .tablet-work-row { min-height: 34px; }
:root .tablet-room-row { min-height: 40px; }
:root .tablet-work-title {
  padding: 4px 7px; border: 1px solid #ced8e3; border-radius: 4px;
  background: #f0f3f6; font-size: 11px; font-weight: 500;
}
:root .tablet-work-title:hover { color: var(--ink); background: #e8eef4; }
:root .tablet-work-row:focus-within .tablet-work-title { background: #f0f3f6; }
:root .tablet-work-row > output { margin-inline: 2px; padding: 4px; border-radius: 4px; background: #f0f3f6; }
:root .phone-work-title { padding: 6px; border: 1px solid #ced8e3; border-radius: 4px; background: #f0f3f6; }
:root .phone-work-card { gap: 6px; padding: 10px; }
:root .compact-room-group > summary { padding: 8px 10px; }
:root .tablet-work-room { padding-left: 3px; }
:root .tablet-measurement-form { padding-block: 8px; grid-template-rows: auto 32px; }
:root .tablet-measurement-values > label {
  grid-template-rows: 18px 32px !important; height: 50px !important; min-height: 50px !important; max-height: 50px !important;
}
:root .measurement-climate-preview output { grid-template-rows: 18px 32px; }
:root .tablet-measurement-form > .primary-action { height: 32px; }
@media (pointer: fine) {
:root #content .finance-position:not(.is-expanded) .finance-position-order { display: flex; flex-direction: row; align-items: center; gap: 3px; }
}
:root .tablet-work-row { --control-height: 28px; --button-height: 28px; }
:root :is(.main, #content) .tablet-work-row input:not([type='checkbox']) { height: 28px !important; min-height: 28px !important; max-height: 28px; padding: 3px 4px !important; }
:root :is(.main, #content) .tablet-work-row > :is(label, output, .tablet-work-title) { height: 28px !important; min-height: 28px !important; max-height: 28px !important; }
:root .tablet-work-row .tablet-work-quantity b { height: 28px; }
:root :is(.main, #content) :is(.tablet-history-button, .tablet-work-save) { --square-action-size: 28px; min-height: 28px !important; padding: 0; }
:root .phone-work-quantity { height: 32px; }
:root .phone-work-card .phone-work-quantity input { height: 32px !important; min-height: 32px !important; }
@media (min-width: 641px) {
:root :is(.tablet-work-head, .tablet-work-row) {
    grid-template-columns: minmax(70px, .8fr) 32px minmax(104px, 2fr) 32px 38px minmax(68px, .9fr) 72px 52px 32px;
  }
}



/* Standard menus: preserve their existing structure, position, labels and borders. */
:root .order-context-navigation {
  top: 64px; margin-inline: 0; border: 1px solid var(--line);
  border-radius: 12px; background: #f8fafc; box-shadow: none; backdrop-filter: none;
}
:root .order-context-heading { color: var(--teal); }
:root .order-context-navigation, :root .order-context-navigation.is-collapsed { gap: 0; padding: 8px; }
:root .order-context-heading { min-height: 36px; }
:root .order-context-heading > div > span { display: none; }
:root .order-context-collapse { display: inline-flex; }
:root .order-context-navigation .order-context-sections {
  position: absolute; inset: calc(100% + 4px) -1px auto; z-index: 1;
  max-height: calc(100dvh - 208px - env(safe-area-inset-bottom, 0px)); overflow: auto; overscroll-behavior: contain;
  padding: 8px; border: 1px solid var(--control-border); border-radius: 12px;
  background: #fff; box-shadow: 0 8px 24px rgb(32 39 53 / 14%);
}
:root .order-context-navigation.is-collapsed .order-context-sections { display: none; }
:root .order-context-heading span { color: var(--muted); }
:root .order-context-collapse { border-color: var(--control-border); border-radius: 4px; background: #fff; }
:root .order-context-sections button {
  min-height: 36px; padding: 7px 10px; border: 1px solid var(--control-border);
  border-radius: 4px; color: var(--teal); background: #fff; font-weight: 650;
}
:root .order-context-sections button.active { border-color: var(--teal); color: #fff; background: var(--teal); opacity: 1; }
:root .order-context-sections button:hover:not(.active):not(:disabled) { background: var(--teal-soft); }
:root .order-context-navigation .order-context-sections { grid-template-columns: repeat(4, minmax(0, 1fr)); }
:root .order-context-sections button > span { min-width: 0; overflow-wrap: normal; word-break: normal; hyphens: auto; }
:root :is(input, select, textarea) { font-weight: 400; }
:root .quick-nav { background: var(--deep); border-color: #59657a; box-shadow: 0 8px 24px #20273526; backdrop-filter: none; }
:root .quick-item { color: #d4dced; }
:root .quick-item.active { background: var(--teal); color: #fff; }
:root .sidebar { background: var(--deep); }
:root .sidebar :is(.nav-item, .muted) { color: #d4dced; }
:root .sidebar .nav-item.active { color: #fff; background: var(--teal); box-shadow: none; }
:root .sidebar .brand-mark { color: #fff; background: var(--teal); border-radius: 4px; }
:root .topbar :is(.status, .menu-button) { color: #e2e8f2; }
:root .global-search input { border-radius: 4px 0 0 4px; }
:root .global-search button { border-radius: 0 4px 4px 0; }
:root .main { margin-inline: auto; }
:root .backoffice-embed .order-context-navigation { top: 0; }
:root .main :is(.scope-compact-header, .app-record-section, .measurement-point-card) { min-width: 0; }
:root :is(.main, #content) :is(label, fieldset, form) { min-width: 0; }
:root :is(.main, #content, dialog) :is(input, select, textarea) { max-width: 100%; }
:root :is(.main, #content, dialog) select[multiple] { height: auto !important; min-height: 96px !important; }
:root :is(.main, #content, dialog) textarea { resize: vertical; }
:root :is(.main, #content) :is(h2, h3, h4, .card-title, .document-file-info > strong) { overflow-wrap: anywhere; }
:root .scope-compact-header .overline { display: none; }
:root :is(.app-header, .drawer, .welcome, .section-title) .overline,
:root .eyebrow { display: none; }
:root .topbar { box-shadow: none; }
:root[data-admin-view] {
  --view-accent: #4d6c8c; --view-strong: #3f5a76; --view-soft: #edf2f7; --view-line: #d8dee9;
}
:root[data-admin-view] #content button.primary { background: var(--teal); }
:root[data-admin-view] #content button.primary:hover:not(:disabled) { background: #3f5a76; }
:root #content :is(.hero, .card, .panel, .detail-card) { box-shadow: none; }
:root #content :is(.metric-grid > .metric, .personnel-time-summary > article)::before { display: none; }
:root #content .hero { color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; }
:root #content .hero p { color: var(--muted); }
:root #content .hero h2 { color: var(--ink); }
:root #content :is(.form-actions, .button-row, .toolbar) { flex-wrap: wrap; }
:root :is(input[type='checkbox'], input[type='radio']) { accent-color: var(--teal); flex-shrink: 0; }
:root :is(.main, #content, dialog) :is(input[type='checkbox']:not([role='switch']), input[type='radio']) { width: 18px !important; height: 18px !important; min-height: 18px !important; flex-basis: 18px; padding: 0; }
:root :is(input[type='checkbox'], input[type='radio']):focus:not(:focus-visible) { outline: none; box-shadow: none; }
:root :is(input[type='checkbox'], input[type='radio']):focus-visible { outline-offset: 2px; }
:root * { scrollbar-color: #a9b4c6 #eef2f7; }
:root a { text-underline-offset: .18em; }
:root :is(.main, #content) .form-template-card { min-height: 64px !important; }
:root .measurement-climate-preview output { height: calc(18px + var(--control-height)); min-height: calc(18px + var(--control-height)); max-height: none; }
:root .tablet-measurement-form > .primary-action { height: var(--control-height) !important; min-height: var(--control-height) !important; }
:root .tablet-work-row .tablet-work-quantity input:not([type='checkbox']) { border-radius: 4px 0 0 4px !important; }
:root .tablet-work-row .tablet-work-quantity b { border-radius: 0 4px 4px 0 !important; }
:root :is(.tablet-work-head, .tablet-work-row, .tablet-room-head, .tablet-room-row) { padding-inline: 10px; }
@media (max-width: 640px) {
  :root .order-context-navigation { top: 56px; }
  :root .order-context-navigation .order-context-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root .scope-compact-header h2 { font-size: 22px; }
  :root #content :is(.form-actions, .button-row) > * { max-width: 100%; }
}
@media (min-width: 641px) and (max-width: 759px) {
  :root .order-context-navigation .order-context-sections { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* Equivalent module actions share a stable grid, not a text-sized flex row. */
:root .mobile-order-summary { container: order-actions / inline-size; }
:root .mobile-order-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 6px; }
:root :is(.main, #content) .mobile-order-links .back-link {
  width: 100%; min-width: 0; min-height: 44px !important; margin: 0;
  justify-content: flex-start; gap: 8px; padding: 6px 10px;
  border: 1px solid var(--control-border); border-radius: 4px;
  background: #f8fafc; color: var(--teal); text-align: left; white-space: normal;
}
:root .mobile-order-links .back-link > span { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
:root .mobile-order-links .back-link:hover:not(:disabled) { background: var(--teal-soft); border-color: var(--teal); }
:root .mobile-order-links .order-chat-note { grid-column: 1 / -1; }
@container order-actions (min-width: 520px) {
  :root .mobile-order-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container order-actions (min-width: 880px) {
  :root .mobile-order-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

:root #content .order-content-hub {
  container: order-hub / inline-size; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: #f8fafc;
}
:root #content .order-content-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; }
:root #content .order-content-link {
  display: flex; align-items: center; gap: 10px; min-height: 52px !important; padding: 8px 10px;
  border-color: var(--control-border); border-radius: 4px; background: #fff; box-shadow: none;
}
:root #content .order-content-link > span { flex: 0 0 30px; border-radius: 6px; }
:root #content .order-content-link strong { min-width: 0; overflow: visible; overflow-wrap: anywhere; hyphens: auto; font-size: 12px; }
/* The order number already appears once in the hub header. */
:root #content .order-content-link small { display: none; }
:root #content .order-content-link:hover:not(:disabled) { border-color: var(--teal); background: var(--teal-soft); }
@container order-hub (min-width: 560px) {
  :root #content .order-content-hub-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container order-hub (min-width: 840px) {
  :root #content .order-content-hub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container order-hub (min-width: 1120px) {
  :root #content .order-content-hub-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

:root :is(.main, #content) .tile { min-height: 84px !important; border-radius: 12px; line-height: 1.3; }
/* Keep the footer's location and labels; remove excess vertical padding. */
:root .quick-nav { --quick-target-height: 40px; min-height: 48px; padding: 3px; border-radius: 12px; }
:root .quick-item { min-width: 0; min-height: var(--quick-target-height); height: var(--quick-target-height); align-content: center; gap: 2px; padding: 3px 4px; border-radius: 9px; font-size: 10px; line-height: 1.2; }
:root .quick-item b { font-size: 18px; line-height: 1; }



/* User-approved compact density applies equally to touch and mouse. */
:root .phone-work-title { min-height: 32px; }
:root .device-scan-panel { text-align: center; }
:root :is(.main, #content, dialog) .device-scan-start { display: inline-flex; grid-column: 1 / -1; width: 100%; align-items: center; justify-content: center; gap: 8px; text-align: center; }
:root .device-scan-start .scan-action-icon { flex: 0 0 18px; width: 18px; height: 18px; }
:root .device-scan-feedback { text-align: center; }
:root :is(.main, #content) .phone-work-card .phone-work-quantity input:not([type='checkbox']) { height: 30px !important; min-height: 30px !important; }
:root :is(.tablet-work-complete, .tablet-completed-toggle, .phone-work-complete) { min-height: 32px; }

/* Project parties: compact cards, role above name; stack only on phones. */
:root :is(.main, #content) .project-party-summary {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
:root :is(.main, #content) .project-party-summary > h3 { grid-column: 1 / -1; margin: 0; font-size: 14px; line-height: 18px; }
:root .project-party-summary > div {
  display: grid; grid-template-columns: minmax(0, 1fr); align-content: start;
  justify-content: stretch; gap: 2px; min-width: 0; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 8px; text-align: left;
}
:root .project-party-summary > div > span {
  grid-row: auto; text-align: left; color: var(--muted); font-size: 10px;
  font-weight: 600; line-height: 14px; overflow-wrap: anywhere;
}
:root .project-party-summary > div > strong { font-size: 13px; line-height: 16px; }
:root .project-party-summary > div > small { font-size: 11px; line-height: 15px; }
@media (max-width: 640px) {
  :root :is(.main, #content) .project-party-summary { grid-template-columns: minmax(0, 1fr); }
}

/* Semantic landmarks on long project/order files, independent of card order. */
:root #content :is(.commercial-references, .focused-order-section, .focused-order-appointments, .focused-order-finance, .customer-context-card, .project-address-book, .project-parties-card, .order-cost-panel, .office-document-card, .project-chat-context) {
  --section-accent: #526b86; --section-tint: #e9eef5; --section-line: #cbd6e3;
  padding: 12px; border-width: 1px; border-color: var(--section-line); background: #fff;
}
:root #content .focused-order-appointments { --section-accent: #34747c; --section-tint: #e2f0f1; --section-line: #bad6d9; }
:root #content :is(.focused-order-finance, .order-cost-panel) { --section-accent: #75598e; --section-tint: #eee7f6; --section-line: #d5c6e4; }
:root #content :is(.customer-context-card, .project-address-book, .project-parties-card) { --section-accent: #866433; --section-tint: #f5ecd9; --section-line: #dfcfaf; }
:root #content :is(.office-document-card, .project-chat-context) { --section-accent: #426f9c; --section-tint: #e5effa; --section-line: #bfd2e8; }
:root #content :is(.commercial-references, .focused-order-section, .focused-order-appointments, .focused-order-finance, .customer-context-card, .project-address-book, .project-parties-card, .order-cost-panel, .office-document-card, .project-chat-context) > .section-head {
  align-items: center; gap: 8px; margin: -12px -12px 10px; padding: 8px 12px;
  border: 0; border-left: 4px solid var(--section-accent); border-bottom: 1px solid var(--section-line);
  border-radius: 11px 11px 0 0; background: var(--section-tint);
}
:root #content :is(.commercial-references, .focused-order-section, .focused-order-appointments, .focused-order-finance, .customer-context-card, .project-address-book, .project-parties-card, .order-cost-panel, .office-document-card, .project-chat-context) > .section-head :is(h2, h3, h4) { color: #202735; }
:root #content .order-content-hub { border-color: #bfd2e8; background: #f7faff; }
:root #content .order-content-hub > header {
  padding: 8px 10px; border-left: 4px solid #426f9c; border-radius: 6px;
  background: #e5effa;
}
:root #content :is(.customer-context-card, .project-parties-card, .project-address-book) { row-gap: 10px; }
:root #content :is(.customer-context-card, .project-parties-card, .project-address-book) > .section-head { margin-bottom: 0; }


/* Completed values keep number and unit together within the shared matrix tracks. */
:root .tablet-work-row > .tablet-work-complete-value{white-space:nowrap;flex-wrap:nowrap;gap:4px}
:root .tablet-work-complete-value small{flex:0 0 auto;white-space:nowrap;word-break:normal;overflow-wrap:normal}
:root .tablet-work-head > span{white-space:nowrap}
