:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #18201c;
  --muted: #69716b;
  --line: #dbe2dc;
  --soft: #eef2ee;
  --accent: #126f68;
  --accent-dark: #0c514b;
  --warn: #b56418;
  --danger: #b3261e;
  --blue: #285c9f;
  --shadow: 0 16px 40px rgba(23, 33, 29, 0.08);
}

.print-preview-dialog {
  width: min(1180px, calc(100vw - 32px));
  height: min(900px, calc(100vh - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #eef1ef;
  box-shadow: 0 24px 64px rgba(10, 20, 18, 0.28);
}

.print-preview-dialog::backdrop {
  background: rgba(10, 18, 17, 0.66);
}

.print-preview-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.print-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #d6ddda);
  background: #fff;
}

.print-preview-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.print-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.print-preview-actions .primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.print-preview-actions svg {
  width: 18px;
  height: 18px;
}

.print-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 720px) {
  .print-preview-dialog {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
  }

  .print-preview-head {
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
  }

  .print-preview-actions .primary {
    font-size: 13px;
  }
}

/* Project-first technical workflow */
.technical-workflow-modes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  border-block: 1px solid var(--line);
  background: #fff;
}

.technical-workflow-modes button {
  min-width: 0;
  min-height: 74px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  gap: 3px 8px;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.technical-workflow-modes button:last-child {
  border-right: 0;
}

.technical-workflow-index {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #aebbb7;
  border-radius: 50%;
  color: #52615d;
  font-size: 11px;
  font-weight: 800;
}

.technical-workflow-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.technical-workflow-copy strong,
.technical-workflow-copy span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.technical-workflow-copy > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.technical-workflow-modes button em {
  grid-column: 2;
  color: #6a7773;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.technical-workflow-modes button.active {
  background: #e7f4f1;
  color: #075d57;
  box-shadow: inset 0 -3px 0 #16766d;
}

.technical-workflow-modes button.active .technical-workflow-index,
.technical-workflow-modes button.complete .technical-workflow-index {
  border-color: #16766d;
  background: #16766d;
  color: #fff;
}

.technical-workflow-modes button.complete:not(.active) em {
  color: #187a56;
}

.technical-workflow-hint {
  min-height: 32px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: #4f5d59;
  font-size: 12px;
}

.technical-workspace[data-workflow-mode="room"] .technical-tabs button:not([data-technical-tab="floor"]),
.technical-workspace[data-workflow-mode="placement"] .technical-tabs button:not([data-technical-tab="floor"]),
.technical-workspace[data-workflow-mode="check"] .technical-tabs button:not([data-technical-tab="floor"]):not([data-technical-tab="engineering"]),
.technical-workspace[data-workflow-mode="print"] .technical-tabs button:not([data-technical-tab="floor"]):not([data-technical-tab="showpack"]),
.technical-workspace[data-workflow-mode="engineering"] .technical-tabs button[data-technical-tab="showpack"] {
  display: none;
}

.technical-workspace[data-workflow-mode="room"] .floor-symbol-library {
  grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
}

.technical-workspace[data-workflow-mode="room"] .floor-symbol-groups,
.technical-workspace[data-workflow-mode="room"] .floor-inventory-browser,
.technical-workspace[data-workflow-mode="room"] .floor-model-coverage {
  display: none;
}

.technical-workspace[data-workflow-mode="placement"] .floor-command-tools [data-floor-wall-preset],
.technical-workspace[data-workflow-mode="placement"] .floor-command-tools [data-floor-tool="door"],
.technical-workspace[data-workflow-mode="placement"] .floor-command-tools [data-floor-tool="window"] {
  display: none;
}

#estimateWizardDialog {
  width: min(920px, calc(100vw - 32px));
  max-width: 920px;
}

.project-wizard-form {
  min-width: 0;
}

.project-wizard-grid,
.technical-assembly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-wizard-grid .wide-field {
  grid-column: 1 / -1;
}

.technical-assembly-grid .wide-field {
  grid-column: 1 / -1;
}

.project-wizard-plan-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
}

.project-wizard-plan-fields:disabled {
  opacity: .48;
}

.project-wizard-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.project-wizard-preview,
.technical-assembly-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #f7f9f8;
}

.technical-assembly-preview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.project-wizard-preview > div,
.technical-assembly-preview > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.project-wizard-preview span,
.technical-assembly-preview span {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

#technicalAssemblyDialog {
  width: min(1080px, calc(100vw - 32px));
  max-width: 1080px;
}

.technical-assembly-form {
  min-width: 0;
}

.technical-assembly-native-type {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.technical-assembly-types {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.technical-assembly-types button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 9px 11px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.technical-assembly-types button:last-child {
  border-right: 0;
}

.technical-assembly-types button span {
  color: var(--muted);
  font-size: 11px;
}

.technical-assembly-types button.active {
  background: #e7f4f1;
  color: #075d57;
  box-shadow: inset 0 -3px 0 #16766d;
}

.technical-assembly-description {
  min-height: 30px;
  margin: 0;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  color: #53605d;
  font-size: 12px;
}

.technical-assembly-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 18px;
  align-items: start;
}

.technical-assembly-fields {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.technical-assembly-fields fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
}

.technical-assembly-fields legend {
  padding: 0 6px;
  color: #33413d;
  font-size: 12px;
  font-weight: 800;
}

.technical-assembly-review {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.technical-assembly-review h4 {
  margin: 0 0 7px;
  font-size: 13px;
}

.technical-assembly-placement {
  padding: 9px 10px;
  border-left: 3px solid #71837f;
  background: #f3f6f5;
  color: #4c5b57;
  font-size: 12px;
}

.technical-assembly-placement.good {
  border-left-color: #187a56;
  background: #edf8f1;
}

.technical-assembly-placement.bad {
  border-left-color: #b23a32;
  background: #fff0ef;
  color: #862d27;
}

.technical-assembly-contents {
  max-height: 240px;
  overflow: auto;
  border-block: 1px solid var(--line);
}

.technical-assembly-content-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px 2px;
  border-bottom: 1px solid #e8ece9;
}

.technical-assembly-content-row:last-child {
  border-bottom: 0;
}

.technical-assembly-content-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.technical-assembly-content-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.technical-assembly-content-row b {
  align-self: center;
  color: #53605d;
}

.technical-sync-table-wrap {
  max-height: min(54vh, 560px);
  overflow: auto;
}

.technical-sync-table-wrap td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.technical-sync-operation,
.technical-sync-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f4f6f5;
  font-size: 11px;
  font-weight: 700;
  white-space: normal;
}

.technical-sync-operation.add,
.technical-sync-operation.update,
.technical-sync-badge.warn {
  border-color: #c99736;
  background: #fff8e9;
  color: #6b4b09;
}

.technical-sync-operation.remove,
.technical-sync-operation.missing,
.technical-sync-badge.bad {
  border-color: #d6a09c;
  background: #fff0ef;
  color: #9a2d25;
}

.technical-sync-operation.same,
.technical-sync-badge.good {
  border-color: #9ecbc2;
  background: #edf8f5;
  color: #075d57;
}

@media (max-width: 900px) {
  .technical-workflow-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-wizard-options,
  .project-wizard-plan-fields,
  .technical-assembly-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .technical-assembly-review {
    padding-top: 12px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .technical-workflow-modes,
  .project-wizard-grid,
  .technical-assembly-grid,
  .project-wizard-preview,
  .technical-assembly-types {
    grid-template-columns: minmax(0, 1fr);
  }

  .technical-assembly-types button {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: block;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  text-decoration: none;
}

.brand-911 {
  width: fit-content;
  min-width: 286px;
  max-width: 100%;
  display: grid;
  align-items: center;
  justify-items: start;
  gap: 5px;
  padding: 12px 18px;
  background: #030303;
  color: #ffffff;
  border-radius: 8px;
  line-height: 1;
}

.brand-911:hover {
  background: #0d0d0d;
}

.brand-wordmark {
  color: #ffffff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-tagline,
.brand-subline {
  text-transform: uppercase;
  font-weight: 900;
  white-space: nowrap;
}

.brand-tagline {
  color: #c83a34;
  font-size: 10px;
  letter-spacing: 0.32em;
}

.brand-subline {
  color: #868c90;
  font-size: 10px;
  letter-spacing: 0.24em;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e7bf58;
  color: #17211d;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 24px;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.section-head h4 {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
  line-height: 1;
}

.brand p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.tabs {
  min-width: 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tab {
  color: var(--muted);
  background: transparent;
  text-align: center;
  padding: 10px 8px;
  border-radius: 8px;
  transition: 0.18s ease;
  white-space: nowrap;
}

.tab:hover,
.tab.active {
  background: #eef7f5;
  color: var(--accent-dark);
}

.storage-note {
  display: none;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  gap: 6px;
  font-size: 13px;
  color: #cbd7ce;
}

.storage-note strong {
  color: #ffffff;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  display: grid;
  grid-template-columns: auto auto minmax(120px, auto) auto;
  align-items: center;
  gap: 8px;
}

.user-card > span:not(.save-status) {
  color: var(--muted);
  font-size: 12px;
}

.user-card strong {
  color: var(--ink);
}

.user-card .ghost {
  min-height: 32px;
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.save-status::before {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #9aa49e;
  content: "";
}

.save-status.is-dirty::before,
.save-status.is-saving::before,
.save-status.is-loading::before {
  background: #c58b16;
}

.save-status.is-saved {
  color: var(--accent-dark);
}

.save-status.is-saved::before {
  background: #27835c;
}

.save-status.is-conflict,
.save-status.is-error {
  color: var(--danger);
}

.save-status.is-conflict::before,
.save-status.is-error::before {
  background: var(--danger);
}

.shell {
  min-width: 0;
  width: 100%;
  min-height: 100vh;
  padding: 0 0 24px;
}

.topbar {
  display: grid;
  gap: 16px;
  padding: 16px 24px 18px;
  margin-bottom: 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.topbar-navigation,
.topbar-workspace {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-navigation {
  align-items: stretch;
}

.topbar-workspace {
  align-items: flex-end;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.topbar h2 {
  font-size: 28px;
  margin-top: 4px;
}

.global-search-shell {
  position: relative;
  flex: 1 1 420px;
  width: min(520px, 100%);
  max-width: 520px;
  align-self: flex-end;
  z-index: 20;
}

.global-search-shell input {
  min-height: 42px;
  padding-left: 14px;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(520px, 60vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.global-search-result,
.global-search-empty {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  text-align: left;
}

.global-search-result {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 3px 10px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.global-search-result:hover,
.global-search-result:focus-visible {
  background: #eef7f5;
}

.global-search-result b {
  grid-row: 1 / span 2;
  color: var(--accent-dark);
  font-size: 11px;
  text-transform: uppercase;
}

.global-search-result strong,
.global-search-result span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.global-search-result span,
.global-search-empty {
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions,
.form-actions,
.export-row,
.dialog-actions,
.stacked-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary,
.ghost,
.small,
.text-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--soft);
}

.primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  border: 1px solid var(--line);
  background: #ffffff;
}

.ghost:hover,
.small:hover {
  background: #eef2ee;
}

.small {
  min-height: 34px;
  padding: 0 12px;
}

.danger {
  color: var(--danger);
}

.text-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.view {
  display: none;
  padding: 0 24px 24px;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel,
dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.readiness-center {
  margin-top: 16px;
}

.readiness-list {
  display: grid;
  gap: 8px;
}

.readiness-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, 0.8fr) minmax(260px, 1.4fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.readiness-row:first-child {
  border-top: 0;
}

.readiness-row > div {
  min-width: 0;
}

.readiness-summary,
.readiness-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.readiness-signal {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}

.readiness-signal.ok {
  border-color: #9fd2bd;
  color: #23664c;
}

.readiness-signal.warn {
  border-color: #dfb86d;
  color: #865c08;
}

.readiness-signal.bad {
  border-color: #e3a49d;
  color: var(--danger);
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head,
.form-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h3,
.form-head h3 {
  font-size: 18px;
}

#estimateForm > .form-head {
  align-items: flex-start;
}

#estimateForm > .form-head > div:first-child {
  flex: 1 1 320px;
  min-width: 0;
}

#estimateForm > .form-head .form-actions {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  justify-content: end;
  flex: 0 1 650px;
}

.form-head p,
.muted {
  color: var(--muted);
  margin: 4px 0 0;
}

.estimate-mode-tabs,
.builder-tabs,
.project-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.estimate-mode-tab,
.builder-tab,
.project-tab {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}

.estimate-mode-tab.active,
.builder-tab.active,
.project-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.project-panel {
  display: none;
}

.project-panel.active {
  display: block;
}

.project-stage-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.project-stage-bar {
  display: grid;
  grid-template-columns: repeat(9, minmax(76px, 1fr));
  min-width: 0;
}

.project-stage {
  position: relative;
  min-width: 0;
  padding: 8px 7px 7px;
  border: 0;
  border-top: 4px solid #cfd7d1;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

.project-stage.done {
  border-top-color: #78aa98;
  color: var(--accent-dark);
}

.project-stage.current {
  border-top-color: var(--accent);
  background: #eaf5f2;
  color: var(--ink);
}

.project-stage-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
  max-width: 260px;
}

.project-stage-actions span {
  margin: 0;
  font-size: 12px;
  text-align: right;
}

.project-production-control {
  display: grid;
  grid-template-columns: minmax(130px, 0.55fr) repeat(3, minmax(0, 1fr));
  min-width: 0;
  margin: -2px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.production-control-title {
  min-width: 0;
  padding: 11px 12px;
  display: grid;
  align-content: center;
  gap: 3px;
  background: #f1f5f2;
}

.production-control-title span,
.production-status-cell small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.production-control-title strong {
  font-size: 13px;
  line-height: 1.25;
}

.production-status-cell {
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  display: grid;
  align-content: center;
  gap: 3px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.production-status-cell:hover {
  background: #f7faf8;
}

.production-status-cell.ok {
  box-shadow: inset 3px 0 #4a9376;
}

.production-status-cell.warn {
  box-shadow: inset 3px 0 #c47a29;
}

.production-status-cell.bad {
  box-shadow: inset 3px 0 var(--danger);
}

.production-status-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.production-status-head b {
  font-size: 12px;
}

.production-status-head em {
  color: var(--accent-dark);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.production-status-cell > strong,
.production-status-cell > small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-status-cell > strong {
  font-size: 13px;
  line-height: 1.25;
}

.production-status-progress {
  height: 3px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: #e5ebe7;
}

.production-status-progress i {
  display: block;
  height: 100%;
  background: #7d948b;
}

.production-status-cell.ok .production-status-progress i {
  background: #4a9376;
}

.production-status-cell.warn .production-status-progress i {
  background: #c47a29;
}

.production-status-cell.bad .production-status-progress i {
  background: var(--danger);
}

.warehouse-flow-board {
  display: grid;
  grid-template-columns: minmax(130px, 0.55fr) minmax(0, 3fr);
  min-width: 0;
  margin: 4px 0 14px;
  border-block: 1px solid var(--line);
  background: #f8faf8;
}

.warehouse-flow-label {
  padding: 11px 12px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.warehouse-flow-label span {
  color: var(--muted);
  font-size: 11px;
}

.warehouse-flow-label strong {
  font-size: 13px;
}

.warehouse-flow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-width: 0;
}

.warehouse-flow-step {
  min-width: 0;
  padding: 10px 12px;
  border-left: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 4px;
  color: var(--muted);
}

.warehouse-flow-step > span {
  font-size: 11px;
  font-weight: 700;
}

.warehouse-flow-step > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-flow-step > i {
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: #e1e7e3;
}

.warehouse-flow-step > i > b {
  display: block;
  height: 100%;
  background: #8ba097;
}

.warehouse-flow-step.active {
  background: #eaf5f2;
  color: var(--accent-dark);
}

.warehouse-flow-step.active > i > b,
.warehouse-flow-step.complete > i > b {
  background: var(--accent);
}

.warehouse-flow-step.complete > strong {
  color: var(--accent-dark);
}

.warehouse-flow-step.blocked {
  background: #fff3ef;
  color: var(--danger);
}

.warehouse-flow-step.blocked > i > b {
  background: var(--danger);
}

.warehouse-manifest-title {
  align-items: end;
}

.warehouse-manifest-header {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) repeat(3, minmax(150px, 1fr));
  margin: 8px 0 12px;
  border-block: 1px solid var(--line);
  background: #f8faf8;
}

.warehouse-manifest-summary,
.warehouse-manifest-stamp {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 11px 12px;
  border-left: 1px solid var(--line);
}

.warehouse-manifest-summary {
  border-left: 0;
}

.warehouse-manifest-summary span,
.warehouse-manifest-stamp span,
.warehouse-manifest-summary small,
.warehouse-manifest-stamp small {
  color: var(--muted);
  font-size: 11px;
}

.warehouse-manifest-summary strong,
.warehouse-manifest-stamp strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.warehouse-manifest-stamp.done {
  box-shadow: inset 3px 0 var(--accent);
  background: #eef7f5;
}

.warehouse-category-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.warehouse-category-card {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.warehouse-category-card > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.warehouse-category-card strong,
.warehouse-category-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.warehouse-category-card span {
  color: var(--muted);
  font-size: 11px;
}

.warehouse-category-card > i {
  position: relative;
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #e5ebe7;
}

.warehouse-category-card > i > b,
.warehouse-category-card > i > em {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
}

.warehouse-category-card > i > b {
  background: #a9c9c2;
}

.warehouse-category-card > i > em {
  height: 3px;
  top: 3px;
  background: var(--accent);
}

.warehouse-category-card.complete {
  border-color: #b8d6c8;
  background: #f3faf6;
}

.compact-toggle {
  width: auto;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  color: var(--ink);
  white-space: nowrap;
}

.compact-toggle input {
  width: auto;
  margin: 0;
}

.crew-row-conflict td:first-child {
  box-shadow: inset 3px 0 var(--danger);
}

.crew-conflict-badge {
  display: block;
  margin-top: 5px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #fff0ed;
  color: #8d1f19;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 900px) {
  .project-production-control,
  .warehouse-flow-board {
    grid-template-columns: 1fr;
  }

  .warehouse-manifest-header {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-manifest-summary,
  .warehouse-manifest-stamp:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .warehouse-manifest-stamp:nth-child(3) {
    border-left: 0;
  }

  .production-control-title,
  .warehouse-flow-label {
    border-bottom: 1px solid var(--line);
  }

  .production-status-cell {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .production-control-title + .production-status-cell {
    border-top: 0;
  }
}

@media (max-width: 620px) {
  .warehouse-flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-flow-step:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .warehouse-flow-step:nth-child(odd) {
    border-left: 0;
  }

  .warehouse-manifest-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .warehouse-manifest-summary,
  .warehouse-manifest-stamp {
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .warehouse-manifest-stamp:last-child {
    border-bottom: 0;
  }

  .production-status-cell > strong,
  .production-status-cell > small,
  .warehouse-flow-step > strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.section-actions,
.manifest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manifest-actions {
  justify-content: flex-end;
  margin: 12px 0 18px;
}

.operation-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.operation-form .wide-field {
  grid-column: span 2;
}

.operation-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.operation-metric {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  gap: 3px;
}

.operation-metric span {
  color: var(--muted);
  font-size: 12px;
}

.operation-metric strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.operation-metric.ok {
  border-color: #bdddc9;
  background: #f2faf5;
}

.operation-metric.warn {
  border-color: #ead29a;
  background: #fff9ec;
}

.operation-metric.bad {
  border-color: #e1b1a8;
  background: #fff4f2;
}

.operations-table input,
.operations-table select {
  min-width: 112px;
}

.operations-table .compact-text {
  min-width: 150px;
}

.operations-table .compact-number {
  min-width: 96px;
  width: 110px;
}

.operations-table .account-toggle {
  min-width: auto;
}

.finance-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 320px));
  gap: 10px;
  margin-bottom: 14px;
}

.finance-breakdown {
  display: grid;
  gap: 8px;
}

.finance-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.finance-breakdown-row span {
  color: var(--muted);
}

.finance-breakdown-row.total {
  font-size: 16px;
  font-weight: 800;
  border-bottom-width: 2px;
  color: var(--ink);
}

.maintenance-queue-panel {
  min-width: 0;
}

#inventoryHome.maintenance-mode > :not(#maintenanceQueuePanel) {
  display: none;
}

#inventoryHome.verification-mode > :not(#inventoryVerificationPanel) {
  display: none;
}

.estimate-mode-panel {
  display: none;
}

.estimate-mode-panel.active {
  display: block;
}

.estimate-mode-panel[data-estimate-panel="list"] .list-panel {
  max-width: 980px;
}

.filters {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.inventory-filters {
  grid-template-columns: minmax(240px, 1fr) 180px 220px;
}

.inventory-head {
  align-items: flex-start;
}

.inventory-head h3 {
  margin-bottom: 4px;
}

.inventory-head .muted {
  margin: 0;
}

.inventory-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.inventory-section-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.inventory-section-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.inventory-section-card:hover {
  border-color: #9bb8ae;
  box-shadow: 0 8px 22px rgba(23, 33, 29, 0.08);
}

.inventory-section-open {
  min-width: 0;
  min-height: 150px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  display: grid;
  align-content: start;
  gap: 8px;
}

.inventory-section-open strong {
  font-size: 22px;
  line-height: 1.15;
}

.inventory-section-open > span:not(.inventory-section-label) {
  color: var(--muted);
  line-height: 1.4;
}

.inventory-section-open b {
  align-self: end;
  color: var(--accent-dark);
  font-size: 14px;
}

.inventory-section-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.inventory-section-card > .small {
  width: 100%;
}

.inventory-global-tools {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.inventory-receive-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.6fr) minmax(320px, 1.4fr);
  gap: 12px 18px;
  align-items: end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.inventory-receive-panel h4,
.inventory-receive-panel p {
  margin: 3px 0 0;
}

.inventory-receive-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inventory-receive-panel > p {
  grid-column: 1 / -1;
}

.inventory-receive-panel > p.bad {
  color: var(--danger);
  font-weight: 800;
}

.inventory-catalog-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.inventory-catalog-title {
  min-width: 0;
}

.inventory-catalog-title h3 {
  margin: 3px 0 0;
}

.inventory-catalog-title .muted {
  margin-top: 4px;
}

.inventory-catalog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inventory-search-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.inventory-stock-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(104px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.inventory-stock-filter button {
  min-width: 0;
  min-height: 34px;
  border-radius: 6px;
  padding: 5px 9px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.inventory-stock-filter button.active {
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 3px 10px rgba(23, 33, 29, 0.08);
  font-weight: 800;
}

.bulk-price-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.inventory-category-head,
.inventory-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.inventory-category-head h4,
.inventory-list-head h4 {
  margin: 0;
  font-size: 16px;
}

.inventory-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.inventory-category-card {
  min-width: 0;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.inventory-category-card:hover,
.inventory-category-card.active {
  border-color: var(--accent);
  background: #eef7f5;
}

.inventory-category-card strong {
  line-height: 1.25;
}

.inventory-category-card span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-category-all {
  border-style: dashed;
}

.inventory-list-panel {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  scroll-margin-top: 20px;
}

.inventory-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.inventory-stat {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}

.inventory-stat span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.inventory-stat strong {
  font-size: 20px;
  line-height: 1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

label {
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.item-list {
  display: grid;
  gap: 8px;
}

.estimate-card {
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.estimate-card.active {
  border-color: var(--accent);
  background: #eef7f5;
}

.estimate-card strong {
  display: block;
}

.estimate-card small {
  color: var(--muted);
}

.card-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  background: #e8ece8;
  color: #384139;
}

.status.sent {
  background: #e7eef8;
  color: var(--blue);
}

.status.approved {
  background: #e5f3eb;
  color: #17613a;
}

.status.closed {
  background: #f2eadf;
  color: var(--warn);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.inventory-list-panel .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.inventory-list-panel table {
  min-width: 1380px;
  table-layout: fixed;
}

.inventory-list-panel th,
.inventory-list-panel td {
  overflow-wrap: normal;
  word-break: normal;
}

.inventory-list-panel th:nth-child(1),
.inventory-list-panel td:nth-child(1) {
  width: 48px;
}

.inventory-list-panel th:nth-child(2),
.inventory-list-panel td:nth-child(2) {
  width: 320px;
}

.inventory-list-panel th:nth-child(3),
.inventory-list-panel td:nth-child(3) {
  width: 110px;
}

.inventory-list-panel th:nth-child(4),
.inventory-list-panel td:nth-child(4) {
  width: 190px;
}

.inventory-list-panel th:nth-child(5),
.inventory-list-panel td:nth-child(5) {
  width: 150px;
}

.inventory-list-panel th:nth-child(n + 6):nth-child(-n + 11),
.inventory-list-panel td:nth-child(n + 6):nth-child(-n + 11) {
  width: 92px;
  white-space: nowrap;
}

.inventory-list-panel th:nth-child(12),
.inventory-list-panel td:nth-child(12) {
  width: 110px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  table-layout: auto;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

td {
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: normal;
}

.estimate-lines-wrap {
  overflow-x: auto;
}

.lines-table {
  min-width: 1340px;
  table-layout: fixed;
}

.lines-table th,
.lines-table td {
  padding: 8px 6px;
}

.lines-table th:nth-child(1),
.lines-table td:nth-child(1) {
  width: 112px;
}

.lines-table th:nth-child(2),
.lines-table td:nth-child(2) {
  width: 170px;
}

.lines-table th:nth-child(3),
.lines-table td:nth-child(3) {
  width: 360px;
}

.lines-table th:nth-child(4),
.lines-table td:nth-child(4),
.lines-table th:nth-child(5),
.lines-table td:nth-child(5) {
  width: 68px;
}

.lines-table th:nth-child(6),
.lines-table td:nth-child(6),
.lines-table th:nth-child(7),
.lines-table td:nth-child(7) {
  width: 94px;
}

.lines-table th:nth-child(8),
.lines-table td:nth-child(8) {
  width: 90px;
}

.lines-table th:nth-child(9),
.lines-table td:nth-child(9) {
  width: 102px;
}

.lines-table th:nth-child(10),
.lines-table td:nth-child(10) {
  width: 96px;
}

.lines-table th:nth-child(11),
.lines-table td:nth-child(11) {
  width: 108px;
}

.lines-table th:nth-child(12),
.lines-table td:nth-child(12) {
  width: 78px;
}

.line-name,
.line-category {
  min-width: 0;
}

.line-name-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.line-name-stack select,
.line-name-stack input {
  width: 100%;
  min-width: 0;
}

.line-comment-label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.line-comment,
.line-internal-comment {
  padding: 7px 9px;
  color: #3f4a46;
  font-size: 12px;
  background: #f8faf8;
}

.line-internal-comment {
  border-color: #d7c8ad;
  background: #fffaf1;
}

.line-row-actions,
.compact-line-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.line-row-actions .icon-button,
.compact-line-actions .icon-button {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
}

.line-number {
  width: 100%;
  min-width: 0;
  text-align: right;
  padding-left: 8px;
  padding-right: 8px;
}

.line-discount {
  width: 100%;
  min-width: 0;
}

.summary-wrap {
  margin-top: 4px;
}

.summary-table {
  min-width: 980px;
}

.specification-wrap {
  margin-top: 4px;
}

.specification-table {
  min-width: 900px;
}

.specification-table td:nth-child(2) {
  min-width: 240px;
}

.specification-name-cell {
  min-width: 0;
}

.specification-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: start;
  gap: 10px;
}

.specification-line-main {
  min-width: 0;
  overflow-wrap: anywhere;
}

.specification-delete-line {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.line-comment-preview {
  display: block;
  margin-top: 4px;
  padding-left: 7px;
  border-left: 2px solid var(--accent);
  color: #43504c;
  font-size: 12px;
  line-height: 1.35;
}

.line-comment-preview.internal {
  border-left-color: #b27a2a;
  color: #73501d;
  background: #fffaf1;
}

.line-comment-preview b {
  font-weight: 800;
}

.specification-table td:nth-child(2) > .muted,
.specification-line-main > .muted {
  display: block;
  margin-top: 4px;
}

.summary-head {
  margin-top: 18px;
}

.estimate-builder-head,
.specification-head,
.scan-head {
  margin-top: 22px;
}

.project-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
}

.quick-tools {
  grid-template-columns: minmax(280px, 1fr) auto;
}

.project-tools .primary,
.project-tools .ghost {
  min-height: 42px;
  white-space: nowrap;
}

.line-add-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.line-add-row .small {
  min-height: 42px;
}

.inline-field {
  width: min(260px, 100%);
}

.builder-variant {
  display: none;
}

.builder-variant.active {
  display: block;
}

.hidden-builder {
  display: none !important;
}

.quick-builder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.quick-item-field {
  min-width: min(280px, 100%);
  grid-column: span 2;
}

.quick-comment-field,
.quick-internal-comment-field {
  grid-column: span 2;
}

.quick-builder > * {
  min-width: 0;
}

.quick-builder button {
  min-height: 42px;
  white-space: normal;
}

.compact-lines {
  display: grid;
  gap: 8px;
}

.compact-line {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 1.8fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.compact-line span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.compact-line-summary {
  min-width: 0;
}

.compact-line-summary > strong {
  display: block;
  overflow-wrap: anywhere;
}

.compact-line-summary label {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.compact-line-summary input {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  color: var(--ink);
  background: #f8faf8;
}

.compact-line-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(68px, 1fr)) minmax(98px, auto) auto;
  gap: 8px;
  align-items: center;
}

.compact-line-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
}

.compact-line-controls input {
  width: 100%;
  min-width: 0;
  text-align: right;
  padding: 7px 8px;
}

.compact-line-controls strong {
  white-space: nowrap;
  text-align: right;
}

.catalog-toolbar {
  margin-bottom: 14px;
}

.estimate-catalog-intro h4,
.estimate-catalog-title h4 {
  margin: 0;
  font-size: 18px;
}

.estimate-catalog-intro .muted,
.estimate-catalog-title .muted,
.estimate-catalog-results .muted {
  margin: 4px 0 0;
}

.estimate-catalog-section-grid {
  margin-top: 12px;
}

.estimate-catalog-results {
  margin-top: 2px;
}

.category-builder {
  display: grid;
  gap: 14px;
}

.category-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.category-panel h5 {
  margin: 0 0 10px;
  font-size: 14px;
}

.catalog-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

.catalog-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.catalog-main {
  text-align: left;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 4px;
  color: var(--ink);
  min-width: 0;
}

.catalog-main strong {
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.catalog-main span,
.catalog-main small {
  color: var(--muted);
  font-size: 12px;
}

.catalog-presence {
  justify-self: start;
  margin-top: 2px;
  padding: 4px 7px;
  border: 1px solid #b9d5cf;
  border-radius: 5px;
  background: #eef7f5;
  color: #0b625b !important;
  font-size: 11px !important;
  font-weight: 750;
}

.catalog-item:hover {
  border-color: var(--accent);
  background: #eef7f5;
}

.catalog-added {
  background: #0c514b;
}

.catalog-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  align-content: end;
  min-width: 0;
}

.catalog-bundle-controls {
  grid-template-columns: minmax(136px, 1fr) minmax(150px, 1fr);
}

.catalog-qty-control {
  display: grid;
  grid-template-columns: 30px minmax(42px, 1fr) 30px;
  gap: 4px;
  align-items: center;
}

.catalog-step {
  width: 30px;
  min-height: 38px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
  padding: 0;
}

.catalog-controls label {
  font-size: 11px;
  display: grid;
  gap: 5px;
  min-width: 0;
  line-height: 1.2;
}

.catalog-controls input {
  padding: 7px 8px;
  text-align: right;
  min-width: 0;
  width: 100%;
}

.catalog-comment-field {
  grid-column: 1 / -1;
}

.catalog-comment-field input {
  text-align: left;
}

.catalog-controls .catalog-add {
  grid-column: 1 / -1;
  min-height: 44px;
  white-space: nowrap;
}

.catalog-controls .catalog-has-lines {
  background: var(--accent-dark);
}

.stock-state {
  min-width: 110px;
  font-weight: 700;
}

.stock-cell {
  min-width: 150px;
}

.stock-cell .stock-state {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

.stock-cell button.stock-state {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.stock-cell button.stock-state.low:hover,
.stock-cell button.stock-state.bad:hover,
.stock-cell button.stock-state:focus-visible {
  border-color: currentColor;
  background: #fff7f2;
}

.stock-state.ok {
  color: #17613a;
}

.stock-state.low {
  color: var(--warn);
}

.stock-state.bad {
  color: var(--danger);
}

.inventory-group td {
  background: #17211d;
  color: #ffffff;
  font-weight: 800;
  padding: 9px 10px;
  border-bottom: 0;
}

.inventory-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.inventory-item-cell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.inventory-thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--soft);
}

.barcode-print {
  width: 76px;
  min-height: 92px;
  padding: 5px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid transparent;
  display: grid;
  place-items: center;
}

.barcode-print:hover {
  border-color: var(--accent);
  background: #eef7f5;
}

.qr-code {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.qr-code span {
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.qr-svg {
  width: 54px;
  height: 54px;
  display: block;
}

.qr-bg {
  fill: #ffffff;
}

.qr-svg rect:not(.qr-bg) {
  fill: var(--ink);
}

.edit-item {
  min-width: 92px;
  white-space: nowrap;
}

.inventory-qr-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 330px;
  max-height: 126px;
  overflow: auto;
  padding-right: 2px;
}

.unit-code-print {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  min-height: 30px;
  padding: 7px 8px;
  white-space: nowrap;
}

.unit-code-print:hover {
  border-color: var(--accent);
  background: #eef7f5;
}

.inventory-qr-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.unit-more {
  min-height: 54px;
  font-weight: 900;
  color: var(--accent);
}

.unit-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 180px;
}

.unit-badge {
  display: grid;
  gap: 1px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  line-height: 1.15;
}

.unit-badge strong {
  font-size: 10px;
  white-space: nowrap;
}

.unit-badge small {
  color: var(--muted);
  font-size: 9px;
}

.unit-badge.issued {
  border-color: #9fc8c1;
  background: #eef7f5;
}

.unit-badge.returned {
  border-color: #bdd5bd;
  background: #f1f7ef;
}

.unit-badge.transferred {
  border-color: #bdc5d8;
  background: #f2f4f8;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f4f1;
  color: var(--danger);
}

.totals {
  width: 100%;
  margin: 10px 0 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.totals div {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: start;
  padding-right: 8px;
}

.totals span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.totals strong {
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.totals .grand {
  color: var(--accent-dark);
}

.totals .grand strong {
  font-size: 22px;
}

.export-row {
  justify-content: flex-end;
  margin-top: 14px;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.danger-alert,
.ok-alert {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.danger-alert {
  border-color: rgba(179, 38, 30, 0.32);
  background: #fff6f4;
  color: var(--danger);
}

.ok-alert {
  border-color: rgba(18, 111, 104, 0.22);
  background: #f2faf8;
  color: var(--accent-dark);
}

.danger-alert span,
.ok-alert span {
  color: var(--muted);
}

.alert {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.alert strong {
  color: var(--ink);
}

.alert span {
  color: var(--muted);
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px 320px;
  gap: 16px;
}

.settings-wide {
  grid-column: 1 / -1;
}

.counterparty-directory {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.counterparty-directory-item {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(160px, 1fr) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.counterparty-directory-item > div {
  min-width: 0;
}

.counterparty-directory-item strong,
.counterparty-directory-item span {
  display: block;
  overflow-wrap: anywhere;
}

.counterparty-directory-item.is-duplicate {
  border-color: #dfb86d;
  background: #fffaf0;
}

.discount-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.discount-grid label {
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: center;
}

.discount-grid input {
  text-align: right;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.reports-live {
  grid-column: 1 / -1;
}

.finance-report-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.finance-calendar-head {
  margin-top: 18px;
}

.finance-payment-calendar {
  display: grid;
  gap: 8px;
}

.finance-payment-row {
  display: grid;
  grid-template-columns: 110px minmax(220px, 1.4fr) minmax(160px, 0.8fr) minmax(130px, 0.6fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.finance-payment-row.is-overdue {
  border-color: #e3a49d;
  background: #fff7f6;
}

.finance-payment-row > div {
  min-width: 0;
}

.report-actions {
  margin-top: 16px;
}

.expenses-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.expenses-ledger {
  grid-column: 1 / -1;
}

.expense-insights {
  min-height: 0;
}

.expense-filters {
  grid-template-columns: minmax(180px, 1fr) 170px 120px 150px minmax(240px, 1.2fr);
  align-items: end;
}

.inline-number {
  min-width: 0;
}

.inline-number input {
  text-align: right;
}

.expense-table {
  min-width: 1380px;
}

.expense-table th:nth-child(1),
.expense-table td:nth-child(1) {
  width: 210px;
}

.expense-table th:nth-child(4),
.expense-table td:nth-child(4),
.expense-table th:nth-child(5),
.expense-table td:nth-child(5),
.expense-table th:nth-child(6),
.expense-table td:nth-child(6) {
  width: 130px;
}

.expense-form {
  display: grid;
  gap: 12px;
}

.expense-form .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.expense-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.expense-payments {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.expense-payment-grid {
  display: grid;
  grid-template-columns: 130px 150px 100px minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.payment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #e8ece8;
  color: #384139;
}

.payment-badge.cash {
  background: #fff2dc;
  color: #8a4c12;
}

.payment-badge.cashless {
  background: #e7eef8;
  color: var(--blue);
}

.status.planned {
  background: #e8ece8;
  color: #384139;
}

.status.invoice {
  background: #eef2ff;
  color: #3452a0;
}

.status.partial {
  background: #fff9ef;
  color: var(--warn);
}

.status.paid {
  background: #e5f3eb;
  color: #17613a;
}

.status.issue {
  background: #fff6f4;
  color: var(--danger);
}

.legal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.legal-ledger {
  grid-column: 1 / -1;
}

.legal-wizard-panel {
  grid-column: 1 / -1;
}

.legal-control-panel {
  grid-column: 1 / -1;
}

.legal-form {
  display: grid;
  gap: 12px;
}

.period-filter,
.document-actions,
.wizard-actions,
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}

.period-filter input {
  width: 150px;
  max-width: 100%;
}

.document-actions {
  margin-top: 14px;
}

.legal-wizard {
  display: grid;
  gap: 14px;
}

.wizard-summary {
  color: var(--accent-dark);
  font-size: 14px;
  line-height: 1.25;
  text-align: right;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.wizard-step {
  min-width: 0;
  border-top: 3px solid var(--line);
  padding-top: 8px;
  display: grid;
  gap: 3px;
}

.wizard-step.ok {
  border-color: var(--accent);
}

.wizard-step.warn {
  border-color: var(--warn);
}

.wizard-step strong,
.wizard-step span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wizard-step span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.wizard-actions {
  justify-content: flex-end;
}

.wizard-actions button {
  min-height: 40px;
}

.legal-money-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.legal-money-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: #ffffff;
}

.legal-money-card span {
  color: var(--muted);
  font-size: 12px;
}

.legal-money-card strong {
  overflow-wrap: anywhere;
}

.legal-money-card.ok {
  border-color: rgba(18, 111, 104, 0.28);
  background: #f2faf8;
}

.legal-money-card.debt {
  border-color: rgba(179, 38, 30, 0.3);
  background: #fff6f4;
}

.legal-control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.legal-control-grid section {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.legal-control-grid .legal-print-preflight {
  grid-column: 1 / -1;
}

.legal-control-grid h4,
.party-import h4 {
  margin: 0;
  font-size: 14px;
}

.legal-timeline,
.legal-check-list,
.legal-reminders,
.legal-versions,
.party-import {
  display: grid;
  gap: 8px;
}

.timeline-step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.timeline-step > span {
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #ffffff;
}

.timeline-step.done > span {
  border-color: var(--accent);
  background: var(--accent);
}

.timeline-step strong,
.timeline-step small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline-step small {
  color: var(--muted);
}

.legal-check,
.legal-reminder,
.legal-version {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  display: grid;
  gap: 3px;
  background: #ffffff;
}

.legal-version {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.legal-check span,
.legal-reminder span,
.legal-version span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.legal-check.ok,
.legal-reminder.ok {
  border-color: rgba(18, 111, 104, 0.28);
  background: #f2faf8;
}

.legal-check.warn,
.legal-reminder {
  border-color: rgba(181, 100, 24, 0.3);
  background: #fff9ef;
}

.legal-check.bad {
  border-color: rgba(179, 38, 30, 0.3);
  background: #fff6f4;
}

.project-audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.project-audit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  min-width: 0;
}

.compact-checks {
  gap: 6px;
  margin: 6px 0;
}

.compact-checks .legal-check {
  padding: 7px;
}

.legal2-template-import {
  align-self: end;
  min-height: 42px;
}

.party-import {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.legal2-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
}

.legal2-workspace-nav {
  position: sticky;
  top: 8px;
  z-index: 8;
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(25, 44, 39, 0.08);
}

.legal2-workspace-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.legal2-workspace-tab.active {
  background: var(--accent);
  color: #ffffff;
}

#legal2BuilderSection,
#legal2ContractorsSection,
#legal2ServicesSection,
#legal2TemplatesSection {
  scroll-margin-top: 64px;
}

.legal2-builder-panel,
.legal2-template-panel {
  grid-column: 1 / -1;
}

.legal2-form {
  display: grid;
  gap: 14px;
}

.legal2-service-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.legal2-service-option {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  color: var(--ink);
}

.legal2-service-option input {
  width: auto;
  margin-top: 2px;
}

.legal2-service-option span,
.legal2-service-option strong,
.legal2-service-option small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.legal2-service-option small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.25;
}

.legal2-output-panel {
  align-content: start;
}

.legal2-used-data {
  display: grid;
  gap: 12px;
}

.legal2-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.legal2-data-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #ffffff;
  display: grid;
  gap: 4px;
}

.legal2-data-grid span {
  color: var(--muted);
  font-size: 12px;
}

.legal2-data-grid strong {
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.legal2-preview {
  max-height: 640px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.legal2-preview:empty {
  display: none;
}

.legal2-preview button {
  display: none;
}

.legal2-preview h1 {
  font-size: 18px;
  margin: 0 0 12px;
  text-align: center;
}

.legal2-preview p {
  margin: 0 0 10px;
  line-height: 1.35;
}

.legal2-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.legal2-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  display: grid;
  gap: 5px;
}

.legal2-card strong,
.legal2-card span,
.legal2-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.legal2-card span,
.legal2-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.legal2-details {
  margin-top: 14px;
}

.legal2-template-panel textarea {
  font-family: inherit;
  line-height: 1.4;
}

.template-library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.template-library-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.template-library-card span,
.template-library-card small,
.template-library-card b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.template-library-card.approved {
  border-color: #b8d8c4;
}

.template-library-card.bad {
  border-color: #e6c9c3;
}

.template-library-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #f0f7f5;
}

.template-lock-notice {
  display: grid;
  gap: 3px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #d6dfdc;
  border-radius: 8px;
  background: #f7faf9;
}

.template-lock-notice strong,
.template-lock-notice span {
  overflow-wrap: anywhere;
}

.template-lock-notice span {
  color: var(--muted);
  font-size: 13px;
}

.template-history {
  display: grid;
  gap: 8px;
}

.template-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.template-history-row.current {
  border-color: #b8d8c4;
  background: #f1f8f3;
}

.template-history-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}

.template-history-row span,
.template-history-row small,
.template-history-row p {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.template-history-row p {
  grid-column: 1;
  margin: 0;
}

.template-history-row button {
  grid-column: 2;
  grid-row: 2 / span 2;
}

.document-actions button {
  flex: 1 1 148px;
  min-width: 0;
  min-height: 40px;
  white-space: normal;
}

.compact-metrics {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 14px;
}

.selected-row {
  background: #eef7f5;
}

.danger-text {
  color: var(--danger);
}

.ok-text {
  color: #17613a;
}

.party-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.party-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: #ffffff;
}

.party-card details {
  min-width: 0;
}

.party-card summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.party-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.party-title strong,
.party-title small,
.party-meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

.party-meta {
  color: var(--muted);
  font-size: 12px;
}

.party-card span,
.party-card small {
  color: var(--muted);
  line-height: 1.25;
}

.party-editor-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.party-editor-grid label {
  min-width: 0;
}

.party-editor-grid input,
.party-editor-grid select {
  width: 100%;
}

.party-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.party-details {
  margin-top: 14px;
}

.party-details summary {
  cursor: pointer;
  font-weight: 800;
  margin-bottom: 12px;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-weekday,
.calendar-day {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.calendar-weekday:nth-child(7n),
.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-weekday {
  padding: 9px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.calendar-day {
  min-height: 118px;
  padding: 8px;
  background: #ffffff;
}

.calendar-day.muted-day {
  background: #f8faf8;
  color: var(--muted);
}

.calendar-day-events {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.calendar-pill {
  width: 100%;
  min-height: 28px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #eef7f5;
  color: var(--accent-dark);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
}

.calendar-events {
  display: grid;
  gap: 10px;
}

.calendar-event {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.calendar-event span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.calendar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.availability-calendar {
  margin-top: 16px;
}

.availability-calendar-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.availability-calendar-rows {
  display: grid;
  gap: 8px;
}

.availability-calendar-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.3fr) minmax(150px, 0.7fr) minmax(280px, 1.5fr);
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.availability-calendar-row > div {
  min-width: 0;
}

.availability-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.availability-project {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 6px;
  text-align: left;
  font-size: 12px;
}

.availability-project.is-tentative {
  border-style: dashed;
  color: #865c08;
}

.item-unit-editor {
  display: grid;
  gap: 8px;
}

.item-unit-row {
  display: grid;
  grid-template-columns: 42px minmax(145px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(130px, 1fr);
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.item-unit-row > strong {
  align-self: center;
}

.item-unit-row label {
  min-width: 0;
  font-size: 11px;
}

.item-unit-row input,
.item-unit-row select {
  width: 100%;
  min-width: 0;
  padding: 8px;
}

.item-unit-assignment {
  align-self: center;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.check-table {
  min-width: 1040px;
}

.check-table input {
  min-width: 0;
}

.check-cell {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.check-cell input {
  width: auto;
}

.scan-tools {
  grid-template-columns: minmax(260px, 1fr) auto auto minmax(220px, 0.8fr);
}

.scan-feedback {
  align-self: end;
  min-height: 42px;
  border: 1px solid rgba(18, 111, 104, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--accent-dark);
  background: #f2faf8;
  overflow-wrap: anywhere;
}

.scan-feedback.bad {
  border-color: rgba(179, 38, 30, 0.32);
  color: var(--danger);
  background: #fff6f4;
}

.work-list,
.history-list {
  display: grid;
  gap: 10px;
}

.work-item,
.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.work-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.work-item.done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.work-item span,
.history-item span,
.work-item a {
  color: var(--muted);
  font-size: 13px;
}

.work-item a {
  display: inline-block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.history-item {
  display: grid;
  gap: 4px;
}

.history-item p {
  margin: 0;
  color: var(--muted);
}

.setting-copy {
  color: var(--muted);
  line-height: 1.55;
}

.credentials {
  display: grid;
  gap: 12px;
}

.credentials div,
.account-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.account-form {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.permission-item {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.permission-item input {
  width: auto;
}

.account-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px !important;
}

.credentials span {
  color: var(--muted);
}

dialog {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  padding: 0;
}

.wide-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.pdf-import-options,
.bundle-add-row,
.document-add-row {
  display: grid;
  gap: 10px;
  align-items: end;
}

.pdf-import-options {
  grid-template-columns: auto auto 1fr;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.checkbox-field input {
  width: auto;
}

.pdf-import-table {
  min-width: 1040px;
}

.pdf-import-table input,
.pdf-import-table select,
.pdf-import-table textarea {
  min-width: 0;
}

.pdf-import-table .pdf-row-name {
  min-width: 280px;
}

.pdf-import-table .pdf-row-quantity,
.pdf-import-table .pdf-row-position {
  width: 92px;
}

.pdf-import-table .pdf-row-status {
  max-width: 180px;
  overflow-wrap: anywhere;
}

.bundle-add-row {
  grid-template-columns: minmax(0, 1fr) 110px auto;
}

.bundle-component-list,
.inventory-document-list,
.inventory-history-list {
  display: grid;
  gap: 8px;
}

.bundle-component-row,
.inventory-document-row,
.inventory-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.bundle-component-row {
  grid-template-columns: minmax(0, 1fr) 100px auto;
}

.inventory-document-row a {
  display: block;
  overflow-wrap: anywhere;
}

.bundle-component-row:last-child,
.inventory-document-row:last-child,
.inventory-history-row:last-child {
  border-bottom: 0;
}

.bundle-component-row span,
.inventory-document-row span,
.inventory-history-row span {
  color: var(--muted);
  font-size: 12px;
}

.document-add-row {
  grid-template-columns: minmax(160px, 0.7fr) minmax(240px, 1.3fr) auto;
}

.rate-wizard-launch {
  display: flex;
  align-items: end;
}

dialog::backdrop {
  background: rgba(17, 24, 21, 0.48);
}

.dialog-form {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.dialog-form h3 {
  margin: 0;
}

.dialog-actions {
  justify-content: flex-end;
}

.inventory-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.inventory-editor {
  gap: 16px;
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
}

.dialog-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.dialog-title-row p {
  margin: 4px 0 0;
}

.item-kind-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.kind-preset {
  min-width: 0;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.kind-preset.active {
  background: #ffffff;
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(18, 111, 104, 0.12);
}

.inventory-editor-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.inventory-editor-section h4 {
  margin: 0;
  font-size: 15px;
}

.inventory-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.wide-field {
  grid-column: span 2;
}

.full-field {
  grid-column: 1 / -1;
}

.item-equipment-category-picker {
  display: grid;
  gap: 8px;
}

.item-field-label {
  color: var(--muted);
  font-size: 13px;
}

.item-equipment-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.item-equipment-category {
  min-width: 0;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  display: grid;
  align-content: start;
  gap: 5px;
}

.item-equipment-category:hover,
.item-equipment-category.active {
  border-color: var(--accent);
  background: #eef7f5;
}

.item-equipment-category strong {
  font-size: 13px;
  line-height: 1.2;
}

.item-equipment-category span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.hidden-field {
  display: none !important;
}

.item-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid #c7ded9;
  border-radius: 8px;
  background: #f3faf8;
  padding: 12px;
}

.item-preview div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.item-preview span {
  color: var(--muted);
  font-size: 12px;
}

.item-preview strong,
.item-preview small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.item-preview strong {
  color: var(--accent-dark);
  font-size: 15px;
  line-height: 1.2;
}

.item-preview small {
  color: var(--muted);
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #17211d;
  color: #ffffff;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

.login-screen {
  position: fixed;
  inset: 0;
  background: rgba(18, 30, 25, 0.9);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

body.auth-locked {
  overflow: hidden;
  background: #15191b;
}

body.auth-locked .shell {
  display: none;
}

.login-screen.active {
  display: grid;
}

.login-panel {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 16px;
}

.login-panel .brand-911 {
  width: 100%;
  min-width: 0;
  justify-items: center;
  padding: 22px 18px;
}

.login-panel .brand-wordmark {
  font-size: 42px;
}

.login-panel .brand-tagline {
  font-size: 11px;
}

.hide {
  display: none !important;
}

@media (min-width: 1101px) and (max-width: 1500px) {
  .topbar-navigation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .topbar-navigation .tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    flex-wrap: nowrap;
  }
}

@media (max-width: 1120px) {
  .topbar-navigation {
    flex-wrap: wrap;
    align-items: center;
  }

  .topbar-workspace {
    align-items: flex-start;
  }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .user-card {
    margin-left: auto;
  }

  .split,
  .dashboard-grid,
  .settings-grid,
  .reports-grid,
  .expenses-grid,
  .expense-filters,
  .expense-payment-grid,
  .legal-grid,
  .legal2-grid,
  .calendar-layout,
  .quick-builder,
  .project-tools {
    grid-template-columns: 1fr;
  }

  .settings-wide {
    grid-column: auto;
  }

  .counterparty-directory-item {
    grid-template-columns: 1fr;
  }

  .readiness-row {
    grid-template-columns: 1fr;
  }

  .availability-calendar-filters,
  .availability-calendar-row {
    grid-template-columns: 1fr;
  }

  .finance-report-filters,
  .finance-payment-row {
    grid-template-columns: 1fr;
  }

  .reports-live {
    grid-column: auto;
  }

  .item-unit-row {
    grid-template-columns: 34px 1fr;
  }

  .item-unit-row label,
  .item-unit-assignment {
    grid-column: 2;
  }

  .metrics,
  .form-grid,
  .expense-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-money-grid,
  .legal-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-controls .catalog-add {
    grid-column: 1 / -1;
  }

  .calendar-grid {
    min-width: 760px;
  }

  .calendar-panel {
    overflow-x: auto;
  }
}

@media (max-width: 1100px) {
  .topbar-navigation,
  .topbar-workspace {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    min-width: 0;
  }

  .brand-911 {
    width: 100%;
    min-width: 0;
  }

  .tabs {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .tab {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    white-space: normal;
  }

  .user-card {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto minmax(120px, auto) auto;
    margin-left: 0;
  }

  .topbar-actions {
    width: 100%;
  }

  .global-search-shell {
    width: 100%;
    max-width: none;
    align-self: stretch;
  }

  .topbar-actions > * {
    flex: 1 1 140px;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }

  .summary-table,
  .specification-table {
    min-width: 680px;
  }

  .specification-table td:nth-child(2) {
    min-width: 160px;
  }

  .compact-line {
    grid-template-columns: 1fr;
  }

  .compact-line-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-line-controls strong,
  .compact-line-controls .icon-button {
    grid-column: span 1;
  }

  .quick-comment-field,
  .quick-internal-comment-field,
  .quick-item-field {
    grid-column: span 1;
  }

  .compact-line-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 0 0 16px;
  }

  .topbar {
    padding: 14px 16px 16px;
  }

  .view {
    padding: 0 16px 16px;
  }

  .topbar-navigation,
  .topbar-workspace,
  .panel-head,
  .form-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    min-width: 0;
  }

  .brand-911 {
    width: 100%;
  }

  .tabs {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .tab {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    white-space: normal;
  }

  .legal2-workspace-nav {
    position: static;
    width: 100%;
    flex-wrap: wrap;
  }

  .legal2-workspace-tab {
    flex: 1 1 calc(50% - 4px);
  }

  .template-library {
    grid-template-columns: 1fr;
  }

  .template-history-row {
    grid-template-columns: 1fr;
  }

  .template-history-row p,
  .template-history-row button {
    grid-column: 1;
    grid-row: auto;
  }

  .user-card {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-left: 0;
  }

  .save-status {
    justify-self: start;
  }

  .topbar-actions,
  .form-actions,
  .export-row {
    width: 100%;
  }

  .inventory-catalog-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .inventory-catalog-actions {
    justify-content: stretch;
  }

  .inventory-catalog-actions > * {
    flex: 1 1 calc(50% - 4px);
  }

  .inventory-search-row {
    grid-template-columns: 1fr;
  }

  .inventory-stock-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-stock-filter button {
    white-space: normal;
  }

  .bulk-price-controls {
    grid-template-columns: 1fr;
  }

  #estimateForm > .form-head .form-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    flex: none;
  }

  #estimateForm > .form-head .form-actions > * {
    width: 100%;
  }

  #estimateForm > .form-head .form-actions > :last-child {
    grid-column: 1 / -1;
  }

  .topbar-actions > *,
  .form-actions > *,
  .export-row > * {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
    white-space: normal;
    text-align: center;
  }

  .period-filter,
  .document-actions,
  .wizard-actions,
  .inline-actions,
  .expense-form-actions {
    width: 100%;
    align-items: stretch;
  }

  .period-filter > *,
  .document-actions > *,
  .wizard-actions > *,
  .inline-actions > *,
  .expense-form-actions > * {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
  }

  .period-filter input {
    width: auto;
  }

  .metrics,
  .form-grid,
  .wizard-steps,
  .legal-money-grid,
  .legal-control-grid,
  .totals,
  .inventory-filters,
  .inventory-stats,
  .inventory-section-grid,
  .inventory-receive-panel,
  .inventory-receive-controls,
  .inventory-editor-grid,
  .item-equipment-category-grid,
  .item-preview,
  .pdf-import-options,
  .bundle-add-row,
  .bundle-component-row,
  .document-add-row,
  .expense-filters,
  .expense-payment-grid,
  .expense-form .form-grid,
  .account-grid,
  .permission-grid,
  .project-stage-shell,
  .operation-form,
  .operation-metrics,
  .finance-control-grid,
  .compact-line,
  .work-item,
  .catalog-items,
  .catalog-controls,
  .calendar-event {
    grid-template-columns: 1fr;
  }

  .project-stage-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-stage-actions {
    max-width: none;
    width: 100%;
    justify-items: stretch;
  }

  .project-stage-actions span {
    text-align: left;
  }

  .operation-form .wide-field {
    grid-column: span 1;
  }

  .manifest-actions,
  .section-actions {
    width: 100%;
  }

  .manifest-actions > *,
  .section-actions > * {
    flex: 1 1 160px;
  }

  .compact-line-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-line-controls strong,
  .compact-line-controls .icon-button {
    grid-column: span 1;
  }

  .calendar-actions > * {
    flex: 1;
  }

  .inline-field {
    width: 100%;
  }

  .inventory-head-actions {
    width: 100%;
    justify-content: stretch;
  }

  .inventory-catalog-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .inventory-catalog-head > button {
    width: 100%;
  }

  .inventory-category-grid {
    grid-template-columns: 1fr;
  }

  .item-equipment-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-head-actions > *,
  .item-kind-switch > * {
    min-width: 0;
  }

  .item-kind-switch {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: span 1;
  }

  .full-field {
    grid-column: 1 / -1;
  }

}

@media (max-width: 460px) {
  .topbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .view {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand-wordmark {
    font-size: 26px;
  }

  .brand-tagline,
  .brand-subline {
    white-space: normal;
  }

  #estimateForm > .form-head .form-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-actions > *,
  .export-row > *,
  .period-filter > *,
  .document-actions > *,
  .wizard-actions > *,
  .inline-actions > *,
  .expense-form-actions > * {
    flex-basis: 100%;
  }

  .tab,
  .topbar-actions > * {
    flex-basis: calc(50% - 6px);
  }
}

@media print {
  body {
    display: block;
    background: #ffffff;
  }

  .topbar,
  .list-panel,
  .form-actions,
  .export-row,
  .section-head button,
  .icon-button {
    display: none !important;
  }

  .shell,
  .panel {
    padding: 0;
    box-shadow: none;
    border: 0;
  }

  .split {
    display: block;
  }
}

.audit-panel,
.version-panel,
.mobile-scan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  margin: 14px 0;
  padding: 12px;
}

.audit-head,
.version-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.audit-head strong,
.version-head strong,
.audit-ok strong,
.mobile-scan-card h4 {
  color: var(--ink);
  margin: 0;
}

.audit-ok {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent-dark);
}

.audit-list {
  display: grid;
  gap: 6px;
}

.audit-item {
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff8ec;
  color: var(--warn);
}

.audit-item.bad {
  background: #fff1ef;
  color: var(--danger);
}

.audit-inventory-link {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
}

.audit-inventory-link:hover,
.audit-inventory-link:focus-visible {
  border-color: currentColor;
}

.audit-inventory-link strong {
  flex: 0 0 auto;
  font-size: 11px;
  white-space: nowrap;
}

.version-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.version-chip {
  display: grid;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
}

.version-chip small {
  color: var(--muted);
}

.lock-notice:empty,
.document-chain:empty,
.occupancy-list:empty,
.legal2-readiness:empty,
.legal2-history:empty {
  display: none;
}

.lock-notice,
.document-chain,
.occupancy-list,
.legal2-readiness,
.legal2-history {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
}

.lock-notice {
  border: 1px solid #e1d2ad;
  background: #fff8e6;
  border-radius: 8px;
  padding: 12px 14px;
  color: #5e4311;
}

.lock-notice strong,
.lock-notice span {
  display: block;
}

.chain-card,
.occupancy-card,
.readiness-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.chain-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.chain-card strong,
.occupancy-card strong,
.readiness-card strong {
  display: block;
  color: var(--ink);
}

.chain-card span,
.occupancy-card span,
.readiness-card span {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.chain-steps,
.occupancy-lines,
.readiness-grid,
.backup-create-row {
  display: grid;
  gap: 8px;
}

.chain-steps {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.chain-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8faf8;
  font-size: 13px;
}

.chain-step.ok {
  border-color: #bdddc9;
  background: #edf8f1;
  color: #17613a;
}

.chain-step.warn {
  border-color: #ead29a;
  background: #fff8e6;
  color: #6f4d00;
}

.chain-step.bad {
  border-color: #e1b1a8;
  background: #fff0ee;
  color: #8c2c1f;
}

.danger-row {
  border-color: #e1b1a8 !important;
  background: #fff7f5 !important;
}

.occupancy-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
  gap: 10px;
}

.occupancy-lines {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.occupancy-line {
  border-left: 3px solid var(--accent);
  padding-left: 9px;
  min-width: 0;
}

.readiness-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.readiness-card.ok {
  border-color: #bdddc9;
}

.readiness-card.warn {
  border-color: #ead29a;
}

.readiness-card.bad {
  border-color: #e1b1a8;
}

.backup-create-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 12px;
}

.mobile-scan-card {
  display: grid;
  gap: 10px;
  background: #f8fbf9;
}

.mobile-scan-card input {
  min-height: 52px;
  font-size: 20px;
}

.mobile-scan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mobile-scan-actions button {
  min-height: 52px;
  font-weight: 800;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.self-test-results,
.self-test-list {
  display: grid;
  gap: 10px;
}

.self-test-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.self-test-summary.ok {
  color: #17613a;
  border-color: #bdddc9;
  background: #edf8f1;
}

.self-test-summary.bad {
  color: var(--danger);
  border-color: #e1b1a8;
  background: #fff0ee;
}

.trash-item {
  border-color: #ead29a;
  background: #fffdf7;
}

.trash-item > div:first-child {
  min-width: 0;
}

.notification-shell {
  position: relative;
}

.notification-button {
  gap: 7px;
}

.notification-button.has-alerts {
  border-color: #d5a850;
}

.notification-count {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.notification-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  width: min(390px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 150px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(23, 33, 29, 0.18);
}

.notification-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.notification-list {
  display: grid;
}

.notification-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: 0;
  text-align: left;
  background: #fffdf7;
}

.notification-item.bad {
  border-left-color: var(--danger);
  background: #fff7f5;
}

.notification-item.is-read {
  border-left-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.notification-item span,
.notification-empty {
  font-size: 12px;
  color: var(--muted);
}

.notification-empty {
  padding: 18px 14px;
}

.inventory-stock-filter {
  grid-template-columns: repeat(5, minmax(96px, 1fr));
}

.inventory-bulk-bar {
  position: sticky;
  top: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #9ec7bb;
  border-radius: 8px;
  background: #eef8f5;
  box-shadow: 0 8px 22px rgba(23, 72, 61, 0.1);
}

.inventory-bulk-bar[hidden] {
  display: none;
}

.inventory-bulk-bar strong {
  margin-right: auto;
}

.inventory-select-cell {
  width: 38px;
  text-align: center;
}

.inventory-select-cell input {
  width: 18px;
  height: 18px;
}

tr.is-archived > td {
  background: #f7f7f5;
  color: var(--muted);
}

.favorite-mark {
  color: #b44736;
}

.estimate-presets {
  margin-bottom: 22px;
}

.estimate-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.estimate-preset-button {
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 12px 14px;
  border: 1px solid #a9c9c0;
  border-radius: 8px;
  text-align: left;
  background: #f4fbf8;
  color: var(--ink);
}

.estimate-preset-button:hover {
  border-color: var(--accent);
  background: #edf8f4;
}

.estimate-preset-button span,
.estimate-preset-button small {
  color: var(--muted);
}

.estimate-preset-button.user-bundle {
  border-color: #d5b76f;
  background: #fffaf0;
}

.version-chip {
  grid-template-columns: minmax(140px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.version-chip > span:first-child {
  display: grid;
  gap: 2px;
}

.version-actions {
  display: flex;
  gap: 6px;
}

.estimate-compare-dialog {
  width: min(960px, calc(100vw - 24px));
}

.estimate-diff-added td {
  background: #eff8f2;
}

.estimate-diff-removed td {
  background: #fff1ef;
}

.estimate-diff-changed td {
  background: #fffaf0;
}

.camera-file-button {
  align-self: end;
  min-height: 44px;
}

.operation-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.operation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.operation-card > div,
.final-summary-grid article {
  display: grid;
  gap: 4px;
}

.operation-card span,
.final-summary-grid span {
  color: var(--muted);
  font-size: 13px;
}

.operation-card.ok-card {
  border-color: #b8d6c8;
  background: #f3faf6;
}

.shortage-card {
  border-color: #e6c3bc;
  background: #fff8f6;
}

.shortage-actions {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto auto;
  align-items: center;
  gap: 7px;
}

.shortage-actions select {
  min-width: 0;
}

.warehouse-replacement-note {
  display: block;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 5px;
  border-left: 3px solid #b67823;
  background: #fff8e9;
  color: #76531f;
  font-size: 11px;
  font-weight: 700;
}

.return-disposition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 5px;
  min-width: 210px;
}

.return-disposition-grid label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.return-disposition-grid input,
.return-disposition-grid output {
  width: 54px;
  min-height: 30px;
  padding: 5px;
  text-align: center;
}

.return-disposition-grid output {
  border: 1px solid #b8d6c8;
  border-radius: 5px;
  background: #f3faf6;
  color: var(--accent-dark);
  font-weight: 800;
}

.warehouse-free-scan {
  grid-template-columns: minmax(0, 1fr) auto;
}

.warehouse-free-scan small {
  color: var(--muted);
}

.unit-badge.picked {
  border-color: #d7c69c;
  background: #fff9ea;
}

.availability-mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(54px, 1fr));
  gap: 5px;
  min-width: 560px;
}

.availability-mini-calendar::before {
  content: none;
}

#inventoryAvailabilityDialog .dialog-form {
  width: min(820px, calc(100vw - 40px));
  overflow-x: auto;
}

.availability-day {
  display: grid;
  gap: 2px;
  min-height: 64px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7faf8;
}

.availability-day span,
.availability-day small {
  color: var(--muted);
  font-size: 11px;
}

.availability-day.partial {
  border-color: #dfc97c;
  background: #fffbee;
}

.availability-day.busy {
  border-color: #df9b90;
  background: #fff1ef;
}

.quick-warehouse-dialog .dialog-form {
  width: min(780px, calc(100vw - 36px));
}

.quick-warehouse-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-warehouse-mode {
  min-height: 58px;
  font-size: 17px;
  font-weight: 700;
}

.quick-warehouse-mode.active {
  color: #fff;
  border-color: #176b62;
  background: #176b62;
}

.quick-warehouse-code {
  min-height: 72px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.quick-warehouse-feedback {
  min-height: 64px;
  padding: 16px;
  border: 1px solid #b8d6c8;
  border-radius: 6px;
  background: #f3faf6;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.audit-scan-list {
  display: grid;
  gap: 6px;
  max-height: 330px;
  overflow: auto;
}

.audit-scan-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.audit-scan-row.found {
  border-color: #b8d6c8;
  background: #f3faf6;
}

.audit-scan-row.missing {
  border-color: #e6c3bc;
  background: #fff8f6;
}

.audit-scan-row.unexpected {
  border-color: #dfc97c;
  background: #fffbee;
}

.contractor-documents {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.contractor-document-add {
  grid-template-columns: 1.4fr .8fr .8fr 1.4fr auto;
}

.contractor-document-row > div {
  display: grid;
  gap: 3px;
}

.project-final-summary {
  display: grid;
  gap: 16px;
}

.final-summary-band {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.final-summary-band.ok {
  border-color: #b8d6c8;
  background: #f3faf6;
}

.final-summary-band.warn {
  border-color: #dfc97c;
  background: #fffbee;
}

.final-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.final-summary-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

@media (max-width: 1100px) {
  .global-search-shell {
    flex: 0 0 auto;
  }
}

@media (max-width: 720px) {
  .operation-card,
  .contractor-document-add,
  .final-summary-grid {
    grid-template-columns: 1fr;
  }

  .operation-card > select,
  .operation-card > button,
  .operation-card > a {
    width: 100%;
  }

  .shortage-actions,
  .warehouse-free-scan {
    grid-template-columns: minmax(0, 1fr);
  }

  .shortage-actions button,
  .warehouse-free-scan .row-actions,
  .warehouse-free-scan .row-actions button {
    width: 100%;
  }

  .return-disposition-grid {
    min-width: 190px;
  }

  .quick-warehouse-modes {
    grid-template-columns: 1fr;
  }

  .quick-warehouse-code {
    min-height: 64px;
    font-size: 18px;
  }

  .chain-card,
  .occupancy-card,
  .backup-create-row {
    grid-template-columns: 1fr;
  }

  .mobile-scan-actions {
    grid-template-columns: 1fr;
  }

  .notification-shell {
    width: 100%;
  }

  .notification-button {
    width: 100%;
  }

  .notification-panel {
    position: fixed;
    top: 82px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 100px);
  }

  .inventory-stock-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-bulk-bar {
    top: 4px;
  }

  .inventory-bulk-bar > * {
    flex: 1 1 calc(50% - 4px);
  }

  .inventory-bulk-bar strong {
    flex-basis: 100%;
  }

  .estimate-preset-grid {
    grid-template-columns: 1fr;
  }

  .version-chip {
    grid-template-columns: 1fr;
  }

  .version-actions > * {
    flex: 1;
  }
}

/* Final stability and mobile operations */
.settings-grid > *,
.project-final-summary > *,
.project-close-row > *,
.integrity-row > *,
.panel-head > *,
.section-head > * {
  min-width: 0;
}

.integrity-summary {
  margin-bottom: 12px;
}

.integrity-list,
.project-close-checklist {
  display: grid;
  gap: 8px;
}

.integrity-row,
.project-close-row {
  display: grid;
  grid-template-columns: minmax(110px, .4fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.integrity-row.bad,
.project-close-row.bad {
  border-color: #e3a49d;
  background: #fff6f4;
}

.integrity-row.warn {
  border-color: #dfc97c;
  background: #fffbee;
}

.integrity-row.ok,
.project-close-row.ok,
.integrity-empty {
  border-color: #b8d6c8;
  background: #f3faf6;
}

.integrity-row > span,
.integrity-row small,
.project-close-row small,
.integrity-empty span {
  color: var(--muted);
}

.integrity-row div,
.project-close-row div,
.integrity-empty {
  display: grid;
  gap: 3px;
}

.integrity-row b {
  max-width: 190px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.integrity-row strong,
.integrity-row small,
.integrity-row b,
.project-close-row strong,
.project-close-row small,
.integrity-empty {
  overflow-wrap: anywhere;
}

.integrity-empty {
  padding: 16px;
  border: 1px solid #b8d6c8;
  border-radius: 6px;
}

.project-close-form {
  width: min(840px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.project-close-row {
  grid-template-columns: 36px minmax(220px, 1fr) auto;
}

.project-close-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--danger);
  font-weight: 800;
}

.project-close-row.ok .project-close-mark {
  color: var(--accent-dark);
}

.mobile-inventory-dock {
  display: none;
}

.feature-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfa;
}

.feature-panel h4,
.warehouse-zone-card h5,
.supplier-offer-group h5 {
  margin: 0;
}

.scenario-controls,
.acceptance-photo-form,
.venue-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.venue-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.venue-form .wide-field {
  grid-column: span 2;
}

.feature-card-grid,
.warehouse-map,
.photo-acceptance-grid,
.call-sheet-grid,
.venue-list,
.profitability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.feature-card,
.warehouse-zone-card,
.acceptance-photo-card,
.call-sheet-card,
.call-sheet-venue,
.venue-card,
.profitability-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.feature-card,
.warehouse-zone-card,
.call-sheet-card,
.call-sheet-venue,
.venue-card,
.profitability-card {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.feature-card > div,
.venue-card > div,
.profitability-card > div,
.acceptance-photo-card > div,
.supplier-offer-row > div,
.incident-row > div {
  min-width: 0;
}

.feature-card span,
.feature-card small,
.warehouse-zone-card span,
.acceptance-photo-card span,
.acceptance-photo-card small,
.call-sheet-card span,
.call-sheet-card small,
.call-sheet-venue span,
.venue-card span,
.venue-card small,
.profitability-card span,
.profitability-card small,
.supplier-offer-row span,
.incident-row span,
.incident-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.project-kit-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) 130px auto auto minmax(240px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #b8d6c8;
  border-radius: 6px;
  background: #eef7f4;
}

.project-kit-preview {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.project-kit-preview-head,
.project-kit-preview-head > div {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.project-kit-preview-head > div {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.project-kit-preview-head span,
.project-kit-preview-items span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.project-kit-preview-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 5px 12px;
}

.project-kit-preview .bad,
.transport-capacity-cell .bad {
  color: var(--danger);
}

.project-kit-preview .ok {
  color: var(--accent-dark);
}

.estimate-venue-passport {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(160px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #a9cbc2;
  border-radius: 6px;
  background: #eef7f4;
}

.estimate-venue-passport > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.estimate-venue-passport span,
.estimate-venue-passport small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.venue-passport-readiness strong {
  color: var(--accent-dark);
  font-size: 20px;
}

.project-kit-toolbar label,
.rider-template-select {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rider-template-select {
  width: min(420px, 100%);
}

.warehouse-zone-card {
  position: relative;
  padding-left: 46px;
}

.warehouse-route-number {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-dark);
  color: #fff;
  font-weight: 800;
}

.warehouse-zone-card ul {
  display: grid;
  gap: 5px;
  margin: 2px 0 0;
  padding-left: 18px;
}

.acceptance-photo-card {
  position: relative;
  overflow: hidden;
}

.acceptance-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef2f0;
}

.acceptance-photo-card > div {
  display: grid;
  gap: 4px;
  padding: 10px 44px 12px 12px;
}

.acceptance-photo-card .delete-acceptance-photo {
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.call-sheet-venue {
  grid-column: 1 / -1;
  border-color: #a9cbc2;
  background: #eef7f4;
}

.call-sheet-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.call-sheet-card > b {
  display: grid;
  place-items: center;
  min-width: 52px;
  min-height: 34px;
  padding: 5px;
  border-radius: 4px;
  background: #e8f1ef;
  color: var(--accent-dark);
}

.call-sheet-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.load-plan-list,
.supplier-offer-list,
.incident-list {
  display: grid;
  gap: 8px;
}

.load-plan-row {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(130px, 1fr) 100px 100px 70px;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.transport-capacity-cell {
  min-width: 170px;
}

.transport-capacity-cell label {
  display: grid;
  grid-template-columns: 28px minmax(80px, 1fr);
  gap: 5px;
  align-items: center;
  margin-bottom: 4px;
}

.transport-capacity-cell small {
  display: block;
  color: var(--muted);
}

.load-plan-row > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #a9cbc2;
  border-radius: 50%;
  color: var(--accent-dark);
  font-weight: 800;
}

.load-plan-row > div,
.load-plan-row > label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.load-plan-row small {
  color: var(--muted);
}

.supplier-offer-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-left: 3px solid #9abdb5;
  background: #f7faf9;
}

.supplier-offer-row,
.incident-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, auto) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.supplier-offer-row.selected {
  border-color: var(--accent-dark);
  box-shadow: inset 3px 0 var(--accent-dark);
}

.technical-rider-preview {
  max-height: 460px;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  background: #fff;
  color: #161616;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.45;
}

.technical-rider-preview table {
  width: 100%;
  border-collapse: collapse;
}

.technical-rider-preview th,
.technical-rider-preview td {
  padding: 6px;
  border: 1px solid #222;
}

.incident-row {
  grid-template-columns: minmax(220px, 1fr) 130px 150px auto;
}

.incident-row.severity-critical,
.incident-row.severity-high {
  border-left: 4px solid var(--danger);
}

.incident-row.severity-medium {
  border-left: 4px solid #c18422;
}

.venue-card {
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto) auto;
}

.venue-card > div {
  display: grid;
  gap: 4px;
}

.venue-card > details {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.venue-card summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 700;
}

.venue-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.venue-edit-grid .wide-field {
  grid-column: span 2;
}

.compatibility-rule-form,
.rider-template-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.rider-template-form .wide-field {
  grid-column: span 2;
}

.rider-section-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
  margin: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.rider-section-picker legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.rider-section-picker label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  min-width: 120px;
  line-height: 1.25;
}

.rider-section-picker input,
.rule-toggle input {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.compatibility-rule-list,
.rider-template-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.compatibility-rule-card,
.rider-template-card {
  display: grid;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.compatibility-rule-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.rider-template-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.compatibility-rule-card strong,
.rider-template-card strong {
  font-weight: 700;
  line-height: 1.25;
}

.rider-template-card > .status {
  max-width: 120px;
  white-space: nowrap;
}

.compatibility-rule-card.disabled {
  opacity: .62;
}

.compatibility-rule-card > div,
.rider-template-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.compatibility-rule-card span,
.compatibility-rule-card small,
.rider-template-card span,
.rider-template-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.rule-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.compatibility-rule-card > details,
.rider-template-card > details {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.compatibility-rule-card summary,
.rider-template-card summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 700;
}

.compatibility-rule-edit,
.rider-template-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.rider-template-edit .rider-section-picker {
  grid-column: 1 / -1;
}

.technical-rider-preview > header,
.technical-rider-preview > footer {
  padding: 10px 0;
  border-bottom: 1px solid #bbb;
}

.technical-rider-preview > footer {
  border-top: 1px solid #bbb;
  border-bottom: 0;
  font-weight: 700;
}

.mobile-operations-dialog {
  width: min(620px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #8fb5ac;
  border-radius: 8px;
  background: #f4f7f5;
}

.mobile-operations-dialog::backdrop {
  background: rgba(16, 30, 26, .48);
}

.mobile-operations-shell {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 22px);
  padding: 14px;
  overflow-y: auto;
}

.mobile-operations-head {
  position: sticky;
  top: -14px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: -14px -14px 0;
  padding: 13px 14px;
  border-bottom: 1px solid #8fb5ac;
  background: #173e37;
  color: #fff;
}

.mobile-operations-head span {
  color: #ef5c4f;
  font-size: 11px;
  font-weight: 900;
}

.mobile-operations-head h3 {
  margin: 2px 0 0;
  color: #fff;
  font-size: 19px;
}

.mobile-operations-head .icon-button {
  border-color: rgba(255, 255, 255, .45);
  color: #fff;
}

.mobile-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mobile-operations-panel {
  display: none;
  gap: 12px;
}

.mobile-operations-panel.active {
  display: grid;
}

.mobile-scan-box {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 7px;
}

.mobile-operation-list {
  display: grid;
  gap: 8px;
}

.mobile-operation-card,
.mobile-task-card,
.mobile-venue-summary {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.mobile-operation-card > div,
.mobile-task-card > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mobile-operation-card span,
.mobile-task-card small,
.mobile-venue-summary span,
.mobile-venue-summary small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mobile-operation-progress,
.mobile-line-actions,
.mobile-venue-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.mobile-operation-progress span {
  padding: 7px;
  border-radius: 4px;
  background: #edf3f1;
  text-align: center;
}

.contact-card {
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
}

.contact-card > b {
  color: var(--accent-dark);
  font-size: 18px;
}

.mobile-task-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.profitability-card {
  align-content: start;
}

.profitability-card header,
.profitability-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.profitability-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e3e9e6;
}

.profitability-bar > i {
  display: block;
  height: 100%;
  max-width: 100%;
  background: var(--accent-dark);
}

dialog .dialog-actions {
  position: sticky;
  bottom: -22px;
  z-index: 2;
  margin: 0 -22px -22px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
}

.inventory-dialog .dialog-actions {
  min-width: 0;
  overflow: visible;
}

@media (max-width: 1100px) {
  .inventory-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .inventory-editor {
    max-height: calc(100dvh - 20px);
  }

  .item-equipment-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .estimate-venue-passport {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.panel a,
.work-item,
.operation-card,
.chain-card,
td,
th {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  #inventory.active {
    padding-bottom: 96px;
  }

  .item-equipment-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-inventory-dock {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 8px;
    border: 1px solid #9abdb5;
    border-radius: 8px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 8px 30px rgba(22, 44, 38, .2);
  }

  .mobile-inventory-dock input,
  .mobile-inventory-dock button {
    min-width: 0;
    min-height: 46px;
  }

  .project-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .project-tab {
    flex: 0 0 auto;
  }

  .integrity-row,
  .project-close-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .integrity-row b {
    max-width: none;
    text-align: left;
  }

  .project-close-row .open-close-check {
    width: 100%;
  }

  .project-close-mark {
    width: 28px;
    height: 28px;
  }

  .project-close-form {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  dialog .dialog-actions {
    bottom: -14px;
    margin: 0 -14px -14px;
    padding: 10px 14px max(10px, env(safe-area-inset-bottom));
  }

  .panel-head,
  .section-head {
    align-items: flex-start;
  }

  .panel-head > .stacked-actions,
  .section-head > .stacked-actions {
    width: 100%;
  }

  .scenario-controls,
  .acceptance-photo-form,
  .venue-form,
  .feature-card-grid,
  .warehouse-map,
  .photo-acceptance-grid,
  .call-sheet-grid,
  .venue-list,
  .profitability-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-kit-toolbar,
  .compatibility-rule-form,
  .rider-template-form,
  .compatibility-rule-list,
  .rider-template-list,
  .compatibility-rule-edit,
  .rider-template-edit {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-kit-preview-head,
  .project-kit-preview-head > div,
  .estimate-venue-passport {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .rider-template-form .wide-field,
  .rider-template-edit .rider-section-picker {
    grid-column: auto;
  }

  .mobile-operations-dialog {
    width: 100vw;
    max-width: none;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .mobile-operations-shell {
    min-height: 100dvh;
    max-height: 100dvh;
    padding: 12px 12px max(16px, env(safe-area-inset-bottom));
  }

  .mobile-operations-head {
    top: -12px;
    margin: -12px -12px 0;
    padding: max(12px, env(safe-area-inset-top)) 12px 12px;
  }

  .mobile-scan-box {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-scan-box input,
  .mobile-scan-box select,
  .mobile-scan-box button,
  .mobile-line-actions button,
  .mobile-venue-actions button {
    min-height: 48px;
  }

  .venue-form .wide-field,
  .venue-edit-grid .wide-field,
  .call-sheet-venue {
    grid-column: auto;
  }

  .load-plan-row,
  .supplier-offer-row,
  .incident-row,
  .venue-card,
  .venue-edit-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .load-plan-row > span {
    margin-bottom: 2px;
  }

  .supplier-offer-row button,
  .incident-row button,
  .load-plan-row input,
  .load-plan-row select {
    width: 100%;
  }

  .technical-rider-preview {
    padding: 12px;
    font-size: 13px;
  }
}

@media (max-width: 430px) {
  .mobile-inventory-dock {
    grid-template-columns: minmax(0, 1fr) repeat(2, 44px);
  }

  .mobile-inventory-dock button {
    width: 44px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  #mobileInventoryDockReceive::after {
    content: "+";
    font-size: 24px;
  }

  #mobileInventoryDockQuick::after {
    content: "⋯";
    font-size: 24px;
  }
}

.directory-form,
.directory-edit-grid,
.power-calculator-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.directory-form .wide-field,
.directory-edit-grid .wide-field {
  grid-column: span 2;
}

.compact-directory-form {
  grid-template-columns: minmax(220px, 1fr) 160px minmax(280px, 2fr) auto;
}

.directory-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.directory-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.directory-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, auto) 38px;
  gap: 8px;
  align-items: center;
}

.directory-card-head > div,
.directory-card-head strong,
.directory-card-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.directory-card-head > div {
  display: grid;
  gap: 3px;
}

.directory-card-head span,
.directory-card > small {
  color: var(--muted);
}

.directory-edit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fleet-directory-edit-grid,
.crew-directory-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.passport-details-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.directory-extra-fields {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.directory-extra-fields summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 700;
}

.directory-extra-fields[open] summary {
  margin-bottom: 10px;
}

.route-order-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-dark);
  color: #fff;
}

.power-calculator-controls {
  grid-template-columns: repeat(2, minmax(180px, 260px));
}

.power-consumer-list {
  display: grid;
  gap: 7px;
}

.power-consumer-row,
.power-missing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.power-consumer-row > div,
.power-missing {
  min-width: 0;
}

.power-consumer-row span,
.power-missing span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.power-missing {
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr);
  border-color: #d9bc7a;
  background: #fffaf0;
}

.defect-photo-pair {
  display: grid;
  grid-template-columns: repeat(2, 72px);
  gap: 6px;
}

.defect-photo-pair a,
.defect-photo-pair .missing-photo {
  display: grid;
  gap: 3px;
  align-content: start;
  min-height: 58px;
  font-size: 11px;
  text-align: center;
}

.defect-photo-pair img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.defect-photo-pair .missing-photo {
  place-items: center;
  padding: 6px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--muted);
}

.profitability-recommendation {
  padding: 7px 8px;
  border-radius: 4px;
  background: #edf3f1;
  color: var(--accent-dark) !important;
  font-weight: 700;
}

.profitability-card.decision-attention,
.profitability-card.decision-unused {
  border-color: #d9bc7a;
}

.profitability-card.decision-paid {
  border-color: #8bbcab;
}

.version-operation-diff {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.version-operation-diff article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.version-operation-diff span,
.version-operation-diff b {
  overflow-wrap: anywhere;
}

.version-operation-diff span {
  color: var(--muted);
  text-decoration: line-through;
}

.official-lookup-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #b8d3cc;
  border-radius: 6px;
  background: #f4faf8;
}

.official-lookup-panel h4,
.official-lookup-panel p {
  margin: 0;
}

.official-lookup-actions,
.verification-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.official-lookup-result {
  display: grid;
  gap: 8px;
}

.official-lookup-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #d0a64a;
  border-radius: 5px;
  background: #fff;
}

.official-lookup-card.ok {
  border-left-color: #37856f;
}

.official-lookup-card > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.official-lookup-card span,
.official-lookup-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.inventory-verification-panel {
  min-width: 0;
}

.verification-queue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.verification-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #d0a64a;
  border-radius: 6px;
  background: #fff;
}

.verification-card.ok {
  border-left-color: #37856f;
}

.verification-card.bad {
  border-left-color: #bc4b41;
}

.verification-card img,
.verification-photo-placeholder {
  width: 76px;
  height: 76px;
  grid-row: 1 / span 2;
  border: 1px solid var(--line);
  border-radius: 4px;
  object-fit: contain;
  background: #f3f5f4;
}

.verification-photo-placeholder {
  display: grid;
  place-items: center;
  padding: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.verification-card-body,
.verification-card-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.verification-card-title {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.verification-card-body > span,
.verification-card-body > small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.verification-card > button {
  grid-column: 2;
  justify-self: start;
}

.market-price-add-row {
  display: grid;
  grid-template-columns: 130px 130px minmax(150px, .8fr) minmax(220px, 1.4fr) 150px auto;
  gap: 8px;
  align-items: end;
}

.market-price-list {
  display: grid;
  gap: 8px;
}

.market-price-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.market-price-row > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.market-price-row span {
  color: var(--muted);
}

@media (max-width: 760px) {
  .directory-form,
  .compact-directory-form,
  .directory-edit-grid,
  .power-calculator-controls,
  .power-consumer-row,
  .power-missing,
  .directory-card-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .directory-form .wide-field,
  .directory-edit-grid .wide-field {
    grid-column: auto;
  }

  .directory-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .directory-card-head .icon-button {
    justify-self: end;
  }

  .defect-photo-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .official-lookup-card,
  .market-price-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .official-lookup-card > button {
    justify-self: stretch;
  }

  .verification-queue {
    grid-template-columns: minmax(0, 1fr);
  }

  .market-price-add-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.technical-workspace {
  min-width: 0;
}

.technical-head,
.technical-module-head,
.technical-subhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.technical-head-actions,
.technical-module-actions,
.technical-tabs,
.floor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.technical-plan-picker {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.technical-project-settings {
  margin-top: 10px;
  border-block: 1px solid var(--line);
}

.technical-project-settings > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 4px;
  color: #33413d;
  cursor: pointer;
  list-style-position: inside;
}

.technical-project-settings > summary > span:first-of-type {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.technical-project-settings > summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.technical-project-settings-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.technical-project-settings-summary b {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f5f7f6;
  color: #56635f;
  font-size: 11px;
  white-space: nowrap;
}

.technical-plan-meta {
  display: grid;
  grid-template-columns: 110px 110px 120px minmax(260px, auto) minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px 4px;
  border-top: 1px solid #edf0ee;
}

.technical-size-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.technical-size-presets > span {
  flex: 1 0 100%;
  color: #53605d;
  font-size: 12px;
}

.technical-size-presets button {
  min-height: 34px;
  padding: 5px 8px;
  white-space: nowrap;
}

.technical-tabs {
  margin: 18px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.technical-tabs button,
.floor-toolbar button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.technical-tabs button.active,
.floor-toolbar button.active {
  border-color: #147b72;
  background: #e9f5f2;
  color: #075d57;
}

.technical-content {
  min-width: 0;
}

.technical-empty,
.technical-no-data {
  min-height: 110px;
  display: grid;
  place-content: center;
  gap: 6px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.technical-empty strong {
  color: var(--ink);
}

.technical-module-head {
  margin-bottom: 12px;
}

.technical-module-head h4,
.technical-subhead h5 {
  margin: 0;
}

.technical-module-head p {
  margin: 4px 0 0;
}

.technical-subhead {
  align-items: center;
  margin: 18px 0 8px;
}

.technical-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.technical-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border-left: 3px solid #71837f;
  background: #f4f6f5;
}

.technical-metric span {
  color: var(--muted);
  font-size: 12px;
}

.technical-metric strong {
  overflow-wrap: anywhere;
}

.technical-metric.good {
  border-left-color: #187a56;
  background: #edf8f1;
}

.technical-metric.warn {
  border-left-color: #c38116;
  background: #fff8e8;
}

.technical-metric.bad {
  border-left-color: #b23a32;
  background: #fff0ef;
}

.technical-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 3px solid #b23a32;
  background: #fff0ef;
  color: #7e251f;
}

.technical-table-wrap {
  max-width: 100%;
}

.technical-table {
  min-width: 900px;
}

.technical-table th {
  white-space: nowrap;
}

.technical-table td {
  min-width: 118px;
  vertical-align: top;
}

.technical-table td:last-child {
  min-width: 44px;
  width: 44px;
}

.technical-table input,
.technical-table select {
  width: 100%;
  min-width: 105px;
}

.floor-commandbar,
.floor-layer-bar,
.floor-overlay-bar,
.floor-symbol-library {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #f7f9f8;
}

.floor-inventory-picker {
  display: grid;
  gap: 6px;
  min-width: min(340px, 100%);
}

.floor-inventory-picker select {
  width: 100%;
  min-width: 0;
}

.floor-inventory-browser {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.floor-inventory-browser-head {
  display: grid;
  grid-template-columns: minmax(190px, .7fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.floor-inventory-browser-head > div,
.floor-inventory-selected {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.floor-inspector-inventory-picker {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 7px;
  padding: 9px;
  border: 1px solid #cbd8d4;
  background: #f7faf9;
}

.floor-inspector-inventory-picker > strong {
  grid-column: 1 / -1;
}

.floor-inspector-inventory-picker label {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.floor-inspector-inventory-picker select {
  width: 100%;
  min-width: 0;
}

.floor-led-item-builder output {
  display: grid;
  align-content: end;
  gap: 3px;
  min-height: 54px;
  padding: 7px 9px;
  border-left: 3px solid var(--accent);
  background: #eef7f5;
}

.floor-led-item-builder output span {
  color: var(--muted);
  font-size: 11px;
}

.floor-inventory-browser-head span,
.floor-inventory-selected span,
.floor-inventory-selected small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.floor-inventory-browser-head input {
  width: 100%;
  min-width: 0;
}

.floor-inventory-selected {
  padding: 9px 10px;
  border-left: 3px solid var(--accent);
  background: #eef7f5;
}

.floor-inventory-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 7px;
}

.floor-inventory-category {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 72px;
  padding: 9px 10px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.floor-inventory-category:hover,
.floor-inventory-category.active {
  border-color: var(--accent);
  background: #eef7f5;
}

.floor-inventory-category span,
.floor-inventory-category small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.floor-inventory-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 7px;
  max-height: 330px;
  overflow: auto;
  padding: 2px;
}

.floor-inventory-result {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 70px;
  padding: 7px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.floor-inventory-result:hover,
.floor-inventory-result.active {
  border-color: var(--accent);
  background: #eef7f5;
}

.floor-inventory-result img,
.floor-inventory-result-placeholder {
  width: 58px;
  height: 52px;
  border: 1px solid #d4ddda;
  background: #f8faf9;
  object-fit: contain;
}

.floor-inventory-result-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.floor-inventory-result > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.floor-inventory-result strong,
.floor-inventory-result small {
  overflow-wrap: anywhere;
}

.floor-inventory-result small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.floor-model-coverage,
.floor-exact-model-mark {
  color: #176b62;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.floor-symbol-library > .floor-model-coverage {
  grid-column: 1 / -1;
}

.floor-commandbar {
  align-items: stretch;
  flex-direction: column;
  justify-content: space-between;
}

.floor-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 3px;
  margin: 8px 0;
  padding: 3px;
  border: 1px solid #aebbb7;
  background: #eef2f0;
}

.floor-view-switch button {
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: #4f5c59;
  font-weight: 800;
}

.floor-view-switch button.active {
  border-color: #6f817c;
  background: #fff;
  color: #173f3b;
}

.floor-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow-x: auto;
}

.floor-editor-mode {
  display: inline-grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid #aebbb7;
  background: #eef2f0;
}

.floor-editor-mode button {
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: #4f5c59;
  font-weight: 800;
}

.floor-editor-mode button.active {
  border-color: #6f817c;
  background: #fff;
  color: #173f3b;
}

.floor-command-tools,
.floor-view-tools,
.floor-symbol-groups,
.floor-symbol-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.floor-command-tools {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.floor-view-tools {
  min-width: 0;
  flex-wrap: wrap;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.floor-command-tools > button {
  flex: 0 0 auto;
  min-height: 32px;
}

.floor-action-menu {
  position: relative;
  flex: 0 0 auto;
}

.floor-action-menu > summary {
  display: flex;
  min-height: 34px;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid #bcc7c4;
  border-radius: 5px;
  background: #fff;
  color: #263532;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.floor-action-menu > summary::-webkit-details-marker {
  display: none;
}

.floor-action-menu > summary::after {
  margin-left: 7px;
  content: "▾";
  font-size: 9px;
}

.floor-action-menu > summary.active,
.floor-action-menu[open] > summary {
  border-color: #176f67;
  background: #e7f4f1;
  color: #07564f;
}

.floor-action-menu > div {
  position: absolute;
  z-index: 80;
  top: calc(100% + 4px);
  right: 0;
  display: grid;
  min-width: 190px;
  gap: 4px;
  padding: 6px;
  border: 1px solid #aebbb7;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(25, 43, 39, .16);
}

.floor-action-menu > div button {
  width: 100%;
  min-height: 32px;
  justify-content: flex-start;
  text-align: left;
}

.floor-tool-menu > div {
  right: auto;
  left: 0;
}

.floor-step-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: #53605d;
  font-size: 11px;
  white-space: nowrap;
}

.floor-cell-size-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: #25322f;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.floor-cell-size-control input {
  width: 64px;
  min-height: 30px;
  padding: 4px 6px;
  text-align: center;
}

.floor-cell-size-control button {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 11px;
}

.floor-step-control select {
  width: 76px;
  min-height: 30px;
  padding: 4px 22px 4px 6px;
  font-size: 11px;
}

.floor-grid-readout {
  flex: 0 0 auto;
  color: #53605d;
  font-size: 11px;
  white-space: nowrap;
}

.floor-command-tools button.active,
.floor-symbol-groups button.active,
.floor-symbol-button.active {
  border-color: #126f67;
  background: #e7f4f1;
  color: #07564f;
}

.floor-layer-bar {
  flex-wrap: nowrap;
  overflow-x: auto;
  border-top: 0;
  font-size: 12px;
  overscroll-behavior-inline: contain;
}

.floor-overlay-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
  font-size: 12px;
}

.floor-overlay-bar > span { flex: 0 0 auto; font-weight: 800; }
.floor-overlay-bar label { display: flex; flex: 0 0 auto; gap: 5px; align-items: center; margin: 0; white-space: nowrap; }

.floor-layer-bar > span {
  flex: 0 0 auto;
  margin-right: 4px;
  font-weight: 800;
}

.floor-layer-chip {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 3px 5px 3px 8px;
  border: 1px solid #cbd5d2;
  background: #fff;
}

.floor-layer-chip.locked {
  border-style: dashed;
  background: #f0f2f1;
}

.floor-layer-chip label {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  min-width: max-content;
  margin: 0;
  white-space: nowrap;
}

.floor-layer-chip label span {
  display: block;
  min-width: max-content;
}

.floor-layer-chip .icon-button,
.floor-layer-chip input[type="color"] {
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 2px;
  font-size: 10px;
}

.floor-layer-chip .floor-layer-lock {
  font-size: 14px;
  line-height: 1;
}

.floor-symbol-library {
  display: grid;
  grid-template-columns: minmax(170px, 240px) minmax(0, 1fr) minmax(220px, 320px);
  border-top: 0;
}

.floor-symbol-groups {
  grid-column: 1 / -1;
  overflow-x: auto;
  padding-bottom: 2px;
}

.floor-symbol-groups button {
  flex: 0 0 auto;
  padding: 7px 10px;
  font-size: 12px;
}

.floor-symbol-buttons {
  align-items: stretch;
  overflow-x: auto;
  padding: 2px 0;
}

.floor-symbol-button {
  display: grid;
  flex: 0 0 104px;
  grid-template-rows: 46px auto;
  place-items: center;
  gap: 4px;
  min-height: 82px;
  padding: 6px;
  color: #293633;
}

.floor-symbol-button[hidden] {
  display: none;
}

.floor-symbol-button span {
  max-width: 94px;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

.floor-symbol-button .floor-symbol-svg {
  width: 44px;
  height: 44px;
  stroke-width: 1.45;
}

.floor-symbol-library select {
  width: 100%;
}

.floor-symbol-library > input {
  width: 100%;
  min-width: 0;
}

.floor-simple-library {
  display: block;
  padding: 0;
  border-top: 0;
}

.floor-simple-library > summary {
  padding: 10px 12px;
  color: #173f3b;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.floor-simple-library > .floor-inventory-browser {
  padding: 10px;
}

.floor-editor-simple .floor-inspector > details:not([open]),
.floor-editor-simple .floor-exact-model-mark {
  display: none;
}

.floor-wall-options {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  padding: 8px 10px;
  border-top: 1px solid #cbd5d2;
  border-bottom: 1px solid #cbd5d2;
  background: #f7faf9;
}

.floor-led-builder {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(110px, .45fr)) minmax(180px, .8fr);
  align-items: end;
  gap: 9px;
  padding: 10px;
  border-top: 1px solid #cbd5d2;
  border-bottom: 1px solid #cbd5d2;
  background: #edf6f4;
}

.floor-led-builder > div,
.floor-led-builder output {
  display: grid;
  gap: 3px;
}

.floor-led-builder label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}

.floor-led-builder input,
.floor-led-builder select {
  width: 100%;
  min-width: 0;
}

.floor-led-builder output span,
.floor-led-builder > div span {
  color: var(--muted);
  font-size: 11px;
}

.floor-led-builder .field-help {
  grid-column: 1 / -1;
}

.floor-wall-options label {
  display: grid;
  gap: 3px;
  color: #53605d;
  font-size: 11px;
}

.floor-wall-options select,
.floor-wall-options input {
  width: 128px;
  min-height: 32px;
  padding: 5px 7px;
}

.floor-wall-options span {
  align-self: center;
  color: #66716e;
  font-size: 11px;
}

.floor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.floor-navigation-options {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  padding: 7px 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-top: 0;
  background: #f7faf9;
  white-space: nowrap;
}

.floor-plan-viewport {
  position: relative;
  min-width: 0;
}

.floor-plan-scroll {
  width: 100%;
  min-height: 430px;
  max-height: 76vh;
  overflow: auto;
  border: 1px solid #94a29f;
  background: #e9eeec;
}

.floor-minimap {
  position: absolute;
  z-index: 40;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 3px;
  width: 176px;
  padding: 6px;
  border: 1px solid #62716d;
  border-radius: 4px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 3px 14px rgba(28, 42, 38, .18);
  color: #263532;
}

.floor-minimap svg {
  width: 100%;
  height: 94px;
  border: 1px solid #ccd5d2;
}

.floor-minimap span { font-size: 10px; text-align: left; }
.floor-minimap-sheet { fill: #f8faf9; }
.floor-minimap-walls line { stroke: #283632; stroke-width: .12; vector-effect: non-scaling-stroke; }
.floor-minimap-items rect { fill: #2a726a; opacity: .6; }
.floor-minimap-items .layer-light { fill: #aa6818; }
.floor-minimap-items .layer-sound { fill: #176b62; }
.floor-minimap-items .layer-video { fill: #315f9b; }
.floor-minimap-items .layer-rigging { fill: #a43732; }
.floor-minimap-viewport { fill: rgba(208, 111, 0, .08); stroke: #d06f00; stroke-width: 2px; vector-effect: non-scaling-stroke; }

.floor-plan-canvas {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  border: 2px solid #3e514e;
  background-color: #fbfcfc;
  background-image: linear-gradient(rgba(20, 42, 38, .14) 1px, transparent 1px), linear-gradient(90deg, rgba(20, 42, 38, .14) 1px, transparent 1px);
  background-size: var(--floor-grid-x) var(--floor-grid-y), var(--floor-grid-x) var(--floor-grid-y);
  background-position: 0 0, 0 0, center;
  background-repeat: repeat, repeat, no-repeat;
  touch-action: none;
  cursor: crosshair;
}

.floor-plan-canvas.pan-mode { cursor: grab; }
.floor-plan-canvas.pan-mode.panning { cursor: grabbing; }

.floor-3d-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 8px;
}

.floor-3d-toolbar > label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: #56635f;
  font-size: 11px;
  white-space: nowrap;
}

.floor-3d-toolbar > label select,
.floor-3d-toolbar > label input[type="number"] {
  width: 108px;
  min-height: 34px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.floor-3d-toolbar > span {
  margin-right: auto;
  color: #5f6b68;
  font-size: 12px;
}

.floor-3d-transform-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #b9c5c1;
}

.floor-3d-transform-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 0;
}

.floor-3d-transform-switch button + button {
  border-left: 1px solid #b9c5c1;
}

.floor-3d-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
}

.floor-3d-viewport {
  position: relative;
  width: 100%;
  height: min(72vh, 760px);
  min-height: 520px;
  overflow: hidden;
  background: #f4f7f6;
  cursor: grab;
  touch-action: none;
}

.floor-3d-viewport:active {
  cursor: grabbing;
}

.floor-3d-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.floor-3d-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #5d6966;
  font-weight: 700;
}

.floor-3d-status {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 7px;
  border: 1px solid #aebbb7;
  background: rgba(255, 255, 255, .9);
  color: #45524f;
  font-size: 10px;
  pointer-events: none;
}

.floor-centerline {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: .48;
}

.floor-centerline-x {
  top: 50%;
  right: 0;
  left: 0;
  border-top: 1px dashed #b4463d;
}

.floor-centerline-y {
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px dashed #b4463d;
}

.floor-wall-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.floor-dimension-draft-layer {
  position: absolute;
  z-index: 9;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.floor-dimension-draft {
  fill: #fff;
  stroke: #c2760a;
  stroke-width: .055;
  stroke-dasharray: .16 .08;
}

.floor-dimension-draft circle {
  stroke-width: .08;
}

.floor-dimension-draft text {
  fill: #6d3c00;
  stroke: #fff;
  stroke-width: .16;
  paint-order: stroke;
  font-size: .4px;
  font-weight: 800;
}

.floor-cable-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.floor-cable-visible {
  fill: none;
  stroke-width: 2px;
  stroke-dasharray: 8px 5px;
  vector-effect: non-scaling-stroke;
}

.floor-cable-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14px;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  pointer-events: stroke;
}

.floor-cable.selected .floor-cable-visible {
  stroke-width: 3px;
  filter: drop-shadow(0 0 1px #d78a16);
}

.floor-cable-label {
  fill: #17211f;
  stroke: #fff;
  stroke-width: .12;
  paint-order: stroke;
  font-size: .24px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: all;
}

.floor-cable.selected .floor-cable-label {
  fill: #8a4a00;
  stroke-width: .16;
}

.floor-cable-handle,
.floor-cable-draft circle {
  fill: #fff;
  stroke: #c2760a;
  stroke-width: .1;
  cursor: move;
  pointer-events: all;
}

.floor-wall-visible {
  stroke-linecap: square;
}

.floor-wall-shell {
  stroke: none;
}

.floor-wall-core {
  pointer-events: none;
}

.floor-wall-partition .floor-wall-shell {
  opacity: .82;
}

.floor-wall-barrier {
  fill: none;
  stroke-width: .08;
  stroke-dasharray: .28 .14;
  vector-effect: non-scaling-stroke;
}

.floor-wall-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14px;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  pointer-events: stroke;
}

.floor-wall.selected .floor-wall-shell {
  filter: drop-shadow(0 0 .12px #176f67);
  fill: #176f67;
}

.floor-wall.selected .floor-wall-barrier {
  filter: drop-shadow(0 0 .12px #176f67);
  stroke: #176f67;
}

.floor-wall.locked .floor-wall-hit {
  cursor: not-allowed;
}

.floor-wall-handle,
.floor-wall-draft circle {
  fill: #fff;
  stroke: #176f67;
  stroke-width: .1;
  cursor: move;
}

.floor-wall-length {
  fill: #17211f;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: .18;
  font-size: .42px;
  font-weight: 800;
  pointer-events: none;
}

.floor-wall-draft {
  fill: none;
  stroke: #c2760a;
  stroke-width: .06;
  stroke-dasharray: .18 .1;
  pointer-events: none;
}

.floor-room-resize rect {
  fill: rgba(23, 111, 103, .035);
  stroke: #176f67;
  stroke-width: .035;
  stroke-dasharray: .16 .1;
  cursor: move;
  pointer-events: fill;
}

.floor-room-resize circle {
  fill: #fff;
  stroke: #176f67;
  stroke-width: .1;
  cursor: nwse-resize;
  pointer-events: all;
}

.floor-room-resize circle[data-room-handle="ne"],
.floor-room-resize circle[data-room-handle="sw"] {
  cursor: nesw-resize;
}

.floor-room-resize text {
  fill: #15564f;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: .16;
  font-size: .4px;
  font-weight: 800;
  pointer-events: none;
}

.floor-selection-marquee {
  position: absolute;
  z-index: 70;
  border: 1px solid #176f67;
  background: rgba(23, 111, 103, .12);
  pointer-events: none;
}

.floor-selection-marquee[hidden] {
  display: none;
}

.floor-plan-item {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: color-mix(in srgb, var(--floor-item-color, #173f3b) calc(var(--floor-fill-opacity, 0) * 100%), transparent);
  color: var(--floor-item-color, #173f3b);
  cursor: grab;
  overflow: visible;
  touch-action: none;
}

.floor-background-layer {
  position: absolute;
  z-index: 0;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.floor-background-tools,
.floor-smart-tools {
  border: 1px solid var(--line);
  border-top: 0;
  background: #fbfcfc;
}

.floor-background-tools > summary,
.floor-smart-tools > summary {
  padding: 8px 10px;
  color: #28433f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.floor-background-grid,
.floor-smart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.floor-background-grid label,
.floor-smart-grid label {
  display: grid;
  gap: 3px;
  color: #53605d;
  font-size: 11px;
}

.floor-background-grid input,
.floor-smart-grid input {
  width: 100%;
  min-width: 0;
}

.floor-background-tools > .field-help {
  display: block;
  padding: 0 10px 10px;
}

.floor-smart-grid fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 9px;
  border: 1px solid #cbd5d2;
}

.floor-smart-grid fieldset button,
.floor-smart-grid fieldset legend {
  grid-column: 1 / -1;
}

.floor-smart-grid fieldset legend {
  padding: 0 5px;
  color: #28433f;
  font-size: 12px;
  font-weight: 800;
}

.floor-plan-health {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 8px 0;
  padding: 6px 0;
  border-block: 1px solid var(--line);
}

.floor-health-metrics,
.floor-health-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.floor-health-actions {
  justify-content: flex-end;
}

.floor-health-metrics > span,
.floor-health-actions > span {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  min-height: 30px;
  padding: 6px 8px;
  border-left: 3px solid #71837f;
  background: #f3f6f5;
  color: #53605d;
  font-size: 11px;
}

.floor-health-actions > button,
.floor-health-metrics > button {
  min-height: 30px;
  border-left: 3px solid #71837f;
  border-radius: 3px;
  font-size: 11px;
}

.floor-plan-health .good { border-left-color: #187a56; background: #edf8f1; }
.floor-plan-health .warn { border-left-color: #c38116; background: #fff8e8; }
.floor-plan-health .bad { border-left-color: #b23a32; background: #fff0ef; }

.floor-assembly-dock {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(150px, .7fr) repeat(5, minmax(110px, 1fr));
  align-items: stretch;
  gap: 0;
  margin: 8px 0;
  border: 1px solid var(--line);
  background: #fff;
}

.floor-assembly-dock-head {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px 11px;
  background: #f2f6f4;
}

.floor-assembly-dock-head span,
.floor-assembly-button span {
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.floor-assembly-button {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.floor-assembly-dock-head + .floor-assembly-button {
  border-left: 0;
}

.floor-assembly-button:hover,
.floor-assembly-button:focus-visible {
  background: #eaf5f2;
  color: #075d57;
}

.floor-safety-zone rect {
  vector-effect: non-scaling-stroke;
  stroke-width: .045;
  stroke-dasharray: .16 .1;
}

.floor-safety-door rect {
  fill: #b43d32;
  fill-opacity: .1;
  stroke: #a8342b;
}

.floor-safety-passage rect {
  fill: #19765b;
  fill-opacity: .08;
  stroke: #19765b;
}

.floor-safety-zone text {
  fill: #8d2e27;
  stroke: #fff;
  stroke-width: .08;
  paint-order: stroke;
  font-size: .2px;
  font-weight: 800;
  pointer-events: none;
}

.floor-smart-grid-overlay {
  position: absolute;
  z-index: 1;
  inset: 2px;
  border: 1px solid color-mix(in srgb, currentColor 60%, transparent);
  background-image:
    linear-gradient(90deg, color-mix(in srgb, currentColor 42%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, currentColor 42%, transparent) 1px, transparent 1px);
  background-size: calc(100% / var(--smart-columns)) 100%, 100% calc(100% / var(--smart-rows));
  pointer-events: none;
}

.floor-revision-list {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.floor-revision-list button {
  display: grid;
  gap: 2px;
  justify-items: start;
  width: 100%;
  text-align: left;
}

.floor-revision-list button span {
  color: var(--muted);
  font-size: 10px;
}

.floor-plan-item::before {
  position: absolute;
  z-index: 0;
  inset: -6px;
  content: "";
}

.floor-plan-item:active {
  cursor: grabbing;
}

.floor-plan-item.locked {
  cursor: not-allowed;
  opacity: .82;
}

.floor-plan-item.selected {
  z-index: 3;
  outline: 2px solid #176f67;
  outline-offset: 3px;
  background: color-mix(in srgb, var(--floor-item-color, #173f3b) calc(var(--floor-fill-opacity, 0) * 100%), transparent);
}

.floor-selection-badge {
  position: absolute;
  top: -29px;
  left: -4px;
  z-index: 8;
  width: max-content;
  max-width: 190px;
  padding: 3px 5px;
  border: 1px solid #176f67;
  background: rgba(255, 255, 255, .96);
  color: #15564f;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  pointer-events: none;
  transform: rotate(var(--floor-item-counter-rotation));
  transform-origin: left bottom;
}

.floor-plan-item.floor-layer-markup {
  background: transparent;
}

.floor-plan-item.floor-layer-markup.selected {
  background: transparent;
}

.floor-plan-item.floor-layer-markup .shape-fill {
  fill: color-mix(in srgb, var(--floor-item-color, #75549a) calc(var(--floor-fill-opacity, .16) * 100%), transparent);
}

.floor-area-readout {
  position: absolute;
  z-index: 3;
  bottom: 4px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 8px);
  padding: 1px 4px;
  border: 1px solid rgba(78, 92, 88, .3);
  background: rgba(255, 255, 255, .9);
  color: #17211f;
  font: 800 9px/1.25 Arial, sans-serif;
  transform: translateX(-50%) rotate(var(--floor-item-counter-rotation, 0deg));
  white-space: nowrap;
  pointer-events: none;
}

.floor-area-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-left: 3px solid #75549a;
  background: #f5f1f8;
  color: #49345f;
}

.floor-area-summary strong {
  font-size: 16px;
}

.floor-area-summary span {
  color: #655d6c;
  font-size: 11px;
}

.floor-inspector-markup .floor-equipment-only {
  display: none;
}

.floor-plan-item.overloaded {
  outline: 3px solid #b1322b;
  outline-offset: 3px;
}

.floor-plan-item.collision {
  outline: 3px solid #b23a32;
  outline-offset: 4px;
  background: rgba(178, 58, 50, .09);
}

.floor-collision-warning {
  position: absolute;
  right: -12px;
  bottom: -12px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #b23a32;
  color: #fff;
  font: 800 12px/1 Arial, sans-serif;
}

.floor-snap-guide {
  position: absolute;
  z-index: 12;
  background: #d06f00;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .72);
  pointer-events: none;
}

.floor-snap-guide.x { top: 0; bottom: 0; width: 1px; }
.floor-snap-guide.y { right: 0; left: 0; height: 1px; }
.floor-snap-guide.point { width: 14px; height: 14px; transform: translate(-50%, -50%); border: 2px solid #a63d38; border-radius: 50%; background: rgba(255, 255, 255, .72); box-shadow: 0 0 0 3px rgba(166, 61, 56, .16); }
.floor-snap-guide.center { background: #2874aa; }
.floor-snap-guide.wall { background: #853b98; }
.floor-snap-cue { position: sticky; z-index: 30; top: 24px; left: 28px; display: block; width: max-content; max-width: 360px; padding: 5px 7px; border: 1px solid #d06f00; background: rgba(255, 252, 244, .94); color: #683900; font-size: 10px; font-weight: 700; line-height: 1.25; pointer-events: none; }

.floor-coverage-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.floor-rigging-link {
  fill: none;
  stroke: #9a342e;
  stroke-width: .035;
  stroke-dasharray: .16 .1;
  vector-effect: non-scaling-stroke;
}

.floor-rigging-load {
  fill: #8d2c27;
  stroke: rgba(255, 255, 255, .96);
  stroke-width: .08;
  paint-order: stroke fill;
  font-size: .22px;
  font-weight: 800;
}

.floor-rigging-node { fill: #fff; stroke: #9a342e; stroke-width: .08; vector-effect: non-scaling-stroke; }

.floor-field-ready {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #16704f;
  border-radius: 50%;
  background: #fff;
  color: #16704f;
  font: 700 12px/1 Arial, sans-serif;
}

.engineering-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.engineering-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d2dbd7;
  border-radius: 6px;
  background: #fff;
}

.engineering-card h5 {
  margin: 0 0 10px;
  font-size: 15px;
}

.engineering-card p {
  margin: 9px 0;
  color: #5d6966;
}

.engineering-wide {
  grid-column: span 2;
}

.engineering-settings,
.engineering-actions,
.engineering-sheet-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.engineering-settings label,
.engineering-card > label {
  display: grid;
  gap: 4px;
  min-width: 120px;
  color: #596562;
  font-size: 12px;
}

.engineering-settings input,
.engineering-card > label input {
  min-width: 0;
}

.engineering-issues,
.engineering-mini-list,
.engineering-field-list {
  display: grid;
  gap: 6px;
}

.engineering-issue {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid #d3dbd8;
  border-left-width: 4px;
  border-radius: 4px;
  background: #fff;
  color: #24302e;
  text-align: left;
}

.engineering-issue.error { border-left-color: #b23a32; background: #fff5f4; }
.engineering-issue.warning { border-left-color: #b97811; background: #fff9ec; }
.engineering-issue.info { border-left-color: #347098; background: #f2f8fc; }
.engineering-issue span,
.engineering-issue small { color: #67716f; font-size: 11px; }
.engineering-issue strong { overflow-wrap: anywhere; }

.engineering-mini-list span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-left: 3px solid #aab4b1;
  background: #f5f7f6;
  font-size: 12px;
}

.engineering-mini-list span.good { border-left-color: #187a56; }
.engineering-mini-list span.bad { border-left-color: #b23a32; }
.engineering-mini-list strong { overflow-wrap: anywhere; }

.engineering-assembly-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.engineering-assembly-list button {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid #cbd5d1;
  border-radius: 5px;
  background: #f8faf9;
  color: #1f2c29;
  text-align: left;
}

.engineering-assembly-list button:hover { border-color: #176b62; background: #edf7f5; }
.engineering-assembly-list span { color: #64706d; font-size: 11px; }

.engineering-elevations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.engineering-elevations > div {
  min-width: 0;
  border: 1px solid #d6ddda;
  background: #fff;
}

.engineering-elevations span {
  display: block;
  padding: 6px 8px;
  border-bottom: 1px solid #d6ddda;
  color: #5b6764;
  font-size: 12px;
}

.engineering-elevations svg {
  display: block;
  width: 100%;
  height: 230px;
}

.engineering-sheet-checks label {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 12px;
}

.engineering-diff {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}

.engineering-diff span {
  padding: 5px 8px;
  border: 1px solid #cad4d0;
  border-radius: 4px;
  background: #f4f7f6;
  font-weight: 700;
}

.engineering-field-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.engineering-field-list article {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #d1dad6;
  border-radius: 5px;
}

.engineering-field-list article > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.engineering-field-list article > div:first-child {
  grid-template-columns: minmax(0, 1fr);
}

.engineering-field-list article > div:first-child span,
.engineering-field-list article > div:first-child small {
  color: #61706c;
  overflow-wrap: anywhere;
}

.engineering-field-list button {
  min-height: 34px;
  padding: 5px;
  font-size: 11px;
}

.engineering-progress {
  height: 8px;
  margin: 9px 0 12px;
  overflow: hidden;
  border-radius: 4px;
  background: #dfe6e3;
}

.engineering-progress span {
  display: block;
  height: 100%;
  background: #187a56;
  transition: width .18s ease;
}

.engineering-installation-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.engineering-installation-preview span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #d3dbd8;
  background: #f8faf9;
}

.engineering-installation-preview b,
.engineering-installation-preview small { overflow-wrap: anywhere; }
.engineering-installation-preview small { color: #63706c; font-size: 11px; }

.engineering-field-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 8px;
  margin-top: 10px;
}

.engineering-field-filters label {
  display: grid;
  gap: 4px;
  color: #596562;
  font-size: 12px;
}

.engineering-model-queue {
  display: grid;
  gap: 6px;
  max-height: 430px;
  overflow: auto;
}

.engineering-model-queue article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, 160px);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d3dbd8;
  background: #f8faf9;
}

.engineering-model-queue article > div {
  display: grid;
  min-width: 0;
}

.engineering-model-queue strong,
.engineering-model-queue span {
  overflow-wrap: anywhere;
}

.engineering-model-queue span {
  color: #68736f;
  font-size: 11px;
}

.engineering-model-queue b {
  color: #596562;
  font-size: 11px;
  white-space: nowrap;
}

.engineering-model-filters {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.engineering-model-filters label {
  display: grid;
  gap: 4px;
  min-width: min(320px, 100%);
  color: #596562;
  font-size: 12px;
}

.engineering-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 620px;
  overflow: auto;
}

.engineering-model-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) minmax(120px, 150px);
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 92px;
  padding: 8px;
  border: 1px solid #d3dbd8;
  border-left: 4px solid #89938f;
  background: #fafbfb;
}

.engineering-model-card.match { border-left-color: #187a56; }
.engineering-model-card.review { border-left-color: #b97811; }
.engineering-model-card.mismatch { border-left-color: #b23a32; }
.engineering-model-card.missing { border-left-color: #347098; }

.engineering-model-card img,
.engineering-model-placeholder {
  width: 74px;
  height: 74px;
  border: 1px solid #d7dfdc;
  background: #fff;
  object-fit: contain;
}

.engineering-model-placeholder {
  display: grid;
  place-items: center;
  color: #76817d;
  font-weight: 800;
}

.engineering-model-main,
.engineering-model-state {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.engineering-model-main > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.engineering-model-main strong,
.engineering-model-main span,
.engineering-model-main small,
.engineering-model-state small { overflow-wrap: anywhere; }
.engineering-model-main span,
.engineering-model-main small,
.engineering-model-state small { color: #65716d; font-size: 11px; }
.model-used { padding: 2px 5px; background: #e4f2ef; color: #176b62; font-size: 10px; }
.engineering-model-state b { color: #596562; font-size: 11px; }
.engineering-model-state .good { color: #187a56; }

@media (max-width: 1100px) {
  .engineering-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .engineering-assembly-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 719px) {
  .engineering-layout { grid-template-columns: 1fr; }
  .engineering-wide { grid-column: auto; }
  .engineering-elevations { grid-template-columns: 1fr; }
  .engineering-assembly-list { grid-template-columns: 1fr; }
  .engineering-issue { grid-template-columns: 68px minmax(0, 1fr); }
  .engineering-issue small { display: none; }
  .engineering-field-list { grid-template-columns: 1fr; }
  .engineering-field-list article > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .engineering-field-list article > div:first-child { grid-template-columns: minmax(0, 1fr); }
  .engineering-field-filters { grid-template-columns: minmax(0, 1fr); }
  .engineering-installation-preview { grid-template-columns: 1fr; }
  .engineering-model-queue article { grid-template-columns: minmax(0, 1fr); }
  .engineering-model-grid { grid-template-columns: 1fr; max-height: none; }
  .engineering-model-card { grid-template-columns: 60px minmax(0, 1fr); }
  .engineering-model-card img,
  .engineering-model-placeholder { width: 60px; height: 60px; }
  .engineering-model-state { grid-column: 1 / -1; }
  .engineering-field-mode { margin: 0 -6px; padding: 10px; }
  .engineering-field-list button { min-height: 46px; font-size: 12px; }
}

.floor-plan-item.floor-line-dashed .floor-symbol-svg {
  stroke-dasharray: 11 7;
}

.floor-plan-item.floor-line-dotted .floor-symbol-svg {
  stroke-dasharray: 2 7;
}

.floor-resize-handle,
.floor-rotate-handle {
  position: absolute;
  z-index: 7;
  display: block;
  width: 10px;
  height: 10px;
  border: 2px solid #176f67;
  background: #fff;
  pointer-events: auto;
}

.floor-resize-handle.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.floor-resize-handle.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.floor-resize-handle.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.floor-resize-handle.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }

.floor-rotate-handle {
  top: -28px;
  left: 50%;
  border-radius: 50%;
  cursor: grab;
  transform: translateX(-50%);
}

.floor-rotate-handle::before {
  position: absolute;
  inset: -6px;
  display: grid;
  place-items: center;
  color: #15564f;
  content: "↻";
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.floor-rotate-handle::after {
  position: absolute;
  top: 8px;
  left: 2px;
  width: 2px;
  height: 14px;
  background: #176f67;
  content: "";
}

.floor-load-warning {
  position: absolute;
  top: -12px;
  right: -12px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #b1322b;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.floor-symbol-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  background: transparent;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: square;
  stroke-linejoin: miter;
  shape-rendering: geometricPrecision;
}

.floor-exact-top-view {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  pointer-events: none;
  user-select: none;
}

.floor-connection-point {
  position: absolute;
  z-index: 6;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #42504d;
  box-shadow: 0 0 0 1px #42504d;
  opacity: .22;
  transform: translate(-50%, -50%);
  transition: opacity .12s ease, transform .12s ease;
}

.floor-plan-item:hover .floor-connection-point,
.floor-plan-item.selected .floor-connection-point,
.floor-commandbar:has([data-floor-tool="cable"].active) ~ .floor-workspace .floor-connection-point {
  opacity: 1;
}

.floor-connection-point:hover {
  transform: translate(-50%, -50%) scale(1.45);
}

.floor-port-power { background: #bd6b00; box-shadow: 0 0 0 1px #bd6b00; }
.floor-port-audio { background: #14735e; box-shadow: 0 0 0 1px #14735e; }
.floor-port-video { background: #23659a; box-shadow: 0 0 0 1px #23659a; }
.floor-port-dmx { background: #8b56a5; box-shadow: 0 0 0 1px #8b56a5; }
.floor-port-network { background: #3f6bb5; box-shadow: 0 0 0 1px #3f6bb5; }
.floor-port-rigging,
.floor-port-mechanical { border-radius: 1px; background: #b23a32; box-shadow: 0 0 0 1px #b23a32; }

.floor-symbol-svg-cad {
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floor-symbol-svg-cad .cad-symbol-body,
.floor-symbol-svg-cad .cad-symbol-body * {
  fill: none;
}

.floor-plan-item.floor-layer-markup .floor-symbol-svg-cad .cad-symbol-body .shape-fill,
.floor-symbol-button .floor-symbol-svg-cad .cad-symbol-body .shape-fill {
  fill: color-mix(in srgb, currentColor 14%, transparent);
}

.floor-symbol-svg-cad .cad-construction {
  opacity: .42;
  stroke-width: .8;
}

.floor-symbol-svg-cad .cad-symbol-code {
  fill: currentColor;
  stroke: rgba(255, 255, 255, .96);
  stroke-width: 3.4px;
  paint-order: stroke fill;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  pointer-events: none;
}

.floor-symbol-button .cad-symbol-code,
.floor-legend-symbol .cad-symbol-code {
  font-size: 16px;
  stroke-width: 4.5px;
}

.floor-symbol-svg * {
  vector-effect: non-scaling-stroke;
}

.floor-plan-item b {
  position: absolute;
  top: calc(100% + var(--floor-label-offset, 4px));
  left: 50%;
  width: max-content;
  max-width: 180px;
  padding: 1px 3px;
  border: 1px solid rgba(78, 92, 88, .35);
  background: rgba(255, 255, 255, .92);
  color: #17211f;
  font-size: var(--floor-label-size, 9px);
  line-height: 1.2;
  transform: translateX(-50%) rotate(var(--floor-item-counter-rotation, 0deg));
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.floor-plan-item.floor-label-top b {
  top: auto;
  bottom: calc(100% + var(--floor-label-offset, 4px));
}

.floor-plan-item.floor-label-left b {
  top: 50%;
  right: calc(100% + var(--floor-label-offset, 4px));
  left: auto;
  transform: translateY(-50%) rotate(var(--floor-item-counter-rotation, 0deg));
}

.floor-plan-item.floor-label-right b {
  top: 50%;
  left: calc(100% + var(--floor-label-offset, 4px));
  transform: translateY(-50%) rotate(var(--floor-item-counter-rotation, 0deg));
}

.floor-plan-item.floor-label-inside b {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(var(--floor-item-counter-rotation, 0deg));
}

.floor-plan-item.floor-label-decluttered b {
  display: none;
}

.floor-plan-legend {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 5px;
  min-width: 120px;
  max-width: 60%;
  padding: 7px;
  border: 1px solid #566562;
  border-radius: 2px;
  box-shadow: 0 1px 5px rgba(24, 39, 35, .15);
  color: #17211f;
  font-size: var(--floor-legend-font, 10px);
  line-height: 1.15;
  cursor: grab;
  touch-action: none;
}

.floor-plan-legend:active {
  cursor: grabbing;
}

.floor-plan-legend.selected {
  outline: 2px solid #d78a16;
  outline-offset: 2px;
}

.floor-plan-legend header {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(67, 82, 78, .35);
}

.floor-plan-legend header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.floor-plan-legend header span {
  color: #65716f;
  font-size: .82em;
}

.floor-legend-list {
  display: grid;
  grid-template-columns: repeat(var(--floor-legend-columns, 1), minmax(0, 1fr));
  gap: 3px 8px;
}

.floor-legend-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.floor-legend-symbol {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.floor-legend-symbol .floor-symbol-svg {
  width: 20px;
  height: 20px;
}

.floor-legend-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.floor-legend-copy strong,
.floor-legend-copy small {
  overflow-wrap: anywhere;
}

.floor-legend-copy strong {
  font-size: 1em;
}

.floor-legend-copy small {
  color: #5d6966;
  font-size: .8em;
}

.floor-legend-quantity {
  min-width: 18px;
  text-align: right;
}

.floor-plan-legend > p,
.floor-legend-empty {
  margin: 0;
  color: #5d6966;
  font-size: .86em;
  overflow-wrap: anywhere;
}

.floor-scale-label {
  position: absolute;
  z-index: 4;
  right: 6px;
  bottom: 6px;
  padding: 3px 5px;
  border: 1px solid #a8b2b0;
  background: rgba(255, 255, 255, .92);
  color: #3e4b48;
  font-size: 10px;
  pointer-events: none;
}

.floor-title-block {
  position: absolute;
  z-index: 5;
  right: 6px;
  bottom: 32px;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 145px;
  width: min(42%, 380px);
  min-width: 285px;
  border: 1px solid #35433f;
  background: rgba(255, 255, 255, .96);
  color: #17211f;
  font-size: 9px;
  line-height: 1.15;
  cursor: pointer;
}

.floor-title-block.selected {
  outline: 2px solid #d78a16;
  outline-offset: 2px;
}

.floor-title-block > div {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 6px;
  border-right: 1px solid #35433f;
}

.floor-title-block strong,
.floor-title-block span {
  overflow-wrap: anywhere;
}

.floor-title-block dl {
  display: grid;
  grid-template-columns: repeat(2, auto 1fr);
  margin: 0;
}

.floor-title-block dt,
.floor-title-block dd {
  margin: 0;
  padding: 3px;
  border-bottom: 1px solid #aab3b1;
}

.floor-title-block dt {
  color: #5d6865;
}

.floor-warning-count {
  padding: 5px 8px;
  border: 1px solid #d39a96;
  background: #fff0ef;
  color: #9e2d27;
  font-size: 11px;
  white-space: nowrap;
}

.floor-inspector {
  display: grid;
  position: sticky;
  grid-template-columns: minmax(0, 1fr);
  top: 8px;
  gap: 10px;
  max-height: 76vh;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.floor-inspector .section-head {
  margin: 0;
}

.floor-inspector > .section-head,
.floor-inspector > .floor-inspector-actions,
.floor-inspector > .wide-field,
.floor-inspector > .floor-inventory-link,
.floor-inspector > .floor-architecture-model,
.floor-inspector > details,
.floor-inspector > .check-label {
  grid-column: 1 / -1;
}

.floor-inspector h4 {
  margin: 2px 0 0;
  font-size: 16px;
}

.floor-inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.floor-inspector-actions button {
  flex: 1 1 120px;
  min-width: 0;
  white-space: normal;
}

.floor-nudge-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(36px, 1fr));
  align-items: center;
  gap: 5px;
  padding: 7px;
  border: 1px solid #cbd8d4;
  background: #f7faf9;
}

.floor-nudge-controls button {
  width: 100%;
  min-width: 36px;
}

.floor-nudge-controls output {
  color: #45524f;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.floor-print-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.floor-print-presets button {
  min-width: 0;
  padding: 7px 6px;
  font-size: 11px;
  white-space: normal;
}

.floor-print-preflight {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid #9bc6b9;
  border-left: 4px solid #237568;
  background: #eff8f5;
}

.floor-print-preflight.warning {
  border-color: #ddc28d;
  border-left-color: #b7770d;
  background: #fff9ed;
}

.floor-print-preflight.error {
  border-color: #dfa49f;
  border-left-color: #b23a32;
  background: #fff2f1;
}

.floor-print-preflight header {
  display: grid;
  gap: 2px;
}

.floor-print-preflight header span,
.floor-print-preflight p,
.floor-print-preflight li {
  font-size: 11px;
  line-height: 1.35;
}

.floor-print-preflight header span {
  color: #56635f;
}

.floor-print-preflight p,
.floor-print-preflight ul {
  margin: 0;
}

.floor-print-preflight ul {
  display: grid;
  gap: 4px;
  padding-left: 18px;
}

.floor-print-preflight li.error { color: #8f2c27; }
.floor-print-preflight li.warning { color: #77500c; }

.floor-align-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.floor-align-grid button {
  min-width: 0;
  padding: 7px 5px;
  font-size: 10px;
  white-space: normal;
}

.floor-cable-summary {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  border-left: 3px solid #2664a8;
  background: #eef5fc;
}

.floor-cable-summary span {
  color: #516477;
  font-size: 11px;
}

.floor-inspector details {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.floor-inspector summary {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.floor-inspector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.floor-inspector label {
  min-width: 0;
  font-size: 11px;
}

.floor-inspector input,
.floor-inspector select,
.floor-inspector textarea {
  width: 100%;
}

.floor-inspector .check-label {
  align-items: center;
}

.floor-inventory-link {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-left: 3px solid #267c74;
  background: #eef7f5;
}

.floor-inventory-link span {
  color: #64716e;
  font-size: 11px;
}

.floor-architecture-model {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid #b8cec9;
  background: #f4f9f8;
}

.floor-architecture-model label,
.floor-architecture-model strong {
  color: #244b46;
  font-size: 11px;
  font-weight: 800;
}

.floor-architecture-model span {
  color: #5e6c69;
  font-size: 10px;
  line-height: 1.3;
}

.signal-diagram {
  display: block;
  width: 100%;
  min-height: 260px;
  max-height: 430px;
  margin: 10px 0 16px;
  border: 1px solid var(--line);
  background: #fbfcfc;
}

.signal-diagram line {
  stroke: #c47a12;
  stroke-width: 2;
}

.signal-diagram marker path {
  fill: #c47a12;
}

.signal-diagram rect {
  fill: #e8f5f2;
  stroke: #147b72;
  stroke-width: 1.5;
}

.signal-diagram text {
  fill: #17211f;
  font-size: 10px;
  font-weight: 700;
}

.signal-diagram text.sub {
  fill: #64716e;
  font-size: 8px;
  font-weight: 400;
}

.led-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.led-result {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid #9eb9d6;
  background: #f1f7fd;
}

.led-result span {
  color: #465b70;
}

.led-cabinet-map {
  display: grid;
  grid-template-columns: repeat(var(--led-columns), minmax(7px, 1fr));
  gap: 1px;
  max-height: 150px;
  margin-top: 5px;
  overflow: auto;
  border: 1px solid #b9c8d7;
  background: #fff;
}

.led-cabinet-map span {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  min-width: 7px;
  border: 1px solid var(--led-port-color);
  background: color-mix(in srgb, var(--led-port-color) 14%, white);
  color: #21302d;
  font-size: 7px;
}

.led-cabinet-map b { padding: 4px; font-size: 9px; }

.rigging-schematic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.rigging-schematic {
  min-width: 0;
  border: 1px solid #c9d3d0;
  background: #fff;
}

.rigging-schematic header { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-bottom: 1px solid #d8dfdd; }
.rigging-schematic header span { color: var(--muted); font-size: 11px; }
.rigging-schematic svg { display: block; width: 100%; height: auto; min-height: 210px; }
.rigging-ground,.rigging-ticks line { stroke: #60706c; stroke-width: 1; }
.rigging-ticks text,.rigging-schematic-host text,.rigging-schematic-load text { fill: #34413e; font: 10px Arial, sans-serif; }
.rigging-schematic-host line { stroke: #9a342e; stroke-width: 7; stroke-linecap: square; }
.rigging-schematic-host text { font-weight: 700; }
.rigging-schematic-load line { stroke: #9a342e; stroke-width: 1.5; stroke-dasharray: 4 3; }
.rigging-schematic-load rect { fill: #fff; stroke: #293633; stroke-width: 1.5; }

.showpack-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.showpack-sheet-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  align-items: start;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid #ccd5d2;
  background: #f6f8f7;
}

.showpack-sheet-card.selected { border-color: #4b8f86; background: #edf6f4; }
.showpack-sheet-card input { grid-row: 1 / span 3; margin-top: 2px; }
.showpack-sheet-card span,.showpack-sheet-card small { color: var(--muted); font-size: 10px; }
.showpack-sheet-card strong,.showpack-sheet-card small { min-width: 0; overflow-wrap: anywhere; }

.showpack-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.showpack-checklist > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
  min-width: 0;
  padding: 11px;
  border-left: 3px solid #b23a32;
  background: #fff5f4;
}

.showpack-checklist > div.ready {
  border-left-color: #187a56;
  background: #eff8f2;
}

.showpack-checklist span,
.showpack-checklist small {
  color: var(--muted);
}

.showpack-checklist span,
.showpack-checklist strong,
.showpack-checklist small {
  grid-column: 1;
  overflow-wrap: anywhere;
}

.showpack-checklist button {
  grid-column: 2;
  grid-row: 1 / span 3;
}

@media (max-width: 1080px) {
  .technical-plan-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .technical-plan-meta {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }

  .technical-plan-meta .technical-background-url {
    grid-column: 1 / span 2;
  }

  .floor-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .floor-assembly-dock {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .floor-assembly-dock-head {
    grid-column: 1 / -1;
  }

  .floor-assembly-button:nth-of-type(4) {
    border-left: 0;
  }

  .floor-inspector {
    position: static;
    grid-template-columns: minmax(0, 1fr);
    max-height: none;
  }

  .rigging-schematic-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .floor-inventory-browser-head,
  .floor-inspector-inventory-picker,
  .floor-led-builder {
    grid-template-columns: minmax(0, 1fr);
  }

  .floor-led-builder .field-help {
    grid-column: auto;
  }

  .engineering-layout,
  .engineering-elevations,
  .engineering-assembly-list,
  .engineering-field-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .engineering-wide {
    grid-column: auto;
  }

  .engineering-issue {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .engineering-issue small {
    display: none;
  }

  .engineering-field-list article > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .technical-head,
  .technical-module-head,
  .technical-subhead {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .technical-head-actions,
  .technical-module-actions {
    width: 100%;
  }

  .technical-head-actions button,
  .technical-module-actions button {
    flex: 1 1 120px;
  }

  .technical-project-settings > summary,
  .floor-plan-health {
    align-items: stretch;
    flex-direction: column;
  }

  .technical-project-settings-summary,
  .floor-health-actions {
    justify-content: flex-start;
  }

  .floor-assembly-dock {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .floor-assembly-dock-head,
  .floor-assembly-button {
    flex: 0 0 150px;
  }

  .floor-assembly-button:nth-of-type(4) {
    border-left: 1px solid var(--line);
  }

  .technical-plan-picker,
  .technical-plan-meta,
  .floor-inspector,
  .floor-inspector-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .technical-plan-meta .technical-background-url,
  .floor-inspector .section-head,
  .floor-inspector > label:last-child {
    grid-column: auto;
  }

  .technical-tabs,
  .floor-command-tools,
  .floor-view-tools {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .technical-tabs button,
  .floor-command-tools button,
  .floor-view-tools button {
    flex: 0 0 auto;
  }

  .floor-commandbar {
    align-items: stretch;
    flex-direction: column;
  }

  .floor-symbol-library {
    grid-template-columns: minmax(0, 1fr);
  }

  .floor-symbol-groups {
    grid-column: auto;
  }

  .floor-symbol-library select {
    min-width: 0;
  }

  .floor-plan-canvas {
    min-height: 0;
  }

  .floor-navigation-options { align-items: flex-start; flex-direction: column; white-space: normal; }
  .floor-minimap { right: 8px; bottom: 8px; width: 132px; }
  .floor-minimap svg { height: 70px; }

  .floor-view-switch {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .floor-mode-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .floor-editor-mode {
    width: 100%;
  }

  .floor-3d-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .floor-3d-viewport {
    height: 58vh;
    min-height: 380px;
  }

  .floor-3d-toolbar {
    flex-wrap: wrap;
  }

  .floor-3d-toolbar > span {
    flex-basis: 100%;
  }

  .floor-plan-legend {
    min-width: 110px;
  }

  .floor-title-block {
    grid-template-columns: minmax(110px, 1fr) 126px;
    width: min(55%, 310px);
    min-width: 245px;
  }

  .floor-align-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.inventory-stock-sync {
  align-self: end;
  display: grid;
  gap: 6px;
}

#printRenderRoot {
  display: none;
}

@media print {
  body.print-document-active > :not(#printRenderRoot) {
    display: none !important;
  }

  body.print-document-active #printRenderRoot {
    display: block !important;
  }
}

/* Searchable estimate item picker. */
.line-item-picker { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; white-space: normal; background: #fff; color: var(--text); border: 1px solid var(--border); }
#lineItemPickerDialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
#lineItemPickerResults { display: grid; gap: 6px; max-height: 48vh; overflow-y: auto; }
#lineItemPickerResults button { display: grid; gap: 4px; padding: 12px; text-align: left; white-space: normal; background: #f4f8f7; color: #182c29; border: 1px solid #d6e2df; }
#lineItemPickerResults button:hover, #lineItemPickerResults button:focus-visible { background: #e2f1ee; border-color: #137c72; }
#lineItemPickerResults small { color: #526963; }

#lineItemPickerDialog { width: min(760px, calc(100vw - 32px)); }
#lineItemPickerResults.picker-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#lineItemPickerBack { justify-self: start; }
#lineItemPickerBack[hidden] { display: none; }
@media (max-width: 520px) { #lineItemPickerResults.picker-categories { grid-template-columns: 1fr; } }
