:root {
  color-scheme: light;
  --bg: #eef2f6;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #657285;
  --line: #d7dee8;
  --blue: #075da8;
  --blue-dark: #064a85;
  --yellow: #ffc20a;
  --green: #16745f;
  --danger: #9f2f2f;
  --shadow: 0 18px 42px rgba(19, 33, 52, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 194, 10, 0.18), transparent 180px),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto;
  display: grid;
  gap: 18px;
}

.topbar,
.query-panel,
.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-top: 6px solid var(--yellow);
}

.page-logo,
.brand-logo,
.cc-auth-logo {
  display: block;
  object-fit: contain;
  object-position: center;
  background: #ffffff;
}

.page-logo {
  width: 132px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid rgba(7, 93, 168, 0.16);
  border-radius: 12px;
  padding: 7px;
  box-shadow: 0 10px 24px rgba(19, 33, 52, 0.08);
}

.topbar .page-logo + div {
  margin-right: auto;
}

.brand-logo {
  width: 82px;
  height: 46px;
  flex: 0 0 auto;
  border: 1px solid rgba(7, 93, 168, 0.14);
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 8px 18px rgba(19, 33, 52, 0.08);
}

.cc-auth-logo {
  width: 92px;
  height: 50px;
  border: 0;
  border-radius: 10px;
  padding: 3px;
}

.app-contact {
  position: fixed;
  left: 22px;
  bottom: 18px;
  z-index: 80;
  width: max-content;
  max-width: min(340px, calc(100vw - 44px));
  display: grid;
  gap: 4px;
  padding: 10px 13px;
  border: 1px solid rgba(7, 93, 168, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow:
    0 16px 34px rgba(19, 33, 52, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.app-contact a {
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.app-contact a:hover {
  color: var(--blue);
}

@media (max-width: 380px) {
  .app-contact {
    width: auto;
  }

  .app-contact a {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 28px;
}

.status-stack {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 6px;
}

.state {
  min-width: 132px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 750;
}

.state.confirmed {
  border-color: rgba(22, 116, 95, 0.35);
  color: var(--green);
  background: rgba(22, 116, 95, 0.08);
}

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

.workspace {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 18px;
  align-items: start;
}

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

.query-panel,
.result-panel {
  padding: 22px;
}

.query-panel {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 18px;
}

.compact-panel {
  position: static;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.field,
.mode-group {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--text);
  background: white;
  font-weight: 650;
}

.vin-field input {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.adjust-grid {
  display: grid;
  gap: 16px;
}

.mode-group {
  grid-template-columns: 1fr 1fr;
  border: 0;
  padding: 0;
  margin: 0;
}

.mode-group legend {
  grid-column: 1 / -1;
}

.choice {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  font-weight: 700;
}

.choice input {
  width: 16px;
  height: 16px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: var(--blue-dark);
}

button:disabled,
input:disabled {
  cursor: wait;
  opacity: 0.62;
}

button.secondary {
  color: var(--text);
  background: #e8edf4;
}

button.mini {
  min-height: 32px;
  padding: 0 10px;
  color: var(--text);
  background: #eef2f6;
  font-size: 13px;
}

.button-link.mini {
  min-height: 32px;
  padding: 0 10px;
  color: var(--text);
  background: #eef2f6;
  font-size: 13px;
}

.button-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 16px;
  color: white;
  background: var(--blue);
  text-decoration: none;
  font-weight: 800;
}

.button-link.secondary {
  color: var(--text);
  background: #e8edf4;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.hidden {
  display: none !important;
}

.nav-tile {
  display: grid;
  gap: 8px;
  min-height: 150px;
  align-content: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.nav-tile strong {
  font-size: 24px;
}

.nav-tile span,
.muted {
  color: var(--muted);
}

.result-panel {
  display: grid;
  gap: 18px;
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

#status.error {
  color: var(--danger);
}

.vin-chip {
  max-width: 260px;
  overflow-wrap: anywhere;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f6f8fb;
  font-size: 13px;
  font-weight: 800;
}

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

.dashboard-metrics {
  grid-template-columns: repeat(4, 1fr);
}

.metrics div,
.details div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.metrics div {
  padding: 16px;
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

dd {
  margin: 8px 0 0;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 850;
}

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

.details div {
  display: grid;
  gap: 5px;
  padding: 13px;
}

.details span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.details strong {
  min-height: 20px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

pre {
  min-height: 112px;
  margin: 0;
  white-space: pre-wrap;
  border-radius: 8px;
  background: #111827;
  color: #e6edf5;
  padding: 14px;
  overflow: auto;
  line-height: 1.5;
}

.full {
  margin-top: 18px;
}

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

.console-shell {
  width: min(1360px, calc(100vw - 32px));
}

.console-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}

.console-nav {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nav-button {
  justify-content: flex-start;
  width: 100%;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  color: white;
  background: var(--blue);
}

.console-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.console-panel {
  display: grid;
  gap: 18px;
}

.row-editor {
  display: grid;
  grid-template-columns: 90px 100px auto auto 130px auto;
  gap: 8px;
  align-items: center;
}

.row-editor input,
.row-editor select {
  height: 36px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: white;
}

.inline-check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.inline-form.link-form {
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
}

.inline-form input {
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
}

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

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.list-row div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.list-row strong,
.list-row span {
  overflow-wrap: anywhere;
}

.list-row span,
.list-row time {
  color: var(--muted);
  font-size: 13px;
}

.list-row.small {
  padding: 11px 13px;
}

.row-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}

.row-metrics.left {
  justify-content: flex-start;
}

.row-metrics span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2f6;
}

.client-shell .workspace.compact {
  grid-template-columns: 420px 1fr;
}

@media (max-width: 900px) {
  .topbar,
  .result-head {
    display: grid;
  }

  .status-stack {
    justify-items: start;
  }

  .workspace,
  .workspace.compact,
  .console-layout,
  .client-shell .workspace.compact,
  .metrics,
  .dashboard-metrics,
  .details {
    grid-template-columns: 1fr;
  }

  .query-panel {
    position: static;
  }

  .inline-form,
  .list-row {
    display: grid;
  }

  .row-metrics {
    justify-content: flex-start;
  }

  .console-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

body:has(.wx-console) {
  background: #f5f5f5;
}

.wx-console {
  --blue: #07c160;
  --blue-dark: #06ad56;
  --yellow: #07c160;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --line: #e8e8e8;
  --text: #191919;
  --muted: #7a7a7a;
  --green: #07c160;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
  width: min(980px, calc(100vw - 28px));
  margin: 18px auto 34px;
  gap: 14px;
}

.wx-console .topbar,
.wx-console .query-panel,
.wx-console .result-panel,
.wx-console .console-nav,
.wx-console .metrics div,
.wx-console .details div,
.wx-console .list-row {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.wx-appbar {
  align-items: center;
  border-top: 0;
  padding: 18px 20px;
}

.wx-app-title {
  display: grid;
  gap: 5px;
}

.wx-app-title h1 {
  font-size: 25px;
  font-weight: 850;
}

.wx-app-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.wx-app-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wx-console .state {
  min-width: auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f2f2f2;
  color: #666;
  font-size: 13px;
}

.wx-console .state.confirmed {
  border-color: rgba(7, 193, 96, 0.22);
  background: rgba(7, 193, 96, 0.1);
  color: #058f49;
}

.wx-console .state.needs-action {
  border-color: rgba(230, 145, 56, 0.28);
  background: rgba(230, 145, 56, 0.1);
  color: #a65f12;
}

.wx-more-menu {
  position: relative;
}

.wx-more-menu summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 13px;
  color: var(--text);
  background: #f2f2f2;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.wx-more-menu summary::-webkit-details-marker {
  display: none;
}

.wx-more-menu[open] {
  z-index: 20;
}

.wx-more-menu[open]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
}

.wx-more-menu a,
.wx-more-menu button {
  width: 150px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 0;
  padding: 0 14px;
  color: var(--text);
  background: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.wx-more-menu a {
  position: relative;
}

.wx-more-menu a:first-of-type {
  margin-top: 8px;
  border-radius: 8px 8px 0 0;
}

.wx-more-menu button:last-child {
  border-radius: 0 0 8px 8px;
}

.wx-more-menu a,
.wx-more-menu button {
  position: absolute;
  right: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.wx-more-menu a:first-of-type {
  top: 38px;
}

.wx-more-menu a:nth-of-type(2) {
  top: 78px;
}

.wx-more-menu button {
  top: 118px;
}

.wx-console .console-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.wx-tabbar {
  position: sticky;
  top: 10px;
  z-index: 5;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

.wx-tabbar.wx-tabbar-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wx-tabbar .nav-button {
  min-height: 42px;
  justify-content: center;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
}

.wx-tabbar .nav-button.active,
.wx-tabbar .nav-button:hover {
  background: var(--blue);
}

.wx-console .console-main,
.wx-console .console-panel {
  gap: 14px;
}

.wx-quote-workspace {
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 14px;
}

.wx-quote-card,
.wx-session-card,
.wx-result-card {
  padding: 20px;
}

.wx-quote-card {
  position: static;
}

.wx-quote-card h2,
.wx-session-card h2,
.wx-result-card h2 {
  font-size: 23px;
}

.wx-quote-card .muted {
  margin: 7px 0 0;
  font-size: 14px;
}

.wx-console .eyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: none;
}

.wx-console .field {
  font-size: 14px;
}

.wx-console .field input,
.wx-console .field select,
.wx-console .inline-form input,
.wx-console .row-editor input,
.wx-console .row-editor select {
  height: 48px;
  border-radius: 8px;
  border-color: var(--line);
  background: #fbfbfb;
}

.wx-console button,
.wx-console .button-link {
  border-radius: 8px;
}

.wx-console button.primary,
.wx-console .button-link {
  background: var(--blue);
}

.wx-console button.primary:hover,
.wx-console .button-link:hover {
  background: var(--blue-dark);
}

.wx-console button.secondary,
.wx-console button.mini,
.wx-console .button-link.secondary,
.wx-console .button-link.mini {
  background: #f2f2f2;
}

.wx-session-card.is-ok .wx-session-actions {
  display: none;
}

.wx-session-card.is-ok #checkManheim {
  color: #058f49;
  background: rgba(7, 193, 96, 0.1);
}

.wx-session-card.needs-action {
  border-color: rgba(230, 145, 56, 0.4);
}

.wx-session-details {
  grid-template-columns: 1fr;
}

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

.preflight-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfb;
}

.preflight-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.preflight-grid strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-result-card:not(.has-result) .metrics,
.wx-result-card:not(.has-result) .details {
  display: none;
}

.wx-console .metrics div,
.wx-console .details div,
.wx-console .list-row {
  background: #fbfbfb;
}

.wx-console pre {
  min-height: auto;
  background: #f7f7f7;
  color: #4f4f4f;
  font-size: 14px;
}

.wx-records {
  grid-template-columns: 1fr 1fr;
}

.wx-console .dashboard-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .wx-console {
    width: min(100vw - 18px, 720px);
    margin-top: 10px;
  }

  .wx-appbar {
    display: grid;
    gap: 14px;
  }

  .wx-app-actions {
    justify-content: space-between;
  }

  .wx-tabbar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .wx-tabbar.wx-tabbar-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wx-tabbar .nav-button {
    min-width: 56px;
    padding: 0 8px;
  }

  .wx-quote-workspace,
  .wx-records,
  .wx-console .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .inline-form.link-form,
  .preflight-grid {
    grid-template-columns: 1fr 1fr;
  }

  .wx-console h1 {
    font-size: 24px;
  }
}


/* ---------- 共享组件：toast、对话框、VIN hint、链接删除、查询进度 ---------- */

.toast-stack {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 10px;
  background: #1f2937;
  color: white;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: auto;
  text-align: center;
}

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

.toast-success { background: #16745f; }
.toast-error { background: #9f2f2f; }
.toast-info { background: #1f2937; }

.dialog-mask {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.dialog-mask.show {
  opacity: 1;
}

.dialog {
  width: min(420px, calc(100vw - 36px));
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.32);
  display: grid;
  gap: 14px;
}

.dialog h3 {
  margin: 0;
  font-size: 18px;
}

.dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 8px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

.dialog-cancel {
  color: var(--text);
  background: #eef2f6;
}

.dialog-confirm {
  color: white;
  background: var(--blue);
}

.dialog-confirm.danger {
  background: var(--danger);
}

.vin-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.vin-hint[data-state="ok"] { color: var(--green); }
.vin-hint[data-state="forbidden"],
.vin-hint[data-state="invalid"],
.vin-hint[data-state="long"] { color: var(--danger); }
.vin-hint[data-state="short"] { color: #b25c00; }

button.danger,
button.mini.danger {
  color: white;
  background: var(--danger);
}

button.danger:hover,
button.mini.danger:hover {
  background: #882828;
}

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill-on {
  color: var(--green);
  background: rgba(22, 116, 95, 0.12);
}

.pill-off {
  color: var(--muted);
  background: #eef2f6;
}

.link-url {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-size: 12px;
  color: var(--muted);
}

.list-row.flash-new {
  animation: flash-new 2.4s ease-out;
}

@keyframes flash-new {
  0% { background: rgba(255, 194, 10, 0.4); }
  100% { background: #fbfcfe; }
}

.quote-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.quote-progress.hidden {
  display: none;
}

.quote-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--yellow));
  background-size: 200% 100%;
  animation: progress-shimmer 1.6s linear infinite;
}

.quote-progress-text {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

@keyframes progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 客户端页面单一指标（去掉 3 列的 metrics 网格） */
.metrics.single {
  grid-template-columns: 1fr;
}

.metrics.single dd {
  font-size: 36px;
}

/* 微信主题里的 toast/对话框颜色保持一致（不被覆盖） */
.wx-console + .toast-stack .toast-success,
body:has(.wx-console) .toast-success { background: #07c160; }

/* 移动端 toast 收窄 */
@media (max-width: 600px) {
  .toast-stack { top: 16px; }
  .toast { min-width: auto; }
  .quote-progress {
    grid-template-columns: 1fr;
  }
  .quote-progress-text {
    white-space: normal;
  }
  .row-editor {
    grid-template-columns: 1fr 1fr;
  }
  .row-editor button,
  .row-editor input,
  .row-editor select {
    grid-column: span 1;
  }
  .inline-form.link-form,
  .preflight-grid {
    grid-template-columns: 1fr;
  }
}

/* 主控制台车行权限：窄面板里不要把中文按钮挤成竖排。 */
.wx-console .dealer-editor {
  display: grid;
  align-items: stretch;
  gap: 12px;
}

.wx-console .dealer-editor .row-editor {
  width: 100%;
  grid-template-columns: minmax(80px, 1fr) minmax(96px, 1fr) minmax(72px, 0.8fr) minmax(84px, 0.8fr);
}

.wx-console .dealer-editor .row-editor button {
  min-width: 72px;
  white-space: nowrap;
}

.wx-console .dealer-editor .row-editor input[name="password"] {
  grid-column: 1 / span 3;
}

.wx-console .dealer-editor .row-editor [data-reset-password] {
  grid-column: 4;
  min-width: 96px;
}

@media (max-width: 600px) {
  .wx-console .dealer-editor .row-editor {
    grid-template-columns: 1fr 1fr;
  }

  .wx-console .dealer-editor .row-editor input[name="password"],
  .wx-console .dealer-editor .row-editor [data-reset-password] {
    grid-column: 1 / -1;
  }
}

/* -------------------------------------------------------------------------
   IBM / Carbon direction
   Local preview only: shared visual language for Admin, Dealer, Customer.
   ------------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f4;
  --surface-3: #e8e8e8;
  --text: #161616;
  --muted: #525252;
  --line: #c6c6c6;
  --line-soft: #e0e0e0;
  --blue: #0f62fe;
  --blue-dark: #0043ce;
  --blue-soft: #edf5ff;
  --yellow: #f1c21b;
  --green: #24a148;
  --danger: #da1e28;
  --shadow: none;
  --radius: 0;
  --font-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

body:has(.wx-console) {
  background: var(--bg);
}

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

.shell,
.console-shell,
.wx-console {
  width: min(1440px, calc(100vw - 32px));
  margin: 24px auto 40px;
  gap: 16px;
}

.client-shell {
  width: min(1120px, calc(100vw - 32px));
}

.topbar,
.query-panel,
.result-panel,
.console-nav,
.metrics div,
.details div,
.list-row,
.nav-tile,
.preflight-grid div {
  border: 1px solid var(--line-soft);
  border-radius: 0;
  box-shadow: none;
}

.topbar,
.wx-console .topbar {
  min-height: 64px;
  align-items: center;
  padding: 16px 20px;
  border-top: 0;
  background: #161616;
  color: #f4f4f4;
}

.topbar h1,
.wx-app-title h1 {
  color: #f4f4f4;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.16;
  font-weight: 300;
  letter-spacing: 0;
}

.topbar p,
.wx-app-title p {
  color: #c6c6c6;
}

.eyebrow,
.wx-console .eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.32px;
  text-transform: none;
}

.topbar .eyebrow {
  color: #78a9ff;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h2,
.wx-quote-card h2,
.wx-session-card h2,
.wx-result-card h2 {
  color: var(--text);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 400;
}

.workspace {
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
}

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

.console-layout,
.wx-console .console-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 1px;
  align-items: start;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.console-main,
.wx-console .console-main {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 16px;
  background: #ffffff;
}

.console-panel,
.wx-console .console-panel {
  gap: 16px;
}

.console-nav,
.wx-console .console-nav,
.wx-tabbar {
  position: sticky;
  top: 16px;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-self: start;
  padding: 8px 0;
  background: #161616;
  border: 0;
}

.wx-tabbar.wx-tabbar-four {
  grid-template-columns: 1fr;
}

.nav-button,
.wx-tabbar .nav-button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  padding: 0 18px;
  background: transparent;
  color: #c6c6c6;
  text-align: left;
  font-size: 14px;
  font-weight: 400;
}

.nav-button:hover,
.nav-button.active,
.wx-tabbar .nav-button:hover,
.wx-tabbar .nav-button.active {
  color: #ffffff;
  background: #262626;
  border-left: 4px solid var(--blue);
  padding-left: 14px;
}

.query-panel,
.result-panel,
.wx-quote-card,
.wx-session-card,
.wx-result-card {
  gap: 16px;
  padding: 18px;
  background: var(--surface-2);
}

.query-panel {
  top: 16px;
}

.result-panel {
  background: #ffffff;
}

.compact-panel {
  background: transparent;
}

.field,
.mode-group,
.wx-console .field {
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.32px;
}

.field input,
.field select,
.inline-form input,
.row-editor input,
.row-editor select,
.wx-console .field input,
.wx-console .field select,
.wx-console .inline-form input,
.wx-console .row-editor input,
.wx-console .row-editor select {
  height: 44px;
  border: 0;
  border-bottom: 2px solid #8d8d8d;
  border-radius: 0;
  padding: 0 12px;
  background: #ffffff;
  color: var(--text);
  font-weight: 400;
}

.field input:focus,
.field select:focus,
.inline-form input:focus,
.row-editor input:focus,
.row-editor select:focus {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  border-bottom-color: var(--blue);
}

.vin-field input {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.choice {
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  background: #ffffff;
  color: var(--text);
  font-weight: 400;
}

button,
.button-link,
.wx-console button,
.wx-console .button-link {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0 16px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

button:hover,
.button-link:hover,
.wx-console button.primary:hover,
.wx-console .button-link:hover {
  background: var(--blue-dark);
}

button.secondary,
button.mini,
.button-link.secondary,
.button-link.mini,
.wx-console button.secondary,
.wx-console button.mini,
.wx-console .button-link.secondary,
.wx-console .button-link.mini {
  border-color: #393939;
  background: #393939;
  color: #ffffff;
}

button.secondary:hover,
button.mini:hover,
.button-link.secondary:hover,
.button-link.mini:hover {
  background: #4c4c4c;
}

button.danger,
button.mini.danger {
  background: var(--danger);
  color: #ffffff;
}

button.danger:hover,
button.mini.danger:hover {
  background: #a2191f;
}

.state,
.vin-chip,
.pill {
  border-radius: 0;
  font-weight: 600;
}

.state,
.wx-console .state {
  min-width: auto;
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

.state.confirmed,
.wx-console .state.confirmed {
  border-color: #a7f0ba;
  background: #defbe6;
  color: #0e6027;
}

.wx-console .state.needs-action {
  border-color: #fddc69;
  background: #fcf4d6;
  color: #684e00;
}

.vin-chip {
  border-color: var(--line-soft);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.metrics,
.dashboard-metrics,
.wx-console .dashboard-metrics {
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.metrics div,
.details div,
.wx-console .metrics div,
.wx-console .details div {
  border: 0;
  background: var(--surface-2);
}

.metrics div {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  padding: 16px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.32px;
}

dd {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  font-weight: 300;
}

.metrics.single dd {
  font-size: clamp(42px, 7vw, 64px);
  color: var(--blue);
}

.details {
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.details div {
  border: 0;
  border-radius: 0;
}

.details span,
.preflight-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.32px;
}

.details strong,
.preflight-grid strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.preflight-grid {
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.preflight-grid div {
  border: 0;
  border-radius: 0;
  background: var(--surface-2);
}

.list {
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.list:empty {
  display: none;
}

.list > .muted {
  padding: 16px;
  background: #ffffff;
}

.list-row,
.wx-console .list-row {
  gap: 14px;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.list-row:hover {
  background: var(--blue-soft);
}

.row-metrics span {
  border-radius: 0;
  background: var(--surface-2);
  color: var(--muted);
}

.nav-tile {
  min-height: 164px;
  border-radius: 0;
  background: var(--surface-2);
}

.nav-tile:hover {
  background: var(--blue-soft);
  border-color: #a6c8ff;
}

.nav-tile strong {
  font-size: 24px;
  font-weight: 400;
}

pre,
.wx-console pre {
  min-height: auto;
  border-radius: 0;
  border-left: 4px solid #393939;
  background: #262626;
  color: #f4f4f4;
  font-family: var(--font-mono);
  font-size: 13px;
}

.wx-more-menu summary {
  min-height: 38px;
  border-radius: 0;
  background: #393939;
  color: #ffffff;
  font-weight: 600;
}

.wx-more-menu a,
.wx-more-menu button {
  border-radius: 0;
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--line-soft);
  border-bottom: 0;
}

.wx-more-menu a:first-of-type,
.wx-more-menu button:last-child {
  border-radius: 0;
}

.toast {
  border-radius: 0;
  background: #262626;
  box-shadow: none;
}

.toast-success,
.wx-console + .toast-stack .toast-success,
body:has(.wx-console) .toast-success {
  background: var(--green);
}

.toast-error {
  background: var(--danger);
}

.dialog {
  border-radius: 0;
  box-shadow: none;
  border: 1px solid var(--line-soft);
}

.dialog-actions button {
  border-radius: 0;
}

.dialog-cancel {
  background: #393939;
  color: #ffffff;
}

.dialog-confirm {
  background: var(--blue);
}

.pill-on {
  color: #0e6027;
  background: #defbe6;
}

.pill-off {
  color: var(--muted);
  background: var(--surface-2);
}

.quote-progress {
  border-radius: 0;
  background: var(--surface-2);
}

.quote-progress-bar {
  border-radius: 0;
  background: linear-gradient(90deg, var(--blue), #78a9ff);
}

.link-url {
  font-family: var(--font-mono);
}

@keyframes flash-new {
  0% { background: var(--blue-soft); }
  100% { background: #ffffff; }
}

@media (max-width: 980px) {
  .shell,
  .console-shell,
  .wx-console {
    width: min(100vw - 20px, 760px);
    margin-top: 12px;
  }

  .topbar,
  .result-head,
  .wx-appbar {
    display: grid;
    gap: 14px;
  }

  .workspace,
  .workspace.compact,
  .client-shell .workspace.compact,
  .console-layout,
  .wx-console .console-layout,
  .wx-quote-workspace,
  .wx-records,
  .metrics,
  .dashboard-metrics,
  .details,
  .wx-console .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .console-nav,
  .wx-console .console-nav,
  .wx-tabbar,
  .wx-tabbar.wx-tabbar-four {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px;
  }

  .nav-button,
  .wx-tabbar .nav-button {
    justify-content: center;
    min-height: 40px;
    padding: 0 8px;
    text-align: center;
  }

  .nav-button:hover,
  .nav-button.active,
  .wx-tabbar .nav-button:hover,
  .wx-tabbar .nav-button.active {
    border-left: 0;
    border-bottom: 3px solid var(--blue);
    padding-left: 8px;
  }

  .console-main,
  .wx-console .console-main {
    padding: 12px;
  }
}

/* Final IBM pass for the main console. The previous console theme defines
   local WeChat-green variables, so these scoped tokens keep the preview unified. */
.wx-console {
  --blue: #0f62fe;
  --blue-dark: #0043ce;
  --blue-soft: #edf5ff;
  --yellow: #f1c21b;
  --green: #24a148;
  --bg: #ffffff;
  --surface: #ffffff;
  --line: #c6c6c6;
  --text: #161616;
  --muted: #525252;
  --shadow: none;
}

.wx-console .topbar,
.wx-console .query-panel,
.wx-console .result-panel,
.wx-console .console-nav,
.wx-console .metrics div,
.wx-console .details div,
.wx-console .list-row,
.wx-console .preflight-grid div,
.wx-console .wx-login-card,
.wx-console .wx-quote-card,
.wx-console .wx-session-card,
.wx-console .wx-result-card {
  border-radius: 0;
  box-shadow: none;
}

.wx-console button.primary,
.wx-console .button-link,
.wx-console .button-link.mini {
  border-color: #0f62fe;
  background: #0f62fe;
  color: #ffffff;
}

.wx-console button.primary:hover,
.wx-console .button-link:hover,
.wx-console .button-link.mini:hover {
  border-color: #0043ce;
  background: #0043ce;
}

/* -------------------------------------------------------------------------
   New York City MMR Quote Center
   Production shell connected to the existing local backend.
   ------------------------------------------------------------------------- */

.quote-center-page {
  margin: 0;
  min-height: 100vh;
  background: #f4f4f4;
  color: #161616;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

.quote-center-page * {
  box-sizing: border-box;
}

.quote-center-page button,
.quote-center-page input,
.quote-center-page select {
  font: inherit;
}

.quote-center-page button {
  cursor: pointer;
}

.quote-center-page .hidden {
  display: none !important;
}

.quote-center-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: #f4f4f4;
}

.quote-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #161616;
  color: #f4f4f4;
  border-right: 1px solid #000;
}

.quote-brand {
  min-height: 92px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #393939;
}

.quote-logo-wrap {
  width: 72px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #525252;
}

.quote-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.quote-brand strong {
  display: block;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.25;
}

.quote-brand span {
  display: block;
  margin-top: 4px;
  color: #c6c6c6;
  font-size: 12px;
}

.quote-nav {
  padding: 18px 12px;
  border-bottom: 1px solid #393939;
}

.quote-nav p {
  margin: 0 0 8px;
  padding: 0 8px;
  color: #8d8d8d;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quote-center-page .quote-nav-button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 0;
  padding: 0 12px 0 8px;
  background: transparent;
  color: #c6c6c6;
  text-align: left;
  font-weight: 500;
}

.quote-center-page .quote-nav-button:hover,
.quote-center-page .quote-nav-button.active {
  background: #262626;
  color: #ffffff;
  border-left-color: #0f62fe;
}

.quote-nav-button span {
  color: currentColor;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

.quote-session-card {
  margin: 16px;
  display: grid;
  gap: 1px;
  background: #393939;
  border: 1px solid #393939;
}

.quote-session-card div {
  min-height: 52px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: #262626;
}

.quote-session-card span {
  color: #c6c6c6;
  font-size: 12px;
}

.quote-session-card strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.quote-session-card .state {
  min-width: 0;
  width: max-content;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #f1c21b;
}

.quote-session-card .state.confirmed {
  color: #42be65;
}

.quote-session-card .state.needs-action {
  color: #ffb3b8;
}

.quote-workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.quote-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid #d9d9d9;
}

.quote-crumb {
  margin: 0 0 4px;
  color: #6f6f6f;
  font-size: 12px;
}

.quote-topbar strong {
  color: #161616;
  font-size: 14px;
  font-weight: 600;
}

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

.quote-center-page:not(.is-authenticated) .quote-top-actions {
  display: none;
}

.quote-top-actions .button-link,
.quote-center-page button,
.quote-center-page .button-link {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 14px;
  background: #0f62fe;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.quote-center-page button:hover,
.quote-center-page .button-link:hover {
  background: #0043ce;
}

.quote-center-page button:disabled,
.quote-center-page input:disabled,
.quote-center-page select:disabled {
  cursor: not-allowed;
  opacity: .54;
}

.quote-center-page button.secondary,
.quote-center-page .button-link.mini {
  background: #393939;
  color: #ffffff;
  border-color: #393939;
}

.quote-center-page button.secondary:hover,
.quote-center-page .button-link.mini:hover {
  background: #4c4c4c;
}

.quote-center-page button.mini,
.quote-center-page button.quiet,
.quote-list .button-link.mini {
  min-height: 32px;
  padding: 0 10px;
  background: #e8e8e8;
  color: #161616;
  border-color: #c6c6c6;
  font-size: 12px;
}

.quote-center-page button.danger {
  background: #da1e28;
  color: #ffffff;
  border-color: #da1e28;
}

.quote-login-screen,
.quote-content {
  min-width: 0;
  padding: 24px;
}

.quote-login-screen {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
}

.quote-login-card {
  width: min(720px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid #d9d9d9;
}

.quote-login-brand {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid #e0e0e0;
}

.quote-login-brand img {
  width: 128px;
  height: 76px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e0e0e0;
}

.quote-login-brand h1,
.quote-page-head h1 {
  margin: 0;
  color: #161616;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.08;
  font-weight: 300;
  letter-spacing: 0;
}

.quote-login-brand p,
.quote-page-head p {
  margin: 12px 0 0;
  color: #525252;
  font-size: 16px;
  line-height: 1.45;
}

.quote-content {
  display: grid;
  gap: 18px;
}

.quote-panel {
  display: grid;
  gap: 18px;
}

.quote-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.quote-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #d9d9d9;
  border: 1px solid #d9d9d9;
}

.quote-metrics div {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
  background: #ffffff;
}

.quote-metrics span {
  color: #525252;
  font-size: 12px;
}

.quote-metrics strong {
  color: #161616;
  font-size: 42px;
  line-height: 1;
  font-weight: 300;
}

.quote-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .58fr);
  gap: 18px;
  align-items: start;
}

.quote-card,
.quote-command,
.quote-result-card {
  background: #ffffff;
  border: 1px solid #d9d9d9;
}

.quote-browser-board {
  grid-column: 1 / -1;
}

.quote-browser-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.quote-browser-body p {
  margin: 0;
  color: #525252;
  font-size: 15px;
}

.browser-status-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: #e8e8e8;
  color: #161616;
  font-size: 12px;
  font-weight: 700;
}

.browser-status-chip.confirmed {
  background: #defbe6;
  color: #044317;
}

.browser-status-chip.needs-action {
  background: #ffd7d9;
  color: #750e13;
}

.quote-card-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #d9d9d9;
}

.quote-card-head p {
  margin: 0 0 4px;
  color: #6f6f6f;
  font-size: 12px;
}

.quote-card-head h2 {
  margin: 0;
  color: #161616;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
}

.quote-list {
  display: grid;
  gap: 1px;
  background: #d9d9d9;
}

.quote-list > .muted {
  margin: 0;
  padding: 18px;
  background: #ffffff;
  color: #525252;
}

.quote-list .list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 14px 16px;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.quote-list .list-row.small {
  min-height: 58px;
}

.quote-list .list-row strong {
  display: block;
  color: #161616;
  font-size: 14px;
}

.quote-list .list-row span {
  display: block;
  margin-top: 4px;
  color: #525252;
  font-size: 12px;
}

.row-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.row-metrics span,
.pill {
  min-height: 24px;
  display: inline-flex !important;
  align-items: center;
  margin: 0 !important;
  padding: 0 8px;
  background: #e8e8e8;
  color: #161616 !important;
  font-size: 12px !important;
}

.pill-on {
  background: #defbe6;
  color: #044317 !important;
}

.pill-off {
  background: #fcf4d6;
  color: #5e4b00 !important;
}

.quote-health {
  display: grid;
  gap: 1px;
  background: #d9d9d9;
}

.quote-health div {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
}

.quote-health span {
  color: #525252;
  font-size: 12px;
}

.quote-health strong {
  color: #161616;
  font-size: 13px;
  font-weight: 600;
}

.quote-center-page pre {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  background: #262626;
  color: #f4f4f4;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.quote-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1px;
  background: #d9d9d9;
}

.quote-command-form,
.quote-result-card {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 18px;
  background: #ffffff;
}

.quote-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  color: #525252;
  font-size: 12px;
}

.field input,
.field select {
  width: 100%;
  height: 46px;
  border: 0;
  border-bottom: 2px solid #8d8d8d;
  border-radius: 0;
  padding: 0 12px;
  background: #f4f4f4;
  color: #161616;
}

.field input:focus,
.field select:focus {
  outline: 2px solid #0f62fe;
  outline-offset: -2px;
  border-bottom-color: #0f62fe;
}

.vin-input {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.vin-hint {
  min-height: 18px;
  color: #6f6f6f;
  font-size: 12px;
}

.vin-hint[data-state="valid"] {
  color: #24a148;
}

.vin-hint[data-state="invalid"] {
  color: #da1e28;
}

.quote-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #d9d9d9;
  border: 1px solid #d9d9d9;
}

.quote-steps div {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  background: #f8f8f8;
}

.quote-steps div:first-child {
  border-top: 3px solid #0f62fe;
  background: #edf5ff;
}

.quote-steps strong {
  font-size: 13px;
}

.quote-steps span {
  color: #525252;
  font-size: 12px;
}

.vin-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  background: #edf5ff;
  color: #0043ce;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
}

.quote-progress {
  position: relative;
  min-height: 38px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #edf5ff;
}

.quote-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  background: #0f62fe;
  opacity: .18;
  animation: quote-progress 1.8s ease-in-out infinite;
}

.quote-progress-text {
  position: relative;
  z-index: 1;
  color: #0043ce;
  font-size: 12px;
  font-weight: 600;
}

@keyframes quote-progress {
  0% { transform: translateX(-60%); }
  100% { transform: translateX(260%); }
}

.quote-price-metrics {
  display: grid;
  gap: 1px;
  margin: 0;
  background: #d9d9d9;
  border: 1px solid #d9d9d9;
}

.quote-price-metrics div {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
  background: #ffffff;
}

.quote-price-metrics dt {
  color: #525252;
  font-size: 12px;
}

.quote-price-metrics dd {
  margin: 0;
  color: #161616;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 26px;
}

.mode-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-group legend {
  grid-column: 1 / -1;
  color: #525252;
  font-size: 12px;
}

.choice,
.inline-check {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: #f4f4f4;
  border: 1px solid #d9d9d9;
}

.quote-form-card {
  display: grid;
  gap: 14px;
  padding-bottom: 16px;
}

.row-editor {
  display: grid;
  grid-template-columns: 90px 110px auto auto minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.row-editor input,
.row-editor select {
  height: 36px;
  min-width: 0;
  border: 0;
  border-bottom: 2px solid #8d8d8d;
  border-radius: 0;
  padding: 0 10px;
  background: #f4f4f4;
}

.link-url {
  max-width: 540px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

@media (max-width: 1280px) {
  .quote-center-app {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .quote-topbar,
  .quote-page-head,
  .quote-command,
  .quote-grid,
  .quote-form-row {
    grid-template-columns: 1fr;
  }

  .quote-top-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  .quote-center-app {
    grid-template-columns: 1fr;
  }

  .quote-rail {
    position: relative;
    height: auto;
    grid-template-rows: auto auto;
  }

  .quote-brand {
    min-height: 74px;
  }

  .quote-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px;
  }

  .quote-nav p,
  .quote-session-card {
    display: none;
  }

  .quote-nav-button {
    min-width: 120px;
  }

  .quote-login-screen,
  .quote-content {
    padding: 14px;
  }

  .quote-login-brand,
  .quote-metrics,
  .quote-steps {
    grid-template-columns: 1fr;
  }

  .quote-list .list-row,
  .row-editor {
    grid-template-columns: 1fr;
  }
}

/* Customer quote page: keep the customer surface simple and non-technical. */
body.client-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(27, 97, 201, 0.055), transparent 46%),
    #ffffff;
  color: #181d26;
}

.client-page .client-shell {
  width: min(920px, calc(100vw - 32px));
  margin: 28px auto 44px;
  display: grid;
  gap: 18px;
}

.client-page .topbar,
.client-page .query-panel,
.client-page .result-panel {
  border: 1px solid #e0e2e6;
  border-radius: 18px;
  background: #ffffff;
  color: #181d26;
  box-shadow:
    0 0 1px rgba(0, 0, 0, 0.24),
    0 1px 3px rgba(45, 127, 249, 0.16);
}

.client-page .topbar {
  min-height: auto;
  padding: 24px;
}

.client-page .topbar h1 {
  margin: 0;
  color: #181d26;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 850;
}

.client-page .topbar .eyebrow,
.client-page .result-head .eyebrow {
  color: #1b61c9;
  font-size: 13px;
  font-weight: 850;
}

.client-page .workspace.compact {
  grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr);
  gap: 18px;
}

.client-page .query-panel,
.client-page .result-panel {
  padding: 22px;
}

.client-page .field {
  gap: 9px;
  color: rgba(4, 14, 32, 0.68);
  font-weight: 800;
}

.client-page .field input {
  height: 48px;
  border: 1px solid #e0e2e6;
  border-radius: 999px;
  padding: 0 18px;
  background: #ffffff;
  color: #181d26;
  font-size: 15px;
  font-weight: 700;
}

.client-page .field input:focus {
  border-color: #1b61c9;
  outline: 3px solid rgba(27, 97, 201, 0.2);
  outline-offset: 0;
}

.client-page button.primary {
  border-radius: 999px;
  background: #1b61c9;
  font-weight: 850;
}

.client-page button.primary:hover {
  background: #254fad;
}

.client-page .result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.client-page .result-head h2 {
  color: #181d26;
  font-size: 24px;
  font-weight: 800;
}

.client-page .vin-chip {
  border-radius: 999px;
  border-color: #dbe7fb;
  background: #eef4ff;
  color: #1b61c9;
}

.client-page .metrics.single dd {
  color: #1b61c9;
  font-weight: 850;
}

.client-page .details {
  border: 1px solid #eef0f3;
  border-radius: 14px;
  background: #ffffff;
}

.client-page .details div {
  background: #f8fbff;
}

.client-page pre {
  border: 1px solid #e0e2e6;
  border-left: 4px solid #1b61c9;
  border-radius: 14px;
  background: #f8fbff;
  color: #333333;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .client-page .client-shell {
    width: min(100vw - 24px, 520px);
    margin-top: 12px;
  }

  .client-page .workspace.compact,
  .client-page .result-head {
    grid-template-columns: 1fr;
    display: grid;
  }
}
