:root {
  --bg: #f2f7fc;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #d4e0ee;
  --text: #152439;
  --muted: #4f6886;
  --blue: #2f8de8;
  --blue-strong: #0078d4;
  --green: #1e8e3e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 70% -30%, #dbefff 0%, transparent 45%),
    radial-gradient(circle at 8% 5%, #eaf5ff 0%, transparent 35%),
    var(--bg);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 340px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 16px;
  background: linear-gradient(180deg, #fbfdff, #f4f9ff);
}

.brand {
  display: block;
  margin-bottom: 12px;
}

.brand-main {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.brand-text {
  min-width: 0;
  flex: 1 1 auto;
}

.brand-text h1 {
  margin: 0;
  font-size: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.icon-btn:hover {
  border-color: var(--blue);
}

.pill-btn {
  min-width: 40px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.pill-btn:hover {
  border-color: var(--blue);
}

.side-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.side-card h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.model-control-card label,
.speech-model-control-card label,
.side-settings-card label {
  font-size: 12px;
}

.speech-custom-model-field[hidden] {
  display: none !important;
}

.speech-ai-review-fields[hidden] {
  display: none !important;
}

.speech-ai-review-fields {
  margin-top: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.speech-live-setting.is-strategy-hidden {
  display: none !important;
}

.speech-billing-hint {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.speech-billing-hint.is-double-charge {
  color: #a15c00;
  font-weight: 600;
}

.speech-model-note {
  margin: 8px 0 0;
}

.mic-test-row {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 6px;
  min-width: 0;
}

.mic-test-row select {
  width: auto;
  max-width: 110px;
  min-width: 84px;
  height: 34px;
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}

.mic-test-row .btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 9px;
  white-space: nowrap;
}

.mic-test-meter {
  flex: 0 1 52px;
  min-width: 36px;
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}

.mic-test-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #107c10, #7ccf62);
  transition: width 80ms linear;
}

.mic-test-status {
  flex: 0 1 auto;
  max-width: 96px;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#micTestStatus.is-error {
  color: #b42318;
}

.compare-module {
  min-width: 0;
}

.calculator-title-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.sticky-totals {
  position: sticky;
  top: 58px;
  z-index: 6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
  padding: 8px 14px;
  border: 1px solid #9fc3e2;
  border-radius: 6px;
  background: #eef6fd;
  box-shadow: 0 2px 6px rgba(15, 108, 189, 0.08);
}

.sticky-total-item {
  color: #31506d;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.sticky-total-item strong {
  margin-left: 4px;
  color: #0067b8;
  font-size: 16px;
  font-weight: 800;
}

body.dark .sticky-totals {
  border-color: #3d5468;
  background: #16283a;
  box-shadow: none;
}

body.dark .sticky-total-item {
  color: #b8cbdc;
}

body.dark .sticky-total-item strong {
  color: #8ecbfa;
}

.compare-header h3 {
  margin: 0;
  color: #123f68;
  font-size: 24px;
}

.compare-header p {
  max-width: 820px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.compare-dataset-tabs {
  display: flex;
  gap: 4px;
  margin: 14px 0 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.compare-dataset-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.compare-dataset-tab:hover,
.compare-dataset-tab.is-active {
  border-bottom-color: #0067b8;
  color: #0067b8;
}

.compare-dataset-tab small {
  display: inline-grid;
  min-width: 18px;
  margin-left: 6px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #eaf2f8;
  color: inherit;
  font-size: 9px;
  place-items: center;
}

body.dark .compare-dataset-tab small {
  background: #1f3548;
}

.compare-dataset-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px 8px;
}

.compare-dataset-meta > div {
  display: grid;
  gap: 3px;
}

.compare-dataset-meta strong {
  color: var(--text);
  font-size: 15px;
}

.compare-dataset-meta span {
  color: var(--muted);
  font-size: 11px;
}

.compare-dataset-meta a {
  flex: 0 0 auto;
  color: #0067b8;
  font-size: 11px;
  font-weight: 700;
}

.compare-dataset-caveat {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 3px solid #d49b32;
  background: #fff8e8;
  color: #6f4b0b;
  font-size: 11px;
  line-height: 1.5;
}

.compare-plan-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px 22px;
  margin-top: 4px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.compare-plan-group {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.compare-plan-group-name {
  flex: 0 0 auto;
  color: #31506d;
  font-size: 12px;
  font-weight: 800;
}

.compare-plan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compare-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 11px;
  border: 1px solid #b8c8d8;
  border-radius: 15px;
  background: #f7fafc;
  color: #40576a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.compare-plan-chip input {
  width: auto;
  margin: 0;
}

.compare-plan-chip.is-selected {
  border-color: #0f6cbd;
  background: #0f6cbd;
  color: #fff;
}

.compare-plan-chip.is-selected input {
  accent-color: #fff;
}

.compare-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.compare-toolbar input[type="text"],
#compareSearchInput {
  width: 300px;
  max-width: 100%;
  height: 37px;
  margin: 0;
}

.compare-diff-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

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

.compare-legend {
  color: var(--muted);
  font-size: 12px;
}

.compare-table-wrap {
  max-height: min(80vh, calc(100dvh - 130px));
  margin-top: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.compare-table th,
.compare-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

@media (hover: hover) and (pointer: fine) {
  .compare-table tbody tr:not(.compare-category-row):is(:hover, :focus-within) > td {
    background: #edf6fd;
    box-shadow: inset 0 1px 0 #b9d9f2, inset 0 -1px 0 #b9d9f2;
  }

  .compare-table tbody tr:not(.compare-category-row):is(:hover, :focus-within) > .compare-feature-col {
    background: #e4f1fb;
  }

  body.dark .compare-table tbody tr:not(.compare-category-row):is(:hover, :focus-within) > td {
    background: #17334a;
    box-shadow: inset 0 1px 0 #35688f, inset 0 -1px 0 #35688f;
  }

  body.dark .compare-table tbody tr:not(.compare-category-row):is(:hover, :focus-within) > .compare-feature-col {
    background: #1b3d57;
  }
}

.compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 2px solid #0a4d8c;
  background: #0f6cbd;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(9, 62, 110, 0.3);
}

.compare-table .compare-feature-col {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 260px;
  max-width: 420px;
  background: var(--panel);
  text-align: left;
}

.compare-table thead .compare-feature-col {
  z-index: 4;
  background: #0f6cbd;
  color: #fff;
}

.compare-feature-zh {
  display: block;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.compare-feature-en {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.compare-category-row td {
  position: sticky;
  left: 0;
  background: #f0f6ee;
  color: #0b6a0b;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.compare-cell {
  font-size: 15px;
  font-weight: 800;
}

.compare-cell.is-included {
  color: #107c10;
}

.compare-cell.is-addon {
  color: #a15c00;
}

.compare-cell.is-limited {
  color: #0f6cbd;
}

.compare-cell.is-unconfirmed {
  color: #7a4f01;
}

.compare-cell.is-none {
  color: #9aa8b5;
  font-weight: 400;
}

.compare-note {
  border: 0;
  padding: 0;
  background: transparent;
  color: #0f6cbd;
  font-size: 12px;
  cursor: help;
}

.compare-note-detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.compare-note-detail[hidden] {
  display: none;
}

.compare-empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.compare-footnote {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.compare-data-status {
  display: block;
  margin-top: 6px;
  color: #176b36;
  font-size: 11px;
}

.compare-data-status.is-warning {
  color: #a15c00;
}

body.dark .compare-data-status {
  color: #91d2a8;
}

body.dark .compare-data-status.is-warning {
  color: #f3ce80;
}

body.dark .compare-header h3 {
  color: #8ecbfa;
}

body.dark .compare-dataset-tab:hover,
body.dark .compare-dataset-tab.is-active,
body.dark .compare-dataset-meta a {
  color: #8ecbfa;
  border-bottom-color: #8ecbfa;
}

body.dark .compare-dataset-caveat {
  border-left-color: #b8872e;
  background: #332a17;
  color: #f0d28f;
}

body.dark .compare-plan-picker {
  background: #17222d;
}

body.dark .compare-plan-group-name {
  color: #9fc1dd;
}

body.dark .compare-plan-chip {
  border-color: #3d5468;
  background: #1d2a37;
  color: #b8cbdc;
}

body.dark .compare-plan-chip.is-selected {
  border-color: #4f9fe0;
  background: #1d68ab;
  color: #fff;
}

body.dark .compare-table thead th,
body.dark .compare-table thead .compare-feature-col {
  border-bottom-color: #4f9fe0;
  background: #14507f;
  color: #eaf5ff;
}

body.dark .compare-table .compare-feature-col {
  background: #141d26;
}

body.dark .compare-category-row td {
  background: #1c2b1c;
  color: #7ccf62;
}

@media (max-width: 720px) {

  .compare-dataset-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .compare-table .compare-feature-col {
    min-width: 180px;
  }

  #compareSearchInput {
    width: 100%;
  }
}

.reference-data-version {
  margin-bottom: 9px;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

th.te-sortable {
  position: relative;
  cursor: pointer;
  user-select: none;
}

th.te-sortable:focus-visible {
  outline: 2px solid #0f6cbd;
  outline-offset: -2px;
}

th.te-sortable::after {
  content: "⇅";
  margin-left: 5px;
  color: #93a9bd;
  font-size: 11px;
}

th.te-sortable[aria-sort="ascending"]::after {
  content: "↑";
  color: #0f6cbd;
}

th.te-sortable[aria-sort="descending"]::after {
  content: "↓";
  color: #0f6cbd;
}

.te-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 5;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.te-resize-handle:hover {
  background: linear-gradient(to right, transparent 3px, #0f6cbd 3px, #0f6cbd 5px, transparent 5px);
}

@media (max-width: 720px) {
  .te-resize-handle {
    display: none;
  }
}


.reference-auto-control {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  cursor: pointer;
}

.reference-auto-control input {
  width: auto;
  margin: 0;
}

.reference-data-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.reference-data-actions .btn {
  min-height: 34px;
  padding: 6px 8px;
}

.reference-data-status {
  min-height: 17px;
  margin-top: 7px;
}

.reference-data-status.is-error {
  color: #a4262c;
}

.daily-brief-admin-card {
  padding: 0;
}

.daily-brief-admin-card summary {
  padding: 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.daily-brief-admin-card[open] summary {
  border-bottom: 1px solid var(--line);
}

.daily-brief-admin-body {
  padding: 12px;
}

.daily-brief-admin-body label {
  font-size: 12px;
}

.daily-brief-admin-body textarea {
  resize: vertical;
}

.daily-brief-admin-badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 3px;
  background: #f1f4f6;
  color: #40576a;
  font-size: 11px;
  font-weight: 800;
}

.daily-brief-admin-badge.is-verified {
  background: #fff4ce;
  color: #6b4f00;
}

.daily-brief-admin-badge.is-enabled {
  background: #dff6dd;
  color: #0b6a0b;
}

.daily-brief-admin-hint {
  margin-left: 0;
}

.daily-brief-admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.daily-brief-admin-actions .btn {
  min-height: 34px;
  padding: 6px 8px;
}

.daily-brief-admin-actions #toggleDailyBriefAutomationBtn {
  grid-column: 1 / -1;
}

.daily-brief-admin-message {
  min-height: 17px;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.4;
}

.compact-grid {
  align-items: end;
}

.reasoning-control {
  min-width: 0;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}

.reasoning-control legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f7fb;
}

.segmented-control label {
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 4px 2px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #4a617a;
  background: #ffffff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.segmented-control input:focus-visible + span {
  outline: 2px solid rgba(47, 141, 232, 0.35);
  outline-offset: 1px;
}

.segmented-control input:checked + span {
  border-color: var(--blue-strong);
  background: var(--blue-strong);
  color: #ffffff;
}

.side-settings-card {
  padding: 0;
}

.side-settings-card summary {
  padding: 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.side-settings-card[open] summary {
  border-bottom: 1px solid var(--line);
}

.side-settings-card textarea,
.side-settings-card .grid-two,
.side-settings-card .settings-reset-btn {
  width: calc(100% - 24px);
  margin-left: 12px;
  margin-right: 12px;
}

.side-settings-card textarea {
  margin-top: 12px;
  resize: vertical;
}

.side-settings-card .grid-two {
  margin-top: 4px;
  margin-bottom: 8px;
}

.settings-reset-btn {
  margin-top: 0;
  margin-bottom: 12px;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--blue-strong);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.settings-reset-btn:hover {
  text-decoration: underline;
}

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

.remember-key-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  cursor: pointer;
}

.remember-key-control input {
  width: auto;
  margin: 0;
}

.field-note {
  margin: 4px 0 2px 23px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #bdd0e6;
  border-radius: 9px;
  background: #ffffff;
  color: var(--text);
  padding: 10px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(47, 141, 232, 0.25);
  border-color: var(--blue);
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.workspace {
  min-width: 0;
  padding: 0 14px 14px;
}

.workspace-header {
  position: sticky;
  z-index: 900;
  top: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  margin: 0 -14px 8px;
  padding: 0 14px 0 41px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 2px 8px rgba(21, 52, 84, 0.07);
  backdrop-filter: blur(10px);
}

.workspace-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 1 280px;
}

.sidebar-edge-toggle {
  position: fixed;
  z-index: 1000;
  top: 11px;
  left: 340px;
  width: 27px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(21, 52, 84, 0.16);
  color: var(--blue-strong);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.sidebar-edge-toggle:hover {
  background: #edf6ff;
}

.sidebar-edge-toggle:focus-visible {
  outline: 2px solid rgba(47, 141, 232, 0.4);
  outline-offset: 2px;
}

/* Collapsible sidebar: hide the left panel and let the workspace take full width. */
.app-shell.sidebar-collapsed {
  grid-template-columns: 1fr;
}

.app-shell.sidebar-collapsed .sidebar {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-edge-toggle {
  left: 0;
}

.workspace-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  white-space: nowrap;
}

.workspace-header p {
  display: none;
}

.customer-workspace-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  margin-bottom: 14px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue-strong);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(21, 52, 84, 0.09);
}

.customer-workspace-picker {
  display: grid;
  grid-template-columns: auto minmax(200px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.customer-workspace-label {
  color: #224f80;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.customer-workspace-select {
  height: 38px;
  min-width: 0;
  margin: 0;
  padding: 7px 34px 7px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}

.customer-workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.workspace-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 4px;
  white-space: nowrap;
}

.workspace-action-btn.danger {
  color: #a4262c;
  border-color: #d9a4a7;
}

.workspace-action-btn.danger:hover:not(:disabled) {
  background: #fff1f1;
  border-color: #a4262c;
}

.customer-workspace-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 36px));
  padding: 10px 12px;
  border: 1px solid #d9a4a7;
  border-radius: 6px;
  background: #fff1f1;
  box-shadow: 0 8px 24px rgba(81, 20, 25, 0.16);
  font-size: 12px;
}

.customer-workspace-status.is-error {
  color: #a4262c;
}

.workspace-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(15, 37, 61, 0.25);
}

.workspace-dialog::backdrop {
  background: rgba(15, 31, 48, 0.45);
}

.workspace-dialog form {
  padding: 20px;
}

.workspace-dialog h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.workspace-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

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

.reference-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

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

.reference-dialog-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.reference-version-list {
  display: grid;
  gap: 7px;
  max-height: 280px;
  margin-top: 12px;
  overflow: auto;
}

.reference-version-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-soft);
}

.reference-version-item.is-active {
  border-color: var(--blue-strong);
  box-shadow: inset 3px 0 var(--blue-strong);
}

.reference-version-item strong,
.reference-version-item span {
  display: block;
}

.reference-version-item span,
.reference-version-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.reference-correction-editor {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.reference-correction-editor summary {
  color: var(--blue-strong);
  font-weight: 700;
  cursor: pointer;
}

.reference-correction-editor label {
  margin-top: 10px;
}

.reference-correction-editor textarea {
  min-height: 260px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.step-card {
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.step-panel[hidden] {
  display: none;
}

.requirement-workbench {
  min-width: 0;
  padding: 16px;
}

.requirement-workbench-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.requirement-workbench-title .step-hint {
  margin-bottom: 0;
}

.quote-view-tablist {
  display: flex;
  flex: 0 0 auto;
  gap: 0;
  max-width: 58%;
  overflow-x: auto;
  border-bottom: 1px solid #c9d7e6;
}

.quote-view-tab {
  flex: 0 0 auto;
  padding: 11px 16px 9px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4f6886;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.quote-view-tab:hover:not(:disabled) {
  color: #005a9e;
  background: #eaf3fd;
}

.quote-view-tab.is-active {
  border-bottom-color: #0078d4;
  color: #005a9e;
  background: #ffffff;
}

.quote-view-tab:disabled {
  opacity: 0.48;
  cursor: default;
}

.quote-view-panel[hidden] {
  display: none;
}

.requirement-input-band {
  min-width: 0;
  margin-top: 0;
}

.requirement-input-label {
  margin-bottom: 6px;
  color: #24435f;
  font-size: 12px;
  font-weight: 800;
}

.requirement-input-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
  width: 136px;
}

.requirement-input-actions .btn {
  width: 100%;
  min-height: 38px;
}

.requirement-results-grid {
  display: grid;
  grid-template-columns: clamp(220px, 18vw, 280px) minmax(0, 1fr);
  gap: 12px;
  height: min(72vh, 760px);
  min-height: 600px;
  margin-top: 12px;
}

@media (min-width: 1101px) {
  .app-shell:not(.sidebar-collapsed) .requirement-results-grid {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

.requirement-left-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  height: 100%;
}

.requirement-left-column .chat-input-row {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

.requirement-left-column .requirement-input-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  width: 100%;
}

.requirement-left-column .requirement-input-actions .btn {
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
}

.raw-requirement-panel,
.requirement-table-panel {
  min-width: 0;
  margin-top: 0;
}

.raw-requirement-panel {
  height: 100%;
  min-height: 0;
}

.raw-requirement-panel .chat-col-body {
  padding: 10px;
}

.raw-requirement-panel .chat-msg {
  padding: 9px 10px;
  font-size: 12.5px;
  line-height: 1.5;
}

.requirement-table-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.requirement-table-panel .solution-draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex: 0 0 auto;
}

.solution-draft-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.solution-draft-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.solution-draft-actions .btn {
  min-height: 34px;
  padding: 7px 11px;
  white-space: nowrap;
}

.requirement-table-panel .progress-bar {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid #dce5ee;
}

.requirement-table-panel .solution-brief-view {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.quote-review-page {
  height: min(72vh, 760px);
  min-height: 600px;
  margin-top: 12px;
  overflow-y: auto;
  border: 1px solid #c9d7e6;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
}

.quote-review-page-head {
  padding: 16px 18px 13px;
  border-bottom: 1px solid #dce5ee;
  background: #f3f7fb;
}

.quote-review-page-head h4 {
  margin: 0;
  font-size: 18px;
}

.quote-review-page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.quote-review-page .assumptions-review-list {
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.65;
}

.assumptions-review-list ul {
  margin: 0;
  padding-left: 18px;
}

.assumptions-review-list li + li {
  margin-top: 4px;
}

.draft-review-empty {
  color: var(--muted);
}

.assumptions-review-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 24px 20px;
  padding-top: 12px;
  border-top: 1px solid #dce5ee;
}

.assumptions-review-actions .btn {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.assumptions-review-status {
  color: #107c10;
  font-size: 11px;
  font-weight: 700;
}

.quote-review-page .followup {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 18px 20px 24px;
  font-size: 13px;
}

.stepper {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.step-tab {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: #5a6b7e;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.step-tab:hover {
  border-color: #9fc4ec;
}

.step-tab:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.step-tab:disabled:hover {
  border-color: var(--line);
}

.step-tab.is-active {
  border-color: var(--blue-strong);
  background: #eef6ff;
  color: var(--blue-strong);
  box-shadow: 0 2px 6px rgba(0, 120, 212, 0.12);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d7e6f8;
  color: #345;
  font-size: 13px;
  flex: none;
}

.step-tab.is-active .step-num {
  background: var(--blue-strong);
  color: #ffffff;
}

.export-summary {
  margin: 8px 0 14px;
  padding: 14px 16px;
  border: 1px solid #cfe0f3;
  border-radius: 12px;
  background: #f7fbff;
  font-size: 15px;
  line-height: 1.7;
}

.quote-details {
  margin: 12px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.requirement-review,
.confirmed-requirement,
.solution-draft {
  margin-top: 14px;
  border: 1px solid #c9d7e6;
  border-radius: 6px;
  background: #ffffff;
}

.requirement-results-grid > .requirement-table-panel {
  height: 100%;
  margin-top: 0;
}

.requirement-review-head,
.solution-draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #dce5ee;
  background: #f3f7fb;
}

.requirement-review h4,
.confirmed-requirement h4,
.solution-draft h4 {
  margin: 0;
  font-size: 16px;
}

.requirement-review-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.review-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid #8abbe7;
  border-radius: 3px;
  color: #005a9e;
  font-size: 10px;
  font-weight: 700;
}

.confirmed-requirement h4 {
  padding: 12px 14px;
  border-bottom: 1px solid #dce5ee;
  background: #eef6fd;
  color: #005a9e;
}

.confirmed-requirement summary {
  padding: 10px 14px;
  background: #eef6fd;
  color: #005a9e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.confirmed-requirement pre {
  max-height: 300px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.solution-brief-view {
  min-height: 220px;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}

.solution-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  border-bottom: 1px solid #c9d7e6;
  background: #f8fbfe;
}

.solution-overview-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid #dce5ee;
}

.solution-overview-grid > div:last-child {
  border-right: 0;
}

.solution-overview-grid span,
.solution-overview-grid strong {
  display: block;
}

.solution-overview-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.solution-overview-grid strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-validation {
  padding: 8px 12px;
  border-bottom: 1px solid #c9d7e6;
  background: #fff4ce;
  color: #6b4f00;
  font-size: 12px;
  font-weight: 700;
}

.draft-validation.is-ready {
  background: #dff6dd;
  color: #0b6a0b;
}

.solution-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.solution-report-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}

.solution-report-table th,
.solution-report-table td {
  border-right: 1px solid #c9d7e6;
  border-bottom: 1px solid #c9d7e6;
  vertical-align: middle;
}

.solution-report-table th {
  padding: 7px 6px;
  background: #dcebf7;
  color: #12344d;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
}

.solution-report-table th span,
.solution-report-table th small {
  display: block;
}

.solution-report-table th small {
  margin-top: 3px;
  color: #3e5d73;
  font-size: 9px;
  font-weight: 600;
}

.solution-report-table th:nth-child(1) { width: 6%; }
.solution-report-table th:nth-child(2) { width: 11%; }
.solution-report-table th:nth-child(3) { width: 11%; }
.solution-report-table th:nth-child(4) { width: 20.5%; }
.solution-report-table th:nth-child(5) { width: 14.5%; }
.solution-report-table th:nth-child(6) { width: 6%; }
.solution-report-table th:nth-child(7) { width: 7%; }
.solution-report-table th:nth-child(8) { width: 7%; }
.solution-report-table th:nth-child(9) { width: 6%; }
.solution-report-table th:nth-child(10) { width: 11%; }

.solution-report-table input,
.solution-report-table select,
.solution-report-table textarea {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 7px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.solution-report-table textarea {
  min-height: 52px;
  line-height: 1.35;
  resize: vertical;
}

.solution-report-table input:focus,
.solution-report-table select:focus,
.solution-report-table textarea:focus {
  outline: 2px solid #0078d4;
  outline-offset: -2px;
  background: #ffffff;
}

.solution-report-table input:disabled {
  background: #f4f6f8;
  color: #8795a1;
}

.draft-category-cell {
  padding: 8px 7px;
  background: #eef6fd;
  color: #164c73;
  font-weight: 700;
}

.draft-row-incomplete {
  background: #fffaf0;
}

.draft-status-cell {
  padding: 6px;
  text-align: center;
}

.draft-row-status {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
}

.draft-row-status.is-complete {
  background: #dff6dd;
  color: #0b6a0b;
}

.draft-row-status.is-incomplete {
  background: #fff4ce;
  color: #6b4f00;
}

.draft-remove-row {
  width: 24px;
  height: 24px;
  margin-left: 4px;
  border: 0;
  background: transparent;
  color: #a4262c;
  cursor: pointer;
  font-size: 16px;
}

.draft-table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #dce5ee;
}

.draft-table-actions .btn {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.draft-table-actions .draft-validation {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 10px;
  text-align: right;
}

.draft-table-actions .draft-validation.is-ready {
  background: transparent;
}

.draft-empty {
  padding: 20px 14px;
  color: var(--muted);
  text-align: center;
}

.export-summary .total-line {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue-strong);
}

.export-format-note {
  margin: 8px 0;
  padding: 9px 11px;
  border-left: 3px solid var(--blue-strong);
  background: #f1f7fd;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .reference-dialog-head {
    align-items: stretch;
    flex-direction: column;
  }

  .reference-version-item {
    grid-template-columns: 1fr;
  }

  .stepper {
    flex-direction: column;
  }
}

.step-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

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

.btn {
  border: 1px solid #b7cae2;
  background: #ffffff;
  color: var(--text);
  padding: 9px 13px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, var(--blue), var(--blue-strong));
  border-color: #1f84e2;
  color: #ffffff;
}

.btn-success {
  background: linear-gradient(180deg, #34aa4f, var(--green));
  border-color: #249441;
  color: #ffffff;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.lang-btn {
  border: 0;
  background: #ffffff;
  color: var(--muted);
  padding: 6px 12px;
  cursor: pointer;
}

.lang-btn.is-active {
  color: #ffffff;
  background: var(--blue);
}

.status-line,
.followup,
.meta,
.totals {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.status-line {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  line-height: 1.4;
}

.status-server,
.status-connected {
  border-color: #85c99a;
  background: #edf8f0;
  color: #176b35;
}

.status-local,
.status-pending {
  border-color: #e5bd66;
  background: #fff8e8;
  color: #755000;
}

.status-error {
  border-color: #e5a4a7;
  background: #fff1f1;
  color: #a4262c;
}

.chat-mode-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 6px;
  border: 1px solid #e5bd66;
  border-radius: 4px;
  background: #fff8e8;
  color: #755000;
  font-size: 11px;
  font-weight: 700;
}

.term-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border: 1px solid #e1e7ee;
  border-radius: 8px;
  background: #f7fafd;
}

.term-row .term-name {
  font-weight: 700;
  color: #1f4e79;
  min-width: 120px;
}

.term-row .term-val strong {
  color: #111;
}

.term-row .term-save {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 12px;
  background: #d6f0dd;
  color: #136f3a;
  font-weight: 700;
  font-size: 13px;
}

.term-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.pricing-warnings {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid #f0c36d;
  border-radius: 6px;
  background: #fff8e8;
  color: #6b4e00;
  font-size: 12px;
  line-height: 1.5;
}

.pricing-warnings strong {
  display: block;
  margin-bottom: 3px;
}

.followup ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.followup-hint {
  margin: 4px 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.followup-warn {
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid #f0c36d;
  background: #fff7e6;
  color: #8a5a00;
  border-radius: 8px;
  font-size: 13px;
}

.followup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.followup-item {
  border: 1px solid #cfe0f3;
  background: #f7fbff;
  border-radius: 10px;
  padding: 10px 12px;
}

.followup-q {
  font-size: 13px;
  line-height: 1.45;
  color: #1f3450;
  font-weight: 700;
  margin-bottom: 4px;
}

.followup-impact,
.followup-instruction {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.followup-instruction {
  margin-top: 6px;
  font-weight: 700;
}

.followup-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 7px;
  margin: 8px 0;
}

.followup-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid #b9cce0;
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.followup-option:hover {
  border-color: var(--blue);
  background: #f2f8fe;
}

.followup-option.is-selected {
  border-color: var(--blue-strong);
  background: #eaf4fe;
  box-shadow: inset 3px 0 0 var(--blue-strong);
}

.followup-option-label {
  padding-right: 48px;
  font-size: 12px;
  font-weight: 700;
}

.followup-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.recommended-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #dff1e3;
  color: #166534;
  font-size: 9px;
  font-weight: 700;
}

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

.followup-answer {
  flex: 1 1 auto;
  margin: 0;
  padding: 7px 10px;
  font-size: 13px;
}

.followup-confirm {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 7px 14px;
}

.followup-validation {
  min-height: 16px;
  margin-top: 4px;
  color: #a4262c;
  font-size: 11px;
}

.followup-batch-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-check input {
  width: auto;
  margin: 0;
}

.service-editor {
  display: block;
  max-width: 100%;
  margin-top: 10px;
  overflow-x: auto;
}

.calculator-panel {
  padding: 18px;
  background: var(--panel);
}

.calculator-title-row,
.product-picker-head,
.estimate-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.calculator-title-row .step-hint {
  margin-bottom: 0;
}

.product-picker {
  margin: 18px -18px 16px;
  padding: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.product-picker[hidden] {
  display: none;
}

.product-picker h4,
.estimate-heading h4,
.commercial-options h4 {
  margin: 0;
  font-size: 18px;
}

.product-picker-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.product-picker-head input {
  width: min(360px, 45%);
  margin-top: 0;
}

.product-category-tabs {
  display: flex;
  gap: 2px;
  margin: 16px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.category-tab {
  flex: 0 0 auto;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}

.category-tab.is-active {
  border-bottom-color: var(--blue-strong);
  color: var(--blue-strong);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.product-tile {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 132px;
  padding: 12px;
  border: 1px solid #cfd9e5;
  border-radius: 4px;
  background: #ffffff;
}

.product-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #9fc5ec;
  border-radius: 4px;
  background: #eaf4fe;
  color: #0067b8;
  font-size: 11px;
  font-weight: 700;
}

.product-copy {
  min-width: 0;
}

.product-copy strong {
  display: block;
  font-size: 14px;
}

.product-copy p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.product-add-btn {
  grid-column: 2;
  justify-self: start;
  border: 0;
  background: transparent;
  color: #0067b8;
  padding: 2px 0;
  cursor: pointer;
  font-weight: 700;
}

.estimate-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 220px)) minmax(230px, 1fr);
  gap: 12px;
  align-items: end;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--line);
}

.estimate-settings label {
  margin: 0;
}

.setting-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: 0;
  color: var(--text);
}

.setting-check input {
  width: auto;
  margin: 0;
}

.estimate-heading {
  align-items: center;
  margin-top: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #606f7b;
}

.estimate-heading .meta {
  margin-top: 4px;
  font-size: 12px;
}

.estimate-tools {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tool-btn {
  border: 0;
  background: transparent;
  color: #0067b8;
  padding: 6px 8px;
  cursor: pointer;
  font-weight: 600;
}

.tool-btn.danger {
  color: #a4262c;
}

.estimate-list {
  margin-top: 0;
}

.estimate-report-header,
.estimate-item-row {
  display: grid;
  grid-template-columns: 30px 90px 150px 130px 210px 170px 60px 74px 74px 58px 112px 96px 118px 118px 64px;
  min-width: 1554px;
}

.estimate-report-header {
  min-height: 48px;
  border-bottom: 2px solid #0067b8;
  background: #f4f8fc;
  color: #24455f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
}

.estimate-report-header > span {
  min-width: 0;
  padding: 8px 8px;
  border-right: 1px solid #e3ebf2;
}

.estimate-report-header > span:nth-child(n+7):nth-child(-n+11),
.estimate-report-header > span:nth-child(13),
.estimate-report-header > span:nth-child(14) {
  text-align: right;
}

.estimate-report-header > span > span,
.estimate-report-header small {
  display: block;
}

.estimate-report-header small {
  margin-top: 3px;
  color: #6b8299;
  font-size: 9px;
  font-weight: 600;
}

.estimate-item {
  min-width: 1554px;
  border-bottom: 1px solid #e1e8ef;
  background: #ffffff;
}

.estimate-item:nth-of-type(even) {
  background: #fafcfe;
}

.estimate-item:not(.is-excluded):hover {
  background: #f1f8fe;
}

.estimate-item.is-excluded {
  opacity: 0.58;
}

.estimate-item-row {
  align-items: center;
  min-height: 58px;
}

.estimate-item-row > * {
  min-width: 0;
  height: 100%;
  padding: 8px 8px;
  border-right: 1px solid #edf2f7;
}

.estimate-toggle,
.item-icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #0078d4;
  cursor: pointer;
  padding: 0;
  font-size: 18px;
}

.estimate-item-row > .estimate-toggle {
  align-self: center;
  justify-self: center;
  height: 28px;
  padding: 0;
  border-right: 0;
}

.estimate-item.is-expanded .estimate-toggle {
  transform: rotate(180deg);
}

.estimate-product-icon {
  width: 34px;
  height: 34px;
}

.estimate-product-copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.estimate-product-copy strong {
  display: block;
  font-size: 13px;
}

.estimate-item-description {
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #3d5368;
  font-size: 12px;
  line-height: 1.4;
}

.estimate-item-description > span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.estimate-category {
  display: flex;
  align-items: center;
  background: transparent;
  color: #0f6cbd;
  font-size: 12px;
  font-weight: 700;
}

.estimate-spec-value {
  display: flex;
  align-items: center;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.estimate-spec-value.is-number {
  justify-content: flex-end;
}

.estimate-unit {
  color: var(--muted);
  font-size: 11.5px;
}

.estimate-item-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.estimate-price {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 8px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.estimate-price span,
.estimate-price strong {
  display: block;
}

.estimate-price strong {
  overflow: hidden;
  margin-top: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.estimate-price strong[data-price="monthly"] {
  color: #0067b8;
  font-weight: 700;
}

.estimate-price-editable {
  gap: 4px;
}

.unit-price-currency {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.unit-price-input {
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid #cbd6e2;
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.unit-price-input::-webkit-outer-spin-button,
.unit-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.unit-price-input:focus {
  border-color: #0067b8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 103, 184, 0.15);
}

.unit-price-input.is-overridden {
  border-color: #c07a00;
  background: #fff8ec;
  color: #7a4c00;
  font-weight: 700;
}

.unit-price-input:disabled {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.estimate-config {
  padding: 14px 70px 16px;
  border-top: 1px solid #dce3ea;
  background: #f7f9fb;
}

.estimate-config[hidden] {
  display: none;
}

.calculator-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px 12px;
}

.calculator-field {
  min-width: 0;
  margin: 0;
}

.calculator-field span,
.calculator-note span {
  display: block;
  min-height: 18px;
  color: #3e5267;
  font-size: 12px;
  font-weight: 600;
}

.calculator-field input,
.calculator-field select,
.calculator-note input {
  margin-top: 4px;
  border-radius: 3px;
  padding: 8px;
}

.estimate-config-footer {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(180px, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #dce3ea;
}

.calculator-note {
  margin: 0;
}

.include-service {
  min-height: 34px;
}

.line-source {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.line-source.has-warning {
  color: #8a5a00;
}

.empty-estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 26px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.commercial-options {
  margin-top: 22px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.commercial-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.5fr) minmax(180px, 1fr);
  gap: 14px;
  align-items: end;
}

.commercial-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.quote-version-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(150px, auto);
  align-items: end;
  gap: 8px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue-strong);
  border-radius: 4px;
  background: var(--panel-soft);
}

.quote-version-bar[hidden] {
  display: none;
}

.quote-version-bar label,
.quote-version-bar select {
  margin: 0;
}

.quote-version-bar .meta {
  align-self: center;
  margin: 0;
  text-align: right;
}

.official-totals {
  margin-top: 18px;
  border-top: 1px solid #7b8792;
  padding: 12px 0;
}

.official-total-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 4px;
  font-size: 15px;
}

.official-total-row.is-primary {
  font-size: 18px;
}

.term-comparison {
  margin-top: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.term-comparison summary {
  color: #0067b8;
  cursor: pointer;
  font-weight: 700;
}

.term-comparison .term-row {
  margin-top: 8px;
}

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

.contingency-field {
  display: block;
  max-width: 220px;
  margin-top: 8px;
}

.service-add-row {
  display: flex;
  align-items: end;
  gap: 8px;
  margin: 10px 0;
}

.service-add-row select {
  width: min(320px, 100%);
}

.step-hint {
  margin: 0 0 10px;
  color: #5a6b7e;
  font-size: 13px;
}

.example-prompts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.example-label {
  font-size: 12px;
  color: #5a6b7e;
}

.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.example-chip {
  border: 1px solid #bcd5f0;
  background: #eef6ff;
  color: #0b5394;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.example-chip:hover {
  background: #d9ecff;
  border-color: #0078d4;
}

.chat-window {
  border: 1px solid #d6e3f2;
  border-radius: 12px;
  background: #f7fbff;
  padding: 16px;
  height: 48vh;
  min-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: 48vh;
  min-height: 380px;
}

.chat-col {
  display: flex;
  flex-direction: column;
  border: 1px solid #d6e3f2;
  border-radius: 12px;
  background: #f7fbff;
  overflow: hidden;
}

.chat-col-head {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #0b5394;
  background: #eaf3fd;
  border-bottom: 1px solid #d6e3f2;
}

.chat-col:last-child .chat-col-head {
  color: #ffffff;
  background: linear-gradient(135deg, #0078d4, #2b88d8);
  border-bottom-color: #1f84e2;
}

.chat-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-empty {
  margin: auto;
  color: #8aa0b6;
  font-size: 13px;
  text-align: center;
}

.chat-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 0 1px 2px rgba(15, 52, 80, 0.06);
}

.chat-user {
  background: #ffffff;
  border: 1px solid #cfe0f3;
  color: #1f3450;
}

.chat-assistant {
  background: #ffffff;
  border: 1px solid #bcd9f5;
  color: #1f3450;
}

.chat-time {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.6;
  margin-bottom: 3px;
}

.chat-thinking {
  font-style: italic;
  color: #0b5394;
}

.brief-section-title {
  display: inline-block;
  margin: 8px 0 2px;
  color: #005a9e;
  font-size: 13px;
}

.chat-text .brief-section-title:first-child {
  margin-top: 0;
}

.progress-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar[hidden] {
  display: none;
}

.progress-track {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 6px;
  background: #e3eefb;
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: -40%;
  height: 100%;
  width: 40%;
  border-radius: 6px;
  background: linear-gradient(90deg, #0078d4, #4aa3ec);
  animation: progress-indeterminate 1.1s ease-in-out infinite;
}

.progress-text {
  font-size: 12px;
  color: #0b5394;
  white-space: nowrap;
}

@keyframes progress-indeterminate {
  0% { left: -40%; }
  50% { left: 30%; }
  100% { left: 100%; }
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
  align-items: end;
}

.requirement-composer {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #b8cbe0;
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.requirement-composer:focus-within,
.requirement-composer.is-dragging {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.14);
}

.requirement-composer.is-dragging {
  background: #eef7ff;
}

.chat-input-row textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
  font-size: 14px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.requirement-input-band .chat-input-row textarea {
  min-height: 108px;
}

.composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 38px;
  padding: 5px 8px;
  border-top: 1px solid #dce7f2;
}

.attachment-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #075a9c;
  padding: 5px 7px;
  cursor: pointer;
  font-weight: 600;
}

.attachment-btn:hover {
  color: var(--blue-strong);
}

.voice-input-btn {
  border-left: 1px solid #d5e1ed;
  margin-left: 3px;
  padding-left: 10px;
}

.voice-input-icon {
  width: 11px;
  height: 11px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
}

.voice-input-btn.is-listening {
  color: #a4262c;
}

.voice-input-btn.is-listening .voice-input-icon {
  background: #d13438;
  box-shadow: 0 0 0 4px rgba(209, 52, 56, 0.14);
  animation: voice-pulse 1.2s ease-in-out infinite;
}

.voice-input-status {
  flex: 1 1 180px;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
}

.voice-input-status.is-error {
  color: #a4262c;
}

@keyframes voice-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px;
  border-top: 1px solid #dce7f2;
  background: #f7fbff;
}

.attachment-tray:empty {
  display: none;
}

.attachment-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 7px;
  width: min(260px, 100%);
  min-height: 44px;
  padding: 4px;
  border: 1px solid #c9dced;
  border-radius: 6px;
  background: #ffffff;
}

.attachment-preview,
.attachment-file-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
}

.attachment-preview {
  object-fit: cover;
}

.attachment-file-icon {
  display: grid;
  place-items: center;
  background: #e6f2fc;
  color: #075a9c;
  font-size: 10px;
  font-weight: 700;
}

.attachment-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.attachment-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.attachment-meta small {
  color: var(--muted);
  font-size: 11px;
}

.attachment-remove {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.attachment-notice {
  width: 100%;
  color: #a4262c;
  font-size: 12px;
}

.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.chat-attachments span {
  padding: 2px 6px;
  border: 1px solid #c9dced;
  border-radius: 4px;
  background: #f3f8fd;
  font-size: 11px;
}

.service-row {
  border: 1px dashed #b6cbe3;
  border-radius: 10px;
  background: #f7fbff;
  padding: 10px;
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 1fr 1fr 1fr 2fr;
  gap: 8px;
  align-items: end;
}

.notes-box {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7e6;
  border: 1px solid #ffe1a8;
  color: #6b4e00;
  font-size: 13px;
  line-height: 1.5;
  display: none;
}

.notes-box div + div {
  margin-top: 4px;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid #1e3454;
  text-align: left;
}

th {
  color: #275177;
  background: #edf5fe;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-edge-toggle {
    left: 0;
  }

  .sidebar .brand {
    margin-left: 27px;
  }

  .workspace {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .estimate-settings,
  .calculator-fields {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .estimate-config {
    padding-inline: 16px;
  }

}

@media (max-width: 900px) {
  .requirement-workbench-title {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-view-tablist {
    width: 100%;
    max-width: 100%;
  }

  .requirement-results-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .requirement-left-column {
    grid-template-rows: auto 250px;
    height: auto;
  }

  .requirement-left-column .raw-requirement-panel {
    height: 250px;
    min-height: 250px;
  }

  .requirement-table-panel {
    height: min(68vh, 680px);
    min-height: 500px;
  }
}

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

  .workspace-header {
    gap: 8px;
    margin: 0 -10px 8px;
    padding: 0 10px 0 37px;
  }

  .workspace-header-left {
    display: none;
  }

  .top-controls {
    margin-left: auto;
  }

  .quote-view-tab {
    padding: 10px 13px 8px;
    font-size: 14px;
  }

  .quote-version-bar {
    grid-template-columns: 1fr;
  }

  .quote-version-bar .meta {
    text-align: left;
  }

  .customer-workspace-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .customer-workspace-picker {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
  }

  .customer-workspace-actions {
    grid-column: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .workspace-action-btn {
    width: 100%;
    min-height: 34px;
    padding: 6px 4px;
    font-size: 12px;
  }

  .chat-split {
    grid-template-columns: 1fr;
    height: auto;
  }

  .chat-col {
    min-height: 280px;
  }

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

  .requirement-input-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .chat-input-row > .btn,
  .requirement-input-actions .btn {
    width: 100%;
  }

  .solution-draft-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .solution-draft-actions .btn {
    width: 100%;
  }

  .service-add-row {
    align-items: stretch;
    flex-direction: column;
  }

  .service-add-row select,
  .service-add-row .btn {
    width: 100%;
  }

  .calculator-title-row,
  .product-picker-head,
  .estimate-heading,
  .empty-estimate,
  .requirement-review-head,
  .solution-draft-head {
    align-items: stretch;
    flex-direction: column;
  }

  .product-picker-head input,
  .commercial-grid {
    width: 100%;
  }

  .estimate-settings,
  .calculator-fields,
  .commercial-grid,
  .estimate-config-footer {
    grid-template-columns: 1fr;
  }

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

  .solution-overview-grid > div:nth-child(2) {
    border-right: 0;
  }

  .solution-overview-grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid #dce5ee;
  }

  .line-source {
    text-align: left;
  }
}

/* ---------- Dark theme ---------- */
body.dark {
  --bg: #0f1822;
  --panel: #16212e;
  --panel-soft: #1b2837;
  --line: #2b3a4d;
  --text: #e6eef7;
  --muted: #9fb2c8;
  --blue: #3a9bf0;
  --blue-strong: #4aa6f5;
  background: radial-gradient(circle at 70% -30%, #16344f 0%, transparent 45%),
    radial-gradient(circle at 8% 5%, #122231 0%, transparent 35%),
    var(--bg);
}

body.dark .sidebar {
  background: linear-gradient(180deg, #14202d, #101a25);
}

body.dark .sidebar-edge-toggle:hover {
  background: var(--panel-soft);
}

body.dark .side-card,
body.dark .step-card,
body.dark .step-tab,
body.dark .btn,
body.dark .customer-workspace-bar {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

body.dark .customer-workspace-bar {
  border-left-color: var(--blue-strong);
}

body.dark .customer-workspace-label {
  color: #9fd0ff;
}

body.dark .workspace-action-btn.danger {
  color: #ffb3b8;
  border-color: #854b50;
}

body.dark .workspace-action-btn.danger:hover:not(:disabled) {
  background: #40262a;
}

body.dark .segmented-control {
  background: #101b27;
  border-color: var(--line);
}

body.dark .segmented-control span {
  background: #1b2a39;
  color: #b9cbe0;
}

body.dark .segmented-control input:checked + span {
  background: var(--blue-strong);
  border-color: var(--blue-strong);
  color: #ffffff;
}

body.dark .side-settings-card[open] summary {
  border-bottom-color: var(--line);
}

body.dark .customer-workspace-status {
  background: #40262a;
  border-color: #854b50;
  color: #ffb3b8;
}

body.dark .workspace-dialog {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

body.dark input,
body.dark textarea,
body.dark select {
  background: #0f1a25;
  border-color: var(--line);
  color: var(--text);
}

body.dark .requirement-composer,
body.dark .attachment-item {
  background: #0f1a25;
  border-color: var(--line);
}

body.dark .status-server,
body.dark .status-connected,
body.dark .status-local,
body.dark .status-pending,
body.dark .status-error,
body.dark .chat-mode-badge {
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--text);
}

body.dark .requirement-composer.is-dragging,
body.dark .attachment-tray,
body.dark .chat-attachments span {
  background: #142b3f;
  border-color: var(--line);
}

body.dark .composer-toolbar,
body.dark .attachment-tray {
  border-color: var(--line);
}

body.dark .attachment-btn {
  color: #8bc8ff;
}

body.dark .icon-btn,
body.dark .pill-btn {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

body.dark .step-tab.is-active {
  background: #163049;
  color: var(--blue-strong);
  border-color: var(--blue-strong);
}

body.dark .step-num {
  background: #294866;
  color: #dcebff;
}

body.dark .export-summary,
body.dark .term-row,
body.dark .notes-box,
body.dark .pricing-warnings {
  background: var(--panel-soft);
  border-color: var(--line);
}

body.dark .export-format-note {
  background: var(--panel-soft);
  border-color: var(--blue);
}

body.dark .term-row .term-name {
  color: var(--blue-strong);
}

body.dark .term-row .term-val strong {
  color: var(--text);
}

body.dark .chat-col {
  background: var(--panel-soft);
  border-color: var(--line);
}

body.dark .chat-col-head {
  background: #1d3753;
  color: #cfe4fb;
  border-bottom-color: var(--line);
}

body.dark .chat-col:last-child .chat-col-head {
  background: linear-gradient(135deg, #0a5fa8, #1f6fbf);
  color: #ffffff;
}

body.dark .chat-user,
body.dark .chat-assistant {
  background: #14222f;
  border-color: var(--line);
  color: var(--text);
}

body.dark .chat-empty {
  color: var(--muted);
}

body.dark th {
  background: #16293c;
  color: #bcd6f1;
}

body.dark th,
body.dark td {
  border-bottom-color: var(--line);
}

body.dark .example-chip {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

body.dark .followup-chip {
  background: #14222f;
  border-color: #355072;
  color: #cfe4fb;
}

body.dark .followup-chip:hover {
  background: #1b2f44;
  border-color: var(--blue);
}

body.dark .followup-item {
  background: #14222f;
  border-color: #355072;
}

body.dark .followup-option {
  background: #101d29;
  border-color: #355072;
  color: var(--text);
}

body.dark .followup-option:hover,
body.dark .followup-option.is-selected {
  background: #17324a;
  border-color: var(--blue);
}

body.dark .followup-q {
  color: var(--text);
}

body.dark .service-row {
  background: #14222f;
  border-color: #355072;
}

body.dark .product-picker,
body.dark .estimate-config,
body.dark .product-tile,
body.dark .estimate-item,
body.dark .requirement-review,
body.dark .confirmed-requirement,
body.dark .solution-draft,
body.dark .quote-review-page {
  background: var(--panel-soft);
  border-color: var(--line);
}

body.dark .requirement-input-label {
  color: #b9d8ef;
}

body.dark .quote-view-tablist,
body.dark .quote-review-page-head,
body.dark .assumptions-review-actions {
  border-color: var(--line);
  background: #132433;
}

body.dark .quote-view-tab {
  color: var(--muted);
}

body.dark .quote-view-tab:hover:not(:disabled),
body.dark .quote-view-tab.is-active {
  color: #b9ddf7;
  background: #183047;
}

body.dark .requirement-review-head,
body.dark .solution-draft-head,
body.dark .confirmed-requirement h4,
body.dark .confirmed-requirement summary {
  background: #183047;
  border-color: var(--line);
}

body.dark .solution-overview-grid,
body.dark .solution-report-table input:disabled {
  background: #132433;
}

body.dark .solution-overview-grid > div,
body.dark .solution-report-table th,
body.dark .solution-report-table td,
body.dark .draft-table-actions {
  border-color: var(--line);
}

body.dark .solution-report-table th {
  background: #23425b;
  color: var(--text);
}

body.dark .solution-report-table th small {
  color: #a9c8df;
}

body.dark .solution-report-table input:focus,
body.dark .solution-report-table select:focus,
body.dark .solution-report-table textarea:focus {
  background: #0f1c28;
}

body.dark .draft-category-cell {
  background: #193349;
  color: #b9ddf7;
}

body.dark .draft-row-incomplete {
  background: #2b2517;
}

body.dark .estimate-item-description,
body.dark .calculator-field span,
body.dark .calculator-note span {
  color: var(--muted);
}

body.dark .estimate-report-header {
  border-bottom-color: #3d8fd0;
  background: #16293a;
  color: #c8dff2;
}

body.dark .estimate-report-header > span {
  border-right-color: #24384b;
}

body.dark .estimate-report-header small {
  color: #7fa0bd;
}

body.dark .estimate-item {
  border-bottom-color: #24384b;
}

body.dark .estimate-item:nth-of-type(even) {
  background: #13222f;
}

body.dark .estimate-item:not(.is-excluded):hover {
  background: #18314a;
}

body.dark .estimate-item-row > * {
  border-right-color: #1f3245;
}

body.dark .estimate-category {
  color: #8ecbfa;
}

body.dark .estimate-price strong[data-price="monthly"] {
  color: #8ecbfa;
}

body.dark .unit-price-input {
  border-color: #3a5068;
  background: #10202e;
  color: var(--text);
}

body.dark .unit-price-input.is-overridden {
  border-color: #d69a2d;
  background: #33270f;
  color: #ffd58a;
}

body.dark .unit-price-input:disabled {
  border-color: transparent;
  background: transparent;
}

body.dark .product-icon {
  background: #15324a;
  border-color: #355f83;
  color: #9bd0ff;
}
