:root {
  --ink: #19252d;
  --muted: #60717b;
  --line: #d3dce0;
  --panel: #ffffff;
  --page: #f6f8fb;
  --brand: #143d6f;
  --brand-dark: #091d34;
  --brand-soft: #eaf1fb;
  --accent: #ff921d;
  --success: #19744d;
  --warning: #996510;
  --danger: #a33535;
  --tab-bg: #eef4fb;
  --tab-hover: #dfe9f7;
  --tab-outline: #aac3ca;
  --tab-border: #d3dce0;
  --tab-idle-ink: #091d34;
  --tab-active: #143d6f;
  --tab-active-ink: #ffffff;
  --tab-empty: #f3f6f7;
  --shadow: 0 1px 2px rgba(15, 29, 37, 0.06);
  /* ONEX Visual System 001B shared typography roles; dense widgets may opt into smaller type. */
  --font-page: 13px;
  --font-small: 12px;
  --font-label: 11px;
  --font-title: 20px;
  --font-heading: 15px;
  --sidebar-width: 236px;
  --eb-drawer-w: 380px;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

/* Proposal Builder simplified workflow (Option B production binding). */
html[data-proposal-mode="simplified"] .eb-page-main,
html[data-proposal-mode="advanced"] .proposal-simplified-main,
html[data-proposal-mode="advanced"] .pbs-output-footer {
  display: none !important;
}

.proposal-simplified-main {
  min-width: 0;
  padding: 18px 66px 94px 22px;
}

.pbs-stage {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}

.pbs-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.pbs-heading h1 {
  margin: 0;
  font-size: 25px;
}

.pbs-heading p {
  max-width: 900px;
  margin: 5px 0 0;
  color: var(--muted);
}

.pbs-top-strip {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(210px, 1fr) minmax(220px, 1fr) minmax(330px, 1.7fr);
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.pbs-top-cell {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.pbs-top-cell:last-child {
  border-right: 0;
}

.pbs-top-cell label,
.pbs-cell-label {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.pbs-top-cell select {
  width: 100%;
  min-height: 34px;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.pbs-cell-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.pbs-tech-inline {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  max-height: 106px;
  margin-top: 5px;
  padding-right: 2px;
  overflow-y: auto;
}

.pbs-tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 27px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.pbs-tech-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pbs-tech-chip input {
  width: 13px;
  height: 13px;
}

.pbs-tech-chip:has(input:not(:checked)) {
  opacity: .56;
}

.pbs-tech-chip:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, var(--panel));
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
}

.pbs-empty-inline {
  color: var(--muted);
  font-size: 11px;
}

.pbs-build-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 62px;
  padding: 11px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--brand-soft) 60%, var(--panel));
}

.pbs-build-strip strong,
.pbs-build-note {
  display: block;
}

.pbs-build-strip strong {
  font-size: 12px;
}

.pbs-build-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.pbs-build-note.pending,
.pbs-build-note.blocked {
  color: var(--warning, #9b5600);
  font-weight: 700;
}

.pbs-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pbs-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
}

.pbs-main-col {
  min-width: 0;
}

.pbs-health-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.pbs-health-stat {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  text-align: center;
}

.pbs-health-stat span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.pbs-health-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.pbs-health-stat.ready strong {
  color: var(--success, #087443);
}

.pbs-health-stat.review strong {
  color: var(--warning, #9b5600);
}

.pbs-widget,
.pbs-review-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.pbs-widget {
  margin-bottom: 12px;
}

.pbs-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
}

.pbs-widget-head h2 {
  margin: 0;
  font-size: 13px;
}

.pbs-widget-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.pbs-reference-basis {
  color: var(--muted);
  font-size: 10.5px;
  text-align: right;
}

.pbs-table-wrap {
  overflow-x: auto;
}

.pbs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.pbs-table th {
  padding: 8px 13px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 9px;
  text-align: left;
  text-transform: uppercase;
}

.pbs-table td {
  padding: 9px 13px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.pbs-table tr[data-row-state="review"] td:first-child,
.pbs-table tr[data-row-state="failed"] td:first-child {
  border-left: 3px solid var(--warning, #9b5600);
}

.pbs-table tr[data-row-state="ready"] td:first-child {
  border-left: 3px solid var(--success, #087443);
}

.pbs-table tr.selected {
  background: color-mix(in srgb, var(--brand-soft) 65%, var(--panel));
}

.pbs-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
}

.pbs-badge.review,
.pbs-badge.partial,
.pbs-badge.stale,
.pbs-badge.failed {
  background: color-mix(in srgb, #f4a340 18%, var(--panel));
  color: var(--warning, #9b5600);
}

.pbs-badge.ready {
  background: color-mix(in srgb, #35a06f 14%, var(--panel));
  color: var(--success, #087443);
}

.pbs-ready-summary,
.pbs-outline-actions {
  padding: 9px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.pbs-ready-summary button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pbs-outline-actions {
  display: flex;
  gap: 16px;
}

.pbs-outline-actions a {
  color: var(--accent);
  font-weight: 700;
}

.pbs-future-notice > p {
  margin: 0;
  padding: 12px 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.pbs-review-panel {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.pbs-review-head {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.pbs-review-head span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.pbs-review-head h2 {
  margin: 4px 0 0;
  font-size: 14px;
}

.pbs-review-body {
  padding: 13px;
}

.pbs-empty-review {
  padding: 30px 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.pbs-review-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.pbs-review-meta div {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
}

.pbs-review-meta span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.pbs-review-meta strong {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}

.pbs-review-editor,
.pbs-ai-preview {
  min-height: 190px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-family: Calibri, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.55;
}

.pbs-review-editor[contenteditable="false"] {
  background: var(--panel-soft);
}

.pbs-ai-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pbs-ai-wrap textarea {
  width: 100%;
  min-height: 66px;
  margin: 6px 0;
}

.pbs-ai-preview {
  min-height: 80px;
  margin-top: 8px;
  background: var(--panel-soft);
}

.pbs-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.pbs-output-footer {
  position: fixed;
  right: 52px;
  bottom: 0;
  left: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 10px 22px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 -8px 20px rgb(19 42 56 / 10%);
}

.pbs-output-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1100px) {
  .proposal-simplified-main {
    padding-right: 52px;
  }

  .pbs-output-footer {
    right: 52px;
  }
}

@media (max-width: 1024px) {
  .pbs-top-strip {
    grid-template-columns: 1fr 1fr;
  }

  .pbs-top-cell:nth-child(2) {
    border-right: 0;
  }

  .pbs-top-cell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .pbs-workspace {
    grid-template-columns: 1fr;
  }

  .pbs-review-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 680px) {
  .proposal-simplified-main {
    padding: 14px 52px 128px 12px;
  }

  .pbs-top-strip,
  .pbs-health-strip {
    grid-template-columns: 1fr;
  }

  .pbs-top-cell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pbs-build-strip,
  .pbs-output-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

:root[data-theme="dark"] {
  --ink: #ddeaf5;
  --muted: #7fa3bf;
  --line: #253549;
  --panel: #16263a;
  --page: #0f1923;
  --brand: #5baeff;
  --brand-dark: #061424;
  --brand-soft: #102035;
  --accent: #ffae52;
  --success: #75d0a3;
  --warning: #e1bc5d;
  --danger: #ef8e86;
  --tab-bg: #1a2d40;
  --tab-hover: #243d57;
  --tab-outline: #355967;
  --tab-border: #355967;
  --tab-idle-ink: #dce9ed;
  --tab-active: #5baeff;
  --tab-active-ink: #06101a;
  --tab-empty: #111f2e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-size: var(--font-page);
  line-height: 1.45;
}

html.theme-navigating,
html.theme-navigating body {
  background: var(--page);
}

:root[data-theme="dark"].theme-navigating,
:root[data-theme="dark"].theme-navigating body {
  background: #0d171c;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: #0f1c22;
  color: var(--ink);
  border-color: #415861;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #7f929b;
}

:root[data-theme="dark"] table,
:root[data-theme="dark"] th,
:root[data-theme="dark"] td {
  border-color: var(--line);
}

:root[data-theme="dark"] th,
:root[data-theme="dark"] .group-row,
:root[data-theme="dark"] .empty-category-row {
  background: #182b33;
}

:root[data-theme="dark"] .strategy-card,
:root[data-theme="dark"] .capability-grid div,
:root[data-theme="dark"] .metric,
:root[data-theme="dark"] .progress-step,
:root[data-theme="dark"] .active-project-card,
:root[data-theme="dark"] .storage-path-preview {
  background: #0d1a28;
  border-color: var(--line);
}

:root[data-theme="dark"] .tabbar button,
:root[data-theme="dark"] .button.secondary,
:root[data-theme="dark"] nav a {
  background: #16263a;
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] .tabbar button.selected,
:root[data-theme="dark"] nav a.active {
  background: #1f3a44;
  color: #eef8fb;
}

:root[data-theme="dark"] .badge {
  background: #20343d;
  color: var(--ink);
}

:root[data-theme="dark"] .badge.active,
:root[data-theme="dark"] .badge.imported {
  background: #163a28;
  color: var(--success);
}

:root[data-theme="dark"] .badge.failed {
  background: #422221;
  color: var(--danger);
}

:root[data-theme="dark"] .active-context-card {
  background: linear-gradient(180deg, #1a2d42, #0d1a28);
  border-color: #4f7885;
}

:root[data-theme="dark"] .context-title {
  color: #eef8fb;
}

:root[data-theme="dark"] .status.success {
  background: linear-gradient(180deg, #12382d, #10241f);
  border-color: #2e8d68;
  border-left-color: var(--success);
  color: #c8f4dd;
}

:root[data-theme="dark"] .status.error {
  background: #341b1f;
  border-color: #7d3e3f;
  border-left-color: var(--danger);
  color: #ffd2cf;
}

:root[data-theme="dark"] .loaded-project-context {
  background: linear-gradient(180deg, #12382d, #10241f);
  border-color: #2e8d68;
  border-left-color: var(--success);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .loaded-project-context strong {
  color: #eefbf4;
}

:root[data-theme="dark"] .loaded-project-context small {
  color: #b8d5cb;
}

header {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid #123947;
  background: var(--brand-dark);
  color: #fff;
}

.header-right {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 600;
}

.brand > span:last-child {
  max-width: min(42vw, 360px);
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffffff 0%, #eef4fb 100%);
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  border: 1px solid rgba(20, 61, 111, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.brand-mark img,
.tenant-logo-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fff;
}

.brand-mark img {
  border-radius: 6px;
}

.environment {
  flex: none;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 12px;
  color: #dae5e7;
}

.auth-user-pill {
  max-width: 240px;
  overflow: hidden;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #eef8fb;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-auth-button {
  flex: none;
  min-height: 30px;
  padding: 5px 10px;
}

header .active-project-card {
  width: min(620px, 52vw);
  min-height: 42px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: #eef8fb;
}

header .active-context-card {
  background: rgba(255, 255, 255, 0.08);
}

header .context-eyebrow {
  margin-bottom: 1px;
  color: #b9dfe7;
  font-size: 10px;
}

header .context-title {
  overflow: hidden;
  color: #ffffff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

header .active-project-meta {
  margin-top: 2px;
  overflow: hidden;
  color: #c7dbe0;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

header .context-action {
  display: none;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 7px minmax(0, 1fr);
  min-height: calc(100vh - 62px);
}

nav {
  position: sticky;
  top: 0;
  height: calc(100vh - 62px);
  overflow: auto;
  padding: 14px 10px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--panel) 88%, var(--page)));
  scrollbar-width: thin;
}

.tenant-workspace-badge {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 84%, var(--brand-soft));
  box-shadow: 0 8px 18px rgba(15, 50, 62, 0.07);
}

.tenant-workspace-badge.owner-testing {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  border-left-color: var(--accent);
  background: color-mix(in srgb, #fff4e8 72%, var(--panel));
}

.tenant-logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-dark);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.tenant-logo-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
}

.tenant-workspace-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.tenant-workspace-copy span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.tenant-workspace-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-workspace-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.source-readiness-card,
.run-status-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, var(--brand-soft));
}

.source-readiness-card {
  padding: 10px;
}

.source-readiness-card strong {
  display: block;
  margin: 2px 0 6px;
  font-size: 13px;
}

.source-readiness-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.source-readiness-text b {
  color: var(--text);
}

.context-extract-panel {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 90%, var(--brand-soft));
}

.context-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.context-field-candidate {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 7px;
  background: var(--panel);
  font-size: 12px;
}

.context-field-candidate span {
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: 800;
}

.context-field-candidate input[type="text"],
.context-field-candidate input:not([type]) {
  min-height: 30px;
  font-size: 12px;
}

.context-field-candidate small {
  color: var(--muted);
  line-height: 1.35;
}

.run-status-panel {
  margin: 10px 0 0;
  padding: 10px;
}

.run-status-panel:empty {
  display: none;
}

.run-status-panel > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
}

.run-step-list {
  display: grid;
  gap: 6px;
}

.run-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 7px;
  background: var(--panel);
}

.run-step > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.run-step strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.run-step small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.run-step.done > span {
  background: color-mix(in srgb, #29a36a 18%, transparent);
  color: #117247;
}

.run-step.active > span {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

.run-step.error > span {
  background: color-mix(in srgb, #b43737 16%, transparent);
  color: #b43737;
}

.sidebar-resizer {
  width: 7px;
  height: calc(100vh - 62px);
  border: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid transparent;
  background: transparent;
  cursor: col-resize;
}

.sidebar-resizer:hover,
body.sidebar-resizing .sidebar-resizer {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  border-left-color: color-mix(in srgb, var(--brand) 35%, transparent);
}

.sidebar-resize-reset {
  width: 100%;
  margin: 10px 0 0;
  padding: 7px 9px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.active-project-card {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #d2dcdf;
  border-radius: 7px;
  background: #f7fafb;
}

.active-context-card {
  border: 2px solid rgba(11, 83, 103, 0.34);
  background: linear-gradient(180deg, #eef8fa, #ffffff);
  box-shadow: 0 2px 8px rgba(15, 29, 37, 0.08);
}

.context-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.context-title {
  display: block;
  color: var(--brand-dark);
  font-size: 14px;
  line-height: 1.25;
}

.context-action {
  display: inline-flex;
  margin-top: 9px;
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
}

.active-project-card label {
  margin-bottom: 6px;
}

.active-project-card select {
  height: 34px;
  margin-bottom: 7px;
  font-size: 12px;
}

.active-project-card button {
  width: 100%;
}

.active-project-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.nav-group {
  margin-bottom: 9px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 82%, var(--page));
}

.nav-group summary {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 999px;
  color: var(--brand);
  font-size: 12px;
}

.nav-group[open] summary::before {
  content: "-";
}

.nav-subsection {
  margin: 10px 6px 5px;
  padding: 6px 7px 4px;
  border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-subsection:first-of-type {
  margin-top: 4px;
  border-top: 0;
}

nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  height: auto;
  margin-bottom: 4px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #31434d;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  line-height: 1.18;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

nav a:hover {
  background: var(--tab-hover);
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
  color: var(--brand-dark);
}

nav > a {
  min-height: 44px;
  font-size: 14px;
  font-weight: 800;
  background: color-mix(in srgb, var(--tab-bg) 55%, transparent);
}

.nav-group a {
  min-height: 36px;
  margin-left: 0;
  padding: 8px 9px;
  font-size: 14px;
  font-weight: 600;
}

nav a.active {
  background: var(--tab-active);
  color: var(--tab-active-ink);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--tab-active));
  box-shadow: inset 4px 0 0 var(--accent), 0 2px 8px rgba(15, 29, 37, 0.1);
}

nav svg,
.button svg {
  width: 17px;
  height: 17px;
  flex: none;
}

main {
  width: 100%;
  max-width: none;
  padding: 25px 27px 36px;
}

body:has(.generated-lines-panel) main {
  padding-right: 12px;
  padding-left: 12px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 21px;
}

.loaded-project-context {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(180px, 0.8fr) minmax(160px, 0.8fr) auto;
  gap: 13px;
  align-items: center;
  margin: -8px 0 18px;
  padding: 13px 15px;
  border: 1px solid #77c3a0;
  border-left: 6px solid var(--success);
  border-radius: 7px;
  background: linear-gradient(180deg, #dff6ee, #f6fffb);
  box-shadow: 0 2px 10px rgba(25, 116, 77, 0.13);
}

.loaded-project-context strong,
.loaded-project-context small,
.loaded-project-context .context-label {
  display: block;
}

.loaded-project-context strong {
  color: #0c3024;
  font-size: calc(var(--font-body) + 2px);
}

.loaded-project-context small {
  margin-top: 3px;
  color: #3d5c55;
}

h1 {
  margin: 0 0 5px;
  font-size: var(--font-title);
  font-weight: 800;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status {
  min-height: 32px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  visibility: hidden;
}

.status.show {
  visibility: visible;
}

.status.success {
  background: linear-gradient(180deg, #dcf5ee, #f5fffb);
  border-color: #78c8a2;
  border-left: 5px solid var(--success);
  color: #0d623e;
  box-shadow: 0 2px 8px rgba(25, 116, 77, 0.12);
}

.status.error {
  background: #fff2f1;
  border-color: #efcfca;
  border-left: 5px solid var(--danger);
  color: var(--danger);
}

.layout {
  display: grid;
  gap: 18px;
}

.layout.project {
  grid-template-columns: minmax(475px, 1fr) minmax(440px, 1.14fr);
}

.layout.split {
  grid-template-columns: minmax(400px, 490px) minmax(500px, 1fr);
}

.entry-layout {
  display: grid;
  grid-template-columns: minmax(500px, 1.15fr) minmax(300px, 0.85fr);
  gap: 22px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head {
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
}

.project-register-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.panel-body {
  padding: 17px 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 14px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #4c5f68;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #bfcbd0;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

input[type="checkbox"] {
  width: 13px;
  height: 13px;
  min-width: 13px;
  margin: 0;
  accent-color: var(--brand);
  transform: scale(0.78);
  transform-origin: center;
  vertical-align: middle;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 14px 0 0;
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfb;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  transform: none;
}

.check-row label:has(input[type="checkbox"]:checked) {
  border-color: rgba(0, 95, 115, 0.42);
  background: #e8f4f4;
  color: var(--brand-dark);
}

.security-profile-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  width: 100%;
}

.security-profile-picker label {
  min-height: 42px;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #9dcbd5;
  outline-offset: 0;
  border-color: var(--brand);
}

textarea {
  min-height: 72px;
  padding-top: 9px;
  resize: vertical;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 17px;
}

.button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid var(--brand);
  border-radius: 5px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.button:hover {
  background: var(--brand-dark);
}

.button.secondary {
  border-color: #bdc9ce;
  background: #fff;
  color: #30434c;
}

.button.secondary:hover {
  background: #edf2f3;
}

.button.danger {
  border-color: #c58f89;
  background: #fff4f2;
  color: var(--danger);
}

.button.danger:hover {
  background: #ffe9e5;
}

.button:disabled {
  opacity: 0.55;
  cursor: wait;
}

@keyframes aiButtonShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes aiButtonGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(25, 166, 178, 0.18); }
  50% { box-shadow: 0 0 0 5px rgba(25, 166, 178, 0.12); }
}

.button.ai-busy {
  position: relative;
  border-color: color-mix(in srgb, var(--brand) 45%, #56d8df);
  background: linear-gradient(90deg, #0d5668 0%, #13808a 25%, #1cb0b8 50%, #13808a 75%, #0d5668 100%);
  background-size: 260% 260%;
  color: #fff;
  animation: aiButtonShift 1.4s linear infinite, aiButtonGlow 1.9s ease-in-out infinite;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.button.ai-busy::before {
  content: "✦";
  display: inline-block;
  margin-right: 6px;
  font-size: 11px;
  opacity: 0.95;
}

.button.secondary.ai-busy {
  border-color: color-mix(in srgb, var(--brand) 55%, #a8f4ee);
  background: linear-gradient(90deg, #e8fbfb 0%, #d5f4f3 35%, #bfecec 50%, #d5f4f3 65%, #e8fbfb 100%);
  background-size: 260% 260%;
  color: var(--brand-dark);
  text-shadow: none;
}

.button.compact {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.transition {
  display: flex;
  gap: 6px;
  min-width: 195px;
}

.project-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.actions-cell {
  position: relative;
  width: 58px;
  text-align: right;
}

.row-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.button.icon-button {
  width: 34px;
  min-width: 34px;
  height: 30px;
  padding: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.row-menu-panel {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 60;
  display: none;
  min-width: 184px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: left;
}

.row-menu-panel.open {
  display: grid;
  gap: 4px;
}

.row-menu-panel.wide {
  min-width: 250px;
}

/* Keep shared action menus above scrolling lists while retaining row handlers. */
.row-menu-panel[popover],
.source-actions-menu[popover],
.tab-more-menu[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  box-sizing: border-box;
  min-width: min(184px, calc(100vw - 16px));
  overflow: auto;
  overscroll-behavior: contain;
}

.row-menu-panel.wide[popover] {
  min-width: min(250px, calc(100vw - 16px));
}

.row-menu-panel[popover]::backdrop {
  background: transparent;
  pointer-events: none;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--font-small);
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--tab-hover);
  color: var(--brand);
}

.menu-item.danger {
  color: var(--danger);
}

.menu-field {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.menu-field label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.menu-field select {
  width: 100%;
  height: 30px;
  font-size: 12px;
}

.transition select {
  height: 30px;
  min-width: 122px;
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

/* A single row still leaves useful room for its action menu. */
.table-wrap:has(.row-menu),
.source-wrap:has(.row-menu) {
  min-height: min(280px, 45vh);
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: #f6f8f8;
  color: #4a5e66;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

td {
  height: 45px;
  padding: 10px 13px;
  border-bottom: 1px solid #e4eaec;
  color: #273840;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e9f2f3;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge.imported {
  background: #e9f6ef;
  color: var(--success);
}

.badge.failed {
  background: #fff0ee;
  color: var(--danger);
}

.badge.danger {
  background: #fff0ee;
  color: var(--danger);
}

.badge.warning {
  background: #fff8e5;
  color: var(--warning);
}

.badge.success {
  background: #e9f6ef;
  color: var(--success);
}

.badge.neutral {
  background: #eef1f2;
  color: #61747c;
}

.badge.active {
  background: #e9f6ef;
  color: var(--success);
}

.badge.superseded {
  background: #eef1f2;
  color: #61747c;
}

.small-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
}

.callout {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px dashed #a9c8cf;
  border-radius: 7px;
  background: #f5fbfb;
  color: #25414b;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.pointer-progress-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.metric {
  min-height: 80px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.metric-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric-value {
  font-size: 23px;
  font-weight: 650;
}

.metric-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #42545d;
  font-size: 12px;
  line-height: 1.45;
}

.pointer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 240px;
}

.pointer-actions .button {
  padding: 7px 10px;
  min-width: unset;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.toolbar .field {
  width: min(350px, 100%);
}

.compact-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.compact-filter-row .field {
  min-width: 220px;
  margin: 0;
}

.compact-filter-row .field.grow {
  flex: 1 1 420px;
}

.money {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.source-table {
  table-layout: fixed;
}

.table-actions.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.bulk-selection-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.compact-check {
  margin: 0;
}

.selection-cell {
  width: 34px;
  text-align: center;
  vertical-align: middle;
}

.selection-cell input[type="checkbox"],
.bulk-actions input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.file-cell {
  overflow-wrap: anywhere;
}

.source-table th,
.source-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.source-table .file-cell strong {
  display: block;
  word-break: break-word;
}

.source-table .button {
  width: 100%;
  padding: 0 4px;
}

.cleanup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 6px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.knowledge-search-output {
  display: grid;
  gap: 10px;
}

.knowledge-result {
  padding: 12px;
  border: 1px solid #d3dce0;
  border-radius: 6px;
  background: #fbfdfd;
}

.knowledge-result h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.knowledge-result p {
  margin: 0 0 6px;
  color: #324751;
}

.source-wrap {
  overflow-x: hidden;
}

.notice {
  padding: 19px;
  border: 1px dashed #bbcace;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.quick-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 56vh;
  min-height: 260px;
  resize: vertical;
  overflow: auto;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.quick-chat-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

.quick-chat-message {
  max-width: min(860px, 92%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.quick-chat-message.user {
  align-self: flex-end;
  border-color: rgba(11, 94, 110, 0.35);
  background: rgba(11, 94, 110, 0.08);
}

.quick-chat-message.assistant {
  align-self: flex-start;
}

.quick-chat-role {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.quick-chat-content {
  font-size: 13px;
  line-height: 1.45;
}

.quick-assistant-stage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 11px;
  border: 1px solid rgba(11, 94, 110, 0.28);
  border-radius: 999px;
  background: rgba(11, 94, 110, 0.08);
  color: var(--ink);
  font-size: var(--font-small);
  font-weight: 700;
}

.quick-assistant-stage.hidden {
  display: none;
}

.quick-stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(25, 116, 77, 0.12);
}

.quick-assistant-stage.active .quick-stage-dot {
  animation: quickPulse 1.1s ease-in-out infinite;
}

.quick-chat-message.thinking {
  color: var(--muted);
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  animation: quickTyping 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes quickPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.45); opacity: 1; }
}

@keyframes quickTyping {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-3px); opacity: 0.9; }
}

.quick-message-composer {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.quick-message-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 420px;
}

.quick-message-actions .button {
  min-height: 38px;
}

.page-guide-steps {
  margin: 10px 0 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: var(--font-small);
  line-height: 1.55;
}

.page-guide-steps li {
  margin: 3px 0;
}

.setup-assistant-launcher {
  position: fixed;
  right: 0;
  top: 46%;
  z-index: 40;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--brand);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  writing-mode: vertical-rl;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.setup-assistant-drawer {
  position: fixed;
  right: 14px;
  top: 78px;
  z-index: 45;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.setup-assistant-drawer.hidden {
  display: none;
}

.setup-assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--tab-bg);
}

.setup-assistant-head strong,
.setup-assistant-head span {
  display: block;
}

.setup-assistant-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--font-small);
}

.setup-assistant-body {
  max-height: calc(100vh - 175px);
  padding: 14px;
  overflow: auto;
}

.setup-assistant-body p,
.setup-assistant-body li,
.setup-assistant-answer {
  color: var(--muted);
  font-size: var(--font-small);
  line-height: 1.5;
}

.setup-assistant-body ol,
.setup-assistant-body ul {
  padding-left: 20px;
}

.setup-assistant-body textarea {
  min-height: 92px;
  margin-bottom: 10px;
}

.setup-assistant-answer {
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.quick-intake-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.quick-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft, #f7fafb);
  color: var(--muted);
  font-size: var(--font-small);
  font-weight: 700;
}

.quick-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tab-bg);
  color: var(--brand);
  font-size: 12px;
}

.quick-step.done {
  border-color: rgba(25, 116, 77, 0.35);
  color: var(--ink);
}

.quick-step.done span {
  background: var(--success);
  color: #fff;
}

.quick-budget-detail {
  position: relative;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--panel);
}

.quick-budget-watermark {
  position: absolute;
  right: 20px;
  top: 18px;
  color: rgba(180, 91, 43, 0.18);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: rotate(-8deg);
  pointer-events: none;
}

.quick-budget-detail-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quick-budget-detail h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.quick-budget-detail table {
  width: 100%;
}

.quick-budget-detail td:last-child {
  text-align: right;
  font-weight: 800;
}

.quick-budget-detail ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.quick-bom-detail {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.quick-bom-detail table {
  width: 100%;
  border-collapse: collapse;
}

.quick-bom-detail th,
.quick-bom-detail td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.quick-bom-detail th {
  background: var(--tab-bg);
  color: var(--brand-dark);
}

.quick-bom-detail td:nth-child(2) {
  width: 64px;
  text-align: center;
  font-weight: 800;
}

.quick-bom-detail td:last-child {
  width: 140px;
  text-align: right;
  font-weight: 800;
}

#quick-estimate-print-root {
  display: none;
}

.owner-ip-notice {
  border-color: #b46b62;
  background: #fff6f4;
  color: #4c2a27;
}

.owner-search-toggle {
  margin-top: 12px;
}

.legal-package-table {
  min-width: 1100px;
}

.legal-package-table td:nth-child(2),
.legal-package-table td:nth-child(3) {
  min-width: 240px;
}

.legal-package-metrics {
  margin: 14px 0 0;
}

.legal-review-panel {
  margin: 18px;
}

.legal-review-content {
  max-height: 560px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfd;
  color: var(--ink);
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-price-tools-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ai-setup-link {
  flex-shrink: 0;
  align-self: center;
  font-size: 12px;
}

.msrp-workflow-steps {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
}

.msrp-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  min-width: 100px;
  flex: 1 1 100px;
  text-align: center;
}

.msrp-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msrp-step-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.msrp-step-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.msrp-step-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.msrp-step-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.msrp-step .button {
  font-size: 12px;
  padding: 5px 12px;
  margin-top: auto;
}

.msrp-step-arrow {
  display: flex;
  align-items: center;
  padding: 0 4px;
  font-size: 20px;
  color: var(--muted);
  flex-shrink: 0;
  align-self: center;
}

@media (max-width: 720px) {
  .msrp-workflow-steps {
    flex-direction: column;
  }
  .msrp-step-arrow {
    transform: rotate(90deg);
    align-self: flex-start;
    padding: 0 0 0 20px;
  }
}

.pricing-action-status {
  margin: 10px 0 0;
  padding: 11px 13px;
  border: 1px solid #c6d5d9;
  border-radius: 6px;
  background: #f7fbfc;
  color: #264653;
  font-size: 13px;
}

.pricing-action-status.success {
  border-color: #7fb69d;
  background: #f0faf5;
}

.pricing-action-status.warning {
  border-color: #d7bb72;
  background: #fff9e8;
}

.pricing-action-status.error {
  border-color: #d98c8c;
  background: #fff2f2;
}

.upload-progress {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid #c6d5d9;
  border-radius: 6px;
  background: #f7fbfc;
}

.upload-progress.hidden {
  display: none;
}

.upload-progress-head,
.upload-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-progress-head span,
.upload-progress-meta {
  color: var(--muted);
  font-size: 12px;
}

.upload-progress-head span {
  display: block;
  margin-top: 2px;
}

.upload-progress-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid #b5c9cf;
  border-radius: 999px;
  background: #e7eef0;
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #16816c);
  transition: width 160ms ease;
}

.upload-error {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #efcfca;
  border-radius: 6px;
  background: #fff8f7;
  color: var(--danger);
}

.upload-error.hidden {
  display: none;
}

.upload-error-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-error pre {
  max-height: 190px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: #5f2424;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.form-section {
  margin: 0 0 15px;
  padding: 14px 13px 15px;
  border: 1px solid #d2dcdf;
  border-radius: 6px;
  background: #fcfdfd;
}

.form-section.full {
  grid-column: 1 / -1;
}

.form-section legend {
  padding: 0 7px;
  color: #364a52;
  font-size: 13px;
  font-weight: 650;
}

.workflow-panel {
  margin-bottom: 18px;
}

.page-guide-panel {
  margin-bottom: 14px;
  border-style: dashed;
}

.page-guide-panel summary {
  cursor: pointer;
  list-style: none;
}

.page-guide-panel summary::-webkit-details-marker {
  display: none;
}

.page-guide-panel summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--brand);
}

.page-guide-panel[open] summary::before {
  content: "-";
}

.progress-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}

.progress-step {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.progress-step strong,
.progress-step span {
  display: block;
}

.progress-step span {
  margin-top: 5px;
  color: var(--muted);
}

.progress-step.green {
  border-color: #8ac5a5;
  background: #effaf4;
}

.progress-step.yellow {
  border-color: #d4ba58;
  background: #fff9df;
}

.progress-step.red {
  border-color: #e69b90;
  background: #fff0ee;
}

.progress-step.blue {
  border-color: #8bb8d7;
  background: #eef7fc;
}

.progress-step.gray {
  border-color: #d7dee1;
  background: #f6f8f8;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0;
}

.workflow-steps div {
  min-height: 96px;
  padding: 15px 16px;
  border-right: 1px solid #e4eaec;
}

.workflow-steps div:last-child {
  border-right: 0;
}

.workflow-steps strong,
.workflow-steps span {
  display: block;
}

.workflow-steps strong {
  margin-bottom: 7px;
  color: var(--brand-dark);
  font-size: 13px;
}

.workflow-steps span {
  color: #455961;
  font-size: 12px;
  line-height: 1.4;
}

.intake-preview,
.project-basis {
  padding: 13px;
  border: 1px solid #cbd9dc;
  border-radius: 6px;
  background: #f7fafb;
}

.file-drop-zone {
  display: grid;
  gap: 12px;
  min-height: 118px;
  padding: 16px 16px 14px;
  border: 1px dashed #9fb5bf;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff, #f3f8fb);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.file-drop-zone.drag-over {
  border-color: var(--brand);
  background: linear-gradient(180deg, #eef5ff, #e6effb);
  box-shadow: 0 0 0 2px rgba(20, 61, 111, 0.08);
}

.file-drop-copy {
  display: grid;
  gap: 6px;
}

.file-drop-copy strong {
  color: var(--brand-dark);
  font-size: 13px;
}

.file-drop-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.file-drop-zone input[type="file"] {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  background: #fff;
}

:root[data-theme="dark"] .file-drop-zone {
  background: linear-gradient(180deg, #11232b, #0f1c22);
  border-color: #44606b;
}

:root[data-theme="dark"] .file-drop-zone.drag-over {
  background: linear-gradient(180deg, #123447, #102b36);
  border-color: #67b5d8;
  box-shadow: 0 0 0 2px rgba(103, 181, 216, 0.15);
}

:root[data-theme="dark"] .file-drop-zone input[type="file"] {
  background: #0f1c22;
  border-color: #415861;
  color: var(--ink);
}

@media (max-width: 760px) {
  .file-drop-zone {
    min-height: 104px;
    padding: 14px 14px 12px;
  }
}

.intake-preview strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.intake-preview dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
  margin: 0 0 9px;
}

.intake-preview div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #e2e8e9;
  font-size: 12px;
}

.intake-preview dt {
  color: var(--muted);
}

.intake-preview dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.intake-preview span {
  color: var(--muted);
  font-size: 12px;
}

.project-basis-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.project-basis-head strong,
.project-basis-head span {
  display: block;
}

.project-basis-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.basis-grid.compact {
  grid-template-columns: repeat(4, minmax(100px, 1fr));
}

.context-project {
  margin-bottom: 15px;
}

.compact-actions {
  margin-top: 12px;
  flex-wrap: wrap;
}

.context-register {
  padding: 0 16px 14px;
}

.context-note {
  padding: 14px 0;
  border-bottom: 1px solid #e4eaec;
}

.context-note:last-child {
  border-bottom: 0;
}

.context-note-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
}

.context-note strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
}

.context-note p {
  margin: 0 0 8px;
  color: #42545d;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
}

.context-state {
  color: var(--muted);
  font-size: 12px;
}

.source-register {
  margin-top: 18px;
}

.price-reference {
  max-height: 540px;
  overflow-y: auto;
}

.strategy-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.strategy-card {
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.strategy-card strong {
  color: var(--brand);
  display: block;
  margin-bottom: 6px;
}

.strategy-card p {
  color: var(--muted);
  margin: 0;
}

.capability-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.capability-grid div {
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 46px;
  padding: 10px;
}

.capability-grid strong,
.capability-grid span {
  display: block;
}

.capability-grid span {
  color: var(--muted);
  margin-top: 3px;
}

.storage-path-preview {
  background: #f6faf9;
  border: 1px dashed #9db2ba;
  border-radius: 6px;
  color: #30434c;
  margin-bottom: 12px;
  padding: 12px;
}

.storage-path-preview strong {
  color: var(--brand);
}

.compact-flow {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.compact-flow div {
  border-bottom: 1px solid #e4eaec;
  min-width: 0;
}

.compact-flow div:nth-child(2n) {
  border-right: 0;
}

.compact-flow div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.disclosure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}

.disclosure summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 51px;
  padding: 0 18px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.disclosure summary::before {
  content: "+";
  width: 19px;
  color: var(--brand);
  font-size: 20px;
  line-height: 1;
}

.disclosure[open] summary {
  border-bottom: 1px solid var(--line);
}

.disclosure[open] summary::before {
  content: "-";
}

.disclosure summary::-webkit-details-marker {
  display: none;
}

.connector-grid {
  display: grid;
  grid-template-columns: 270px minmax(360px, 1fr);
}

.connector-list {
  padding: 12px;
  border-right: 1px solid var(--line);
}

.connector-choice {
  width: 100%;
  padding: 12px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.connector-choice:hover,
.connector-choice.selected {
  background: #eaf2f3;
}

.connector-choice strong,
.connector-choice span {
  display: block;
}

.connector-choice strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.connector-choice span {
  color: var(--muted);
  font-size: 12px;
}

.connector-detail {
  padding: 18px;
}

.connector-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.connector-heading h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.connector-heading p,
.reference-item p {
  margin: 0 0 10px;
  color: #455961;
  font-size: 13px;
  line-height: 1.45;
}

.connector-status {
  display: flex;
  gap: 30px;
  margin: 0 0 16px;
  padding: 11px 0;
  border-top: 1px solid #e4eaec;
  border-bottom: 1px solid #e4eaec;
}

.connector-status dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.connector-status dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.setup-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.setup-fields input:disabled {
  background: #f4f6f6;
  color: #6d7f87;
}

.reference-link {
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.reference-link:hover {
  text-decoration: underline;
}

.criteria {
  align-self: start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9f9;
}

.criteria h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.criteria-note {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.criteria dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  margin: 0;
}

.criteria dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8e9;
  font-size: 12px;
}

.criteria dt {
  color: var(--muted);
}

.criteria dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.segmented {
  display: flex;
  height: 38px;
  overflow: hidden;
  border: 1px solid #bdc9ce;
  border-radius: 5px;
}

.segmented button {
  padding: 0 15px;
  border: 0;
  border-right: 1px solid #bdc9ce;
  background: #fff;
  color: #30434c;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.selected {
  background: #e6f0f1;
  color: var(--brand);
  font-weight: 600;
}

.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 -1px;
  padding-left: 10px;
  position: relative;
  z-index: 2;
}

.tabbar button {
  background: var(--tab-bg);
  border: 1px solid var(--tab-outline);
  border-bottom-color: var(--tab-border);
  border-radius: 6px 6px 0 0;
  color: var(--tab-idle-ink);
  cursor: pointer;
  font: inherit;
  font-size: var(--font-small);
  margin-right: 4px;
  padding: 9px 14px;
}

.tabbar button:hover {
  background: var(--tab-hover);
  color: var(--brand);
}

.tabbar button.selected {
  background: var(--tab-active);
  border-color: var(--tab-active);
  border-bottom-color: var(--tab-active);
  color: var(--tab-active-ink);
  font-weight: 700;
  box-shadow: 0 -2px 0 var(--accent) inset;
}

.tabbar + .panel,
.tabbar + .project-tab-panel,
.tabbar + .estimate-tab-panel {
  border-top-left-radius: 0;
}

.sheet-tabs {
  margin-top: 8px;
}

.primary-record-tabs {
  margin-top: 10px;
}

.record-workspace-tabs {
  margin-top: 10px;
  padding: 10px 12px 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: color-mix(in srgb, var(--panel) 88%, var(--brand-soft));
}

.record-workspace-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.record-workspace-label span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.record-workspace-label small {
  color: var(--muted);
  font-size: 12px;
}

#selected-project-workspace-tabs .record-workspace-label {
  flex-wrap: wrap;
  align-items: center;
}

.project-workspace-back {
  margin-left: auto;
}

.record-workspace-tabs .tabbar {
  margin-top: 0;
  padding-left: 0;
}

.project-tab-panel,
.estimate-tab-panel {
  margin-top: 0;
}

.sub-tabs {
  margin-top: 12px;
}

.sub-tabs button {
  font-size: var(--font-small);
  padding: 7px 10px;
}

.sub-tabs span {
  color: var(--muted);
  display: inline-block;
  font-weight: 700;
  margin-left: 6px;
}

.sub-tabs span:hover {
  color: #a3332f;
}

.site-workspace-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.site-workspace-head h3 {
  margin: 0;
}

.standards-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.standards-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.standards-grid span {
  color: var(--muted);
  display: block;
  font-size: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
}

.standards-grid strong {
  display: block;
  margin-top: 4px;
}

.report-context {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.report-context:empty {
  display: none;
}

.report-title {
  margin-bottom: 14px;
  font-size: 17px;
}

.report-title .badge {
  margin-left: 8px;
}

.context-grid,
.basis-grid {
  display: grid;
  gap: 12px;
}

.context-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin-bottom: 14px;
}

.context-grid div {
  color: #273840;
  font-size: 13px;
}

.context-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.basis-grid {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  padding-top: 12px;
  border-top: 1px solid #e4eaec;
}

.basis-grid span,
.report-line {
  font-size: 13px;
  color: #42545d;
}

.basis-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.criteria-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.criteria-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.criteria-card.small {
  padding: 14px;
}

.criteria-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.criteria-card h3 {
  margin: 0;
  font-size: 16px;
}

.criteria-card-head span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.crm-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.connector-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  min-width: 180px;
}

.connector-chip strong,
.connector-chip span,
.connector-chip small {
  display: block;
}

.connector-chip span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.connector-chip small {
  color: #42545d;
  margin-top: 6px;
}

.report-context p {
  margin: 0 0 14px;
  color: #374952;
  font-size: 14px;
}

.report-line {
  margin-top: 6px;
}

.release-hold {
  padding: 11px 12px;
  border: 1px solid #e8d7b4;
  border-radius: 5px;
  background: #fff7e7;
  color: var(--warning);
}

.approval-panel {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #cbd9dc;
  border-radius: 6px;
  background: #f7fafb;
}

.approval-panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.hidden {
  display: none;
}

.client-table .internal-only {
  display: none;
}

.total-row td {
  font-weight: 700;
}

.scope-detail {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.scope-detail h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.scope-card {
  margin-bottom: 10px;
  padding: 12px 11px;
  border: 1px solid #d7e0e3;
  border-radius: 6px;
  background: #fff;
}

.scope-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.scope-card p {
  margin: 0 0 5px;
  color: #40535b;
  font-size: 12px;
  line-height: 1.35;
}

.scope-card p:last-child {
  margin-bottom: 0;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin: 0;
  font-weight: 500;
}

.check-line input,
.requirement-row input {
  width: 17px;
  height: 17px;
  margin: 0;
  flex: none;
}

.contract-select {
  margin-top: 13px;
  margin-bottom: 14px;
}

.contract-review-panel {
  margin: 0;
}

.contract-tab-panel {
  margin-top: 0;
}

.government-review-panel {
  margin-top: 18px;
}

.government-evidence-panel {
  margin-top: 18px;
}

.government-file-inventory-panel {
  margin-top: 18px;
}

.government-tab-panel {
  margin-top: 0;
}

.cmmc-level-chart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.cmmc-level-chart article {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfb;
  padding: 14px;
}

.cmmc-level-chart h3 {
  margin: 0 0 6px;
}

.cmmc-level-chart strong,
.cmmc-level-chart span {
  display: block;
}

.cmmc-level-chart p {
  margin: 8px 0;
}

.cmmc-level-chart span {
  color: #42545d;
  font-size: var(--font-label);
  line-height: 1.45;
}

.cmmc-read-more {
  margin-top: 12px;
}

.cmmc-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.cmmc-detail-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.contract-review-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.contract-review-summary div {
  padding: 9px;
  border: 1px solid #d4dfe2;
  border-radius: 6px;
  background: #f8fbfb;
}

.contract-review-summary span,
.contract-review-summary strong {
  display: block;
}

.contract-review-summary span {
  color: var(--muted);
  font-size: var(--font-label);
  font-weight: 700;
}

.contract-review-summary strong {
  margin-top: 4px;
}

.contract-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.contract-ai-recommendation {
  margin-bottom: 14px;
}

.contract-ai-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.contract-ai-grid h3 {
  margin: 8px 0 6px;
  font-size: var(--font-page);
}

.contract-ai-grid ul {
  margin: 0;
  padding-left: 18px;
}

.reference-list {
  padding: 4px 18px 15px;
}

.reference-item {
  padding: 14px 0;
  border-bottom: 1px solid #e4eaec;
}

.reference-item:last-child {
  border-bottom: 0;
}

.reference-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.major-check {
  margin: 16px 0 11px;
  padding: 12px;
  border: 1px solid #d2dcdf;
  border-radius: 6px;
  background: #f7f9f9;
}

.requirement-fields {
  border-top: 1px solid var(--line);
}

.requirement-row {
  display: grid;
  grid-template-columns: 20px minmax(180px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  margin: 0;
  border-bottom: 1px solid #e4eaec;
  font-weight: 500;
}

.requirement-row strong,
.requirement-row small {
  display: block;
}

.requirement-row small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}

.outcome-source {
  margin-bottom: 18px;
}

.rfp-top-workspace {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  margin-bottom: 18px;
  width: 100%;
}

.rfp-top-workspace .outcome-source,
.rfp-top-workspace .rfi-repository-panel {
  width: 100%;
}

.rfp-project-context {
  margin: 10px 0 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-left: 4px solid var(--primary);
}

.rfp-project-context strong {
  display: block;
  margin: 2px 0;
  font-size: 14px;
}

.rfp-project-context .muted {
  display: block;
  font-size: 12px;
}

.rfp-top-workspace .outcome-source,
.rfp-top-workspace .rfi-repository-panel {
  margin: 0;
}

.outcome-upload {
  display: grid;
  grid-template-columns: minmax(200px, 1.1fr) minmax(190px, 0.8fr) minmax(260px, 1.3fr) auto;
  align-items: end;
  gap: 12px;
}

.rfp-top-workspace .outcome-upload {
  grid-template-columns: repeat(2, minmax(170px, 1fr));
}

.rfp-top-workspace .outcome-upload .field:nth-child(3) {
  grid-column: 1 / -1;
}

.outcome-upload .button {
  margin-bottom: 1px;
}

.outcome-columns {
  grid-template-columns: repeat(2, minmax(420px, 1fr));
}

.rfp-response-builder-panel {
  grid-column: 1 / -1;
}

.response-builder-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.4fr) minmax(280px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.rfp-response-builder-panel .response-builder-main .actions,
.presentation-document-panel .actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.response-builder-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 10px;
}

.response-builder-side {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.response-builder-side h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.response-export-output {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.response-export-output:empty {
  display: none;
}

.supporting-doc-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.supporting-doc-item {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--surface);
}

.supporting-doc-item strong,
.supporting-doc-item span {
  display: block;
}

.supporting-doc-item strong {
  font-size: 12px;
}

.supporting-doc-item span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.rfp-response-output {
  margin-top: 14px;
}

.response-result-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.response-section-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.response-output-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
}

.response-output-section.editable-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.response-output-section h4 {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 13px;
}

.response-output-section p,
.response-output-section li {
  font-size: 12px;
  line-height: 1.45;
}

.response-editable {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  white-space: normal;
  line-height: 1.45;
  font-size: 12px;
}

.response-editable:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 1px;
}

.response-editable p {
  margin: 0 0 10px;
}

.response-editable ul {
  margin: 0;
  padding-left: 18px;
}

.response-editable li {
  margin: 0 0 6px;
}

.response-source-trace {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.compact-empty {
  padding: 8px;
  font-size: 12px;
}

.outcome-history {
  margin-top: 18px;
}

.source-entry {
  margin-top: 14px;
}

.tall-text {
  min-height: 118px;
}

.proposal-layout {
  display: block;
}

.proposal-project-control {
  margin-bottom: 14px;
}

.proposal-project-control .outcome-upload,
.presentation-project-control .outcome-upload {
  grid-template-columns: minmax(360px, 1fr) auto auto;
}

.presentation-project-control,
.presentation-section-panel {
  margin-top: 0;
}

.presentation-version-table table {
  min-width: 100%;
}

.presentation-layout {
  display: block;
}

.presentation-export-link {
  margin-left: auto;
}

.proposal-draft-tabs {
  margin-top: 14px;
}

.proposal-section-panel {
  margin-top: 0;
}

.proposal-version-table table {
  min-width: 100%;
}

.proposal-version-table th:nth-child(1),
.proposal-version-table td:nth-child(1) {
  width: 90px;
}

.proposal-version-table th:nth-child(4),
.proposal-version-table td:nth-child(4) {
  width: 160px;
}

.proposal-version-table th:nth-child(5),
.proposal-version-table td:nth-child(5) {
  width: 240px;
}

.proposal-draft-tabs span {
  color: var(--muted);
  display: inline-block;
  font-weight: 700;
  margin-left: 8px;
}

.proposal-draft-tabs span:hover {
  color: #a3332f;
}

.proposal-meta {
  margin-bottom: 18px;
}

.document-section {
  margin-bottom: 16px;
}

.document-section h3 {
  margin: 0 0 7px;
  color: #364a52;
  font-size: 13px;
  font-weight: 650;
}

.editor-tools {
  display: flex;
  gap: 5px;
  margin-bottom: 5px;
}

.editor-tools button {
  min-width: 33px;
  height: 30px;
  border: 1px solid #bdc9ce;
  border-radius: 4px;
  background: #fff;
  color: #30434c;
  cursor: pointer;
}

.editor-tools button:hover {
  background: #edf2f3;
}

.doc-editor {
  min-height: 102px;
  padding: 10px;
  border: 1px solid #bfcbd0;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.doc-editor:focus {
  outline: 2px solid #9dcbd5;
  border-color: var(--brand);
}

.proposal-section-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.28fr) minmax(680px, 1fr);
  gap: 14px;
}

.proposal-section-list {
  border-right: 1px solid var(--line);
  padding-right: 12px;
}

.proposal-section-list-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  margin-bottom: 7px;
}

.proposal-section-list-row.selected {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

.proposal-section-list-row strong {
  display: block;
  font-size: 12px;
}

.proposal-section-list-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.proposal-section-editor-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.proposal-format-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.proposal-format-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--panel) 88%, var(--brand) 6%);
}

.proposal-section-content,
#proposal-print-root,
#proposal-print-root p,
#proposal-print-root li {
  font-family: Calibri, Arial, sans-serif;
  font-size: 11pt;
  line-height: 1.35;
  text-align: justify;
}

.proposal-section-content {
  min-height: 360px;
  max-height: 620px;
  overflow: auto;
}

.proposal-history-wrap {
  margin-top: 14px;
}

.proposal-copilot-wrap {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--panel-alt);
}

/* Right-side drawer — same treatment as the Estimate Builder line/group drawers */
.proposal-copilot-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--eb-drawer-w);
  max-width: 92vw;
  z-index: 120;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.proposal-copilot-drawer:not(.hidden) {
  transform: translateX(0);
}

.proposal-copilot-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Drawer resize handle — shared by every right-side drawer (line editor,
   group controls, proposal copilot) so users can widen it for more room. */
.eb-drawer-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  background: transparent;
  z-index: 5;
}

.eb-drawer-resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  left: 2px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.eb-drawer-resize-handle:hover::after,
.eb-drawer-resize-handle.dragging::after {
  background: var(--brand);
}

.proposal-copilot-actions .button {
  width: 100%;
}

/* Section workspace top action groups — Primary / Advanced / Review and export */
.section-action-groups {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.section-action-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-action-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-action-group .button {
  white-space: nowrap;
}

.proposal-copilot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.proposal-copilot-head h3 {
  margin: 0;
  font-size: 13px;
}

.proposal-copilot-presets {
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.proposal-copilot-chat {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  min-height: 88px;
  max-height: 240px;
  overflow: auto;
  background: var(--panel);
  margin-bottom: 8px;
}

.proposal-copilot-msg {
  margin-bottom: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 12px;
}

.proposal-copilot-msg.user {
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

.proposal-copilot-msg.assistant {
  background: var(--panel-alt);
}

.proposal-copilot-msg .role {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.proposal-copilot-preview {
  margin-top: 8px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 8px;
  min-height: 44px;
  background: var(--panel);
}

.proposal-history-wrap h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.proposal-knowledge-preview {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 10px;
  max-height: 320px;
  overflow: auto;
}

.proposal-knowledge-preview .knowledge-preview-meta {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
}

.proposal-knowledge-preview pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
}

.collapsible-panel .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.collapsible-panel.collapsed .panel-body {
  display: none;
}

.proposal-export-results {
  padding: 0 14px 10px;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.ai-layout {
  grid-template-columns: minmax(500px, 1.05fr) minmax(360px, 0.75fr);
}

.security-note {
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid #cbd9dc;
  border-radius: 6px;
  background: #f7fafb;
  color: #374952;
  font-size: 13px;
}

.security-note strong {
  display: block;
  margin-bottom: 6px;
}

.security-note p {
  margin: 0;
  line-height: 1.45;
}

.security-note code {
  font-family: Consolas, monospace;
}

.connection-summary {
  margin: 0;
}

.connection-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #e4eaec;
  font-size: 13px;
}

.connection-summary dt {
  color: var(--muted);
}

.connection-summary dd {
  margin: 0;
  max-width: 62%;
  overflow-wrap: anywhere;
  font-weight: 600;
  text-align: right;
}

.connection-actions {
  justify-content: flex-start;
}

.ai-transmission {
  margin-top: 16px;
  padding: 13px;
}

.ai-capabilities {
  margin-top: 18px;
}

.ai-outcome-state {
  padding: 10px 18px;
  border-top: 1px solid #e4eaec;
  color: var(--muted);
  font-size: 13px;
}

.ai-outcome-state a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.extraction-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  border-top: 1px solid #e4eaec;
}

.support-link-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.support-link-panel strong {
  display: block;
  margin-bottom: 4px;
}

.support-source-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.rfp-report-panel {
  margin-top: 18px;
}

.report-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.rfp-report {
  padding: 20px 22px 24px;
  background: #fff;
}

.rfp-report-cover {
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--brand);
}

.rfp-report-cover h1 {
  margin-bottom: 9px;
}

.rfp-report-cover div {
  color: #465a63;
  font-size: 13px;
}

.rfp-report-nav {
  position: static;
  top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  width: auto;
  height: auto;
  min-height: 0;
  overflow: visible;
  margin: 0 0 10px;
  padding: 0 0 10px;
  border-right: 0;
  border-bottom: 1px solid #e3e9eb;
  background: transparent;
}

.rfp-report-nav a {
  all: unset;
  display: inline;
  width: auto;
  max-width: 100%;
  padding: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rfp-report-nav a:not(:last-child)::after {
  content: "|";
  margin-left: 10px;
  color: #9fb0b7;
  font-weight: 400;
}

.rfp-report-section {
  padding: 16px 0;
  border-top: 1px solid #e3e9eb;
}

.rfp-report-section h3 {
  margin: 0 0 9px;
  color: var(--brand-dark);
  font-size: 16px;
}

.rfp-report-section p {
  margin: 0 0 10px;
  color: #273840;
  font-size: 13px;
  line-height: 1.55;
}

.rfi-repository-panel {
  margin-top: 18px;
  margin-bottom: 18px;
}

.rfi-question-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(150px, 1fr) minmax(130px, 0.6fr);
  gap: 13px 14px;
  border-bottom: 1px solid #e4eaec;
}

.rfi-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.rfi-table {
  table-layout: fixed;
}

.rfi-table th:first-child,
.rfi-table td:first-child {
  width: 48%;
}

.rfi-question-cell strong,
.rfi-question-cell span,
.rfi-question-cell small {
  display: block;
  overflow-wrap: anywhere;
}

.rfi-question-cell span {
  margin-top: 6px;
  color: #455961;
  font-size: 12px;
  line-height: 1.4;
}

.rfi-question-cell small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.rfi-status-select {
  height: 30px;
  min-width: 120px;
  padding: 0 7px;
  font-size: 12px;
}

.builder-top-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.92fr) minmax(560px, 1.08fr);
  align-items: stretch;
  gap: 14px;
}

.builder-selector-stack {
  display: grid;
  align-content: start;
  gap: 10px;
  order: 1;
}

.builder-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.builder-search-field {
  margin: 0;
}

.builder-build-section {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
}

.builder-build-section .field {
  margin: 0;
}

.builder-actions {
  justify-content: flex-start;
  margin-top: 0;
}

.builder-actions .button {
  flex: 0 1 auto;
  min-width: 0;
  padding-inline: 9px;
}

.source-actions-wrap {
  position: relative;
}

.source-actions-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 152px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
  z-index: 220;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.source-action-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  background: none;
  border: none;
  border-radius: 5px;
  font-size: var(--font-page);
  color: var(--ink);
  cursor: pointer;
}

.source-action-item:hover {
  background: var(--brand-soft);
}

.source-action-item.danger {
  color: var(--danger);
}

.source-action-item.danger:hover {
  background: #fdf0f0;
}

:root[data-theme="dark"] .source-actions-menu {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.40);
}

:root[data-theme="dark"] .source-action-item.danger:hover {
  background: #2a1414;
}

.builder-top-grid .project-basis {
  min-height: 100%;
  order: 2;
}

.builder-top-grid .basis-grid.compact {
  grid-template-columns: repeat(3, minmax(92px, 1fr));
}

.active-site-basis {
  border-top: 1px solid #dfe8ea;
  margin-top: 10px;
  padding-top: 10px;
}

.active-site-basis strong,
.active-site-basis span {
  display: block;
}

.active-site-basis strong {
  color: var(--brand);
}

.active-site-basis span {
  color: var(--muted);
  font-size: var(--font-label);
  margin-top: 3px;
}

.site-context-rail {
  grid-column: 1 / -1;
  order: 3;
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfb;
  padding: 12px;
  min-width: 0;
}

.rail-head {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 9px;
}

.rail-head strong,
.rail-head span {
  display: block;
}

.rail-head span {
  color: var(--muted);
  font-size: var(--font-label);
  margin-top: 0;
}

.site-rail-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.site-rail-list button,
.site-rail-list a {
  border: 1px solid var(--tab-outline);
  border-bottom-color: var(--tab-border);
  border-radius: 6px 6px 0 0;
  background: var(--tab-bg);
  color: var(--tab-idle-ink);
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: var(--font-small);
  padding: 9px 10px;
  text-align: left;
  text-decoration: none;
  min-width: 190px;
  width: auto;
}

.site-rail-list button.selected {
  border-color: var(--tab-active);
  border-radius: 6px 6px 0 0;
  background: var(--tab-active);
  box-shadow: inset 0 -2px 0 var(--accent);
  color: var(--tab-active-ink);
}

.site-rail-list button.selected span { color: var(--tab-active-ink); }

.site-rail-list strong,
.site-rail-list span {
  display: block;
}

.site-rail-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

.site-rail-list i {
  color: #8b3b34;
  float: right;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  margin-left: 8px;
}

.inline-actions {
  align-self: end;
  margin-top: 0;
  flex-wrap: wrap;
}

.editor-head,
.generated-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.version-timeline-panel {
  margin-top: 18px;
}

.hidden {
  display: none !important;
}

tr.selected-row,
tr.is-selected {
  background: #e2f2f1;
  box-shadow: inset 4px 0 0 var(--brand);
}

tr.selected-row td,
tr.is-selected td {
  border-top-color: #b9d8d5;
  border-bottom-color: #b9d8d5;
}

.client-workspace {
  border-top: 1px solid var(--line);
  padding: 16px;
}

.compact-head {
  padding: 0 0 12px;
}

.active-context-card {
  display: grid;
  grid-template-columns: 1.3fr 1.1fr 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #9fc9c6;
  border-left: 5px solid var(--brand);
  border-radius: 6px;
  background: #e9f6f4;
  padding: 14px 16px;
  margin: 0 0 14px;
  box-shadow: 0 1px 2px rgba(10, 40, 45, 0.08);
}

.active-context-card strong,
.active-context-card small,
.context-label {
  display: block;
}

.active-context-card strong {
  font-size: calc(var(--font-body) + 2px);
  color: #071d24;
}

.context-record-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(11, 93, 104, 0.45);
}

.context-record-link:hover {
  color: var(--brand);
  border-bottom-color: currentColor;
}

.active-context-card small {
  color: #42545d;
  margin-top: 3px;
}

.context-label {
  color: #0b5d68;
  font-size: var(--font-label);
  font-weight: 800;
  text-transform: uppercase;
}

html[data-theme="dark"] tr.selected-row,
html[data-theme="dark"] tr.is-selected {
  background: #0f2a40;
  box-shadow: inset 4px 0 0 #27a7b0;
}

html[data-theme="dark"] tr.selected-row td,
html[data-theme="dark"] tr.is-selected td {
  border-top-color: #245663;
  border-bottom-color: #245663;
}

html[data-theme="dark"] .active-context-card {
  background: #0f2a40;
  border-color: #245663;
  border-left-color: #27a7b0;
}

html[data-theme="dark"] .active-context-card strong {
  color: #f1f7f8;
}

html[data-theme="dark"] .context-record-link:hover {
  color: #71d4dc;
}

html[data-theme="dark"] .active-context-card small {
  color: #aac2c9;
}

html[data-theme="dark"] .context-label {
  color: #71d4dc;
}

.criteria-note-cell {
  min-width: 240px;
}

.criteria-note-cell input {
  width: 100%;
  min-width: 220px;
  font-size: 12px;
}

.version-history-panel {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
  background: #fbfdfe;
}

.version-history-panel.hidden {
  display: none;
}

.version-history-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.version-history-head h3 {
  margin: 0;
  font-size: 16px;
}

.version-history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.version-history-list div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--panel);
}

.version-history-list p {
  margin: 4px 0 0;
  color: var(--muted);
}

.inline-detail-row td {
  background: #fbfdfe;
}

.inline-line-editor {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.inline-line-editor.compact-inline-editor {
  grid-template-columns: minmax(130px, 0.7fr) minmax(240px, 1.5fr) minmax(70px, 0.35fr) repeat(4, minmax(95px, 0.55fr)) minmax(92px, 0.5fr) minmax(240px, 1.2fr) auto auto;
}

.inline-line-editor.advanced-inline-editor {
  margin-top: 8px;
}

.inline-line-editor.group-inline-editor {
  grid-template-columns: auto repeat(5, minmax(110px, 1fr)) auto auto;
  background: #f7fbfb;
}

.inline-line-editor label {
  display: grid;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.inline-line-editor label.wide {
  grid-column: span 2;
}

.inline-line-editor input,
.inline-line-editor select {
  min-height: 30px;
  font-size: 12px;
  padding: 5px 7px;
}

.inline-save-state {
  color: var(--muted);
  font-size: 11px;
  align-self: center;
}

.proposal-context-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 16px 14px;
}

.proposal-context-strip:empty {
  display: none;
}

.proposal-context-strip div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfdfe;
}

.proposal-context-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.proposal-context-strip strong {
  display: block;
  margin-top: 4px;
}

.managed-controls {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(5, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.managed-table-wrap {
  max-height: 58vh;
}

.managed-services-table {
  min-width: 1320px;
}

.managed-services-table th:nth-child(1),
.managed-services-table td:nth-child(1) {
  width: 58px;
  text-align: center;
}

.managed-services-table th:nth-child(3),
.managed-services-table td:nth-child(3),
.managed-services-table th:nth-child(5),
.managed-services-table td:nth-child(5),
.managed-services-table th:nth-child(6),
.managed-services-table td:nth-child(6),
.managed-services-table th:nth-child(7),
.managed-services-table td:nth-child(7) {
  width: 112px;
}

.managed-services-table input[type="number"],
.managed-services-table select {
  width: 100%;
  min-width: 88px;
}

.managed-inclusion-cell {
  min-width: 340px;
  color: var(--muted);
  font-size: var(--font-small);
}

.managed-inclusion-cell div + div {
  margin-top: 8px;
}

.managed-inclusion-cell span {
  display: block;
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
}

.muted-row {
  opacity: 0.58;
}

.managed-summary-grid,
.managed-proposal-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 14px;
}

.managed-proposal-metrics {
  padding: 0;
  margin: 14px 0;
}

.managed-proposal-metrics div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--tab-empty);
}

.managed-proposal-metrics span {
  display: block;
  color: var(--muted);
  font-size: var(--font-label);
  text-transform: uppercase;
  font-weight: 700;
}

.managed-proposal-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.managed-proposal-output {
  max-width: 1040px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  font-size: 11pt;
  text-align: justify;
}

.managed-proposal-output h2,
.managed-proposal-output h3 {
  text-align: left;
}

.managed-admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  gap: 14px;
  padding: 14px;
}

.access-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px;
}

.access-tabs {
  padding: 10px 14px 0;
}

.access-tab-panel {
  border-top: 1px solid var(--line);
}

.access-edit-panel {
  width: 100%;
}

.compact-head {
  min-height: auto;
  padding: 0 0 10px;
  border-bottom: 0;
}

.compact-head h3 {
  margin: 0;
}

.mini-panel {
  margin: 0;
}

#proposal-print-root,
#rfp-print-root {
  display: none;
}

.export-result-link {
  align-self: end;
}

.export-result-note {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

@media print {
  body:has(#proposal-print-root) > :not(#proposal-print-root) {
    display: none !important;
  }

  #proposal-print-root {
    display: block;
    color: #102b3a;
    font-family: Calibri, Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.45;
    text-align: justify;
  }

  #proposal-print-root h1 {
    font-size: 24px;
    margin-bottom: 18px;
  }

  #proposal-print-root h2 {
    border-bottom: 1px solid #cfdbe3;
    font-size: 18px;
    margin-top: 24px;
    padding-bottom: 6px;
  }

  #proposal-print-root p {
    margin: 0 0 10px;
  }

  #proposal-print-root .proposal-export-context {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, 1fr);
    margin: 12px 0 20px;
  }

  #proposal-print-root .proposal-export-context div {
    border: 1px solid #cfdbe3;
    padding: 8px;
  }

  #proposal-print-root .proposal-export-context span {
    color: #496070;
    display: block;
    font-size: 10px;
    text-transform: uppercase;
  }

  body:has(#rfp-print-root) > :not(#rfp-print-root) {
    display: none !important;
  }

  #rfp-print-root {
    display: block !important;
    color: #102b3a;
    background: #fff;
    font-family: Calibri, Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.45;
  }

  #rfp-print-root .rfp-report {
    padding: 0;
    background: #fff;
  }

  #rfp-print-root .rfp-report-nav {
    display: none !important;
  }

  #rfp-print-root .rfp-report-cover {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0b5367;
  }

  #rfp-print-root .rfp-report-cover h1 {
    color: #102b3a;
    font-size: 20px;
    margin: 0 0 10px;
  }

  #rfp-print-root .rfp-report-section {
    padding: 12px 0;
    border-top: 1px solid #d9e4e8;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #rfp-print-root .rfp-report-section h3 {
    color: #0b5367;
    font-size: 14px;
    margin: 0 0 8px;
  }

  #rfp-print-root .rfp-report-section p {
    color: #273840;
    margin: 0 0 8px;
  }
}

.inline-advanced-detail {
  margin-top: 8px;
}

.inline-advanced-detail summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.icon-text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
}

.selection-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.compact-line-editor {
  margin-top: 18px;
}

.compact-line-editor .panel-body {
  display: grid;
  gap: 8px;
}

.editor-section-label {
  margin: 4px 0 0;
  padding: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.compact-editor-row {
  display: grid;
  gap: 8px;
}

.editor-action-row {
  grid-template-columns: minmax(340px, 0.9fr) minmax(560px, 1.35fr);
}

.compact-group {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d8e4e7;
  border-radius: 6px;
  background: #f8fbfb;
}

.compact-group h3 {
  align-self: center;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.criteria-group {
  grid-template-columns: auto minmax(190px, 1fr) auto auto auto;
}

.line-detail-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(74px, 1fr));
  gap: 8px;
}

.line-detail-grid .wide {
  grid-column: span 2;
}

.line-detail-grid .small {
  min-width: 86px;
}

.line-detail-grid .tiny {
  min-width: 68px;
}

.compact-line-editor .field label {
  font-size: 10px;
  margin-bottom: 3px;
}

.compact-line-editor input,
.compact-line-editor select {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 12px;
}

.compact-line-editor .button {
  min-height: 32px;
  padding: 6px 9px;
  white-space: nowrap;
}

.notes-total-row {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(500px, 0.95fr);
  align-items: end;
  gap: 8px;
}

.notes-field {
  min-width: 0;
}

.editor-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.editor-totals div {
  padding: 7px 9px;
  border: 1px solid #d4dfe2;
  border-radius: 6px;
  background: #f8fbfb;
}

.editor-totals span,
.editor-totals strong {
  display: block;
}

.editor-totals span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.editor-totals strong {
  font-size: 15px;
}

.estimate-workbench {
  align-items: start;
  grid-template-columns: 1fr;
  margin-top: 18px;
}

.generated-lines-panel,
.imported-items-panel {
  width: 100%;
}

.generated-lines-panel {
  border-radius: 4px;
  min-width: 0;
}

/* ── Context strip ── */
.ctx-strip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  min-height: 40px;
}

.ctx-strip-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.ctx-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.ctx-chip-muted {
  color: var(--muted);
  font-weight: 400;
}

.ctx-sep {
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
}

.ctx-strip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ctx-panel.ctx-collapsed #ctxFullPanel {
  display: none;
}

/* ── 2-column workspace grid ── */
.estimate-workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.estimate-workspace-grid.has-editor {
  grid-template-columns: 1fr;
}

/* Right-side drawer — sits over the table, doesn't compress it */
.estimate-workspace-grid .line-editor-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--eb-drawer-w);
  max-width: 92vw;
  z-index: 120;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}

.estimate-workspace-grid .line-editor-panel:not(.hidden) {
  transform: translateX(0);
}

/* Drawer content is narrow — collapse every wide desktop grid down to a
   single, stacked column so nothing clips or requires internal scroll. */
.estimate-workspace-grid .line-editor-panel .compact-editor-row,
.estimate-workspace-grid .line-editor-panel .editor-action-row,
.estimate-workspace-grid .line-editor-panel .notes-total-row {
  grid-template-columns: 1fr !important;
}

.estimate-workspace-grid .line-editor-panel .compact-group,
.estimate-workspace-grid .line-editor-panel .criteria-group {
  grid-template-columns: 1fr !important;
  align-items: stretch;
}

.estimate-workspace-grid .line-editor-panel .line-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.estimate-workspace-grid .line-editor-panel .line-detail-grid .wide {
  grid-column: 1 / -1;
}

.estimate-workspace-grid .line-editor-panel .editor-totals {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.estimate-workspace-grid .line-editor-panel .field,
.estimate-workspace-grid .line-editor-panel .field.small,
.estimate-workspace-grid .line-editor-panel .field.tiny {
  min-width: 0;
}

.estimate-workspace-grid .line-editor-panel select,
.estimate-workspace-grid .line-editor-panel input {
  width: 100%;
  box-sizing: border-box;
}

/* Group Controls drawer — same right-side treatment as the line drawer,
   rendered inline in the table for event delegation but visually fixed. */
.inline-line-editor.group-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--eb-drawer-w);
  max-width: 92vw;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}

.group-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.group-drawer-head strong {
  font-size: 14px;
  color: var(--ink);
}

.group-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
}

.group-drawer-body label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.group-drawer-body label.check-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.group-drawer-body input,
.group-drawer-body select {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.group-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 18px 18px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.group-drawer-actions .button {
  width: 100%;
}

.close-group-drawer {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 2px 6px;
}

.close-group-drawer:hover {
  color: var(--ink);
}

.estimate-workbench .imported-items-panel {
  grid-column: auto;
}

.design-items-wrap,
.generated-lines-wrap {
  max-height: 590px;
  overflow: auto;
}

.generated-lines-wrap {
  width: 100%;
}

.estimate-line-tools {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.line-tools-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--panel) 60%, var(--page));
  border-bottom: 1px solid var(--line);
}

.line-tools-add-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 12px;
}

.add-line-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.add-line-input-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.add-line-search-icon {
  position: absolute;
  left: 9px;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.55;
}

.add-line-input-inner input {
  padding-left: 30px;
}

.reference-desk {
  min-width: 420px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.floating-reference {
  position: fixed;
  z-index: 48;
  min-height: 360px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 90px);
}

.floating-reference.half {
  top: 76px;
  right: 18px;
  width: min(860px, calc(100vw - 36px));
  height: min(54vh, 620px);
}

.floating-reference.side {
  top: 70px;
  right: 12px;
  width: min(720px, 44vw);
  height: calc(100vh - 88px);
}

.floating-reference.full {
  top: 70px;
  right: 12px;
  left: 230px;
  width: auto;
  height: calc(100vh - 88px);
  max-width: none;
}

.reference-desk-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  cursor: move;
}

.reference-mode-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  cursor: default;
}

.reference-mode-actions button {
  cursor: pointer;
}

.floating-reference.dragging {
  user-select: none;
}

.reference-desk-head h2 {
  margin: 0;
  font-size: 15px;
}

.reference-desk-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.reference-status {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.reference-status[data-status="error"] {
  color: var(--danger);
}

.reference-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.reference-shortcuts button {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.reference-desk iframe {
  width: 100%;
  height: calc(100% - 214px);
  min-height: 210px;
  border: 0;
  background: #fff;
}

.reference-resize-handle {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    linear-gradient(135deg, transparent 0 42%, var(--muted) 43% 47%, transparent 48%),
    linear-gradient(135deg, transparent 0 58%, var(--muted) 59% 63%, transparent 64%),
    var(--panel);
  cursor: nesw-resize;
  opacity: 0.82;
}

.reference-resize-handle:hover {
  border-color: var(--brand);
  opacity: 1;
}

.reference-edge-handle {
  position: fixed;
  right: 0;
  top: 42%;
  z-index: 49;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 12px 7px;
  border: 1px solid var(--brand);
  border-right: 0;
  border-radius: 7px 0 0 7px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.task-sheet-panel {
  border-bottom: 1px solid var(--line);
  background: #f7fbfb;
}

.task-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.task-sheet-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.task-sheet-table {
  min-width: 900px;
}

.task-sheet-table th,
.task-sheet-table td {
  height: 34px;
  padding: 7px 9px;
}

.estimate-line-tools .grow {
  min-width: 0;
}

.estimate-line-table {
  min-width: 1480px;
  font-size: 12px;
  table-layout: fixed;
}

.estimate-line-table th,
.estimate-line-table td {
  height: 34px;
  padding: 6px 8px;
}

.estimate-line-table th:nth-child(1),
.estimate-line-table td:nth-child(1) {
  width: 34px;
}

.estimate-line-table th:nth-child(2),
.estimate-line-table td:nth-child(2) {
  width: 145px;
}

.estimate-line-table th:nth-child(3),
.estimate-line-table td:nth-child(3) {
  width: 44%;
}

.estimate-line-table th:nth-child(4),
.estimate-line-table td:nth-child(4) {
  width: 48px;
  text-align: right;
}

.estimate-line-table th:nth-child(5),
.estimate-line-table td:nth-child(5),
.estimate-line-table th:nth-child(6),
.estimate-line-table td:nth-child(6),
.estimate-line-table th:nth-child(8),
.estimate-line-table td:nth-child(8),
.estimate-line-table th:nth-child(9),
.estimate-line-table td:nth-child(9),
.estimate-line-table th:nth-child(10),
.estimate-line-table td:nth-child(10) {
  width: 92px;
  text-align: right;
}

.estimate-line-table th:nth-child(7),
.estimate-line-table td:nth-child(7) {
  width: 96px;
}

.estimate-line-table .money {
  white-space: nowrap;
}

.estimate-line-table .cost-basis-cell {
  text-align: right;
}

.cost-basis-input {
  background: #fff;
  border: 1px solid #b8c8ce;
  border-radius: 4px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  height: 28px;
  max-width: 88px;
  padding: 4px 6px;
  text-align: right;
  width: 100%;
}

.cost-basis-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0, 95, 115, 0.12);
  outline: none;
}

.estimate-line-table input[type="checkbox"] {
  width: 12px;
  height: 12px;
  min-width: 12px;
  transform: scale(0.72);
}

.group-row {
  background: #eaf3f3;
  cursor: pointer;
}

.empty-category-row {
  background: #f4f7f7;
  color: #8fa0a7;
}

.empty-category-row strong {
  font-weight: 600;
}

.empty-category-row td {
  opacity: 0.62;
}

.part-group-row {
  background: #f5f8f8;
  cursor: pointer;
}

.part-group-row td {
  border-top: 1px solid #dce8e8;
}

.row-subtext {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}

.criteria-reference-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.criteria-reference-grid .full {
  grid-column: 1 / -1;
}

.criteria-reference-grid h3 {
  margin: 0 0 10px;
}

.spreadsheet-status-zone {
  padding-top: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfb;
}

.spreadsheet-tab-zone {
  position: sticky;
  top: 0;
  z-index: 8;
  padding-top: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfd;
}

.category-tab-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: end;
}

.category-tab-shell {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.category-sheet-tabs {
  flex: 1 1 0;
  min-width: 0;
}

.category-sheet-tabs {
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  white-space: nowrap;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.category-sheet-tabs::-webkit-scrollbar {
  display: none;
}

.category-sheet-tabs button {
  flex: 0 0 auto;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 34px;
  padding: 7px 10px;
  border-color: var(--tab-outline);
  border-bottom-color: var(--tab-border);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: var(--tab-bg);
  color: var(--tab-idle-ink);
  font-family: inherit;
  border-radius: 6px 6px 0 0;
  font-size: var(--font-small);
  font-weight: 400;
}

.category-sheet-tabs button:hover {
  background: var(--tab-hover);
}

.category-sheet-tabs button.selected {
  background: var(--tab-active);
  border-color: var(--tab-active);
  color: var(--tab-active-ink);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.category-sheet-tabs button span {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.category-sheet-tabs button.selected span {
  color: color-mix(in srgb, var(--tab-active-ink) 72%, transparent);
}

.category-sheet-tabs.compact-tabs {
  margin-bottom: 12px;
  min-height: auto;
}

.category-sheet-tabs.compact-tabs button {
  min-width: 150px;
  max-width: 230px;
  padding: 8px 10px;
}

.danger-row td {
  background: rgba(176, 49, 49, 0.08);
}

.danger-note {
  border-color: rgba(176, 49, 49, 0.45);
  background: rgba(176, 49, 49, 0.08);
  color: var(--text);
}

.template-category-panel {
  margin-top: 12px;
  margin-bottom: 12px;
}

.template-category-tabs {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--line);
}

.template-category-tabs button {
  max-width: 230px;
}

.category-sheet-tabs .empty-sheet-tab {
  color: #70858d;
  background: var(--tab-empty);
}

.category-sheet-tabs .summary-sheet-tab {
  margin-left: auto;
  font-weight: 800;
  border-color: var(--accent);
}

.summary-tab-pin {
  flex-shrink: 0;
  height: 31px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  background: var(--panel);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.01em;
}
.summary-tab-pin:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}
.summary-tab-pin.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.summary-tab-pin #summaryTabTotal {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}
[data-theme="dark"] .summary-tab-pin {
  background: var(--panel);
  color: var(--accent);
}

.tab-scroll-button,
.tab-more-button {
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 5px 5px 0 0;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.tab-scroll-button:disabled {
  color: #b5c1c5;
  cursor: default;
  opacity: 0.62;
}

.tab-more-wrap {
  position: relative;
}

.tab-more-button {
  width: 100%;
  font-size: 13px;
  letter-spacing: 0;
}

.tab-more-button.attention {
  border-color: var(--brand);
}

.tab-more-menu {
  position: absolute;
  right: 0;
  top: 35px;
  z-index: 20;
  width: 280px;
  max-height: 420px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}

.tab-more-menu button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.tab-more-menu button:hover,
.tab-more-menu button.selected {
  background: #eef8f8;
  color: var(--brand);
}

.tab-more-menu span {
  color: var(--muted);
}

.density-control {
  display: grid;
  grid-template-columns: 1fr;
}

.density-control label {
  margin-bottom: 2px;
  font-size: 10px;
}

.density-control select {
  height: 31px;
  font-size: 12px;
}

.estimate-summary-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0;
  margin-top: 0;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}

.summary-widget {
  min-height: 42px;
  padding: 6px 9px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.summary-widget:last-child {
  border-right: 0;
}

.summary-widget span,
.summary-widget small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.summary-widget strong {
  display: block;
  margin: 1px 0;
  font-size: 14px;
}

.summary-widget.primary {
  border-color: #a9c8cf;
  background: #eef8f8;
}

.summary-widget.warning {
  border-color: #f0d98c;
  background: #fff9e8;
}

.summary-widget.success {
  border-color: #b7ddc8;
  background: #eef9f2;
}

.estimate-build-task-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 6px;
}

.build-task {
  min-height: 43px;
  padding: 6px 8px;
  border-left: 4px solid #9fb4bc;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.build-task strong,
.build-task span {
  display: block;
}

.build-task strong {
  font-size: 11px;
}

.build-task span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.build-task.ready {
  border-left-color: var(--success);
}

.build-task.warning {
  border-left-color: var(--warning);
}

.build-task.needed {
  border-left-color: var(--danger);
}

body[data-estimate-density="compact"] .estimate-line-table,
body[data-estimate-density="compact"] .estimate-line-table input,
body[data-estimate-density="compact"] .estimate-line-table select,
body[data-estimate-density="compact"] .inline-line-editor {
  font-size: 12px;
}

body[data-estimate-density="compact"] .estimate-line-table td,
body[data-estimate-density="compact"] .estimate-line-table th {
  padding: 6px 7px;
}

body[data-estimate-density="compact"] .row-subtext {
  font-size: 10px;
}

body[data-estimate-density="micro"] .estimate-line-table,
body[data-estimate-density="micro"] .estimate-line-table input,
body[data-estimate-density="micro"] .estimate-line-table select,
body[data-estimate-density="micro"] .inline-line-editor {
  font-size: 11px;
}

body[data-estimate-density="micro"] .estimate-line-table td,
body[data-estimate-density="micro"] .estimate-line-table th {
  padding: 4px 5px;
}

body[data-estimate-density="micro"] .estimate-line-table .row-subtext,
body[data-estimate-density="micro"] .estimate-line-table small {
  font-size: 9px;
}

body[data-estimate-density="micro"] .cost-basis-input {
  max-width: 78px;
  height: 28px;
}

@media (min-width: 1800px) {
  body:has(.generated-lines-panel) main {
    padding-right: 18px;
    padding-left: 18px;
  }

  .builder-top-grid {
    grid-template-columns: minmax(520px, 0.82fr) minmax(680px, 1.18fr) minmax(240px, 0.38fr);
  }

  .estimate-line-table {
    min-width: 1760px;
  }

  .generated-lines-wrap {
    max-height: calc(100vh - 455px);
  }
}

@media (max-width: 1499px) {
  .floating-reference.half,
  .floating-reference.side,
  .floating-reference.full {
    inset: 70px 18px 18px;
    width: auto;
    height: auto;
    min-width: 0;
  }

  .reference-desk iframe {
    height: calc(100vh - 260px);
  }
}

@media (min-width: 2300px) {
  .estimate-line-table {
    min-width: 2100px;
  }

  .estimate-line-table th:nth-child(3),
  .estimate-line-table td:nth-child(3) {
    width: 50%;
  }
}

.category-add-row td {
  background: #fbfdfd;
}

.plus-row-button {
  width: 27px;
  height: 27px;
  border: 1px solid var(--brand);
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.empty-callout-button {
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed #a9c8cf;
  border-radius: 6px;
  background: #f7fcfc;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 54px 22px;
  background: rgba(7, 28, 36, 0.38);
  overflow-y: auto;
}

.modal-card {
  width: min(1100px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.line-callout-modal {
  padding-bottom: 16px;
}

.line-callout-modal > .form-grid,
.line-callout-modal > .callout-manual-grid,
.line-callout-modal > .notice,
.line-callout-modal > .actions,
.callout-results {
  margin: 14px 18px 0;
}

.callout-no-version-hint {
  margin: 10px 18px 0;
  padding: 9px 13px;
  border: 1px solid var(--warning, #d7bb72);
  border-radius: 6px;
  background: #fff9e8;
  color: #7a5c00;
  font-size: 13px;
}

.callout-manual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(280px, 2fr) 120px 120px 170px;
  gap: 12px;
}

.callout-results {
  display: grid;
  gap: 8px;
  max-height: 270px;
  overflow-y: auto;
}

.callout-result {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.callout-result:hover,
.callout-result.selected {
  border-color: var(--brand);
  background: #eef8f8;
}

.callout-result strong,
.callout-result span,
.callout-result small {
  display: block;
}

.callout-result span {
  margin-top: 3px;
  color: #31464f;
  font-size: 12px;
}

.callout-result small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.sub-tabs {
  margin-bottom: 0;
}

.criteria-subtab-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
}

.criteria-subtab-panel h3 {
  margin: 0 0 10px;
}

.reference-table {
  min-width: 760px;
}

.reference-table input {
  min-width: 0;
  width: 100%;
}

.reference-table td:nth-child(3) {
  width: 110px;
}

.reference-table td:last-child {
  width: 80px;
}

.selected-row {
  background: #f3f8df;
}

.archived-row td {
  background: #f7f9fa;
  color: var(--muted);
}

.archived-row td strong,
.archived-row td .badge,
.archived-row td .button,
.archived-row td a {
  color: inherit;
}

.archived-row .actions-cell,
.archived-row .row-menu,
.archived-row .row-menu-panel,
.archived-row .menu-item,
.archived-row .button.icon-button {
  opacity: 1;
}

.archived-row .actions-cell,
.archived-row .actions-cell .button,
.archived-row .actions-cell .menu-item,
.archived-row .actions-cell a,
.archived-row .actions-cell .row-menu-toggle {
  color: var(--ink);
}

.pursuit-schedule-card {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
}

.inline-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
}

.inline-section-head label {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 14px;
}

.compact-schedule-grid {
  padding: 14px;
}

.pursuit-notice {
  margin: 0 14px 14px;
}

.click-row {
  cursor: pointer;
}

.click-row:hover {
  background: #f6fafb;
}

.project-row-link {
  color: inherit;
  display: inline-grid;
  gap: 3px;
  text-decoration: none;
}

.project-row-link span {
  color: var(--muted);
}

.project-row-link:hover strong,
.project-row-link:focus-visible strong {
  color: var(--accent);
  text-decoration: underline;
}

.compact-list {
  margin: 0;
  padding-left: 20px;
}

.compact-list li {
  margin: 0 0 10px;
}

.code-block {
  background: var(--surface-strong, #f7fbfb);
  border: 1px solid var(--border, #cbdde2);
  border-radius: 8px;
  color: var(--text, #16262d);
  font: 12px/1.55 Consolas, "Courier New", monospace;
  margin: 12px 0 22px;
  max-height: 520px;
  overflow: auto;
  padding: 16px;
  white-space: pre;
}

.code-block code {
  color: inherit;
  font: inherit;
}

.deployment-visual-flow {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  margin: 18px 0 6px;
}

.setup-shot {
  background: linear-gradient(180deg, var(--surface, #fff), var(--surface-strong, #f7fbfb));
  border: 1px solid var(--border, #cbdde2);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 40, 48, .08);
  min-height: 210px;
  padding: 18px;
  position: relative;
}

.setup-shot h3 {
  margin: 8px 0 6px;
}

.setup-shot p {
  color: var(--muted, #5d737d);
  margin: 0 0 14px;
}

.shot-label {
  align-items: center;
  background: var(--accent, #075766);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.shot-ui {
  background: var(--surface, #fff);
  border: 1px dashed var(--border-strong, #9fb8c0);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.shot-ui span {
  background: var(--surface-strong, #eef6f4);
  border-left: 3px solid var(--accent, #075766);
  border-radius: 5px;
  color: var(--text, #16262d);
  padding: 6px 8px;
}

.snapshot-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  margin: 12px 0 20px;
}

.snapshot-card {
  margin: 0;
}

.snapshot-card figcaption {
  color: var(--text, #16262d);
  font-weight: 700;
  margin: 0 0 8px;
}

.mock-screen {
  background: #f8fbfb;
  border: 1px solid var(--border, #cbdde2);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 40, 48, .08);
  color: #18303a;
  min-height: 190px;
  padding: 16px;
}

.mock-screen.dark {
  background: #101820;
  border-color: #2b3b46;
  color: #eaf2f5;
}

.mock-title {
  border-bottom: 1px solid rgba(125, 154, 164, .35);
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 10px;
}

.mock-row {
  align-items: center;
  border-bottom: 1px solid rgba(125, 154, 164, .25);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 0;
}

.mock-select {
  background: #2d3743;
  border: 1px solid #4c5d6d;
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-width: 130px;
  padding: 7px 10px;
}

.mock-select.wide {
  background: #fff;
  border-color: var(--border, #cbdde2);
  color: #18303a;
  display: block;
  margin: 12px 0;
  text-align: left;
}

.mock-note,
.mock-warning {
  color: #536b75;
  font-size: var(--font-small);
  line-height: 1.45;
  margin-top: 12px;
}

.mock-screen.dark .mock-note {
  color: #c5d3d8;
}

.mock-warning {
  color: #b64b2a;
}

.mock-radio,
.mock-check {
  align-items: center;
  display: flex;
  gap: 8px;
  line-height: 1.35;
  margin: 0 0 12px;
}

.mock-radio::before,
.mock-check::before {
  border: 2px solid #879da6;
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  height: 14px;
  width: 14px;
}

.mock-radio::before {
  border-radius: 50%;
}

.mock-check::before {
  border-radius: 3px;
}

.mock-radio.on::before {
  background: radial-gradient(circle, #0a6980 0 42%, transparent 45%);
  border-color: #0a6980;
}

.mock-check.on::before {
  background: #0a6980;
  border-color: #0a6980;
  box-shadow: inset 0 0 0 3px #fff;
}

.mock-good {
  color: #3fc37d;
  font-weight: 700;
}

@media (max-width: 980px) {
  .deployment-visual-flow,
  .snapshot-grid {
    grid-template-columns: 1fr;
  }
}

.muted {
  color: var(--muted);
  font-size: var(--font-small);
}

.lookup-source-preview {
  display: grid;
  gap: 8px;
}

.lookup-source-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 10px;
}

.lookup-source-card > summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.lookup-source-card > summary span {
  color: var(--muted);
  font-size: var(--font-small);
}

.lookup-source-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.lookup-source-option {
  display: grid;
  grid-template-columns: 20px minmax(120px, 160px) 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

.lookup-source-price {
  font-weight: 700;
}

.lookup-source-title {
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lookup-source-history {
  margin-top: 10px;
}

.lookup-source-option.read-only {
  background: rgba(16, 61, 88, 0.04);
}

.brand,
main,
.panel-body,
input,
select,
textarea,
.button,
.status,
.subtitle,
.empty,
.badge,
.project-basis-head,
.basis-grid,
.metrics,
.lookup-preview,
.ai-outcome-state,
.rfp-report-section p,
.rfp-report-cover div,
.criteria-card,
.connector-detail,
.comparison-panel,
.outcome-draft-editor,
.generated-lines-panel,
.imported-items-panel {
  font-size: var(--font-page);
}

td {
  font-size: var(--font-small);
}

h1 {
  font-size: var(--font-title);
}

h2,
.panel-head h2,
.rfp-report-section h3 {
  font-size: var(--font-heading);
}

label,
th,
.button.compact,
.transition select,
.active-project-card select,
.active-project-meta,
.nav-group summary,
.selection-status,
.compact-line-editor .field label,
.editor-totals span,
.row-subtext,
.rfi-question-cell small,
.rfi-status-select,
.rfp-report-nav a,
.environment {
  font-size: var(--font-label);
}

.compact-line-editor input,
.compact-line-editor select,
.compact-line-editor .button,
.compact-group h3,
.rfi-question-cell span {
  font-size: var(--font-small);
}

/* Navigation uses the approved body role on every shell page. */
nav a,
.nav-group a {
  font-size: var(--font-page);
}

/* Keep the context-fact typography aligned when the older batch stylesheet loads later. */
.shell main .batch1-context-fact span,
.shell main .batch1-sticky-metrics span,
.shell main .batch1-card-metrics span,
.shell main .batch1-summary-list span {
  font-size: var(--font-label);
  font-weight: 700;
}

.shell main .batch1-context-fact strong {
  font-size: var(--font-small);
}

.editor-totals strong,
.brand-mark {
  font-size: var(--font-heading);
}

:root[data-theme="dark"] {
  background: var(--page);
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] main,
:root[data-theme="dark"] .shell {
  background: var(--page);
  color: var(--ink);
}

:root[data-theme="dark"] nav {
  background: #0d1a28;
  border-color: var(--line);
}

:root[data-theme="dark"] .nav-group summary {
  color: #c2d1d7;
}

:root[data-theme="dark"] nav a {
  background: transparent;
  color: #d8e4e8;
}

:root[data-theme="dark"] nav a:hover {
  background: #1a3039;
}

:root[data-theme="dark"] nav a.active {
  background: var(--tab-active);
  color: var(--tab-active-ink);
}

:root[data-theme="dark"] td,
:root[data-theme="dark"] label,
:root[data-theme="dark"] .panel-head h2,
:root[data-theme="dark"] .metric-list,
:root[data-theme="dark"] .field strong,
:root[data-theme="dark"] .table-wrap,
:root[data-theme="dark"] .page-head {
  color: var(--ink);
}

:root[data-theme="dark"] .subtitle,
:root[data-theme="dark"] .muted,
:root[data-theme="dark"] .small-note,
:root[data-theme="dark"] .active-project-meta,
:root[data-theme="dark"] .row-subtext {
  color: var(--muted);
}

:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .project-tab-panel,
:root[data-theme="dark"] .estimate-tab-panel,
:root[data-theme="dark"] .project-basis,
:root[data-theme="dark"] .site-context-rail,
:root[data-theme="dark"] .rfp-report-panel,
:root[data-theme="dark"] .reference-desk,
:root[data-theme="dark"] .line-callout-modal,
:root[data-theme="dark"] .task-sheet-panel,
:root[data-theme="dark"] .tab-more-menu,
:root[data-theme="dark"] .connector-panel,
:root[data-theme="dark"] .site-workspace {
  background: var(--panel);
  border-color: var(--line);
}

:root[data-theme="dark"] .spreadsheet-status-zone,
:root[data-theme="dark"] .spreadsheet-tab-zone,
:root[data-theme="dark"] .estimate-summary-widgets,
:root[data-theme="dark"] .summary-widget,
:root[data-theme="dark"] .build-task,
:root[data-theme="dark"] .site-rail-list button,
:root[data-theme="dark"] .site-rail-list a,
:root[data-theme="dark"] .reference-shortcuts button,
:root[data-theme="dark"] .tab-scroll-button,
:root[data-theme="dark"] .tab-more-button,
:root[data-theme="dark"] .callout,
:root[data-theme="dark"] .metric {
  background: #0d1a28;
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .project-basis {
  background: #0d1a28;
}

:root[data-theme="dark"] .active-site-basis {
  border-color: var(--line);
}

:root[data-theme="dark"] .active-site-basis strong,
:root[data-theme="dark"] .active-site-basis strong {
  color: #8fd5e5;
}

:root[data-theme="dark"] .site-rail-list button.selected {
  background: var(--tab-active);
  border-color: var(--tab-active);
  color: var(--tab-active-ink);
}

:root[data-theme="dark"] .site-rail-list button.selected span { color: var(--tab-active-ink); }
:root[data-theme="dark"] .site-rail-list button:not(.selected),
:root[data-theme="dark"] .site-rail-list a {
  background: var(--tab-bg);
  border-color: var(--tab-outline);
  border-bottom-color: var(--tab-border);
  color: var(--tab-idle-ink);
}

:root[data-theme="dark"] .summary-widget.primary,
:root[data-theme="dark"] .selected-row {
  background: #1c2f45;
}

:root[data-theme="dark"] .code-block {
  background: #081419;
  border-color: #2d4b56;
  color: #d9eef3;
}

:root[data-theme="dark"] .summary-widget.warning,
:root[data-theme="dark"] .badge.warning {
  background: #3b3017;
}

:root[data-theme="dark"] .summary-widget.success {
  background: #163a28;
}

:root[data-theme="dark"] .tabbar button,
:root[data-theme="dark"] .category-sheet-tabs button {
  background: var(--tab-bg);
  border-color: #355967;
  color: #dce9ed;
}

:root[data-theme="dark"] .tabbar button:hover,
:root[data-theme="dark"] .category-sheet-tabs button:hover {
  background: var(--tab-hover);
}

:root[data-theme="dark"] .tabbar button.selected,
:root[data-theme="dark"] .category-sheet-tabs button.selected,
:root[data-theme="dark"] .tab-more-menu button.selected {
  background: var(--tab-active);
  border-color: var(--tab-active);
  color: var(--tab-active-ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

:root[data-theme="dark"] .category-sheet-tabs .empty-sheet-tab {
  background: #0f1c22;
  color: #7f929b;
}

:root[data-theme="dark"] .tab-more-menu button {
  color: var(--ink);
}

:root[data-theme="dark"] .tab-more-menu button:hover {
  background: #203943;
  color: #eef8fb;
}

:root[data-theme="dark"] .button.secondary,
:root[data-theme="dark"] .button.danger {
  background: #1a2d40;
  border-color: #3c5964;
  color: var(--ink);
}

:root[data-theme="dark"] .button.ai-busy {
  background: linear-gradient(90deg, #0b4656 0%, #0f6e79 28%, #149aa8 50%, #0f6e79 72%, #0b4656 100%);
  border-color: #4fd5df;
  color: #f3ffff;
}

:root[data-theme="dark"] .button.secondary.ai-busy {
  background: linear-gradient(90deg, #13232b 0%, #18333b 28%, #20414a 50%, #18333b 72%, #13232b 100%);
  border-color: #5cb7c2;
  color: #e9fbfd;
}

:root[data-theme="dark"] .button.secondary:hover,
:root[data-theme="dark"] .button.danger:hover {
  background: #243d57;
}

:root[data-theme="dark"] .notice,
:root[data-theme="dark"] .owner-ip-notice,
:root[data-theme="dark"] .compact-notice {
  background: #152832;
  border-color: #375867;
  color: #d3e1e6;
}

:root[data-theme="dark"] a {
  color: #8fd5e5;
}

:root[data-theme="dark"] a:hover {
  color: #b9edf5;
}

:root[data-theme="dark"] .panel-head,
:root[data-theme="dark"] .report-panel-head,
:root[data-theme="dark"] .inline-section-head {
  background: #152832;
  border-color: var(--line);
}

:root[data-theme="dark"] .contract-review-summary div,
:root[data-theme="dark"] .strategy-card,
:root[data-theme="dark"] .capability-grid div,
:root[data-theme="dark"] .quick-chat-thread,
:root[data-theme="dark"] .quick-chat-message,
:root[data-theme="dark"] .quick-step,
:root[data-theme="dark"] .quick-budget-detail,
:root[data-theme="dark"] .pursuit-schedule-card,
:root[data-theme="dark"] .criteria-card,
:root[data-theme="dark"] .connector-detail,
:root[data-theme="dark"] .ai-outcome-state,
:root[data-theme="dark"] .workflow-panel,
:root[data-theme="dark"] .legal-review-panel,
:root[data-theme="dark"] .approval-panel {
  background: #0d1a28;
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .quick-chat-message.user {
  background: #1c2f45;
  border-color: #5baeff;
}

:root[data-theme="dark"] .contract-review-summary span,
:root[data-theme="dark"] .summary-widget span,
:root[data-theme="dark"] .summary-widget small,
:root[data-theme="dark"] .strategy-card p,
:root[data-theme="dark"] .capability-grid span,
:root[data-theme="dark"] .quick-chat-role,
:root[data-theme="dark"] .quick-chat-empty {
  color: var(--muted);
}

:root[data-theme="dark"] .quick-step span {
  background: #1c2f45;
  color: #8fd5e5;
}

:root[data-theme="dark"] .quick-step.done span {
  background: var(--success);
  color: #071015;
}

:root[data-theme="dark"] .quick-assistant-stage {
  border-color: rgba(143, 213, 229, 0.28);
  background: rgba(143, 213, 229, 0.1);
  color: var(--ink);
}

:root[data-theme="dark"] .quick-bom-detail th {
  background: #1c2f45;
  color: #dce9ed;
}

:root[data-theme="dark"] .quick-bom-detail td,
:root[data-theme="dark"] .quick-bom-detail th {
  border-color: var(--line);
}

:root[data-theme="dark"] .contract-review-summary strong,
:root[data-theme="dark"] .summary-widget strong,
:root[data-theme="dark"] .strategy-card strong,
:root[data-theme="dark"] .capability-grid strong {
  color: var(--ink);
}

:root[data-theme="dark"] .storage-path-preview,
:root[data-theme="dark"] .field,
:root[data-theme="dark"] .metric,
:root[data-theme="dark"] .active-context-card {
  background: #0d1a28;
  border-color: var(--line);
  color: var(--ink);
}

@media print {
  body:has(#quick-estimate-print-root) > :not(#quick-estimate-print-root) {
    display: none !important;
  }

  #quick-estimate-print-root {
    display: block !important;
  }

  body:has(#report-table) [data-page-tab="setup"],
  body:has(#report-table) [data-page-tab="output"] > .panel-body > .toolbar,
  body:has(#report-table) #approval-panel {
    display: none !important;
  }

  body:has(#report-table) [data-page-tab="output"] {
    display: block !important;
    border: 0;
    box-shadow: none;
  }

  body:has(#report-table) [data-page-tab="output"] > .panel-body {
    padding: 0;
  }

  header,
  nav,
  .outcome-source,
  .rfi-repository-panel,
  .outcome-columns,
  .outcome-history,
  .tabbar,
  .rfp-project-context,
  .report-panel-head .button,
  .page-head,
  .status {
    display: none !important;
  }

  body,
  .shell,
  main {
    display: block;
    max-width: none;
    min-height: 0;
    padding: 0;
    background: #fff;
  }

  .rfp-report-panel {
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .report-panel-head {
    display: block;
    padding: 0 0 10px;
    border: 0;
  }

  .report-panel-head h2 {
    font-size: 20px;
  }

  .rfp-report {
    padding: 0;
  }

  .rfp-report-nav {
    display: none;
  }

  .rfp-report-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

@media (max-width: 1120px) {
  header {
    height: auto;
    min-height: 62px;
    align-items: flex-start;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .header-right {
    flex-wrap: wrap;
  }

  header .active-project-card {
    width: min(520px, 50vw);
  }

  .layout.project,
  .layout.split,
  .entry-layout,
  .loaded-project-context,
  .strategy-grid,
  .capability-grid,
  .rfp-top-workspace,
  .outcome-columns,
  .proposal-layout,
  .ai-layout,
  .builder-top-grid,
  .builder-control-grid,
  .site-rail-list,
  .contract-review-summary,
  .contract-check-grid,
  .contract-ai-grid,
  .quick-intake-steps,
  .quick-message-composer,
  .quick-budget-detail-grid,
  .cmmc-level-chart,
  .cmmc-detail-grid,
  .editor-action-row,
  .compact-group,
  .criteria-group,
  .line-detail-grid,
  .notes-total-row,
  .estimate-workbench {
    grid-template-columns: 1fr;
  }

  .workflow-steps,
  .basis-grid.compact {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .builder-top-grid .basis-grid.compact {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .quick-message-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .workflow-steps div:nth-child(2) {
    border-right: 0;
  }

  .outcome-upload {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .extraction-toolbar {
    grid-template-columns: 1fr;
  }

  .support-link-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .connector-grid {
    grid-template-columns: 1fr;
  }

  .connector-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .connector-choice {
    min-width: 190px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .response-builder-layout {
    grid-template-columns: 1fr;
  }

  .response-result-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  header {
    flex-direction: column;
    align-items: stretch;
    padding: 0 15px;
  }

  .header-right {
    justify-content: flex-start;
  }

  header .active-project-card {
    width: 100%;
  }

  .shell {
    display: block;
  }

  nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 9px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  nav a {
    min-width: max-content;
    margin: 0;
  }

  main {
    padding: 18px 12px;
  }

  .form-grid,
  .metrics,
  .context-grid,
  .basis-grid,
  .setup-fields,
  .workflow-steps,
  .intake-preview dl,
  .rfi-question-form,
  .outcome-upload {
    grid-template-columns: 1fr;
  }

  .response-builder-layout {
    grid-template-columns: 1fr;
  }

  .workflow-steps div {
    border-right: 0;
    border-bottom: 1px solid #e4eaec;
  }

  .workflow-steps div:last-child {
    border-bottom: 0;
  }

  table {
    min-width: 520px;
  }

  .source-wrap {
    overflow-x: auto;
  }

  .environment {
    display: none;
  }
}

/* ── Estimate Builder: mobile overrides (≤ 900px) ─────────────────── */
@media (max-width: 900px) {
  /* Workspace: always full-width on mobile */
  .estimate-workspace-grid,
  .estimate-workspace-grid.has-editor {
    grid-template-columns: 1fr;
  }

  /* Drawer: full-width slide-up on mobile */
  .estimate-workspace-grid .line-editor-panel {
    width: 100%;
    max-width: 100vw;
    top: auto;
    height: 70vh;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  }

  .estimate-workspace-grid .line-editor-panel:not(.hidden) {
    transform: translateY(0);
  }

  .inline-line-editor.group-drawer {
    width: 100%;
    max-width: 100vw;
    top: auto;
    height: 70vh;
    border-left: none;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  }

  .proposal-copilot-drawer {
    width: 100%;
    max-width: 100vw;
    top: auto;
    height: 70vh;
    border-left: none;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
    transform: translateY(100%);
  }

  .proposal-copilot-drawer:not(.hidden) {
    transform: translateY(0);
  }

  /* Drawers slide up from the bottom on mobile — a left-edge width
     handle doesn't apply, so hide it. */
  .eb-drawer-resize-handle {
    display: none;
  }

  /* Context strip: stack chips vertically */
  .ctx-strip-bar {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Top builder grid collapses to single column */
  .builder-top-grid {
    grid-template-columns: 1fr;
  }

  /* Line detail grid: single column */
  .line-detail-grid {
    grid-template-columns: 1fr;
  }

  /* Add-row: stack input wrap above Delete button */
  .line-tools-add-row {
    flex-wrap: wrap;
  }

  .add-line-input-wrap {
    flex-wrap: wrap;
    width: 100%;
  }

  /* Filter row: wrap fields */
  .line-tools-filter-row {
    flex-wrap: wrap;
  }

  .line-tools-filter-row .field {
    flex: 1 1 140px;
  }

  /* Category tabs: ensure horizontal scroll works on touch */
  .category-tab-shell {
    overflow: visible;
  }

  #estimateCategoryTabs {
    -webkit-overflow-scrolling: touch;
  }

  /* MSRP workflow: single column on narrow */
  .msrp-workflow-steps {
    flex-direction: column;
  }

  .msrp-step {
    flex-direction: row;
    text-align: left;
    align-items: center;
  }

  .msrp-step-body {
    flex: 1;
  }

  .msrp-step-arrow {
    transform: rotate(90deg);
    align-self: center;
    padding: 0;
  }

  /* Summary pin: shrink label on small screens */
  .summary-tab-pin {
    padding: 0 10px;
    font-size: 12px;
  }

  /* AI setup link: hide label text on small screens */
  .ai-price-tools-head {
    flex-direction: column;
    gap: 8px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   CONCEPT B — Estimate Builder Shell (eb-*)
   ═══════════════════════════════════════════════════════════════ */

/* Screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Remove default main padding — the eb-page handles spacing */
.eb-page-main {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  background: #f4f7fa;
}

/* Top status bar (moved out of page-head) */
.eb-page-main > .status {
  position: fixed;
  top: 10px;
  right: 16px;
  z-index: 200;
  max-width: 360px;
}

/* Three-column shell: sidebar | resize-handle | main */
.eb-page {
  --eb-sidebar-w: 220px;
  display: grid;
  grid-template-columns: var(--eb-sidebar-w) 5px minmax(0, 1fr);
  min-height: calc(100vh - 50px);
  align-items: stretch;
  background: #eef2f7;
}

/* ── Resize handle ─────────────────────────────────── */
.eb-resize-handle {
  cursor: col-resize;
  background: #17283a;
  position: relative;
  z-index: 10;
  transition: background 0.15s;
  flex-shrink: 0;
}

.eb-resize-handle:hover,
.eb-resize-handle.dragging {
  background: #5baeff;
}

.eb-resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  right: -4px;
  bottom: 0;
}

/* ── Sidebar — dark navy ───────────────────────────── */
.eb-sidebar {
  --sb-bg:        #1e2d3d;
  --sb-bg-hover:  #253549;
  --sb-bg-active: #2d4a6b;
  --sb-border:    rgba(255,255,255,0.09);
  --sb-text:      #ddeaf5;
  --sb-muted:     #7fa3bf;
  --sb-accent:    #5baeff;
  --sb-label:     #5a8aab;

  background: var(--sb-bg);
  color: var(--sb-text);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 50px);
  user-select: none;
}

.eb-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}

.eb-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--sb-text);
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.02em;
}

.eb-sidebar-title .ti {
  font-size: 16px;
  color: var(--sb-accent);
}

.eb-sidebar-section {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.eb-sidebar-section:last-child {
  border-bottom: none;
  flex: 1;
}

.eb-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sb-label);
  margin-bottom: 2px;
}

.eb-sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

/* Override button styles inside dark sidebar */
.eb-sidebar .button {
  background: var(--sb-bg-hover);
  border-color: var(--sb-border);
  color: var(--sb-text);
  font-size: 11px;
  padding: 4px 8px;
  height: auto;
  min-height: 28px;
}

.eb-sidebar .button:hover {
  background: var(--sb-bg-active);
  border-color: var(--sb-accent);
  color: var(--sb-accent);
}

.eb-sidebar .button.primary,
.eb-sidebar #buildVersion {
  background: var(--sb-accent);
  border-color: var(--sb-accent);
  color: #fff;
}

.eb-sidebar .button.primary:hover,
.eb-sidebar #buildVersion:hover {
  background: #2d87ff;
  border-color: #2d87ff;
}

.eb-sidebar-actions .button {
  flex: 1 1 auto;
}

/* Form fields inside dark sidebar */
.eb-sidebar .field {
  margin: 0;
}

.eb-sidebar .field label {
  font-size: 10px;
  color: var(--sb-muted);
}

.eb-sidebar .field input,
.eb-sidebar .field select {
  font-size: 12px;
  height: 30px;
  background: var(--sb-bg-hover);
  border-color: var(--sb-border);
  color: var(--sb-text);
}

.eb-sidebar .field input:focus,
.eb-sidebar .field select:focus {
  border-color: var(--sb-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(77,159,255,0.2);
}

.eb-sidebar .field select option {
  background: #0d1b26;
  color: var(--sb-text);
}

.eb-site-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}

.eb-site-list button,
.eb-site-list a {
  font-size: var(--font-small) !important;
  padding: 6px 10px !important;
  border-radius: 6px 6px 0 0 !important;
  text-align: left !important;
  background: var(--tab-bg) !important;
  border-color: var(--tab-outline) !important;
  border-bottom-color: var(--tab-border) !important;
  color: var(--tab-idle-ink) !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  transition: background 0.12s !important;
}

.eb-site-list button:hover,
.eb-site-list a:hover {
  background: var(--tab-hover) !important;
  color: var(--brand) !important;
}

.eb-site-list button.active,
.eb-site-list button[aria-selected="true"],
.eb-site-list button.selected,
.eb-site-list a.active {
  background: var(--tab-active) !important;
  color: var(--tab-active-ink) !important;
  font-weight: 700 !important;
  border-color: var(--tab-active) !important;
  box-shadow: inset 0 -2px 0 var(--accent) !important;
}

.eb-project-basis {
  border-top: none !important;
  margin: 0;
  padding: 0;
}

.eb-project-basis .project-basis-head,
.eb-project-basis .basis-grid {
  padding: 6px 12px !important;
  font-size: 11px !important;
}

.eb-project-basis .basis-grid {
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
  gap: 8px !important;
}

.eb-project-basis .context-grid {
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
  gap: 8px !important;
}

/* Proposal Builder sidebar — context strip and AI outcome state on dark bg */
.eb-sidebar .proposal-context-strip {
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 0 12px 10px;
}

.eb-sidebar .proposal-context-strip div {
  background: var(--sb-bg-hover);
  border-color: var(--sb-border);
  padding: 6px 8px;
}

.eb-sidebar .proposal-context-strip span {
  color: var(--sb-label);
  font-size: 10px;
}

.eb-sidebar .proposal-context-strip strong {
  color: var(--sb-text);
  font-size: 11px;
}

.eb-sidebar .ai-outcome-state {
  padding: 6px 12px;
  border-top: none;
  color: var(--sb-muted);
  font-size: 11px;
}

.eb-sidebar .notice.compact-notice {
  background: var(--sb-bg-hover);
  border-color: var(--sb-border);
  color: var(--sb-muted);
  font-size: 11px;
  padding: 8px 10px;
}

.eb-sidebar .notice.compact-notice strong {
  color: var(--sb-text);
}

/* ── Health panel ──────────────────────────────────── */
.eb-health-section {
  flex: 1;
  min-height: 0;
}

.eb-health-progress {
  margin-bottom: 8px;
}

.eb-health-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--sb-muted);
  margin-bottom: 4px;
}

.eb-health-pct {
  font-weight: 600;
  color: var(--sb-text);
}

.eb-health-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.eb-health-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
  transition: width 0.4s ease;
}

.eb-health-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.eb-health-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--sb-text);
  line-height: 1.3;
}

.eb-health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.eb-health-dot.ok   { background: var(--success); }
.eb-health-dot.warn { background: var(--warning); }
.eb-health-dot.err  { background: var(--danger); }
.eb-health-dot.muted { background: var(--muted); opacity: 0.5; }

/* ── Main area ─────────────────────────────────────── */
.eb-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
  background: var(--page);
  position: relative;
}

.line-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.18);
  z-index: 119;
  transition: opacity 0.22s ease;
}

.line-drawer-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Top bar ───────────────────────────────────────── */
.eb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  height: 42px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-shrink: 0;
}

.eb-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.eb-crumb {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.eb-crumb-muted {
  font-weight: 400;
  color: var(--muted);
}

.eb-crumb-sep {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.eb-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.eb-topbar-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-family: inherit;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}

.eb-topbar-btn:hover {
  background: var(--page);
  border-color: var(--brand);
  color: var(--brand);
}

.eb-topbar-btn .ti {
  font-size: 13px;
}

/* ── Tabler icon utility sizing ────────────────────── */
.ti { line-height: 1; }

.add-line-search-icon.ti {
  font-size: 14px;
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
}

/* ── Dark mode adjustments (sidebar is already dark) ── */
/* ── Dark mode: eb-page creative treatment ─────────── */
[data-theme="dark"] .eb-page {
  background: #0f1923;
}

[data-theme="dark"] .eb-page-main {
  background: transparent;
}

[data-theme="dark"] .eb-main {
  background: linear-gradient(160deg, #152030 0%, #0f1923 40%, #111c2b 100%);
  position: relative;
}

/* Subtle top-left glow — gives the dark canvas depth */
[data-theme="dark"] .eb-main::before {
  content: "";
  pointer-events: none;
  position: absolute;
  top: -60px;
  left: -60px;
  width: 420px;
  height: 420px;
  background: radial-gradient(ellipse at top left, rgba(91,174,255,0.06) 0%, transparent 70%);
  z-index: 0;
}

[data-theme="dark"] .eb-topbar {
  background: rgba(15, 25, 35, 0.92);
  backdrop-filter: blur(8px);
  border-color: rgba(91,174,255,0.12);
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .eb-topbar-btn {
  background: rgba(30, 45, 61, 0.8);
  border-color: rgba(255,255,255,0.1);
  color: #c8dff0;
}

[data-theme="dark"] .eb-topbar-btn:hover {
  background: rgba(45, 74, 107, 0.9);
  border-color: #5baeff;
  color: #5baeff;
}

/* Resize handle in dark mode */
[data-theme="dark"] .eb-resize-handle {
  background: #131f2c;
}

[data-theme="dark"] .eb-resize-handle:hover,
[data-theme="dark"] .eb-resize-handle.dragging {
  background: #5baeff;
}

/* Panels inside dark main get a glass-card look */
[data-theme="dark"] .eb-main .panel,
[data-theme="dark"] .eb-main .estimate-tab-panel,
[data-theme="dark"] .eb-main .spreadsheet-tab-zone,
[data-theme="dark"] .eb-main .spreadsheet-status-zone {
  background: rgba(22, 36, 52, 0.85);
  border-color: rgba(91,174,255,0.1);
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .eb-main .panel-head {
  background: rgba(15, 25, 35, 0.7);
  border-color: rgba(91,174,255,0.1);
}

/* Tables in dark main */
[data-theme="dark"] .eb-main table,
[data-theme="dark"] .eb-main th,
[data-theme="dark"] .eb-main td {
  border-color: rgba(91,174,255,0.08);
}

[data-theme="dark"] .eb-main th,
[data-theme="dark"] .eb-main .group-row {
  background: rgba(12, 22, 34, 0.9);
  color: #7fb8e0;
}

/* Build task cards */
[data-theme="dark"] .eb-main .build-task {
  background: rgba(22, 36, 52, 0.8);
  border-color: rgba(91,174,255,0.1);
}

/* MSRP workflow steps */
[data-theme="dark"] .eb-main .msrp-step {
  background: rgba(18, 30, 46, 0.9);
  border-color: rgba(91,174,255,0.12);
}

/* Summary widgets */
[data-theme="dark"] .eb-main .summary-widget {
  background: rgba(22, 36, 52, 0.8);
  border-color: rgba(91,174,255,0.1);
}

/* ── Mobile: sidebar collapses under topbar ────────── */
@media (max-width: 900px) {
  .eb-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .eb-sidebar {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    overflow-x: auto;
    overflow-y: visible;
  }

  .eb-sidebar-head {
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  .eb-sidebar-section {
    border-bottom: none;
    border-right: 1px solid var(--line);
    min-width: 160px;
    flex: 1 1 160px;
  }

  .eb-health-section {
    width: 100%;
    flex: 1 1 100%;
    border-top: 1px solid var(--line);
    border-right: none;
  }

  .eb-topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 8px;
  }

  .eb-breadcrumb {
    width: 100%;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Clients / Accounts page — Concept B-aligned visual polish.
   Every rule below is scoped under body.clients-page (or the page's
   unique IDs #clientForm / #clientWorkspace / #selected-client-
   workspace-tabs) so nothing bleeds into other pages that happen to
   share the same base classes (.page-head, .layout, .form-grid,
   .compact-filter-row, .record-workspace-tabs, .client-workspace,
   .compact-head, .empty are all shared/global elsewhere).
   ══════════════════════════════════════════════════════════════════ */

.clients-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.clients-page .page-head h1 {
  letter-spacing: -0.01em;
}

.clients-page .compact-filter-row {
  align-items: end;
  gap: 12px;
  padding-bottom: 14px;
}

.clients-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

/* Register + Detail panels stay side-by-side on desktop, stack on
   narrower viewports instead of forcing a hard 800px+ minimum width. */
@media (max-width: 1080px) {
  .clients-page .layout {
    grid-template-columns: 1fr;
  }
}

.clients-page .record-workspace-tabs {
  margin-top: 14px;
}

.clients-page .record-workspace-label {
  flex-wrap: wrap;
  align-items: center;
}

.client-workspace-actions {
  margin-left: auto;
  flex-wrap: wrap;
}

/* Section-group labels inserted into the Client Detail form — purely
   presentational <p> elements with no name/id, so FormData(#clientForm)
   and readForm() in clients.js are unaffected. */
#clientForm .clients-form-section-label {
  grid-column: 1 / -1;
  margin: 14px 0 -2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#clientForm .clients-form-section-label:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Visually separate the destructive action from Save/New/Archive
   without reordering any button in the DOM (keeps focus/tab order
   and click handlers untouched). */
#clientForm .actions #deleteClient {
  margin-left: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

#clientWorkspace .panel-head.compact-head {
  padding-top: 4px;
}

.clients-page .empty {
  border: 1px dashed var(--line);
  border-radius: 7px;
  margin: 4px;
}

@media (max-width: 760px) {
  .clients-page .compact-filter-row {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Knowledge Library page — Concept B-aligned visual polish (Phase 2).
   Every rule below is scoped under body.knowledge-library-page so
   nothing bleeds into other pages that share the same base classes
   or element IDs — .page-head, .tabbar.sheet-tabs, .layout/.ai-layout,
   .table-wrap, .notice, .empty, .knowledge-result, and even the
   #knowledge-upload-progress / #knowledge-upload-error / #library-body
   / #knowledge-file-body IDs are all reused by owner-ip-vault.html
   (a separate, off-limits page that loads the same knowledge-library.js
   bundle in "owner" mode) and/or ai-setup.html, owner-security-testing.html,
   owner-backup-runtime.html, cloud-deployment-process.html.
   ══════════════════════════════════════════════════════════════════ */

.knowledge-library-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.knowledge-library-page .page-head h1 {
  letter-spacing: -0.01em;
}

.knowledge-library-page main > .tabbar.sheet-tabs {
  margin-bottom: 16px;
}

.knowledge-library-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

/* Libraries + Import/Usage panels stay side-by-side on desktop, stack
   on narrower viewports instead of forcing a hard 860px+ minimum width. */
@media (max-width: 1080px) {
  .knowledge-library-page .ai-layout {
    grid-template-columns: 1fr;
  }
}

.knowledge-library-page .notice {
  margin: 14px 0;
}

.knowledge-library-page .empty {
  border: 1px dashed var(--line);
  border-radius: 7px;
  margin: 4px;
}

.knowledge-library-page #knowledge-upload-progress,
.knowledge-library-page #knowledge-upload-error {
  margin-top: 14px;
}

.knowledge-library-page .knowledge-result {
  border-radius: 8px;
}

.knowledge-library-page .knowledge-search-output {
  margin-top: 12px;
}

@media (max-width: 760px) {
  .knowledge-library-page .table-actions.bulk-actions {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Platform Setup / Company Profile page — Concept B-aligned visual
   polish (Phase 3). Every rule below is scoped under body.platform-
   setup-page (or the page's unique #platform-form ID) so nothing
   bleeds into other pages that share the same base classes — .page-
   head, .tabbar.sheet-tabs, .metrics/.metric, .notice.owner-ip-notice,
   .check-row, .security-profile-picker, and .table-wrap are all
   reused by 20+ other pages including template-repository.html and
   several owner-only pages, none of which are in scope for this phase.
   ══════════════════════════════════════════════════════════════════ */

.platform-setup-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.platform-setup-page .page-head h1 {
  letter-spacing: -0.01em;
}

.platform-setup-page main > .tabbar.sheet-tabs {
  margin-bottom: 16px;
}

.platform-setup-page .metrics {
  margin-bottom: 20px;
}

.platform-setup-page .metric p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.platform-setup-page .notice.owner-ip-notice {
  margin: 16px 0;
}

/* Section-group labels inserted into the dense Company Profile form —
   purely presentational <p> elements with no id/name, so the fields{}
   lookup and payload()/setValue() in company-profile.js are unaffected. */
#platform-form .platform-form-section-label {
  grid-column: 1 / -1;
  margin: 16px 0 -2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#platform-form .platform-form-section-label:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#platform-form .check-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.platform-setup-page .security-profile-picker {
  margin-top: 4px;
}

.platform-setup-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

@media (max-width: 760px) {
  .platform-setup-page .panel-head .actions.inline-actions {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Training Center page — Concept B-aligned visual polish (Phase 4).
   Every rule below is scoped under body.training-center-page (or the
   page-local .table-add-row marker added to the "+" add-link rows) so
   nothing bleeds into other pages that share the same base classes —
   .page-head, .tabbar.sheet-tabs, .table-wrap, .capability-grid,
   .strategy-grid/.strategy-card, .workflow-panel, .badge, and
   .form-grid are all reused by 18+ other pages including several
   owner-only pages, none of which are in scope for this phase.
   Tab-switching (data-setup-tab-target / data-setup-tab) is untouched —
   no attribute, selector, or JS behavior was modified.
   ══════════════════════════════════════════════════════════════════ */

.training-center-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.training-center-page .page-head h1 {
  letter-spacing: -0.01em;
}

/* The 14-button workspace tab bar wraps onto several rows at normal
   widths already (.tabbar has flex-wrap: wrap globally) — add row
   spacing so wrapped rows don't crowd each other, and breathing room
   below before the first panel. */
.training-center-page main > .tabbar.sheet-tabs {
  row-gap: 6px;
  margin-bottom: 14px;
}

.training-center-page .panel-head {
  align-items: center;
}

.training-center-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

/* Long reference-text cells (design skills, training descriptions)
   read better with a touch more line-height than the default table
   density used for numeric/short-value tables elsewhere in the app. */
.training-center-page .table-wrap td {
  line-height: 1.45;
}

/* Visually distinguish the trailing "add a link" input row from real
   reference rows above it, without adding any new interactive
   behavior — the row and its Add Link button are unchanged. */
.training-center-page tr.table-add-row {
  background: color-mix(in srgb, var(--panel) 92%, var(--brand-soft));
}

.training-center-page tr.table-add-row td:first-child {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.training-center-page .capability-grid,
.training-center-page .strategy-grid {
  margin-top: 4px;
}

.training-center-page .notice.compact-notice {
  margin-top: 14px;
}

.training-center-page section.workflow-panel {
  margin-top: 16px;
}

@media (max-width: 760px) {
  .training-center-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .training-center-page .panel-head .actions {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Cloud Deployment Process page — Concept B-aligned visual polish
   (Phase 5). Every rule below is scoped under body.cloud-deployment-
   process-page so nothing bleeds into other pages that share the same
   base classes — .page-head, .tabbar.sheet-tabs, .panel-head, .notice,
   .callout, .grid, .table-wrap, .code-block, .compact-list, and .badge
   are all reused by 7+ other pages including several owner-only pages,
   none of which are in scope for this phase. The .uis-*, .mock-*,
   .snapshot-*, and .deployment-visual-flow embedded mockup components
   on this page are intentionally left untouched — they are bespoke,
   already-styled preview widgets, not generic reference-page chrome.
   ══════════════════════════════════════════════════════════════════ */

.cloud-deployment-process-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.cloud-deployment-process-page .page-head h1 {
  letter-spacing: -0.01em;
}

/* 14-button workspace tab bar wraps onto several rows already
   (.tabbar has flex-wrap: wrap globally) — add row spacing so
   wrapped rows don't crowd each other. */
.cloud-deployment-process-page main > .tabbar.sheet-tabs {
  row-gap: 6px;
  margin-bottom: 14px;
}

.cloud-deployment-process-page .panel-head {
  align-items: center;
}

.cloud-deployment-process-page .panel-head .badge {
  flex-shrink: 0;
}

/* .grid.two / .grid.three wrap callout cards throughout this page but
   have no layout CSS backing anywhere in the shared stylesheet, so the
   callouts currently stack full-width instead of forming a card row.
   Fixing this scoped to this page only restores the clearly-intended
   card-row presentation without touching the 7 other pages that also
   use the same unstyled .grid.two/.three markup. */
.cloud-deployment-process-page .grid {
  display: grid;
  gap: 14px;
  margin-bottom: 4px;
}

.cloud-deployment-process-page .grid.two {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.cloud-deployment-process-page .grid.three {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.cloud-deployment-process-page .grid .callout {
  margin-bottom: 0;
}

.cloud-deployment-process-page .notice {
  margin: 14px 0;
}

.cloud-deployment-process-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.cloud-deployment-process-page .table-wrap td {
  line-height: 1.45;
}

.cloud-deployment-process-page .code-block {
  margin: 12px 0;
}

.cloud-deployment-process-page .compact-list {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .cloud-deployment-process-page .grid.two,
  .cloud-deployment-process-page .grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .cloud-deployment-process-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Project Intelligence page — Concept B-aligned visual polish
   (Phase 6). Every rule below is scoped under body.project-
   intelligence-page so nothing bleeds into other pages that share the
   same base classes — .page-head, .tabbar.sheet-tabs, .panel-head,
   .metrics/.metric, .strategy-grid/.strategy-card, .table-wrap,
   .notice, and .badge are all reused by 30+ other pages including
   template-repository.html and several owner-only pages, none of
   which are in scope for this phase.
   ══════════════════════════════════════════════════════════════════ */

.project-intelligence-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.project-intelligence-page .page-head h1 {
  letter-spacing: -0.01em;
}

/* 11-button workspace tab bar wraps onto a couple of rows already
   (.tabbar has flex-wrap: wrap globally) — add row spacing so
   wrapped rows don't crowd each other. */
.project-intelligence-page main > .tabbar.sheet-tabs {
  row-gap: 6px;
  margin-bottom: 14px;
}

.project-intelligence-page .panel-head {
  align-items: center;
}

.project-intelligence-page .panel-head .badge {
  flex-shrink: 0;
}

.project-intelligence-page .metrics {
  margin-bottom: 18px;
}

.project-intelligence-page .metric p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.project-intelligence-page .strategy-grid {
  margin-bottom: 4px;
}

.project-intelligence-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.project-intelligence-page .table-wrap td {
  line-height: 1.45;
}

.project-intelligence-page .notice {
  margin: 14px 0;
}

@media (max-width: 760px) {
  .project-intelligence-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Feedback Request page — Concept B-aligned visual polish (Phase 7).
   Every rule below is scoped under body.feedback-request-page so
   nothing bleeds into other pages that share the same base classes —
   .page-head, .tabbar.sheet-tabs, .panel-head, .metrics/.metric,
   .table-wrap, .notice, .callout, .check-row, .form-grid, and .badge
   are all reused by many other pages including owner-only pages,
   none of which are in scope for this phase. The Submit Feedback /
   Preview AI-Neutralized Summary buttons keep their disabled state
   and text exactly as-is — no "Not Connected" behavior was touched.
   ══════════════════════════════════════════════════════════════════ */

.feedback-request-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.feedback-request-page .page-head h1 {
  letter-spacing: -0.01em;
}

/* 7-button workspace tab bar gets a touch more breathing room. */
.feedback-request-page main > .tabbar.sheet-tabs {
  row-gap: 6px;
  margin-bottom: 14px;
}

.feedback-request-page .panel-head {
  align-items: center;
}

.feedback-request-page .panel-head .badge {
  flex-shrink: 0;
}

.feedback-request-page .notice {
  margin-bottom: 16px;
}

.feedback-request-page .check-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.feedback-request-page .metrics {
  margin-bottom: 18px;
}

.feedback-request-page .metric p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.feedback-request-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.feedback-request-page .table-wrap td {
  line-height: 1.45;
}

.feedback-request-page .callout {
  margin-bottom: 16px;
}

@media (max-width: 760px) {
  .feedback-request-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .feedback-request-page .actions.inline-actions {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Solution Comparison page — Concept B-aligned visual polish
   (Phase 8). Every rule below is scoped under body.solution-
   comparison-page so nothing bleeds into other pages that share the
   same base classes — .page-head, .tabbar.sheet-tabs, .panel-head,
   .outcome-source, .outcome-upload, .outcome-columns, .outcome-history,
   .table-actions.bulk-actions, .table-wrap, and .form-grid are all
   reused by proposal-builder.html, rfp-response.html, presentation-
   builder.html, and engineering-review.html, none of which are in
   scope for this phase. The "AI Match - Not Connected" / "Export PPT -
   Not Connected" buttons keep their disabled state and text exactly
   as-is — no "Not Connected" behavior was touched.
   ══════════════════════════════════════════════════════════════════ */

.solution-comparison-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.solution-comparison-page .page-head h1 {
  letter-spacing: -0.01em;
}

.solution-comparison-page main > .tabbar.sheet-tabs {
  margin-bottom: 14px;
}

.solution-comparison-page .panel-head {
  align-items: center;
}

.solution-comparison-page .outcome-source {
  margin-bottom: 20px;
}

.solution-comparison-page .table-actions.bulk-actions {
  margin-top: 10px;
}

.solution-comparison-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.solution-comparison-page .layout.outcome-columns {
  gap: 16px;
}

.solution-comparison-page .form-grid {
  row-gap: 16px;
}

.solution-comparison-page .tall-text {
  line-height: 1.5;
}

.solution-comparison-page [data-page-tab="review"] .actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .solution-comparison-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .solution-comparison-page .outcome-upload {
    grid-template-columns: 1fr;
  }

  .solution-comparison-page [data-page-tab="review"] .actions {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Presentation Builder page — Concept B-aligned visual polish
   (Phase 9). Every rule below is scoped under body.presentation-
   builder-page so nothing bleeds into other pages that share the same
   base classes — .page-head, .tabbar.sheet-tabs, .panel-head,
   .outcome-upload, .table-wrap, .form-grid, .contract-check-grid,
   .reference-item, and .proposal-context-strip are all reused by
   other pages (clients.html, proposal-builder.html, rfp/contract
   pages), none of which are in scope for this phase. Every disabled
   button ("Generate PPT", "Connect Canva Agent", "Generate PPT From
   Active Version") keeps its exact disabled state, text, and position —
   no "Not Connected" or export behavior was touched.
   ══════════════════════════════════════════════════════════════════ */

.presentation-builder-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.presentation-builder-page .page-head h1 {
  letter-spacing: -0.01em;
}

.presentation-builder-page .presentation-project-control {
  margin-bottom: 16px;
}

.presentation-builder-page .presentation-workspace-tabs {
  margin-bottom: 14px;
}

.presentation-builder-page .panel-head {
  align-items: center;
}

.presentation-builder-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.presentation-builder-page .source-entry {
  margin-bottom: 4px;
}

.presentation-builder-page .presentation-chat-panel .field.full {
  margin-bottom: 4px;
}

.presentation-builder-page .presentation-chat-panel .inline-actions {
  margin-bottom: 12px;
}

.presentation-builder-page .contract-check-grid {
  margin-top: 4px;
}

.presentation-builder-page .reference-item p {
  line-height: 1.5;
}

.presentation-builder-page .presentation-draft-tabs {
  margin-top: 16px;
}

.presentation-builder-page .presentation-document-panel .form-grid {
  row-gap: 16px;
}

.presentation-builder-page .presentation-document-panel .tall-text {
  line-height: 1.5;
}

.presentation-builder-page .presentation-document-panel .actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .presentation-builder-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .presentation-builder-page .outcome-upload {
    grid-template-columns: 1fr;
  }

  .presentation-builder-page .presentation-document-panel .actions {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Engineering Review page — Concept B-aligned visual polish
   (Phase 10). Every rule below is scoped under body.engineering-
   review-page so nothing bleeds into other pages that share the same
   base classes — .page-head, .tabbar.sheet-tabs, .panel-head,
   .outcome-upload, .layout.split, .capability-grid, .workflow-steps,
   .table-wrap, and .form-grid are all reused by other pages including
   estimate-builder.html, none of which are in scope for this phase.
   This entire page is a staged/disabled workspace — every disabled
   input and button ("Upload Review Package", "Run AI Review - Not
   Connected", "Export Review Package - Not Connected", the disabled
   file input) keeps its exact disabled state, text, and position.
   ══════════════════════════════════════════════════════════════════ */

.engineering-review-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.engineering-review-page .page-head h1 {
  letter-spacing: -0.01em;
}

.engineering-review-page main > .tabbar.sheet-tabs {
  margin-bottom: 14px;
}

.engineering-review-page .panel-head {
  align-items: center;
}

.engineering-review-page .panel-head .badge {
  flex-shrink: 0;
}

.engineering-review-page .layout.split {
  gap: 16px;
}

.engineering-review-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.engineering-review-page .capability-grid {
  margin-top: 4px;
}

.engineering-review-page .workflow-steps.compact-flow {
  margin-top: 4px;
}

.engineering-review-page .form-grid {
  row-gap: 16px;
}

.engineering-review-page .tall-text {
  line-height: 1.5;
}

.engineering-review-page [data-setup-tab="ai"] .actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.engineering-review-page [data-legacy-review][hidden]{display:none!important}
.engineering-package-review{display:grid;gap:16px;min-width:0}.engineering-package-review[hidden]{display:none}.package-hero,.package-truth,.package-version-history,.package-boundary{border:1px solid var(--border);border-radius:14px;background:var(--panel);box-shadow:var(--shadow-sm)}.package-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px}.package-hero h2{margin:2px 0 6px}.eyebrow{margin:0;color:var(--muted);font-size:.74rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.package-state{display:grid;gap:4px;min-width:170px;text-align:right}.package-state .badge{justify-self:end}.package-state strong{font-size:1.45rem}.package-state small,.version-card small{color:var(--muted)}.package-truth{display:grid;grid-template-columns:2fr 1.2fr 1fr 1fr;gap:1px;overflow:hidden}.package-truth>div{display:grid;gap:5px;padding:14px;background:var(--surface)}.package-truth small{color:var(--muted)}.package-truth code{overflow:hidden;text-overflow:ellipsis}.package-boundary{padding:14px 18px;border-left:5px solid var(--warning);background:var(--warning-soft)}.package-version-history{padding:0 16px 16px}.version-cards{display:flex;gap:10px;overflow-x:auto;padding-bottom:2px}.version-card{display:grid;gap:4px;min-width:230px;padding:12px;text-align:left;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:inherit}.version-card.selected{border-color:var(--primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 18%,transparent)}.version-card code{font-size:.75rem}.package-section-tabs{display:flex;gap:8px;overflow-x:auto;padding:4px 2px 8px;scrollbar-width:thin}.package-section-tabs button{white-space:nowrap;border:1px solid var(--border);border-radius:999px;padding:9px 13px;background:var(--panel);color:inherit;font-weight:700}.package-section-tabs button[aria-selected="true"]{background:var(--primary);border-color:var(--primary);color:#fff}.package-section{overflow:hidden}.package-section .panel-head{align-items:flex-start}.package-section td small{display:block;margin-top:5px;color:var(--muted);font-family:var(--font-mono);overflow-wrap:anywhere}.package-metadata{display:grid;gap:3px;font-size:.78rem}.package-empty{margin:16px;padding:22px;border:1px dashed var(--border);border-radius:10px;color:var(--muted);text-align:center}.package-empty p{margin:6px 0 0}.package-sources{margin:16px;padding:16px;border:1px solid var(--border);border-radius:10px}.package-sources>div{display:grid;grid-template-columns:1.4fr 2fr .8fr;gap:12px;padding:10px 0;border-top:1px solid var(--border)}.package-sources code{overflow-wrap:anywhere}
@media(max-width:900px){.package-truth{grid-template-columns:1fr 1fr}.package-sources>div{grid-template-columns:1fr}.package-hero{align-items:stretch}.package-state{text-align:left}.package-state .badge{justify-self:start}}
@media(max-width:640px){.package-hero{display:grid}.package-truth{grid-template-columns:1fr}.engineering-package-review .table-wrap{overflow-x:auto}.package-section-tabs{margin-inline:-4px}.version-card{min-width:205px}}

@media (max-width: 760px) {
  .engineering-review-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .engineering-review-page .outcome-upload {
    grid-template-columns: 1fr;
  }

  .engineering-review-page [data-setup-tab="ai"] .actions {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Subscription Tiers page — Concept B-aligned visual polish
   (Phase 11). Every rule below is scoped under body.subscription-
   tiers-page so nothing bleeds into other pages that share the same
   base classes — .panel, .panel-head, .table-wrap, and .actions are
   reused throughout the app. This page has no shared header/nav shell
   (intentional pre-auth marketing page) and loads no JS at all, so
   this is a pure CSS-only visual pass. No tier name, price, feature
   text, or link/route was changed.
   ══════════════════════════════════════════════════════════════════ */

.subscription-tiers-page main.shell {
  padding: 0 16px;
}

.subscription-tiers-page .panel {
  padding: 4px;
}

.subscription-tiers-page .panel-head {
  padding-bottom: 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.subscription-tiers-page .panel-head h1 {
  letter-spacing: -0.01em;
}

.subscription-tiers-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}

.subscription-tiers-page table td,
.subscription-tiers-page table th {
  padding: 12px 14px;
}

/* Plan name and monthly price are the two columns a visitor scans
   first when comparing tiers — give them visual weight without
   changing the underlying text. */
.subscription-tiers-page table td:first-child {
  font-weight: 700;
}

.subscription-tiers-page table td:nth-child(2) {
  font-weight: 700;
  color: var(--brand);
}

.subscription-tiers-page .actions {
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .subscription-tiers-page .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .subscription-tiers-page .actions .button {
    text-align: center;
  }
}

/* Quick Estimate Concept B Stage A: shell layout scope only */
.quick-estimate-page .eb-sidebar .form-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.quick-estimate-page .eb-sidebar .field textarea {
  min-height: 96px;
  resize: vertical;
}

.quick-estimate-page .eb-main .quick-ai-console {
  margin-top: 0;
}

.quick-estimate-page .eb-main > .tabbar.sheet-tabs {
  margin-top: 14px;
}

/* ══════════════════════════════════════════════════════════════════
   Quick Estimate — Concept B Stage A visual polish (this phase).
   Codex's Stage A migration (block above) handled structural shell
   scoping; everything below is presentation only, scoped under
   .quick-estimate-page. No ID, data attribute, class toggle, or JS
   hook is touched — #exportQuickWord and #printQuickPdf keep their
   exact ids/positions.

   Real issue found and fixed here: .quick-step / .quick-assistant-
   stage were designed for a light .panel-body background (light gray
   fill, dark text) and now render inside the dark .eb-sidebar without
   any theme-aware override, producing a washed-out light box against
   the dark sidebar. Re-themed using the sidebar's own --sb-* custom
   properties (same technique already used for .eb-project-basis).
   ══════════════════════════════════════════════════════════════════ */

.quick-estimate-page .eb-sidebar-head {
  padding-bottom: 13px;
}

.quick-estimate-page .eb-sidebar .quick-intake-steps {
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.quick-estimate-page .eb-sidebar .quick-step {
  background: var(--sb-bg-hover);
  border-color: var(--sb-border);
  color: var(--sb-muted);
  min-height: 32px;
  padding: 6px 9px;
}

.quick-estimate-page .eb-sidebar .quick-step span {
  background: var(--sb-bg-active);
  color: var(--sb-accent);
  width: 18px;
  height: 18px;
  font-size: 10px;
  flex-shrink: 0;
}

.quick-estimate-page .eb-sidebar .quick-step.done {
  border-color: color-mix(in srgb, var(--success) 45%, var(--sb-border));
  color: var(--sb-text);
}

.quick-estimate-page .eb-sidebar .quick-step.done span {
  background: var(--success);
  color: #fff;
}

.quick-estimate-page .eb-sidebar .quick-assistant-stage {
  width: 100%;
  margin: 2px 0 4px;
  padding: 7px 10px;
  border-color: var(--sb-border);
  background: var(--sb-bg-hover);
  color: var(--sb-text);
}

.quick-estimate-page .eb-sidebar .eb-sidebar-section.eb-health-section {
  flex: 0 0 auto;
}

/* Main canvas spacing */
.quick-estimate-page .eb-main .panel-head {
  align-items: center;
}

.quick-estimate-page .eb-main .quick-message-composer {
  margin-top: 10px;
}

.quick-estimate-page .eb-main .quick-chat-thread {
  margin-bottom: 4px;
}

.quick-estimate-page .eb-main .notice.compact-notice + .notice.compact-notice {
  margin-top: 8px;
}

.quick-estimate-page .eb-main .estimate-summary-widgets {
  margin-bottom: 14px;
}

.quick-estimate-page .eb-main .quick-budget-detail {
  margin-bottom: 14px;
}

.quick-estimate-page .eb-main .strategy-grid {
  margin-top: 2px;
}

/* Shared long-form review pattern: opt a page and its draft fields in together.
   Ten visible lines replace corner-dragging; longer drafts scroll inside the field.
   The page keeps a clear area below its last panel for reading and review. */
body.onex-longform-page textarea.onex-longform-textarea {
  box-sizing: border-box;
  line-height: 1.4;
  height: calc(14em + 20px);
  min-height: calc(14em + 20px);
  max-height: calc(14em + 20px);
  overflow-y: auto;
  resize: none;
  scrollbar-gutter: stable;
}

/* Keep the final control or panel clear of the viewport edge across the
   application shell. Standalone login/registration and print layouts are not
   part of the shell. */
@media screen {
  body .shell > main,
  body > main.shell {
    padding-bottom: clamp(120px, 18vh, 220px) !important;
  }
}

@media (max-width: 760px) {
  .quick-estimate-page .eb-main .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .quick-estimate-page .eb-main .actions.inline-actions {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   ONEX Claude UX Design Queue — Batch A visual polish.
   Every rule below is additive, scoped per-page under its own body
   class, and does not touch any shared selector definition.
   ══════════════════════════════════════════════════════════════════ */

/* Phase 13 — register.html */
.register-page main.shell {
  padding: 0 16px;
}

.register-page .panel {
  padding: 4px;
}

.register-page .panel-head {
  padding-bottom: 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.register-page .panel-head h1 {
  letter-spacing: -0.01em;
}

.register-page .form-grid {
  row-gap: 16px;
}

.register-page .actions {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .register-page .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .register-page .actions .button {
    text-align: center;
  }
}

/* Phase 14 — user-dashboard.html */
.user-dashboard-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.user-dashboard-page .page-head h1 {
  letter-spacing: -0.01em;
}

.user-dashboard-page main > .tabbar.sheet-tabs {
  margin-bottom: 14px;
}

.user-dashboard-page .panel-head {
  align-items: center;
}

.user-dashboard-page .panel-head .badge {
  flex-shrink: 0;
}

.user-dashboard-page .metrics {
  margin-top: 12px;
}

.user-dashboard-page .progress-flow {
  gap: 8px;
}

.user-dashboard-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.user-dashboard-page .capability-grid {
  margin-top: 4px;
}

@media (max-width: 760px) {
  .user-dashboard-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* Phase 15 — user-preferences.html */
.user-preferences-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.user-preferences-page .page-head h1 {
  letter-spacing: -0.01em;
}

.user-preferences-page main > .tabbar.sheet-tabs {
  margin-bottom: 14px;
}

.user-preferences-page .panel-head {
  align-items: center;
}

.user-preferences-page .panel-head .badge {
  flex-shrink: 0;
}

.user-preferences-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.user-preferences-page .capability-grid,
.user-preferences-page .strategy-grid {
  margin-top: 4px;
}

.user-preferences-page [data-setup-tab="appearance"] .actions {
  margin-top: 4px;
}

@media (max-width: 760px) {
  .user-preferences-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* Phase 16 — notification-center.html */
.notification-center-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.notification-center-page .page-head h1 {
  letter-spacing: -0.01em;
}

.notification-center-page main > .tabbar.sheet-tabs {
  margin-bottom: 14px;
}

.notification-center-page .panel-head {
  align-items: center;
}

.notification-center-page .panel-head .badge {
  flex-shrink: 0;
}

.notification-center-page .strategy-grid {
  margin-bottom: 4px;
}

.notification-center-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.notification-center-page .table-wrap td {
  line-height: 1.45;
}

.notification-center-page .form-grid {
  row-gap: 16px;
}

.notification-center-page .workflow-steps.compact-flow {
  margin-top: 4px;
}

@media (max-width: 760px) {
  .notification-center-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* Phase 17 — data-governance.html */
.data-governance-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.data-governance-page .page-head h1 {
  letter-spacing: -0.01em;
}

.data-governance-page main > .tabbar.sheet-tabs {
  margin-bottom: 14px;
}

.data-governance-page .panel-head {
  align-items: center;
}

.data-governance-page .panel-head .badge {
  flex-shrink: 0;
}

.data-governance-page .strategy-grid {
  margin-bottom: 4px;
}

.data-governance-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.data-governance-page .table-wrap td {
  line-height: 1.45;
}

.data-governance-page .form-grid {
  row-gap: 16px;
}

.data-governance-page .layout.split {
  gap: 16px;
}

.data-governance-page .storage-path-preview {
  margin-bottom: 10px;
}

.data-governance-page .workflow-steps.compact-flow {
  margin-top: 4px;
}

.data-governance-page .capability-grid {
  margin-top: 4px;
}

@media (max-width: 760px) {
  .data-governance-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* Phase 18 — secure-cloud-foundation.html */
.secure-cloud-foundation-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.secure-cloud-foundation-page .page-head h1 {
  letter-spacing: -0.01em;
}

.secure-cloud-foundation-page main > .tabbar.sheet-tabs {
  margin-bottom: 14px;
}

.secure-cloud-foundation-page .panel-head {
  align-items: center;
}

.secure-cloud-foundation-page .panel-head .badge {
  flex-shrink: 0;
}

.secure-cloud-foundation-page .notice {
  margin-bottom: 14px;
}

.secure-cloud-foundation-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}

.secure-cloud-foundation-page .table-wrap:last-child {
  margin-bottom: 0;
}

.secure-cloud-foundation-page .table-wrap td {
  line-height: 1.5;
}

@media (max-width: 760px) {
  .secure-cloud-foundation-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* Phase 19 — government-compliance.html */
.government-compliance-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.government-compliance-page .page-head h1 {
  letter-spacing: -0.01em;
}

.government-compliance-page main > .tabbar.sheet-tabs.government-tabs {
  margin-bottom: 14px;
}

.government-compliance-page .panel-head {
  align-items: center;
}

.government-compliance-page .layout.split {
  gap: 16px;
}

.government-compliance-page .form-grid {
  row-gap: 16px;
}

.government-compliance-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.government-compliance-page .cmmc-level-chart {
  margin-top: 4px;
  margin-bottom: 14px;
}

.government-compliance-page .cmmc-read-more {
  margin-top: 4px;
}

@media (max-width: 760px) {
  .government-compliance-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .government-compliance-page .actions.inline-actions {
    flex-wrap: wrap;
  }
}

/* Phase 20 — contract-vehicles.html */
.contract-vehicles-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.contract-vehicles-page .page-head h1 {
  letter-spacing: -0.01em;
}

.contract-vehicles-page main > .tabbar.sheet-tabs.contract-tabs {
  margin-bottom: 14px;
}

.contract-vehicles-page .panel-head {
  align-items: center;
}

.contract-vehicles-page .form-grid {
  row-gap: 16px;
}

.contract-vehicles-page #selected-vehicle:not(:empty) {
  margin-top: 10px;
}

@media (max-width: 760px) {
  .contract-vehicles-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .contract-vehicles-page .actions.inline-actions {
    flex-wrap: wrap;
  }
}

/* Phase 21 — rfp-database.html */
.rfp-database-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.rfp-database-page .page-head h1 {
  letter-spacing: -0.01em;
}

.rfp-database-page main > .tabbar.sheet-tabs {
  row-gap: 6px;
  margin-bottom: 14px;
}

.rfp-database-page .panel-head {
  align-items: center;
}

.rfp-database-page .metrics {
  margin-bottom: 16px;
}

.rfp-database-page .metric p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.rfp-database-page .form-grid {
  row-gap: 16px;
}

.rfp-database-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.rfp-database-page .table-wrap td {
  line-height: 1.45;
}

.rfp-database-page .strategy-grid {
  margin-top: 2px;
}

.rfp-database-page .notice {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .rfp-database-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .rfp-database-page .actions.inline-actions {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   ai-design-assistant-setup.html — Batch B, Page 1.
   Visual polish only, scoped under body.ai-design-assistant-setup-page.
   No id, name, checkbox value, default checked state, or notice text
   was touched — verified against the HTML before writing these rules.
   ══════════════════════════════════════════════════════════════════ */

.ai-design-assistant-setup-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.ai-design-assistant-setup-page .page-head h1 {
  letter-spacing: -0.01em;
}

.ai-design-assistant-setup-page .panel {
  margin-bottom: 16px;
}

.ai-design-assistant-setup-page .panel:last-child {
  margin-bottom: 0;
}

.ai-design-assistant-setup-page .panel-head {
  align-items: center;
}

.ai-design-assistant-setup-page .notice.compact-notice {
  margin-bottom: 14px;
}

.ai-design-assistant-setup-page #design-assistant-form .form-grid {
  row-gap: 14px;
}

.ai-design-assistant-setup-page #design-assistant-form .form-grid + .form-grid {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ai-design-assistant-setup-page #design-assistant-form .actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ai-design-assistant-setup-page .connection-summary {
  margin: 0;
}

.ai-design-assistant-setup-page #designJobStatus {
  margin-top: 12px;
}

.ai-design-assistant-setup-page #designReviewOutput,
.ai-design-assistant-setup-page #designEvaluationOutput {
  margin-top: 10px;
}

.ai-design-assistant-setup-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

@media (max-width: 760px) {
  .ai-design-assistant-setup-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .ai-design-assistant-setup-page .actions {
    flex-wrap: wrap;
  }

  .ai-design-assistant-setup-page #design-assistant-form .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════════
   ai-setup.html — Batch B, Page 2.
   Visual polish only, scoped under body.ai-setup-page. .ai-layout is
   shared with knowledge-library.html, so every rule below targets it
   only within this page's scope. The inline mountShell("ownerAiSetup")
   bootstrap script and #apiKey's type/autocomplete were not touched —
   this is a CSS/body-class-only change.
   ══════════════════════════════════════════════════════════════════ */

.ai-setup-page .page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.ai-setup-page .page-head h1 {
  letter-spacing: -0.01em;
}

.ai-setup-page main > .tabbar.sheet-tabs.ai-setup-tabs {
  row-gap: 6px;
  margin-bottom: 14px;
}

.ai-setup-page .panel-head {
  align-items: center;
}

.ai-setup-page .ai-layout {
  gap: 16px;
}

.ai-setup-page .security-note {
  margin-bottom: 4px;
}

.ai-setup-page #ai-form .form-grid {
  row-gap: 14px;
  margin-top: 14px;
}

.ai-setup-page #ai-form .actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ai-setup-page .connection-summary {
  margin: 0;
}

.ai-setup-page .connection-actions {
  margin-top: 12px;
}

.ai-setup-page .notice.ai-transmission {
  margin-top: 12px;
}

.ai-setup-page .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.ai-setup-page .table-wrap td {
  line-height: 1.5;
}

.ai-setup-page .strategy-grid {
  margin-top: 4px;
}

.ai-setup-page .notice.owner-ip-notice {
  margin-top: 14px;
}

.ai-setup-page #cloud .form-grid {
  row-gap: 14px;
}

@media (max-width: 900px) {
  .ai-setup-page .ai-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ai-setup-page .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .ai-setup-page .actions.inline-actions {
    flex-wrap: wrap;
  }
}
.source-identity-list {
  display: grid;
  gap: 10px;
}

.source-identity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.source-label-view,
.source-label-edit {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

@media (max-width: 760px) {
  .source-identity-row { grid-template-columns: 1fr; }
}

/* Quick Estimate V2: approved compact capture and assistant workspace. */
.quick-estimate-page .quick-estimate-workspace {
  display: block;
  min-height: calc(100vh - 50px);
  background: #eef2f7;
}

.quick-estimate-page .quick-estimate-workspace > .eb-main {
  width: 100%;
  min-width: 0;
  padding: 0 14px 28px;
}

.quick-estimate-page .quick-context-ribbon {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

.quick-estimate-page .quick-context-field {
  min-width: 0;
  margin: 0;
  padding: 8px 10px 9px;
  border-right: 1px solid var(--line);
}

.quick-estimate-page .quick-context-field:last-child {
  border-right: 0;
}

.quick-estimate-page .quick-context-field label,
.quick-estimate-page .quick-section-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-estimate-page .quick-context-field input,
.quick-estimate-page .quick-context-field select {
  width: 100%;
  height: 29px;
  min-width: 0;
  margin-top: 3px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.quick-estimate-page .quick-context-field input:focus,
.quick-estimate-page .quick-context-field select:focus {
  border-color: var(--brand);
  outline: none;
}

.quick-estimate-page .quick-health-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.quick-estimate-page .quick-health-bar .quick-intake-steps {
  margin: 0;
}

.quick-estimate-page .quick-health-bar .quick-step {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--panel);
}

.quick-estimate-page .quick-health-bar .quick-step span {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.quick-estimate-page .quick-health-bar .quick-assistant-stage {
  margin: 0;
  padding: 6px 9px;
  white-space: nowrap;
}

.quick-estimate-page .eb-main > .tabbar.sheet-tabs {
  margin: 0 0 12px;
  overflow-x: auto;
  white-space: nowrap;
}

.quick-estimate-page .quick-capture-grid {
  display: grid;
  grid-template-columns: minmax(0, 62fr) minmax(320px, 38fr);
  gap: 12px;
  align-items: start;
}

.quick-estimate-page .quick-capture-main,
.quick-estimate-page .quick-assistant-companion {
  margin: 0;
}

.quick-estimate-page .quick-capture-main textarea {
  min-height: 330px;
  resize: vertical;
}

.quick-estimate-page .quick-assistant-companion {
  display: flex;
  flex-direction: column;
  max-height: 690px;
  overflow: hidden;
}

.quick-estimate-page .quick-assistant-head {
  padding: 10px 12px;
}

.quick-estimate-page .quick-assistant-head h2 {
  font-size: 14px;
}

.quick-estimate-page .quick-assistant-body {
  min-height: 0;
  overflow-y: auto;
}

.quick-estimate-page .quick-chat-thread {
  min-height: 88px;
  max-height: 270px;
  margin: 0;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  resize: none;
}

.quick-estimate-page .quick-chat-empty {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.quick-estimate-page .quick-chat-message {
  max-width: 92%;
  padding: 7px 9px;
}

.quick-estimate-page .quick-message-field {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.quick-estimate-page .quick-message-field textarea {
  min-height: 54px;
  resize: vertical;
}

.quick-estimate-page .quick-action-tier {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.quick-estimate-page .quick-primary-actions,
.quick-estimate-page .quick-utility-actions {
  display: flex;
  gap: 6px;
}

.quick-estimate-page .quick-primary-actions .button {
  flex: 1 1 0;
  min-height: 36px;
  justify-content: center;
}

.quick-estimate-page .quick-utility-actions {
  flex-wrap: wrap;
}

.quick-estimate-page .quick-utility-actions .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 11px;
}

.quick-estimate-page .quick-settings-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.quick-estimate-page .quick-settings-row .field {
  min-width: 0;
  margin: 0;
}

.quick-estimate-page .quick-settings-row select {
  min-height: 32px;
  font-size: 11px;
}

.quick-estimate-page .quick-guidance-details {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 11px;
}

.quick-estimate-page .quick-guidance-details summary {
  cursor: pointer;
  font-weight: 700;
}

.quick-estimate-page .quick-guidance-details .notice {
  margin-top: 7px;
  padding: 8px;
}

.quick-estimate-page .quick-configuration-links a {
  margin-right: 8px;
}

.quick-estimate-page .quick-rom-empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.quick-estimate-page .quick-rom-empty-state strong {
  color: var(--text);
  font-size: 16px;
}

.quick-estimate-page .quick-rom-empty-state p {
  max-width: 560px;
  margin: 0;
}

.quick-estimate-page #pushCrmTicket:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.quick-estimate-page .quick-rom-status-band {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(180, 91, 43, 0.32);
  background: rgba(241, 168, 66, 0.12);
}

.quick-estimate-page .quick-rom-status-band strong {
  color: #9a4e17;
  font-size: 12px;
  text-transform: uppercase;
}

.quick-estimate-page .quick-rom-status-band span {
  color: var(--muted);
  font-size: 12px;
}

.quick-estimate-page .quick-rom-panel .estimate-summary-widgets,
.quick-estimate-page .quick-rom-panel .quick-budget-detail {
  margin-bottom: 12px;
}

.quick-estimate-page .quick-bom-detail {
  overflow-x: auto;
}

.quick-estimate-page .quick-bom-detail table {
  min-width: 720px;
  table-layout: fixed;
}

.quick-estimate-page .quick-bom-detail th,
.quick-estimate-page .quick-bom-detail td {
  padding: 6px 8px;
  font-size: 12px;
}

.quick-estimate-page .quick-bom-detail th:nth-child(1) { width: 18%; }
.quick-estimate-page .quick-bom-detail th:nth-child(2) { width: 8%; }
.quick-estimate-page .quick-bom-detail th:nth-child(3) { width: 54%; }
.quick-estimate-page .quick-bom-detail th:nth-child(4) { width: 20%; }

.quick-estimate-page .quick-budget-detail-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.quick-estimate-page .eb-main .panel-head {
  align-items: center;
}

.quick-estimate-page .eb-main .strategy-grid {
  margin-top: 2px;
}

@media (max-width: 1024px) {
  .quick-estimate-page .quick-context-ribbon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-estimate-page .quick-context-field:nth-child(3n) {
    border-right: 0;
  }

  .quick-estimate-page .quick-context-field:nth-child(-n+3) {
    border-bottom: 1px solid var(--line);
  }

  .quick-estimate-page .quick-health-bar {
    grid-template-columns: 1fr;
  }

  .quick-estimate-page .quick-health-bar .quick-assistant-stage {
    white-space: normal;
  }

  .quick-estimate-page .quick-capture-grid {
    grid-template-columns: 1fr;
  }

  .quick-estimate-page .quick-assistant-companion {
    max-height: none;
  }

  .quick-estimate-page .quick-budget-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .quick-estimate-page .quick-estimate-workspace > .eb-main {
    padding: 0 8px 20px;
  }

  .quick-estimate-page .quick-context-ribbon,
  .quick-estimate-page .quick-settings-row {
    grid-template-columns: 1fr;
  }

  .quick-estimate-page .quick-context-field {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quick-estimate-page .quick-context-field:last-child {
    border-bottom: 0;
  }

  .quick-estimate-page .quick-primary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-estimate-page .eb-main .panel-head,
  .quick-estimate-page .quick-rom-status-band {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* Estimate Builder final approved workbench architecture. Presentation only. */
.estimate-builder-page .eb-page {
  display: block;
  min-height: calc(100vh - 54px);
  overflow: visible;
}

.estimate-builder-page .eb-sidebar,
.estimate-builder-page #ebResizeHandle {
  display: none !important;
}

.estimate-builder-page .eb-main {
  width: 100%;
  min-width: 0;
  overflow-x: clip;
  padding-bottom: 24px;
}

.estimate-builder-page .eb-context-workspace {
  margin: 10px 12px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  overflow: visible;
}

.estimate-builder-page .eb-context-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) repeat(5, minmax(130px, 1fr)) auto;
  align-items: end;
}

.estimate-builder-page .eb-context-selector,
.estimate-builder-page .eb-context-value,
.estimate-builder-page .eb-context-actions {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
}

.estimate-builder-page .eb-context-selector .field {
  min-width: 0;
  margin: 0 0 5px;
}

.estimate-builder-page .eb-context-selector .field:last-child {
  margin-bottom: 0;
}

.estimate-builder-page .eb-context-selector label,
.estimate-builder-page .eb-context-value span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.estimate-builder-page .eb-context-selector input,
.estimate-builder-page .eb-context-selector select {
  width: 100%;
  height: 30px;
  min-width: 0;
  font-size: 11px;
}

.estimate-builder-page .eb-context-value {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.estimate-builder-page .eb-context-value strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-builder-page .eb-context-actions {
  display: flex;
  gap: 5px;
  border-right: 0;
}

.estimate-builder-page .eb-source-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, var(--accent));
}

.estimate-builder-page .eb-source-context > div {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: baseline;
  gap: 8px;
}

.estimate-builder-page .eb-source-context span,
.estimate-builder-page .eb-readiness-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.estimate-builder-page .eb-source-context strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-builder-page .eb-readiness-context {
  display: flex;
  align-items: center;
  min-height: 43px;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  overflow: visible;
}

.estimate-builder-page .eb-readiness-title {
  flex: 0 0 auto;
}

.estimate-builder-page .eb-readiness-summary {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.estimate-builder-page .eb-readiness-chip {
  display: inline-flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12px;
  white-space: nowrap;
}

.estimate-builder-page button.eb-readiness-chip {
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}

.estimate-builder-page .eb-readiness-chip strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.estimate-builder-page .eb-readiness-chip.ready {
  border-color: #abd9c1;
  background: #edf8f2;
}

.estimate-builder-page .eb-readiness-chip.warning {
  border-color: #e4c58d;
  background: #fff7e7;
}

.estimate-builder-page .eb-readiness-chip.needed {
  border-color: #e4baba;
  background: #fff0f0;
}

.estimate-builder-page .eb-readiness-disclosure {
  position: relative;
  flex: 0 0 auto;
}

.estimate-builder-page .eb-readiness-disclosure > summary {
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style-position: inside;
  white-space: nowrap;
}

.estimate-builder-page .eb-readiness-disclosure[open] .eb-readiness-projection {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  width: min(760px, calc(100vw - 340px));
  max-height: min(420px, calc(100vh - 180px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: auto;
  z-index: 24;
}

.estimate-builder-page .eb-readiness-projection {
  display: flex;
  align-items: center;
  gap: 7px;
}

.estimate-builder-page .eb-project-basis {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.estimate-builder-page .eb-health-checklist {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.estimate-builder-page .eb-health-item {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 10px;
}

.estimate-builder-page .eb-basis-context-row,
.estimate-builder-page .eb-basis-detail-grid {
  display: grid;
  gap: 7px;
}

.estimate-builder-page .eb-basis-context-row {
  grid-template-columns: 1.4fr 1fr 0.7fr;
  margin-bottom: 7px;
}

.estimate-builder-page .eb-basis-detail-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.estimate-builder-page .eb-basis-context-row div,
.estimate-builder-page .eb-basis-detail-grid div {
  min-width: 0;
}

.estimate-builder-page .eb-basis-context-row span,
.estimate-builder-page .eb-basis-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.estimate-builder-page .eb-basis-context-row strong,
.estimate-builder-page .eb-basis-detail-grid strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-builder-page .eb-basis-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.estimate-builder-page .eb-basis-location {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.estimate-builder-page .eb-health-progress {
  width: 120px;
  min-width: 120px;
  margin: 0;
}

.estimate-builder-page .eb-health-meta {
  color: var(--muted);
}

.estimate-builder-page .eb-site-workspaces {
  margin: 6px 12px 0;
}

.estimate-builder-page .estimate-tabs {
  margin: 8px 12px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft, #f4f7f8);
}

.estimate-builder-page .estimate-tabs > button {
  min-height: 34px;
  border-bottom: 3px solid transparent;
}

.estimate-builder-page .estimate-tabs > button.selected {
  border-bottom-color: var(--tab-active);
}

.estimate-builder-page .estimate-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 74fr) minmax(300px, 26fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px 0;
}

.estimate-builder-page .estimate-workspace-grid .generated-lines-panel {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
}

.estimate-builder-page .estimate-sticky-summary {
  position: sticky;
  bottom: 0;
  z-index: 9;
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  border-top: 3px solid var(--brand);
  box-shadow: 0 -3px 10px rgba(22, 39, 49, 0.12);
}

.estimate-builder-page .estimate-sticky-summary .estimate-summary-widgets {
  grid-template-columns: repeat(9, minmax(78px, 1fr));
  border-top: 0;
}

.estimate-builder-page .estimate-sticky-summary .summary-widget {
  min-height: 52px;
  padding: 7px 9px;
}

.estimate-builder-page .estimate-workspace-grid .line-editor-panel,
.estimate-builder-page .estimate-workspace-grid .line-editor-panel:not(.hidden) {
  position: sticky;
  top: 8px;
  right: auto;
  bottom: auto;
  grid-column: 2;
  grid-row: 1;
  width: auto;
  max-width: none;
  max-height: calc(100vh - 20px);
  z-index: 8;
  overflow-y: auto;
  transform: none;
  transition: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(22, 39, 49, 0.08);
}

.estimate-builder-page.eb-reference-open .line-editor-panel,
.estimate-builder-page.eb-group-editor-open .line-editor-panel {
  visibility: hidden;
  pointer-events: none;
}

.estimate-builder-page .line-editor-panel .eb-drawer-resize-handle {
  display: none;
}

.estimate-builder-page .line-editor-panel .panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 10px;
}

.estimate-builder-page .line-editor-panel .panel-body {
  padding: 9px;
}

.estimate-builder-page .eb-workbench-tabs {
  position: sticky;
  top: 57px;
  z-index: 2;
  display: flex;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.estimate-builder-page .eb-workbench-tabs button {
  flex: 1;
  min-height: 33px;
  padding: 6px 3px;
  border: 1px solid var(--tab-outline);
  border-bottom-color: var(--tab-border);
  border-radius: 6px 6px 0 0;
  background: var(--tab-bg);
  color: var(--tab-idle-ink);
  font: inherit;
  font-size: var(--font-small);
  font-weight: 400;
  cursor: pointer;
}

.estimate-builder-page .eb-workbench-tabs button.selected {
  border-color: var(--tab-active);
  background: var(--tab-active);
  color: var(--tab-active-ink);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.estimate-builder-page .line-editor-panel .eb-wb-group,
.estimate-builder-page .line-editor-panel .eb-wb-pricing,
.estimate-builder-page .line-editor-panel .eb-wb-notes {
  display: none !important;
}

.estimate-builder-page .line-editor-panel[data-eb-workbench-tab="group"] .eb-wb-summary,
.estimate-builder-page .line-editor-panel[data-eb-workbench-tab="pricing"] .eb-wb-summary,
.estimate-builder-page .line-editor-panel[data-eb-workbench-tab="notes"] .eb-wb-summary {
  display: none !important;
}

.estimate-builder-page .line-editor-panel[data-eb-workbench-tab="group"] .eb-wb-group,
.estimate-builder-page .line-editor-panel[data-eb-workbench-tab="pricing"] .eb-wb-pricing,
.estimate-builder-page .line-editor-panel[data-eb-workbench-tab="notes"] .eb-wb-notes {
  display: grid !important;
}

.estimate-builder-page .line-editor-panel .notes-total-row {
  display: block;
}

.estimate-builder-page .line-editor-panel .editor-totals {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.estimate-builder-page .category-tab-shell {
  display: block;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.estimate-builder-page .category-tab-head {
  grid-template-columns: 150px minmax(0, 1fr) 150px;
  align-items: end;
  gap: 8px;
}

.estimate-builder-page .eb-category-filter,
.estimate-builder-page .eb-add-technology {
  min-width: 0;
  margin: 0;
}

.estimate-builder-page .eb-category-filter label,
.estimate-builder-page .eb-add-technology label {
  margin-bottom: 2px;
  font-size: 10px;
}

.estimate-builder-page .eb-category-filter select,
.estimate-builder-page .eb-add-technology select {
  width: 100%;
  height: 31px;
  padding: 4px 7px;
  font-size: 11px;
}

.estimate-builder-page .category-sheet-tabs {
  display: flex;
  min-width: 0;
  max-width: 100%;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  touch-action: pan-x;
  padding: 2px;
}

.estimate-builder-page .category-sheet-tabs .eb-category-card {
  flex: 0 0 165px;
  width: 165px;
  min-width: 165px;
  max-width: 165px;
  min-height: 76px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  transition: width 120ms ease, flex-basis 120ms ease, max-width 120ms ease;
}

.estimate-builder-page .category-sheet-tabs .eb-category-card.selected {
  flex-basis: 280px;
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  border-color: var(--brand);
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--brand);
}

.estimate-builder-page .eb-category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  margin-left: 0;
  color: var(--ink);
}

.estimate-builder-page .eb-category-title strong {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-builder-page .eb-category-title em {
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-style: normal;
}

.estimate-builder-page .eb-category-title em.ready {
  color: #0c6a41;
  background: #e9f7ef;
}

.estimate-builder-page .eb-category-title em.warning {
  color: #8b5200;
  background: #fff1d7;
}

.estimate-builder-page .eb-category-figures {
  display: flex;
  align-items: flex-start;
  gap: 6px 10px;
  min-width: 0;
  margin-top: 7px;
  margin-left: 0;
}

.estimate-builder-page .eb-category-metric {
  display: block;
  flex: 0 0 auto;
  min-width: 32px;
  margin-left: 0;
  color: var(--ink);
}

.estimate-builder-page .eb-category-expanded-only[hidden] {
  display: none !important;
}

.estimate-builder-page .eb-category-figures small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
  text-transform: uppercase;
}

.estimate-builder-page .eb-category-figures b {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.estimate-builder-page .category-sheet-tabs .eb-category-card.selected .eb-category-title,
.estimate-builder-page .category-sheet-tabs .eb-category-card.selected .eb-category-metric,
.estimate-builder-page .category-sheet-tabs .eb-category-card.selected .eb-category-figures b {
  color: var(--ink);
}

.estimate-builder-page .category-sheet-tabs .eb-category-card.selected .eb-category-figures small {
  color: var(--muted);
}

.estimate-builder-page .estimate-line-tools {
  gap: 7px;
  padding: 8px 10px;
  background: var(--panel);
}

.estimate-builder-page .eb-build-tools {
  margin: 0;
}

.estimate-builder-page .eb-build-tools > summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 750;
}

.estimate-builder-page .eb-build-tools-body {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft, #f4f7f8);
}

.estimate-builder-page .line-tools-add-row {
  padding: 0;
}

.estimate-builder-page .add-line-input-wrap {
  gap: 7px;
}

.estimate-builder-page .add-line-input-wrap .field {
  margin: 0;
}

.estimate-builder-page .add-line-input-wrap label {
  margin-bottom: 2px;
  font-size: 10px;
}

.estimate-builder-page .add-line-input-wrap input,
.estimate-builder-page .add-line-input-wrap button {
  min-height: 32px;
}

.estimate-builder-page .add-line-input-wrap .qty-field {
  flex: 0 0 72px;
}

.estimate-builder-page .estimate-grid-utility-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.estimate-builder-page .estimate-grid-utility-row .density-control {
  width: 116px;
}

.estimate-builder-page .line-selection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.estimate-builder-page .eb-pricing-resolution {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.estimate-builder-page .eb-pricing-resolution > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 11px;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
}

.estimate-builder-page .eb-pricing-resolution > summary span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.estimate-builder-page .eb-pricing-resolution > summary em {
  margin-left: auto;
  color: var(--brand);
  font-style: normal;
  font-weight: 700;
}

.estimate-builder-page .eb-pricing-resolution .ai-price-tools {
  border-top: 1px solid var(--line);
}

.estimate-builder-page .generated-lines-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.estimate-builder-page .generated-lines-wrap table {
  min-width: 1050px;
}

.estimate-builder-page .eb-version-management {
  position: relative;
}

.estimate-builder-page .eb-version-management > summary {
  list-style: none;
  cursor: pointer;
}

.estimate-builder-page .eb-version-management .bulk-actions {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 12;
  display: grid;
  min-width: 190px;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.estimate-builder-page .eb-version-management .bulk-actions[popover],
.estimate-builder-page .eb-readiness-disclosure[open] .eb-readiness-projection[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  max-height: calc(100vh - 16px);
  overflow: auto;
}

.estimate-builder-page .eb-readiness-disclosure[open] .eb-readiness-projection[popover] {
  width: min(760px, calc(100vw - 16px));
}

.estimate-builder-page .version-timeline-panel .actions-cell {
  display: flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 1280px) {
  .estimate-builder-page .eb-context-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }
}

@media (max-width: 1024px) {
  .estimate-builder-page .eb-readiness-summary {
    overflow-x: auto;
  }

  .estimate-builder-page .eb-readiness-disclosure[open] .eb-readiness-projection {
    position: fixed;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .estimate-builder-page .estimate-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .estimate-builder-page .estimate-workspace-grid .generated-lines-panel,
  .estimate-builder-page .estimate-workspace-grid .line-editor-panel,
  .estimate-builder-page .estimate-workspace-grid .line-editor-panel:not(.hidden) {
    position: static;
    grid-column: 1;
    width: auto;
    max-width: none;
    max-height: none;
    transform: none;
  }

  .estimate-builder-page .estimate-sticky-summary {
    grid-column: 1;
    grid-row: 3;
  }

  .estimate-builder-page .estimate-sticky-summary .estimate-summary-widgets {
    grid-template-columns: repeat(3, minmax(95px, 1fr));
    overflow-x: auto;
  }

  .estimate-builder-page .estimate-workspace-grid .generated-lines-panel {
    grid-row: 1;
  }

  .estimate-builder-page .estimate-workspace-grid .line-editor-panel,
  .estimate-builder-page .estimate-workspace-grid .line-editor-panel:not(.hidden) {
    grid-row: 2;
  }

  .estimate-builder-page .eb-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .estimate-builder-page .category-tab-head {
    grid-template-columns: 130px minmax(0, 1fr) 130px;
  }
}

@media (max-width: 640px) {
  .estimate-builder-page .eb-context-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .estimate-builder-page .eb-source-context {
    align-items: stretch;
    flex-direction: column;
  }

  .estimate-builder-page .eb-source-context > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .estimate-builder-page .category-tab-head {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .estimate-builder-page .category-tab-shell {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .estimate-builder-page .eb-build-tools-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .estimate-builder-page .add-line-input-wrap {
    flex-wrap: wrap;
  }

  .estimate-builder-page .add-line-input-wrap .grow {
    flex-basis: 100%;
  }
}

/* Quote Imports reviewed-commit workflow */
.quote-imports-page main {
  min-width: 0;
}

.quote-imports-page .quote-page-head {
  align-items: flex-start;
}

.quote-imports-page .quote-context-band {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.quote-imports-page .quote-context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.quote-imports-page .quote-context-grid > div {
  min-width: 0;
  padding: 8px 11px;
  border-right: 1px solid var(--line);
}

.quote-imports-page .quote-context-grid > div:last-child {
  border-right: 0;
}

.quote-imports-page .quote-context-grid span,
.quote-imports-page .quote-source-summary span,
.quote-imports-page .quote-summary-strip span,
.quote-imports-page .quote-commit-counts span,
.quote-imports-page .quote-confirm-identity span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.quote-imports-page .quote-context-grid strong,
.quote-imports-page .quote-source-summary strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-imports-page .quote-primary-tabs {
  margin: 0 0 10px;
}

.quote-imports-page .quote-primary-tabs button {
  min-width: 140px;
}

.quote-imports-page .quote-stage-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.quote-imports-page .quote-stage {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.quote-imports-page .quote-stage.is-current {
  border-color: #b66a00;
  color: #7a4500;
  background: #fff1dc;
}

.quote-imports-page .quote-stage.is-complete {
  border-color: #278265;
  color: #176148;
  background: #e5f5ef;
}

.quote-imports-page .quote-stage.is-failed {
  border-color: #bc4242;
  color: #8f2626;
  background: #fde9e9;
}

.quote-imports-page .quote-authority-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  padding: 8px 11px;
  border-left: 3px solid #b66a00;
  background: #fff5e6;
  color: #5d4726;
  font-size: 11px;
}

.quote-imports-page .quote-authority-note strong {
  flex: 0 0 auto;
}

.quote-imports-page .quote-upload-panel {
  margin-bottom: 10px;
}

.quote-imports-page .quote-upload-panel .panel-head,
.quote-imports-page .quote-inventory-head,
.quote-imports-page .quote-review-panel .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quote-imports-page .quote-upload-panel .panel-head p,
.quote-imports-page .quote-inventory-head p,
.quote-imports-page .quote-review-panel .panel-head p {
  margin: 2px 0 0;
  font-size: 11px;
}

.quote-imports-page .quote-upload-grid {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px 10px;
}

.quote-imports-page .quote-upload-grid .full {
  grid-column: 1 / -1;
}

.quote-imports-page .quote-source-summary {
  display: grid;
  grid-template-columns: minmax(210px, 1.4fr) repeat(3, minmax(150px, 1fr));
  border-top: 1px solid var(--line);
}

.quote-imports-page .quote-source-summary > div {
  min-width: 0;
  padding: 8px 11px;
  border-right: 1px solid var(--line);
}

.quote-imports-page .quote-source-summary > div:last-child {
  border-right: 0;
}

.quote-imports-page .quote-source-summary small,
.quote-imports-page .quote-inventory-table td small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-imports-page .quote-empty-state,
.quote-imports-page .quote-committed-state {
  display: grid;
  gap: 5px;
  margin: 10px 0;
  padding: 24px 18px;
  border: 1px dashed var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
}

.quote-imports-page .quote-empty-state strong,
.quote-imports-page .quote-committed-state strong {
  color: var(--ink);
}

.quote-imports-page .quote-empty-state.is-loading {
  border-style: solid;
  border-color: #b66a00;
}

.quote-imports-page .quote-empty-state.is-failed {
  border-color: #bc4242;
  color: #8f2626;
  background: #fde9e9;
}

.quote-imports-page .quote-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  margin-bottom: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.quote-imports-page .quote-summary-strip > div {
  padding: 7px 10px;
  border-right: 1px solid var(--line);
}

.quote-imports-page .quote-summary-strip > div:last-child {
  border-right: 0;
}

.quote-imports-page .quote-summary-strip strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.quote-imports-page .quote-review-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.quote-imports-page .quote-filter-group,
.quote-imports-page .quote-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.quote-imports-page .quote-filter-group .selected {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--panel);
}

.quote-imports-page .quote-search {
  display: grid;
  min-width: min(340px, 45vw);
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.quote-imports-page .quote-search input {
  min-height: 32px;
}

.quote-imports-page .quote-review-panel {
  margin: 0;
}

.quote-imports-page .quote-review-table-wrap,
.quote-imports-page .quote-inventory-wrap {
  max-height: min(52vh, 610px);
  overflow: auto;
}

.quote-imports-page .quote-review-table,
.quote-imports-page .quote-inventory-table {
  min-width: 1180px;
}

.quote-imports-page .quote-review-table th,
.quote-imports-page .quote-review-table td,
.quote-imports-page .quote-inventory-table th,
.quote-imports-page .quote-inventory-table td {
  padding: 6px 8px;
  font-size: 11px;
  vertical-align: middle;
  white-space: nowrap;
}

.quote-imports-page .quote-review-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-soft);
}

.quote-imports-page .quote-review-table .quote-description {
  min-width: 220px;
  max-width: 320px;
  white-space: normal;
}

.quote-imports-page .quote-review-table tr.is-excluded {
  opacity: .48;
}

.quote-imports-page .quote-review-table tr.has-exception td:first-child {
  border-left: 3px solid #bc4242;
}

.quote-imports-page .quote-row-include {
  width: 18px;
  height: 18px;
}

.quote-imports-page .quote-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.quote-imports-page .quote-state.ready {
  color: #176148;
  background: #e5f5ef;
}

.quote-imports-page .quote-state.review {
  color: #7a4500;
  background: #fff1dc;
}

.quote-imports-page .quote-state.info {
  color: #285a75;
  background: #e8f2f8;
}

.quote-imports-page .quote-state.blocked {
  color: #8f2626;
  background: #fde9e9;
}

.quote-imports-page .quote-commit-bar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quote-imports-page .quote-commit-counts {
  display: flex;
  gap: 24px;
}

.quote-imports-page .quote-commit-counts strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.quote-imports-page .quote-commit-bar > div:last-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quote-imports-page .quote-exception-warning {
  margin: 0;
  max-width: 430px;
  padding: 6px 8px;
  border-left: 3px solid #b66a00;
  color: #7a4500;
  background: #fff1dc;
  font-size: 10px;
}

.quote-imports-page .quote-committed-state {
  border-style: solid;
  border-color: #278265;
  color: #176148;
  background: #e5f5ef;
}

.quote-imports-page .quote-inventory-head .quote-search {
  margin-left: auto;
}

.quote-imports-page .quote-row-actions {
  min-width: 350px;
}

.quote-imports-page .quote-commit-dialog {
  width: min(520px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quote-imports-page .quote-commit-dialog::backdrop {
  background: rgba(10, 20, 27, .52);
}

.quote-imports-page .quote-commit-dialog form {
  padding: 16px;
}

.quote-imports-page .quote-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quote-imports-page .quote-dialog-head h2 {
  margin: 0;
  font-size: 17px;
}

.quote-imports-page .quote-confirm-identity,
.quote-imports-page .quote-confirm-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0;
  border: 1px solid var(--line);
}

.quote-imports-page .quote-confirm-identity > div,
.quote-imports-page .quote-confirm-counts > div {
  min-width: 0;
  padding: 8px;
  border-right: 1px solid var(--line);
}

.quote-imports-page .quote-confirm-identity > div:last-child,
.quote-imports-page .quote-confirm-counts > div:last-child {
  border-right: 0;
}

.quote-imports-page .quote-confirm-identity strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-imports-page .quote-confirm-counts dt {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.quote-imports-page .quote-confirm-counts dd {
  margin: 3px 0 0;
  font-size: 17px;
  font-weight: 800;
}

.quote-imports-page .quote-authority-copy {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1024px) {
  .quote-imports-page .quote-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-imports-page .quote-context-grid > div:nth-child(2) {
    border-right: 0;
  }

  .quote-imports-page .quote-upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-imports-page .quote-source-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-imports-page .quote-source-summary > div:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 700px) {
  .quote-imports-page .quote-primary-tabs,
  .quote-imports-page .quote-review-toolbar,
  .quote-imports-page .quote-commit-bar,
  .quote-imports-page .quote-commit-bar > div:last-child {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-imports-page .quote-primary-tabs button,
  .quote-imports-page .quote-search {
    width: 100%;
    min-width: 0;
  }

  .quote-imports-page .quote-context-grid,
  .quote-imports-page .quote-upload-grid,
  .quote-imports-page .quote-source-summary,
  .quote-imports-page .quote-confirm-identity,
  .quote-imports-page .quote-confirm-counts {
    grid-template-columns: minmax(0, 1fr);
  }

  .quote-imports-page .quote-context-grid > div,
  .quote-imports-page .quote-source-summary > div,
  .quote-imports-page .quote-confirm-identity > div,
  .quote-imports-page .quote-confirm-counts > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quote-imports-page .quote-summary-strip {
    grid-template-columns: repeat(5, minmax(90px, 1fr));
    overflow-x: auto;
  }

  .quote-imports-page .quote-commit-counts {
    justify-content: space-between;
    gap: 10px;
  }

  .quote-imports-page .quote-row-actions {
    min-width: 320px;
  }
}
.contract-vehicles-page .contract-context {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) repeat(4, minmax(130px, 1fr));
  border: 1px solid var(--border);
  background: var(--panel);
  margin: 0 0 10px;
}

.contract-vehicles-page .contract-context > div,
.contract-vehicles-page .contract-project-picker {
  display: grid;
  gap: 3px;
  align-content: center;
  min-width: 0;
  min-height: 58px;
  padding: 9px 12px;
  border-right: 1px solid var(--border);
}

.contract-vehicles-page .contract-context > :last-child { border-right: 0; }

.contract-vehicles-page .contract-context span,
.contract-vehicles-page .contract-evidence-grid dt,
.contract-vehicles-page .contract-criteria-item dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.contract-vehicles-page .contract-context strong {
  overflow-wrap: anywhere;
  text-transform: capitalize;
}

.contract-vehicles-page .contract-project-picker select {
  width: 100%;
  min-width: 0;
  padding: 5px 28px 5px 7px;
}

.contract-vehicles-page .contract-handoffs,
.contract-vehicles-page .contract-health-strip,
.contract-vehicles-page .contract-line-tools {
  display: flex;
  gap: 7px;
}

.contract-vehicles-page .contract-handoffs {
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.contract-vehicles-page .contract-health-strip {
  overflow-x: auto;
  padding: 9px 0;
}

.contract-vehicles-page .contract-health-chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 6px 9px;
  font-size: 12px;
}

.contract-vehicles-page .contract-health-chip.is-current { border-left: 3px solid #16835b; }
.contract-vehicles-page .contract-health-chip.is-review { border-left: 3px solid #ba7713; }
.contract-vehicles-page .contract-health-chip.is-blocked { border-left: 3px solid #b33a3a; }

.contract-vehicles-page .contract-review-body {
  display: grid;
  gap: 12px;
}

.contract-vehicles-page .contract-review-section,
.contract-vehicles-page .contract-evidence,
.contract-vehicles-page .contract-ai-entry,
.contract-vehicles-page .contract-empty,
.contract-vehicles-page .contract-manual-review {
  border: 1px solid var(--border);
  background: var(--panel);
}

.contract-vehicles-page .contract-section-head,
.contract-vehicles-page .contract-ai-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.contract-vehicles-page .contract-section-head h3,
.contract-vehicles-page .contract-ai-entry p { margin: 0; }

.contract-vehicles-page .contract-section-head span,
.contract-vehicles-page .contract-ai-entry p {
  color: var(--muted);
  font-size: 12px;
}

.contract-vehicles-page .contract-review-table {
  max-height: 440px;
  overflow: auto;
  border-top: 1px solid var(--border);
}

.contract-vehicles-page .contract-review-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.contract-vehicles-page .contract-review-table td small { color: var(--muted); }

.contract-vehicles-page .contract-line-tools {
  align-items: center;
  padding: 0 12px 10px;
}

.contract-vehicles-page .contract-line-tools label {
  font-size: 12px;
  font-weight: 700;
}

.contract-vehicles-page .contract-line-tools input {
  width: min(460px, 100%);
  padding: 6px 8px;
}

.contract-vehicles-page .contract-evidence-grid,
.contract-vehicles-page .contract-criteria-item dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--border);
}

.contract-vehicles-page .contract-evidence-grid > div,
.contract-vehicles-page .contract-criteria-item dl > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
}

.contract-vehicles-page .contract-evidence-grid > :last-child,
.contract-vehicles-page .contract-criteria-item dl > :last-child { border-right: 0; }

.contract-vehicles-page .contract-evidence-grid dd,
.contract-vehicles-page .contract-criteria-item dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.contract-vehicles-page .contract-empty,
.contract-vehicles-page .contract-manual-review { padding: 18px; }

.contract-vehicles-page .contract-empty p,
.contract-vehicles-page .contract-manual-review p {
  margin: 6px 0 12px;
  color: var(--muted);
}

.contract-vehicles-page .contract-empty.is-expired { border-left: 4px solid #b33a3a; }
.contract-vehicles-page .contract-manual-review { border-left: 4px solid #ba7713; }

.contract-vehicles-page .contract-criteria-list {
  display: grid;
  gap: 10px;
}

.contract-vehicles-page .contract-criteria-item { border: 1px solid var(--border); }

.contract-vehicles-page .contract-criteria-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.contract-vehicles-page .contract-criteria-head h3 { margin: 0; }
.contract-vehicles-page .contract-criteria-item dl { grid-template-columns: 1.2fr 1.4fr 2fr 1fr; }

@media (max-width: 1024px) {
  .contract-vehicles-page .contract-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contract-vehicles-page .contract-context > div,
  .contract-vehicles-page .contract-project-picker { border-bottom: 1px solid var(--border); }
  .contract-vehicles-page .contract-evidence-grid,
  .contract-vehicles-page .contract-criteria-item dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .contract-vehicles-page .contract-context,
  .contract-vehicles-page .contract-evidence-grid,
  .contract-vehicles-page .contract-criteria-item dl { grid-template-columns: 1fr; }
  .contract-vehicles-page .contract-handoffs,
  .contract-vehicles-page .contract-section-head,
  .contract-vehicles-page .contract-ai-entry,
  .contract-vehicles-page .contract-line-tools {
    align-items: stretch;
    flex-direction: column;
  }
}
/* Page 007C: governed Reports / Export workspace. */
.reports-workspace {
  min-width: 0;
  overflow-x: hidden;
}

.reports-page-head {
  align-items: flex-start;
}

.reports-page-head .status:empty {
  display: none;
}

.reports-context-ribbon {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(220px, 1fr) minmax(150px, .55fr);
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.reports-context-item {
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid var(--line);
}

.reports-context-item:last-child {
  border-right: 0;
}

.reports-context-item > label,
.reports-context-item > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.reports-context-item select {
  width: 100%;
  min-width: 0;
  padding: 5px 28px 5px 7px;
  border: 1px solid transparent;
  background-color: transparent;
  color: var(--ink);
  font-weight: 700;
}

.reports-context-item select:focus {
  border-color: var(--brand);
  outline: 0;
}

.reports-context-item strong {
  display: flex;
  min-height: 31px;
  align-items: center;
}

.reports-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--tab-empty);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.reports-state.ready {
  background: #e8f5ee;
  color: var(--success);
}

.reports-state.blocked {
  background: #f9e9e8;
  color: var(--danger);
}

.reports-tabs {
  margin-bottom: 12px;
}

.reports-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.reports-section {
  margin-bottom: 12px;
}

.reports-workspace .scope-detail,
.reports-workspace .scope-card,
.reports-workspace .table-wrap {
  min-width: 0;
  max-width: 100%;
}

.reports-workspace .scope-card {
  overflow: hidden;
}

.reports-workspace .table-wrap {
  contain: inline-size paint;
}

.reports-section .panel-header,
.reports-filemaker-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.reports-approval-panel > #final-approval-version {
  margin-right: 18px;
  margin-left: 18px;
}

.reports-approval-panel > #final-approval-fields {
  margin-right: 18px;
  margin-left: 18px;
}

.reports-approval-panel > .reports-actions {
  margin: 12px 18px 18px;
}

.reports-section .panel-header h2,
.reports-filemaker-panel .panel-header h2 {
  margin: 0;
  font-size: 14px;
}

.reports-filemaker-panel .panel-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.reports-actions {
  margin-top: 12px;
}

.reports-compatibility-note,
.reports-contract-note,
.reports-readonly-note {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--line);
  background: var(--tab-empty);
  color: var(--muted);
  font-size: 11px;
}

.reports-readonly-note {
  border-left-color: var(--danger);
  color: var(--danger);
}

.reports-handoff-facts {
  max-width: 720px;
  margin: 0;
}

.reports-handoff-facts > div {
  display: grid;
  grid-template-columns: minmax(120px, 30%) minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.reports-handoff-facts dt {
  color: var(--muted);
}

.reports-handoff-facts dd {
  min-width: 0;
  margin: 0;
  font-weight: 700;
}

.reports-handoff-facts ul {
  margin: 0;
  padding-left: 18px;
  font-weight: 400;
}

:root[data-theme="dark"] .reports-state.ready {
  background: #163a28;
}

:root[data-theme="dark"] .reports-state.blocked {
  background: #422221;
}

@media (max-width: 1024px) {
  .reports-context-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-context-item:nth-child(2) {
    border-right: 0;
  }

  .reports-context-item:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .reports-context-ribbon,
  .reports-kpis {
    grid-template-columns: 1fr;
  }

  .reports-context-item,
  .reports-context-item:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .reports-context-item:last-child {
    grid-column: auto;
    border-top: 0;
    border-bottom: 0;
  }

  .reports-handoff-facts > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media print {
  body:has(.reports-workspace) header,
  body:has(.reports-workspace) nav,
  body:has(.reports-workspace) .reports-page-head,
  body:has(.reports-workspace) .reports-context-ribbon,
  body:has(.reports-workspace) .reports-tabs,
  body:has(.reports-workspace) .reports-actions,
  body:has(.reports-workspace) .reports-compatibility-note,
  body:has(.reports-workspace) [data-report-tab="filemaker"] {
    display: none !important;
  }

  body:has(.reports-workspace) [data-report-tab="internal"] {
    display: block !important;
  }

  body:has(.reports-workspace) .shell,
  body:has(.reports-workspace) .reports-workspace {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
  }
}
/* ONEX 016B: canonical mobile shell and shared keyboard/button accessibility. */
.nav-toggle { display:none; flex:none; align-items:center; justify-content:center; width:44px; height:44px; border:1px solid #ffffff66; border-radius:6px; background:transparent; color:#fff; cursor:pointer; }
.nav-toggle svg { width:20px; height:20px; }
.nav-scrim { display:none; }
.nav-open .setup-assistant-drawer { visibility:hidden; }
:root[data-theme="dark"] .setup-assistant-launcher { color:var(--tab-active-ink); }
.brand-label-short { display:none; }
.brand .brand-label-full { max-width:min(42vw,360px); overflow:hidden; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
a.button { text-decoration:none; }
/* Engineering package section tabs use the same selected-tab contract as page tabs. */
.package-section-tabs button { border-color:var(--tab-outline); border-bottom-color:var(--tab-border); border-radius:6px 6px 0 0; background:var(--tab-bg); color:var(--tab-idle-ink); font-family:inherit; font-size:var(--font-small); font-weight:400; }
.package-section-tabs button[aria-selected="true"] { border-color:var(--tab-active); background:var(--tab-active); color:var(--tab-active-ink); font-weight:700; box-shadow:inset 0 -2px 0 var(--accent); }
:is(.batch1-workbench-tabs, .gv-tabs, .gv-workbench-tabs, .oism-tabs, .eb-workbench-tabs, .category-sheet-tabs, .package-section-tabs, .site-rail-list) button:not(.selected):not(.active):not([aria-selected="true"]):not(:disabled):hover,
.mode-tabs button[data-mode]:not(.active):hover { background:var(--tab-hover); color:var(--brand); }
:is(.batch1-workbench-tabs, .gv-tabs, .gv-workbench-tabs, .oism-tabs, .eb-workbench-tabs, .category-sheet-tabs, .package-section-tabs, .site-rail-list) button:focus-visible,
.mode-tabs button[data-mode]:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (max-width:760px) {
  :is(.batch1-workbench-tabs, .gv-tabs, .gv-workbench-tabs, .oism-tabs, .eb-workbench-tabs, .category-sheet-tabs, .package-section-tabs, .site-rail-list) button,
  .mode-tabs button[data-mode] { min-height:44px !important; }
}
:root[data-theme="dark"] a.button:not(.secondary):not(.danger) { color:var(--tab-active-ink); }
:root[data-theme="dark"] a.button.secondary { color:var(--ink); }
.app-nav a:focus-visible, .app-shell a:focus-visible, .nav-group summary:focus-visible, .nav-toggle:focus-visible,
.button:focus-visible, .tabbar button:focus-visible, .setup-assistant-launcher:focus-visible,
.shell select:focus-visible, .header-auth-button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (max-width:760px) {
  .app-shell > .sidebar-resizer, .app-nav .sidebar-resize-reset { display:none; }
  .app-shell > .app-nav { position:fixed; z-index:45; top:62px; bottom:0; left:0; display:block; width:min(86vw,320px); height:auto; overflow:auto; padding:12px 10px 20px; border-right:1px solid var(--line); border-bottom:0; transform:translateX(-100%); visibility:hidden; transition:transform 180ms ease,visibility 180ms; overscroll-behavior:contain; }
  .nav-open .app-shell > .app-nav { transform:none; visibility:visible; }
  .nav-open .nav-scrim { display:block; position:fixed; z-index:44; inset:62px 0 0; background:#040c148c; }
  .app-nav a, .app-nav .nav-group a { min-width:44px; min-height:44px; margin-bottom:4px; }
  .app-nav .nav-group summary { min-height:44px; }
  .app-shell .button, .app-shell select, .app-shell .tabbar button, .app-shell .menu a, .app-header .button { min-height:44px; min-width:44px; }
  /* Scrolling sheet tabs keep their intrinsic label widths. Wrapped page tabs
     retain their existing flex and wrapping contract. */
  body .shell.app-shell .tabbar.sheet-tabs button { flex-shrink:0; min-width:44px; min-height:44px; }
  .app-header .nav-toggle { display:inline-flex; }
  .app-header { position:sticky; top:0; z-index:46; flex-direction:row; align-items:center; height:62px; min-height:62px; padding:0 12px; gap:6px; }
  .app-header .header-right { flex-wrap:nowrap; gap:6px; justify-content:flex-end; min-width:0; }
  .app-header .environment { display:block; min-width:0; max-width:22vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .app-header .auth-user-pill { min-width:0; max-width:24vw; }
  .app-header .brand { gap:6px; }
  .app-shell > main { padding:16px 12px 76px; min-width:0; }
  /* One canonical Help launcher, in document flow after the shell on mobile.
     Its own layout space prevents collisions at every page scroll position. */
  .app-header ~ .setup-assistant-launcher { position:static; display:block; margin:12px 12px 12px auto; width:max-content; max-width:calc(100% - 24px); border-radius:999px; border-right:1px solid var(--brand); padding:0 16px; min-height:44px; writing-mode:horizontal-tb; }
  .app-header ~ .setup-assistant-drawer { inset:62px 8px 8px; width:auto; }
}
@media (max-width:520px) {
  .app-header .brand-label-full { display:none; }
  .app-header .brand-label-short { display:inline; font-size:14px; font-weight:700; letter-spacing:.06em; }
}
@media (prefers-reduced-motion:reduce) {
  .app-shell > .app-nav, .app-nav a, .app-nav .nav-group a { transition:none; }
}

/* Estimate context is an editing form, not a single-row toolbar. Keep every
   control and its label readable while the line sheet owns horizontal scroll. */
.estimate-builder-page .eb-context-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.estimate-builder-page .eb-context-selector label {
  font-size: var(--font-label);
  line-height: 1.25;
}
.estimate-builder-page .eb-context-selector select,
.estimate-builder-page .eb-context-selector input {
  font-size: 13px;
  min-height: 36px;
}
.estimate-builder-page .eb-selected-project-context {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.estimate-builder-page .eb-context-actions {
  flex-wrap: wrap;
  align-content: center;
}
.estimate-builder-page .eb-source-context strong {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.estimate-builder-page .line-editor-panel .editor-head,
.estimate-builder-page .line-editor-panel .editor-head > div:first-child {
  min-width: 0;
}
.estimate-builder-page .line-editor-panel .selection-status {
  white-space: normal;
  overflow-wrap: anywhere;
}
.estimate-builder-page .eb-workbench-tabs {
  overflow-x: auto;
}
.estimate-builder-page .eb-workbench-tabs button {
  min-width: 68px;
}
.estimate-builder-page .estimate-sticky-summary .estimate-summary-widgets {
  grid-template-columns: repeat(10, minmax(104px, 1fr));
  overflow-x: auto;
}
/* The six Quick Estimate fields also need room for entered site/client names. */
.quick-estimate-page .quick-context-field label {
  font-size: var(--font-label);
  line-height: 1.25;
}
.quick-estimate-page .quick-context-field input,
.quick-estimate-page .quick-context-field select {
  min-height: 36px;
  font-size: 13px;
}
@media (max-width: 1500px) {
  .estimate-builder-page .eb-context-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .estimate-builder-page .eb-context-selector[data-context-control="project"] {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .estimate-builder-page .eb-context-selector[data-context-control="project"] .field {
    margin: 0;
  }
  .quick-estimate-page .quick-context-ribbon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1024px) {
  .estimate-builder-page .eb-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .estimate-builder-page .eb-context-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .estimate-builder-page .eb-context-selector[data-context-control="project"] {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr);
  }
  .quick-estimate-page .quick-context-ribbon {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* RFP Discovery Phase 1: page-scoped disclosure and review surfaces. */
.rfp-database-page main, .rfp-database-page .panel { min-width: 0; }
.rfp-database-page [hidden] { display: none !important; }
.rfp-database-page .panel.onex-roadmap { border-style: dashed; background: var(--tab-empty); box-shadow: none; }
.rfp-database-page .onex-roadmap .panel-head { border-bottom-style: dashed; }
.rfp-database-page .badge.neutral { background: var(--tab-empty); color: var(--muted); }
.rfp-database-page .rfp-projection { display: block; font-size: 14px; margin: 6px 0; }
.rfp-database-page .rfp-demo-menu { position: relative; }
.rfp-database-page .rfp-demo-menu summary { cursor: pointer; color: var(--brand); padding: 8px; }
.rfp-database-page .rfp-demo-menu[open] .button { display: block; }
.rfp-database-page :is(button, summary, input, textarea, select, a):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.rfp-database-page .rfp-gate-label { color: var(--danger); font-size: 14px; }
.rfp-database-page .rfp-gated td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.rfp-database-page .rfp-gate-chip { display: inline-block; padding: 2px 5px; border: 1px solid var(--danger); border-radius: 4px; color: var(--danger); margin: 2px 2px 5px 0; font-size: 11px; }
.rfp-database-page .rfp-fit { font-size: 16px; white-space: nowrap; }
.rfp-database-page .rfp-fitbar { display: block; width: 64px; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 4px 0; }
.rfp-database-page .rfp-fitbar i { display: block; height: 100%; background: var(--brand); }
.rfp-database-page .rfp-confidence { display: block; font-size: 11px; margin-top: 8px; }
.rfp-database-page .rfp-segments { display: flex; gap: 3px; margin: 3px 0; }
.rfp-database-page .rfp-segments i { display: block; width: 10px; height: 10px; border-radius: 2px; background: var(--line); }
.rfp-database-page .rfp-segments .on { background: var(--success); }
.rfp-database-page :is(.rfp-review-dialog, .rfp-seed-dialog) { color: var(--ink); background: var(--panel); border: 1px solid var(--line); padding: 0; }
.rfp-database-page dialog::backdrop { background: rgb(9 29 52 / 35%); }
.rfp-database-page .rfp-review-dialog { position: fixed; inset: 0 0 0 auto; margin: 0; width: 480px; max-width: 100vw; height: 100dvh; max-height: 100dvh; }
.rfp-database-page .rfp-review-dialog[open] { display: flex; flex-direction: column; }
.rfp-database-page .rfp-drawer-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.rfp-database-page .rfp-drawer-head h2 { font-size: 17px; margin: 0; overflow-wrap: anywhere; }
.rfp-database-page .rfp-drawer-body { padding: 0 16px 20px; overflow: auto; min-height: 0; font-size: 12px; }
.rfp-database-page .rfp-drawer-body section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rfp-database-page .rfp-drawer-body h3 { margin: 0 0 10px; }
.rfp-database-page .rfp-drawer-body .field { margin: 10px 0; }
.rfp-database-page .rfp-drawer-body .actions { flex-wrap: wrap; }
.rfp-database-page .rfp-drawer-body [aria-pressed="true"] { border: 2px solid var(--brand); background: var(--brand-soft); }
.rfp-database-page .rfp-drawer-body .rfp-gate-block { border: 1px solid var(--danger); padding: 12px; margin-top: 14px; }
.rfp-database-page .rfp-gate-block h3 { color: var(--danger); }
.rfp-database-page .rfp-gate-block li { margin: 7px 0; }
.rfp-database-page .rfp-factor { display: grid; grid-template-columns: minmax(0, 1fr) 64px 64px; gap: 8px; align-items: center; padding: 4px 0; }
.rfp-database-page .rfp-factor.zero { color: var(--danger); }
.rfp-database-page .rfp-seed-dialog { width: 460px; max-width: calc(100vw - 32px); padding: 20px; border-radius: 8px; }
.rfp-database-page #rfpReviewFeedback { position: sticky; bottom: -20px; padding: 12px 0; background: var(--panel); overflow-wrap: anywhere; }
.rfp-database-page #rfpReviewFeedback:empty { display: none; }
@media (max-width: 1279px) { .rfp-database-page .rfp-review-dialog { width: 420px; } }
@media (max-width: 1023px) { .rfp-database-page .rfp-review-dialog { width: 100vw; } }


.rfp-database-page .table-wrap { overflow-x: auto; max-width: 100%; }

/* Shared in-page record sizing: rendered rows determine height, followed by
   reading room. Keep horizontal scrolling for wide tables. Dialogs, floating
   references and deliberately bounded data viewers retain their own scroll.
   Apply at every breakpoint; page-level bottom space remains the shared rule. */
@media screen {
  .shell main :is(.table-wrap,.source-wrap,.batch1-table-wrap,.gv-table-wrap,#clSchedule):has(>table):not(dialog *,[role="dialog"] *,[popover] *,.modal *,.modal-card *,.floating-reference *,.reference-desk *,[data-scroll-mode="bounded"],[data-scroll-mode="bounded"] *) {
    height: auto !important;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    padding-bottom: 24px;
  }
  .shell main #clVisibility:not(dialog *,[role="dialog"] *) {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-bottom: 24px;
  }
}

/* Universal workspace navigation: explicit static pin or full-width drawer. */
@media screen {
 body{--font-page:14px!important;--font-small:13px!important;--font-label:12px!important;--font-title:24px!important;--font-heading:17px!important;font-size:var(--font-page)!important}
 .shell.app-shell>.app-nav{grid-column:1;grid-row:1}.shell.app-shell>.sidebar-resizer{grid-column:2;grid-row:1}.shell.app-shell>main{grid-column:3;grid-row:1}
 .app-header .nav-toggle{display:inline-flex}
 .app-header .brand{margin-right:auto;min-width:0}.app-header .brand-label-full{max-width:min(32vw,320px)}
 .nav-pin{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;min-height:32px;margin:0 0 8px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--brand);font-family:inherit;font-size:var(--font-small);font-weight:600;line-height:1.3;cursor:pointer}
 .nav-pin svg{width:17px;height:17px}.nav-pin[aria-pressed=true]{background:var(--brand-soft)}.nav-pin:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
 body.nav-collapsed .shell.app-shell,body.nav-unpinned .shell.app-shell{grid-template-columns:0 0 minmax(0,1fr)}
 body.nav-collapsed .app-shell>.app-nav{visibility:hidden;pointer-events:none;overflow:hidden;transform:translateX(-100%)}
 body.nav-collapsed .app-shell>.sidebar-resizer,body.nav-unpinned .app-shell>.sidebar-resizer{display:none}
 body.nav-unpinned .app-shell>.app-nav{position:fixed;z-index:45;top:62px;bottom:0;left:0;width:var(--sidebar-width);height:auto;overflow:auto;transform:translateX(-100%);visibility:hidden;box-shadow:8px 0 24px #0003}
 body.nav-unpinned.nav-open .app-shell>.app-nav{visibility:visible;transform:none;pointer-events:auto}
 body.nav-unpinned.nav-open .nav-scrim{display:block;position:fixed;z-index:44;inset:62px 0 0;background:#040c148c}
 body.nav-unpinned .app-header{position:sticky;top:0;z-index:46}
 .app-shell>main h1{font-size:var(--font-title)!important}.app-shell>main h2{font-size:var(--font-heading)!important}.app-shell>main .studio-grid h2{font-size:13px!important}
 .app-shell>main :is(p,.subtitle){font-size:var(--font-page)}
}
@media(max-width:760px){.app-nav .nav-pin{display:none}.nav-pinned .shell.app-shell,.nav-collapsed .shell.app-shell,.nav-unpinned .shell.app-shell{grid-template-columns:0 0 minmax(0,1fr)}body .shell.app-shell>.app-nav{width:min(86vw,320px)}body.nav-open .shell.app-shell>.app-nav{visibility:visible;transform:none;pointer-events:auto}body.revenue-operations-page .shell.app-shell>#ro-navigation.app-nav{position:fixed;display:block;top:62px;bottom:0;left:0;height:auto;z-index:45}body.revenue-operations-page:not(.nav-open) .shell.app-shell>#ro-navigation.app-nav{visibility:hidden;transform:translateX(-100%)}body .app-header .brand-label-full{max-width:32vw}}
@media print{.nav-toggle,.nav-pin,.nav-scrim{display:none!important}}

@media screen{body .gv-tabs button{font-size:var(--font-small)!important}}

/* Shared edge rail keeps hidden navigation discoverable without header chrome. */
@media screen {
 .app-header .brand{margin-right:12px;flex-shrink:0}.app-header>#effectiveTenantPill{display:block;margin-right:auto;min-width:0;max-width:45vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff;border-color:#ffffff66;font-size:12px}
 .app-header>#effectiveTenantPill::before{content:'Selected tenant: ';font-weight:600;color:#bcd6ef}
 .shell.app-shell>.nav-edge-rail{display:flex;position:fixed;left:0;top:62px;bottom:0;width:24px;height:auto;min-width:0;padding:0;border:0;border-right:1px solid var(--line);border-radius:0;background:var(--panel);color:var(--brand);z-index:47;align-items:center;justify-content:center;cursor:pointer}
 .nav-edge-rail{--nav-rail-color:#1769c2}.nav-edge-rail::before{content:'';position:absolute;left:4px;top:12px;bottom:12px;width:4px;border-radius:3px;background:var(--nav-rail-color);opacity:1}
 [data-theme=dark] .nav-edge-rail{--nav-rail-color:#ffad42}.shell.app-shell>.nav-edge-rail{color:var(--nav-rail-color)}
 .nav-edge-rail:hover::before,.nav-edge-rail:focus-visible::before{width:6px}
 .nav-edge-rail svg{width:15px;height:24px;margin-left:5px}.nav-edge-rail[aria-expanded=true] svg{transform:rotate(180deg)}
 .nav-edge-rail:hover,.nav-edge-rail:focus-visible{background:var(--brand-soft)}.nav-edge-rail:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
 .shell.app-shell>.app-nav{padding-left:32px}
 body.nav-collapsed .shell.app-shell,body.nav-unpinned .shell.app-shell{grid-template-columns:24px 0 minmax(0,1fr)}
}
/* The legacy mobile shell becomes block layout. Restore its reserved rail
   column so the fixed closed control cannot paint over workspace text. */
@media screen and (max-width:760px){body .shell.app-shell{display:grid}body .shell.app-shell>.nav-edge-rail{width:44px}body .shell.app-shell>.app-nav{padding-left:50px}body.nav-open .shell.app-shell,body.nav-pinned .shell.app-shell,body.nav-collapsed .shell.app-shell,body.nav-unpinned .shell.app-shell{grid-template-columns:44px 0 minmax(0,1fr)}}
@media(max-width:760px){.app-header .brand-label-full{display:none}.app-header .brand-label-short{display:inline}.app-header .auth-user-pill{display:none}.app-header .brand{margin-right:0}.app-header>#effectiveTenantPill{max-width:50vw;font-size:11px}.app-header>#effectiveTenantPill::before{content:'Tenant: '}}

/* Compact page interiors: approved Studio density, shared across ONEX routes.
   Screen only. Preserve navigation, print layouts, touch targets and bottom room. */
@media screen {
 .shell.app-shell>main{--font-page:14px;--font-small:13px;--font-label:12px;--font-heading:17px;font-size:14px;line-height:1.45;padding-top:14px;padding-inline:16px 36px}
 .shell.app-shell>main :is(.panel-head,.panel-header){padding:9px 12px;gap:8px}
 .shell.app-shell>main .panel-body{padding:12px}
 .shell.app-shell>main :is(.form-grid,.two-column,.three-column){gap:10px}
 .shell.app-shell>main :is(.actions,.inline-actions){gap:6px;margin-block:6px}
 .shell.app-shell>main .field{gap:4px}
 .shell.app-shell>main :is(.notice,.kpi-card,.stat-card){padding:8px 10px}
 .shell.app-shell>main :is(.panel,.notice){margin-block-end:10px}
 .shell.app-shell>main :is(p,.subtitle){margin-block:5px}
 .shell.app-shell>main :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,button,.button){font-size:14px;min-height:36px;padding:5px 8px}
 .shell.app-shell>main textarea{font-size:14px;line-height:1.4}
 .shell.app-shell>main :is(th,td){padding:5px 7px}
 .shell.app-shell>main .sheet-tabs{margin-block:8px 0;gap:4px}
 .shell.app-shell>main h3{font-size:14px;margin-block:8px}
 /* Preserve established workbench/header and wrapping action contracts. */
 .shell.app-shell>main .studio-topbar .sheet-tabs{margin:0}
 .shell.app-shell>main .studio-topbar .studio-selection{margin-bottom:0}
 .shell.app-shell>main :is(.studio-topbar .studio-selection,.studio-toolbar) :is(select,button,.button){font-size:14px}
 body.estimate-studio-page .shell.app-shell>main #studio-build>.studio-toolbar :is(select,button,.button){font-size:14px}
 .shell.app-shell>main #design-form>.actions .button{min-height:44px}
 .shell.app-shell>main :is(.gv-tabs,.site-rail-list) button{font-size:14px!important}
}
@media screen and (max-width:760px){
 .shell.app-shell>main{padding-inline:12px 26px}
 .shell.app-shell>main :is(button,.button,input:not([type=checkbox]):not([type=radio]):not([type=range]),select){min-height:44px}
}

/* Full proposal basis keeps tenant template choice visible. */
.pbs-top-strip.pbs-full-basis { grid-template-columns: repeat(5,minmax(0,1fr)); }
@media(max-width:1200px) { .pbs-top-strip.pbs-full-basis { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .pbs-top-strip.pbs-full-basis { grid-template-columns:1fr; } }

/* ONEX engineering dark surfaces: theme the workspace, never invert source images. */
:root[data-theme="dark"] .tenant-workspace-badge.owner-testing {
  background: color-mix(in srgb, var(--panel) 92%, var(--accent));
}
:root[data-theme="dark"] #engineeringDrawingWorkspace div:has(> #drawingCanvas),
:root[data-theme="dark"] #engineeringDrawingWorkspace #drawingCanvas {
  background: var(--panel) !important;
  border-color: var(--line) !important;
}
:root[data-theme="dark"] #engineeringDrawingWorkspace #drawingCanvas text {
  fill: var(--ink);
}
:root[data-theme="dark"] #engineeringDrawingWorkspace #drawingCanvas line,
:root[data-theme="dark"] #engineeringDrawingWorkspace #drawingCanvas circle[fill="none"] {
  stroke: var(--muted);
}
:root[data-theme="dark"] #engineeringDrawingWorkspace #drawingCanvas g > circle {
  stroke: var(--ink);
  stroke-width: 0.12;
}

/* ONEX universal dark-surface contract. Screen-only; source artwork and print stay intact. */
@media screen {
  :root[data-theme="dark"] {
    --surface: var(--panel);
    --border: var(--line);
    --text: var(--ink);
    --primary: var(--brand);
    --selected-bg: var(--tab-hover);
    --accent-soft: var(--brand-soft);
    --panel-strong: var(--panel);
    --success-soft: #173a2b;
    --warning-soft: #3a2f14;
    --danger-soft: #3a1f1e;
    --info-soft: #152a3d;
  }
  :root[data-theme="dark"] :is(input, select, textarea):is(:disabled, [readonly]) {
    background: var(--tab-empty) !important;
    color: var(--muted) !important;
    -webkit-text-fill-color: var(--muted);
    border-color: var(--line);
    opacity: 1;
  }
  :root[data-theme="dark"] .button:not(.secondary):not(.danger) { color: var(--tab-active-ink); }
  :root[data-theme="dark"] .button:not(.secondary):not(.danger):hover:not(:disabled) {
    background: color-mix(in srgb, var(--brand) 85%, white);
    color: var(--tab-active-ink);
  }
  :root[data-theme="dark"] .button:disabled {
    background: var(--tab-empty);
    color: var(--muted);
    border-color: var(--line);
    opacity: 1;
  }
  :root[data-theme="dark"] th { color: inherit; }
  :root[data-theme="dark"] legend { color: var(--ink); }
  :root[data-theme="dark"] #platformBrandMark:not(:has(img)) {
    background: var(--brand);
    color: var(--tab-active-ink);
  }
  :root[data-theme="dark"] .connector-choice:is(.selected, :hover),
  :root[data-theme="dark"] .check-row label:has(input:checked) {
    background: var(--tab-hover);
    color: var(--ink);
  }
  :root[data-theme="dark"] .check-row label,
  :root[data-theme="dark"] .security-note,
  :root[data-theme="dark"] .shot-ui,
  :root[data-theme="dark"] .mock-screen,
  :root[data-theme="dark"] .mock-select,
  :root[data-theme="dark"] .rfp-report {
    background: var(--panel);
    color: var(--ink);
    border-color: var(--line);
  }
  :root[data-theme="dark"] :is(.connector-heading p, .reference-item p, .workflow-steps span) { color: var(--muted); }
  :root[data-theme="dark"] .workflow-steps strong { color: var(--ink); }
  :root[data-theme="dark"] :is(.shot-label, .msrp-step-num) { background: var(--brand); color: var(--tab-active-ink); }
  :root[data-theme="dark"] :is(.screenshot-card figcaption, .shot-card figcaption, .map-card-kicker) { color: var(--ink); }
  :root[data-theme="dark"] .owner-start-here-page :is(h1, h2, h3, .owner-card strong, .owner-safety strong) { color: var(--ink); }
  :root[data-theme="dark"] .owner-start-here-page :is(p, .card-kicker, .card-state) { color: var(--muted); }
  :root[data-theme="dark"] .owner-start-here-page .card-link { color: var(--brand); }
  :root[data-theme="dark"] .owner-start-here-page .eyebrow { color: var(--accent); }
  :root[data-theme="dark"] .owner-start-here-page :is(.owner-badge, .owner-safety) {
    background: var(--warning-soft);
    color: var(--ink);
    border-color: var(--line);
  }
  :root[data-theme="dark"] .wireless-field-walk-page .eyebrow { color: var(--brand); }
}

@media screen {
  :root[data-theme="dark"] .button:disabled { color: var(--muted) !important; }
  :root[data-theme="dark"] .connector-choice.selected span { color: var(--ink); }
  :root[data-theme="dark"] .shot-ui span { background: var(--tab-hover); color: var(--ink); }
  :root[data-theme="dark"] .mock-note { color: var(--muted); }
  :root[data-theme="dark"] .mock-warning { color: var(--warning); }
  :root[data-theme="dark"] .map-card-kicker { color: var(--ink) !important; }
}

@media screen {
  :root[data-theme="dark"] .button:disabled { background: var(--tab-empty) !important; }
  :root[data-theme="dark"] :is(.workflow-card, .workflow-panel, .menu) {
    background: var(--panel);
    color: var(--ink);
    border-color: var(--line);
  }
  :root[data-theme="dark"] .field-toolbar button { background: var(--tab-bg); color: var(--ink); }
  :root[data-theme="dark"] .notice-test { background: var(--warning-soft); color: var(--warning); }
  :root[data-theme="dark"] :is(.verified-position, .saved-observation, .submitted-banner) { background: var(--success-soft); color: var(--success); }
}

/* Fixed workspace surfaces live outside the main grid: reserve the mobile rail
   for them too. Full-screen dialogs/backdrops remain deliberate overlays. */
@media screen and (max-width:760px) {
 body:has(.shell.app-shell) { --onex-mobile-rail-clearance:44px; }
 body:has(.shell.app-shell) :is(.pbs-output-footer,[data-if-tab="rules"] .epd-readiness) {
  left:calc(var(--onex-mobile-rail-clearance) + 12px);right:12px;
  width:auto;min-width:0;max-width:none;box-sizing:border-box;
 }
 body:has(.shell.app-shell) .pbs-output-footer {
  flex-direction:column;align-items:stretch;gap:8px;
  padding:8px 10px max(8px,env(safe-area-inset-bottom));
 }
 body:has(.shell.app-shell) .pbs-output-status {
  display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px;min-width:0;
 }
 body:has(.shell.app-shell) .pbs-output-status>span {min-width:0;overflow-wrap:anywhere;}
 body:has(.shell.app-shell) .pbs-output-footer .pbs-actions {flex-wrap:wrap;min-width:0;}
 body:has(.shell.app-shell) .pbs-output-footer :is(button,.button) {min-width:0;max-width:100%;white-space:normal;}
 body:has(.pbs-output-footer) .shell.app-shell>.proposal-simplified-main {padding-bottom:calc(200px + env(safe-area-inset-bottom));}
 body:has(.shell.app-shell) :is(.pbs-assistant-panel,.proposal-copilot-drawer,.estimate-workspace-grid .line-editor-panel,.inline-line-editor.group-drawer,.floating-reference,.inspector,.eb-page-main>.status) {
  right:12px;min-width:0;max-width:calc(100vw - var(--onex-mobile-rail-clearance) - 24px);box-sizing:border-box;
 }
 body:has(.shell.app-shell) .pbs-assistant-panel {
  width:min(440px,calc(100vw - var(--onex-mobile-rail-clearance) - 24px));
 }
 body:has(.shell.app-shell) .estimate-builder-page .eb-readiness-disclosure[open] .eb-readiness-projection,
 body.estimate-builder-page:has(.shell.app-shell) .eb-readiness-disclosure[open] .eb-readiness-projection {
  left:calc(var(--onex-mobile-rail-clearance) + 12px);right:12px;width:auto;max-width:none;
 }
}

/* Column-resize hit areas are unnecessary in stacked mobile workspaces. */
@media screen and (max-width:760px) { body:has(.shell.app-shell) .eb-page>.eb-resize-handle { display:none; } }

@media screen and (max-width:760px) { body:has(.shell.app-shell) .inspector { left:auto; } }

html[data-theme="dark"] body.onex-visual-system-pilot .pbs-cell-note { color:#a8b8c8; }

/* Readable shared navigation at native browser scale; spacing stays compact. */
@media screen {
 .app-nav .nav-group summary { font-size:13px; }
 .app-nav .nav-group a { font-size:14px; }
 .app-shell>main .studio-grid h2 { font-size:16px!important; }
}

@media screen and (max-width:760px) {
 .revenue-operations-page .ro-page-head { flex-wrap:wrap; }
}

/* ONEX OUTLINE STYLE BEGIN — screen-only; remove this block to restore original styling. */
@media screen {
  :root {
    --onex-action-ink: #143d6f;
    --onex-action-line: #8399b1;
    --onex-action-hover: #edf3fa;
    --onex-primary-line: #b95b00;
    --onex-primary-hover: #fff3e5;
    --onex-photo-green: #14613f;
    --onex-photo-green-bg: #edf9f2;
    --onex-photo-amber: #775000;
    --onex-photo-amber-bg: #fff8df;
  }
  :root[data-theme="dark"] {
    --onex-action-ink: #d7e8fa;
    --onex-action-line: #7892ad;
    --onex-action-hover: #243d56;
    --onex-primary-line: #ffac50;
    --onex-primary-hover: #403321;
    --onex-photo-green: #8ce2af;
    --onex-photo-green-bg: #163a2a;
    --onex-photo-amber: #ffda83;
    --onex-photo-amber-bg: #3a3019;
  }
  /* Actions share one shape. Selected navigation, category cards, drawing pins
     and document/editor content retain their existing semantics and colors. */
  html body :is(main button, .button, .field-walk button):not(
    .app-nav *, .tabbar *, .tabs *, .package-section-tabs *, [role="tab"],
    [aria-pressed], [aria-selected], [data-category-sheet], .connector-choice, .selected, .active,
    .fw-pin, [data-pin-door], .pbs-document-paper *, [contenteditable] *,
    .nav-rail *, .sidebar *, .row-menu-trigger, .eb-resize-handle
  ) {
    border: 1px solid var(--onex-action-line) !important;
    border-radius: 12px !important;
    background: var(--panel) !important;
    color: var(--onex-action-ink) !important;
    box-shadow: none !important;
    font-weight: 600;
    white-space: normal;
    transition: none;
  }
  html body :is(main button, .button, .field-walk button):not(.app-nav *, .tabbar *, .tabs *, .package-section-tabs *, [role="tab"], [aria-pressed], [aria-selected], [data-category-sheet], .connector-choice, .selected, .active, .fw-pin, [data-pin-door], .pbs-document-paper *, [contenteditable] *, .nav-rail *, .sidebar *, .row-menu-trigger, .eb-resize-handle):hover:not(:disabled) {
    background: var(--onex-action-hover) !important;
    border-color: var(--onex-action-ink) !important;
  }
  html body :is(.button:not(.secondary):not(.danger), #fw-start, #fw-upload, #fw-report, #fw-add-category):not([role="tab"], .app-nav *, .pbs-document-paper *) {
    border-color: var(--onex-primary-line) !important;
  }
  html body :is(.button.danger, button.danger):not(.pbs-document-paper *) {
    color: var(--danger) !important;
    border-color: var(--danger) !important;
  }
  html body :is(main button, .button, .field-walk button):focus-visible {
    outline: 3px solid var(--accent) !important;
    outline-offset: 3px;
  }
  html body :is(main button, .button, .field-walk button):disabled {
    opacity: .65;
    cursor: not-allowed;
  }
  .field-walk .fw-slot { border-radius: 14px; }
  .field-walk .fw-photo-status { font-size: 12px; font-weight: 600; }
  .field-walk .fw-slot[data-photo-state="captured"] { --onex-photo-ink: var(--onex-photo-green); --onex-photo-bg: var(--onex-photo-green-bg); }
  .field-walk .fw-slot[data-photo-state="missing"] { --onex-photo-ink: var(--onex-photo-amber); --onex-photo-bg: var(--onex-photo-amber-bg); }
  html body .field-walk .fw-slot[data-photo-state] :is(button[data-photo], button[data-library]) {
    background: var(--onex-photo-bg) !important;
    color: var(--onex-photo-ink) !important;
    border-color: var(--onex-photo-ink) !important;
  }
  .field-walk .fw-slot[data-photo-state] .fw-photo-status { color: var(--onex-photo-ink); }
  html body .field-walk .fw-slot[data-photo-state] button:hover:not(:disabled) { outline: 1px solid var(--onex-photo-ink); outline-offset: 1px; }
  @media (max-width:760px) {
    html body .field-walk .fw-actions button { min-height:44px; max-width:100%; }
  }
  @media (prefers-reduced-motion:reduce) {
    html body :is(main button, .button, .field-walk button) { transition:none; }
  }
  @media (forced-colors:active) {
    html body :is(main button, .button, .field-walk button),
    html body .field-walk .fw-slot[data-photo-state] :is(button[data-photo], button[data-library]) {
      color:ButtonText !important; background:ButtonFace !important; border-color:ButtonText !important;
    }
    .field-walk .fw-slot[data-photo-state] .fw-photo-status { color:CanvasText; }
  }
}
/* ONEX OUTLINE STYLE END */

/* Personal account menu: native top layer, matching ONEX outline controls. */
.app-header .header-account-button {max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:40px;}
.account-menu {position:fixed;inset:auto;margin:0;padding:8px;min-width:210px;max-width:calc(100vw - 16px);border:1px solid #a9bfce;border-radius:14px;background:#fff;color:#173c65;box-shadow:0 10px 30px #0003;}
.account-menu:popover-open {display:grid;gap:4px;}
.account-menu a,.account-menu button {display:block;text-align:left;font:inherit;color:inherit;background:transparent;padding:12px;border:0;border-radius:8px;text-decoration:none;cursor:pointer;}
.account-menu a:hover,.account-menu button:hover,.account-menu :focus-visible {background:#eaf2fb;outline:2px solid #3679ba;outline-offset:-2px;}
html[data-theme="dark"] .account-menu {background:#17293a;color:#e6edf0;border-color:#47647a;}
html[data-theme="dark"] .account-menu a:hover,html[data-theme="dark"] .account-menu button:hover,html[data-theme="dark"] .account-menu :focus-visible {background:#254461;}
.user-preferences-page #password-form {max-width:560px;}
.user-preferences-page #personal-account {display:grid;grid-template-columns:max-content 1fr;gap:8px 20px;overflow-wrap:anywhere;}
.user-preferences-page #personal-account dd {margin:0;}
@media(max-width:760px){.app-header .header-account-button {max-width:30vw;font-size:12px;min-height:44px;padding:6px 8px;}.user-preferences-page #personal-account {grid-template-columns:1fr;gap:4px;}}
/* ONEX GREEN CONTEXT BEGIN — 2026-11-12
   Presentation only. Remove this block to restore the previous style.
   Green identifies working context, never approval. Paper/artwork excluded. */
@media screen {
  :root {
    --context-green-bg: linear-gradient(110deg, #dff6ee, #f6fffb);
    --context-green-soft: #e4f5ee;
    --context-green-border: #4d9f7f;
    --context-green-accent: #23835f;
    --context-green-ink: #0c3024;
    --context-green-muted: #3d5c55;
  }
  :root[data-theme="dark"] {
    --context-green-bg: linear-gradient(110deg, #12382d, #10241f);
    --context-green-soft: #12382d;
    --context-green-border: #2e8d68;
    --context-green-accent: #69c99c;
    --context-green-ink: #eefbf4;
    --context-green-muted: #b8d5cb;
  }
  :root :is(.loaded-project-context, .active-context-card, .eb-selected-project-context:not(:empty), .pbs-top-strip.pbs-full-basis, .studio-selection, .package-truth, #designProjectContext, #engineeringSolutionWorkspace > .panel-head) {
    background: var(--context-green-bg);
    border-color: var(--context-green-border);
    border-left: 5px solid var(--context-green-accent);
    color: var(--context-green-ink);
    border-radius: 9px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  :root #designProjectContext :is(.panel-body, .field), :root .package-truth > div { background: transparent; }
  :root #engineeringSolutionWorkspace > .panel-head small { color: var(--context-green-muted); }
  :root .eb-selected-project-context:not(:empty) { padding: 10px 12px; }
  :root :is(.loaded-project-context, .active-context-card) :is(strong, .context-title, .context-action) { color: var(--context-green-ink); }
  :root :is(.loaded-project-context, .active-context-card) :is(small, .context-label, .context-eyebrow, .active-project-meta) { color: var(--context-green-muted); }
  :root :is(.batch1-preview-row.is-selected, .studio-lines tr[aria-selected="true"]) > td {
    background: var(--context-green-soft);
    color: var(--context-green-ink);
  }
  :root :is(.batch1-preview-row.is-selected, .studio-lines tr[aria-selected="true"]) > td:first-child { box-shadow: inset 4px 0 var(--context-green-accent); }
  :root :is(.version-card.selected, .studio-category[aria-pressed="true"], .package-section-tabs button[aria-selected="true"]) {
    background: var(--context-green-soft);
    color: var(--context-green-ink);
    border-color: var(--context-green-border);
    box-shadow: inset 4px 0 var(--context-green-accent);
  }
  :root .version-card.selected small { color: var(--context-green-muted); }
  :root #fw-body:has(#fw-door) > h2 {
    background: var(--context-green-bg);
    color: var(--context-green-ink);
    border: 1px solid var(--context-green-border);
    border-left: 5px solid var(--context-green-accent);
    border-radius: 9px;
    padding: 12px 14px;
    overflow-wrap: anywhere;
  }
  :root :is(.version-card.selected, .studio-category[aria-pressed="true"], .package-section-tabs button[aria-selected="true"]):focus-visible {
    outline: 3px solid var(--context-green-accent); outline-offset: 3px;
  }
  @media (max-width: 700px) {
    :root :is(.loaded-project-context, .active-context-card, .package-truth) { grid-template-columns: minmax(0,1fr); }
    :root :is(.loaded-project-context, .active-context-card) > * { min-width: 0; overflow-wrap: anywhere; }
  }
  @media (forced-colors: active) {
    :root :is(.loaded-project-context, .active-context-card, .eb-selected-project-context, .pbs-top-strip.pbs-full-basis, .studio-selection, .package-truth, .version-card.selected, .studio-category[aria-pressed="true"], .package-section-tabs button[aria-selected="true"], #fw-body:has(#fw-door) > h2) { background: Canvas; color: CanvasText; border-color: Highlight; }
  }
}
/* ONEX GREEN CONTEXT END */
/* ONEX SELECTION THEME BEGIN — 2026-11-12. Screen only; original rules retained. */
.eb-category-count, .eb-category-summary { display:none; }
@media screen {
  :root { --review-bg:#f2ede3; --review-ink:#705627; --review-border:#d2c09e; }
  :root[data-theme="dark"] { --review-bg:#332c20; --review-ink:#e4c18c; --review-border:#79613b; }
  :root body:not(#onex-document-theme) :is(.tabbar, .tabs, .batch1-workbench-tabs, .gv-tabs, .gv-workbench-tabs, .oism-tabs, .eb-workbench-tabs, .category-sheet-tabs, .package-section-tabs, .site-rail-list, .mode-tabs, .studio-lenses) button { background:var(--tab-bg) !important; color:var(--tab-idle-ink) !important; border-color:var(--tab-outline) !important; border-radius:9px !important; box-shadow:none !important; font-family:inherit !important; font-size:14px !important; font-weight:400 !important; }
  :root body:not(#onex-document-theme) :is(.tabbar, .tabs, .batch1-workbench-tabs, .gv-tabs, .gv-workbench-tabs, .oism-tabs, .eb-workbench-tabs, .category-sheet-tabs, .package-section-tabs, .site-rail-list, .mode-tabs, .studio-lenses) button:not(.selected):not(.active):not([aria-selected="true"]):not([aria-pressed="true"]):not(:disabled):hover { background:var(--tab-hover) !important; color:var(--tab-idle-ink) !important; }
  :root body:not(#onex-document-theme) :is(.tabbar, .tabs, .batch1-workbench-tabs, .gv-tabs, .gv-workbench-tabs, .oism-tabs, .eb-workbench-tabs, .category-sheet-tabs, .package-section-tabs, .site-rail-list, .mode-tabs, .studio-lenses) button:is(.selected,.active,[aria-selected="true"],[aria-pressed="true"]):not(.pbs-document-paper *,[contenteditable] *) {
    background:var(--context-green-soft) !important;
    color:var(--context-green-ink) !important;
    border-color:var(--context-green-border) !important;
    border-radius:9px !important;
    box-shadow:inset 0 -3px var(--context-green-accent) !important;
    font-weight:700 !important;
  }
  :root body:not(#onex-document-theme) :is(.tabbar, .tabs, .batch1-workbench-tabs, .gv-tabs, .gv-workbench-tabs, .oism-tabs, .eb-workbench-tabs, .category-sheet-tabs, .package-section-tabs, .site-rail-list, .mode-tabs, .studio-lenses) button:focus-visible { outline:2px solid var(--context-green-accent) !important; outline-offset:2px; }
  :root body:not(#onex-document-theme) :is(.category-sheet-tabs .eb-category-card.selected .eb-category-title, .category-sheet-tabs .eb-category-card.selected .eb-category-title strong, .category-sheet-tabs .eb-category-card.selected .eb-category-count) { color:var(--context-green-ink) !important; }
  :root body:not(#onex-document-theme) :is(.app-nav,.app-shell) a:is(.active,.selected,[aria-current="page"]) { background:var(--context-green-soft); color:var(--context-green-ink); border-color:var(--context-green-border); }
  :root body:not(#onex-document-theme) :is(tr.selected-row,tr.is-selected,tr[aria-selected="true"]) > td:not(.pbs-document-paper *) { background:var(--context-green-soft); color:var(--context-green-ink); }
  :root body:not(#onex-document-theme) :is(.badge.warning, .pricing-action-status.warning, .eb-readiness-chip.warning, .eb-category-title em.warning, .eb-category-summary em.warning, .mock-warning, .notice-test, .quote-exception-warning, .summary-widget.warning, .build-task.warning):not(.pbs-document-paper *,[contenteditable] *) {
    background:var(--review-bg); color:var(--review-ink); border-color:var(--review-border);
  }
  :root body:not(#onex-document-theme) :is(.summary-widget.warning,.build-task.warning) :is(strong,span,small) { color:var(--review-ink); }
  :root body:not(#onex-document-theme) .fw-slot[data-photo-state="missing"] { border-color:var(--review-border); }
  :root body:not(#onex-document-theme) .fw-slot[data-photo-state="missing"] :is(.fw-photo-status,button[data-photo],button[data-library]) { background:var(--review-bg);color:var(--review-ink);border-color:var(--review-border); }
  :root body.estimate-builder-page .category-sheet-tabs .eb-category-card {
    flex:0 0 auto; width:auto; min-width:120px; max-width:300px; min-height:44px;
    padding:10px 14px; transition:none; border-radius:9px;
  }
  :root body.estimate-builder-page .eb-category-card :is(.eb-category-figures,em) { display:none; }
  :root body.estimate-builder-page .eb-category-card .eb-category-title { margin:0;gap:10px; }
  :root body.estimate-builder-page .eb-category-card .eb-category-title strong { font-size:14px; white-space:normal; overflow:visible; }
  :root body.estimate-builder-page .eb-category-count { display:inline; font-size:13px; font-weight:400; color:inherit; }
  :root body.estimate-builder-page .eb-category-summary { display:flex;align-items:center;gap:20px;flex-wrap:wrap;padding:14px 0 4px; }
  :root body.estimate-builder-page .eb-category-summary[hidden] { display:none; }
  :root body.estimate-builder-page .eb-category-summary .eb-category-figures { display:flex;gap:20px;flex-wrap:wrap; }
  :root body.estimate-builder-page .eb-category-summary .eb-category-metric { min-width:65px; }
  :root body.estimate-builder-page .eb-category-summary small { display:block;font-size:12px;color:var(--muted); }
  :root body.estimate-builder-page .eb-category-summary b { display:block;font-size:16px;color:var(--ink); }
  :root body.estimate-builder-page .eb-category-summary em { font-style:normal;padding:5px 9px;border:1px solid var(--review-border);border-radius:12px; }
  @media(forced-colors:active) {
    :root body:not(#onex-document-theme) :is(.tabbar,.tabs,.package-section-tabs,.eb-workbench-tabs,.category-sheet-tabs,.mode-tabs) button:is(.selected,.active,[aria-selected="true"]) { background:Highlight !important;color:HighlightText !important;border-color:Highlight !important; }
  }
}
@media screen {
  :root body:not(#onex-document-theme) .category-sheet-tabs button:is(.selected,.active,[aria-selected="true"]) > span { color:var(--context-green-ink) !important; }
}
/* ONEX SELECTION THEME END */

/* Estimate Builder scrolling boundaries: 2026-11-12. Screen only. */
@media screen {
 body.estimate-builder-page .estimate-sticky-summary { grid-column:1; }
 body.estimate-builder-page .inline-line-editor.group-drawer { top:62px; bottom:12px; z-index:40; align-items:stretch; text-align:left; }
 body.estimate-builder-page .group-drawer-actions { margin-top:0; }
 @media(min-width:1200px) {
  body.estimate-builder-page.eb-group-editor-open .estimate-workspace-grid { grid-template-columns:minmax(0,1fr); padding-right:calc(var(--eb-drawer-w) + 12px); }
  body.estimate-builder-page.eb-group-editor-open .line-editor-panel { display:none; }
  body.estimate-builder-page.eb-group-editor-open .estimate-sticky-summary { grid-column:1; }
 }
 @media(max-width:1199px) {
  body.estimate-builder-page.eb-group-editor-open .estimate-sticky-summary { position:static; }
 }
}

/* Workspace scrolling boundaries: 2026-11-12.
   Nonmodal tools respect the shell; document/print layouts and modal top layers stay independent. */
@media screen {
  body { --onex-sticky-header-clearance: 0px; }
  body.nav-unpinned { --onex-sticky-header-clearance: 62px; }
  body.engineering-review-page #engineeringReviewTabs {
    top: var(--onex-sticky-header-clearance);
  }
  body.government-compliance-page .gv-workbench,
  body .pbs-review-panel {
    top: calc(var(--onex-sticky-header-clearance) + 12px);
  }
  body .proposal-copilot-drawer {
    top: 70px; bottom: 12px; z-index: 40;
  }
  body.nav-open :is(.proposal-copilot-drawer, .pbs-assistant-panel) {
    visibility: hidden;
  }
  @media (min-width:761px) {
    body:has(.shell.app-shell) .pbs-output-footer {
      left: calc(var(--sidebar-width) + 7px);
    }
    body.nav-unpinned:has(.shell.app-shell) .pbs-output-footer,
    body.nav-collapsed:has(.shell.app-shell) .pbs-output-footer {
      left: 24px;
    }
  }
  @media (min-width:1201px) {
    body.estimate-studio-page .studio-topbar {
      top: var(--onex-sticky-header-clearance);
    }
    body.estimate-studio-page #studio-build > .studio-toolbar {
      top: calc(var(--onex-sticky-header-clearance) + var(--studio-topbar-height,160px));
    }
  }
  @media (max-width:760px) {
    body { --onex-sticky-header-clearance: 62px; }
    body:has(.shell.app-shell) .engineering-help {
      left: 56px; right: 12px; width: auto;
      max-width: calc(100vw - 68px); box-sizing: border-box;
    }
  }
  @media (min-width:761px) and (max-width:1100px) {
    body.nav-unpinned .engineering-help,
    body.nav-collapsed .engineering-help { left:36px; right:12px; }
  }
}
@media screen {
  /* Release the nested dark-panel stacking context so its fixed editor clears the output footer. */
  html body .proposal-section-panel:has(.proposal-copilot-drawer:not(.hidden)) { z-index:auto; }
}
@media screen and (min-width:1201px) {
  /* Keep the status strip compact without shrinking text or dropping financial metrics. */
  html body.estimate-studio-page .studio-topbar .studio-basis button {
    min-height:24px !important; padding-block:2px !important;
  }
  body.estimate-studio-page .studio-topbar .studio-selection label { margin-block:0; }
  body.estimate-studio-page .studio-topbar .studio-kpis > div { padding-block:1px; }
}
@media screen {
  body .engineering-help { background:var(--panel); color:var(--ink); border-color:var(--line); }
  body .engineering-help .help-section article { background:var(--panel-soft,var(--panel)); }
  body .engineering-help :is(dt,small) { color:var(--muted); }
}
@media screen {
  body.nav-open .floating-reference { visibility:hidden; }
  body .floating-reference.full { left:calc(var(--sidebar-width) + 19px); }
  body.nav-unpinned .floating-reference.full,
  body.nav-collapsed .floating-reference.full { left:36px; }
  @media (min-width:761px) and (max-width:1499px) {
    body .floating-reference:is(.half,.side,.full) { left:calc(var(--sidebar-width) + 19px); }
    body.nav-unpinned .floating-reference,
    body.nav-collapsed .floating-reference { left:36px; }
  }
  @media (max-width:760px) {
    body:has(.shell.app-shell) .floating-reference { left:56px; right:12px; width:auto; }
  }
}

/* Shared modal scroll isolation: keep background position and contain boundary scrolling. */
@media screen {
  html:has(dialog:modal), html[data-modal-scroll-lock],
  html:has(dialog:modal) body, html[data-modal-scroll-lock] body {
    overflow: hidden !important;
    overscroll-behavior: none;
  }
  dialog:modal, [aria-modal="true"] {
    overscroll-behavior: contain;
  }
  dialog:modal *, [aria-modal="true"] * {
    overscroll-behavior: contain;
  }
}

/* Shared ONEX floating surfaces. Keep specialized drawer placement and document artwork. */
@media screen {
  html body :is(dialog,.modal-card,.floating-reference,.reference-desk,.inspector,.if-credential-drawer,.setup-assistant-drawer,.pbs-assistant-panel,.proposal-copilot-drawer) {
    box-sizing:border-box;
    border:1px solid var(--line);
    border-radius:14px;
    box-shadow:0 16px 48px rgb(0 0 0 / 20%);
    overscroll-behavior:contain;
  }
  html body dialog {
    background:var(--panel);color:var(--ink);
    max-inline-size:calc(100vw - 24px) !important;
    max-block-size:94dvh !important;
  }
  html body dialog::backdrop {background:rgb(0 0 0 / 40%);}
  html body :is(dialog,.modal-card) > :is(h2,h3) {margin-top:0;line-height:1.4;}
  html body :is(.modal-head,.studio-dialog-head,.rfp-drawer-head) {gap:12px;border-bottom:1px solid var(--line);}
  html body :is(dialog,.modal-card,.floating-reference,.inspector) :is(input,select,textarea) {max-width:100%;box-sizing:border-box;}
  html body :is(.modal-card,.floating-reference,.reference-desk,.inspector,.if-credential-drawer,.setup-assistant-drawer,.pbs-assistant-panel,.proposal-copilot-drawer) * {overscroll-behavior:contain;}
}
