: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-active: #143d6f;
  --tab-active-ink: #ffffff;
  --tab-empty: #f3f6f7;
  --shadow: 0 1px 2px rgba(15, 29, 37, 0.06);
  --font-page: 13px;
  --font-small: 12px;
  --font-label: 11px;
  --font-title: 22px;
  --font-heading: 16px;
  --sidebar-width: 236px;
  --eb-drawer-w: 380px;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

: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-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.35;
}

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: 11px;
  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: 10px;
  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: 13px;
  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: 13px;
  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: 24px;
  font-weight: 650;
}

.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: 600;
}

.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: 600;
  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;
}

.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;
}

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 #aac3ca;
  border-bottom-color: var(--line);
  border-radius: 6px 6px 0 0;
  color: var(--brand-dark);
  cursor: pointer;
  font: inherit;
  font-size: var(--font-label);
  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;
}

.record-workspace-tabs .tabbar {
  margin-top: 0;
  padding-left: 0;
}

.record-workspace-tabs .tabbar button {
  font-weight: 750;
}

.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(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: var(--font-label);
  padding: 9px 10px;
  text-align: left;
  text-decoration: none;
  min-width: 190px;
  width: auto;
}

.site-rail-list button.selected {
  border-color: var(--brand);
  background: var(--tab-bg);
  box-shadow: inset 4px 0 0 var(--accent);
  color: var(--brand);
}

.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: white;
}

.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: #aac3ca;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: var(--tab-bg);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 750;
}

.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: 900;
  box-shadow: inset 0 -3px 0 var(--accent), 0 0 0 1px color-mix(in srgb, var(--tab-active) 50%, #fff);
}

.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,
td,
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);
}

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,
.nav-group a,
.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);
}

nav a,
.compact-line-editor input,
.compact-line-editor select,
.compact-line-editor .button,
.compact-group h3,
.rfi-question-cell span {
  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"] .site-rail-list button.selected {
  color: #8fd5e5;
}

:root[data-theme="dark"] .site-rail-list button.selected {
  background: #1c2f45;
  border-color: #5baeff;
}

: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 -3px 0 var(--accent), 0 0 0 1px rgba(238, 248, 251, 0.18);
}

: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;
  }

  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: 11px !important;
  padding: 6px 10px !important;
  border-radius: var(--radius) !important;
  text-align: left !important;
  background: var(--sb-bg-hover) !important;
  border-color: transparent !important;
  color: var(--sb-text) !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(--sb-bg-active) !important;
  color: var(--sb-accent) !important;
}

.eb-site-list button.active,
.eb-site-list button[aria-selected="true"],
.eb-site-list a.active {
  background: var(--sb-bg-active) !important;
  color: var(--sb-accent) !important;
  font-weight: 600 !important;
  border-left: 3px solid var(--sb-accent) !important;
  padding-left: 7px !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;
}

/* Single-button tabbar reads as a static section label, not a real
   switcher — quiet it down instead of styling it like a live tab. */
.clients-page .primary-record-tabs {
  padding: 0;
  margin-bottom: 14px;
  border: 0;
  background: none;
}

.clients-page .primary-record-tabs button {
  cursor: default;
  pointer-events: none;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.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;
}

/* 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);
}

@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;
}

@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;
  }
}
