:root {
  color-scheme: light;
  --bg: oklch(99% 0.002 240);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(97% 0.003 240);
  --fg: oklch(18% 0.012 250);
  --muted: oklch(54% 0.012 250);
  --subtle: oklch(66% 0.01 250);
  --border: oklch(92% 0.005 250);
  --line: oklch(94% 0.004 250);
  --sun: oklch(80% 0.16 95);
  --sun-strong: oklch(74% 0.18 92);
  --sun-soft: color-mix(in oklch, var(--sun) 16%, var(--surface));
  --sun-ink: #4b3514;
  --blue: #2563eb;
  --blue-ink: #1e3a8a;
  --blue-soft: #eaf1ff;
  --warn: #d97706;
  --warn-soft: #fff7ed;
  --danger: #dc2626;
  --danger-soft: #fff1f2;
  --green: #059669;
  --green-soft: #ecfdf5;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "Cascadia Code", Menlo, monospace;
  --shadow: 0 18px 44px rgba(34, 42, 53, 0.08);
  --radius: 10px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html.is-minimal-root {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
ul,
h1,
h2,
h3,
h4,
figure {
  margin: 0;
}

ul {
  padding-left: 1.25rem;
}

button,
input,
textarea,
select {
  min-width: 0;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 7rem;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  background: var(--surface-2);
}

code {
  border-radius: 6px;
  background: var(--surface-2);
  padding: 0.125rem 0.375rem;
  font-family: var(--font-mono);
}

img,
svg {
  max-width: 100%;
}

.admin-v2-shell {
  min-height: 100svh;
  --radius: 8px;
  background: var(--bg);
  color: var(--fg);
}

.admin-v2-app {
  min-height: 100svh;
}

.admin-v2-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
}

.admin-v2-topbar-inner {
  display: flex;
  width: min(1440px, 100%);
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 auto;
  padding: 0 clamp(12px, 2.4vw, 20px);
}

.admin-v2-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 680;
  letter-spacing: 0;
  white-space: nowrap;
}

.admin-v2-logo {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 7px;
  object-fit: contain;
  box-shadow: 0 0 0 1px var(--border);
}

.admin-v2-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-v2-nav::-webkit-scrollbar {
  display: none;
}

.admin-v2-nav a,
.admin-v2-nav button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
}

.admin-v2-nav a:hover,
.admin-v2-nav a:focus-visible,
.admin-v2-nav button:hover,
.admin-v2-nav button:focus-visible {
  background: var(--surface-2);
  color: var(--fg);
  outline: 0;
}

.admin-v2-nav a.is-active {
  background: var(--fg);
  color: var(--surface);
}

.admin-v2-page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px clamp(12px, 2.4vw, 20px) 44px;
}

.admin-v2-page .page-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-v2-page .page-title h1 {
  grid-column: 1;
  max-width: 760px;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 680;
  line-height: 1.05;
}

.admin-v2-page .page-title .eyebrow {
  grid-column: 1;
}

.admin-v2-page .page-title p {
  grid-column: 1;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
}

.admin-v2-page .page-title .actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: end;
  justify-content: flex-end;
}

.admin-v2-page .section {
  gap: 16px;
  margin-top: 20px;
}

.admin-v2-page .section:first-child,
.admin-v2-page .page-title + .section {
  margin-top: 0;
}

.admin-v2-page .section-head {
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.admin-v2-page .section-head h1,
.admin-v2-page .section-head h2 {
  font-size: 20px;
  font-weight: 660;
  line-height: 1.15;
}

.admin-v2-page .metric-card,
.admin-v2-page .mini-card,
.admin-v2-page .quote-card,
.admin-v2-page .stage-card,
.admin-v2-page .offer-card,
.admin-v2-page .record-row,
.admin-v2-page .lead-card,
.admin-v2-page .table-wrap,
.admin-v2-page .form-card {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.admin-v2-page .table-wrap {
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 22px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}

.logo-img {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
}

.logo-mark {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid #e2b434;
  border-radius: 8px;
  background: var(--sun-soft);
}

.logo-mark::before {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 7px;
  left: 6px;
  height: 8px;
  border: 1.5px solid var(--blue);
  background: repeating-linear-gradient(90deg, rgba(37, 99, 235, 0.18) 0 6px, transparent 6px 9px);
  transform: skewX(-16deg);
}

.logo-mark::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sun-strong);
  box-shadow: 0 0 0 4px rgba(245, 197, 66, 0.25);
}

.brand-text {
  display: grid;
  min-width: 0;
  line-height: 1.08;
}

.brand-title {
  overflow: hidden;
  font-size: 15px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav-menu {
  position: relative;
  display: none;
  justify-self: end;
}

.menu-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}

.menu-button::-webkit-details-marker {
  display: none;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--fg);
}

.nav-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 190px;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 8px;
}

.nav-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 13px;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--fg);
  outline: 0;
}

.nav-link.cta {
  border-color: #e2b434;
  background: var(--sun-soft);
  color: var(--sun-ink);
  font-weight: 720;
}

.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.auth-page {
  display: grid;
  min-height: calc(100svh - 132px);
  place-items: center;
  padding: 26px 0 46px;
}

.auth-card {
  display: grid;
  width: min(430px, 100%);
  gap: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 760;
  line-height: 1;
}

.auth-logo img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid #e2b434;
  border-radius: 10px;
  background: var(--sun-soft);
  object-fit: contain;
  padding: 3px;
}

.auth-card .head-copy,
.form-grid {
  display: grid;
  gap: 12px;
}

.auth-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.08;
}

.auth-card .lead,
.auth-card .meta {
  color: var(--muted);
}

.auth-card .meta,
.auth-card .error-text {
  font-size: 12px;
}

.auth-card .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.auth-card .summary,
.auth-card .ok-note {
  display: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 13px;
}

.auth-card .summary.is-visible,
.auth-card .ok-note.is-visible {
  display: block;
}

.auth-card .summary.is-visible {
  border-color: #f2a6a6;
  background: var(--danger-soft);
  color: var(--danger);
}

.auth-card .ok-note.is-visible {
  border-color: #a7e4c9;
  background: var(--green-soft);
  color: var(--green);
}

.auth-card .error-text {
  display: none;
  color: var(--danger);
}

.auth-card .has-error .error-text {
  display: block;
}

.admin-pages-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-pages-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  object-fit: contain;
  padding: 4px;
}

.section {
  display: grid;
  gap: 22px;
  margin-top: 52px;
}

.section:first-child,
.page-title + .section {
  margin-top: 0;
}

.stack {
  display: grid;
  gap: 14px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.section-head > div {
  display: grid;
  gap: 6px;
}

.section-head h2,
.section-head h1,
.page-title h1,
.hero-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0;
}

.section-head h2,
.section-head h1 {
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.12;
}

.section-head p,
.page-title p,
.hero-copy p,
.mini-card p,
.metric-note,
.record-row p,
.lead-card p,
.stage-lane p {
  color: var(--muted);
}

.page-title {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.page-title h1 {
  max-width: 920px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.page-title p {
  max-width: 820px;
  font-size: 16px;
}

.eyebrow {
  color: var(--blue-ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: clamp(36px, 4vw, 56px);
  align-items: center;
  min-height: min(680px, calc(100svh - 142px));
  padding: 34px 0 46px;
}

.hero-copy {
  display: grid;
  gap: 20px;
}

.hero-copy h1 {
  max-width: 860px;
  font-size: clamp(44px, 6.8vw, 84px);
  line-height: 0.96;
}

.hero-copy p {
  max-width: 920px;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.38;
}

.actions,
.status-strip,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-actions {
  justify-content: space-between;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.checkbox-line input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--blue);
}

.vendor-checkbox-list {
  display: grid;
  gap: 8px;
  max-width: 360px;
}

.queue-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  padding: 10px 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.btn:hover,
.btn:focus-visible {
  border-color: #93b4f8;
  outline: 0;
}

.btn.primary {
  border-color: #dca51e;
  background: var(--sun);
  color: var(--sun-ink);
}

.btn.primary:hover,
.btn.primary:focus-visible,
.btn.primary:active,
.btn.primary.htmx-request,
.htmx-request .btn.primary {
  border-color: #bd8817;
  background: #f0bb31;
  color: var(--sun-ink);
  box-shadow: inset 0 0 0 1px rgba(75, 53, 20, 0.14);
}

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

.btn.blue {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.btn.warning {
  border-color: #e9b36b;
  background: var(--warn-soft);
  color: #7c4a03;
}

.btn.danger {
  border-color: #f2a6a6;
  background: var(--danger-soft);
  color: var(--danger);
}

.btn.ghost {
  background: transparent;
}

.privacy-line {
  display: inline-flex;
  align-items: start;
  gap: 9px;
  max-width: 680px;
  color: var(--muted);
  font-size: 13px;
}

.privacy-line::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.preview-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  justify-self: stretch;
  width: 100%;
}

.preview-col {
  display: grid;
  gap: 14px;
}

.mini-card,
.quote-card,
.metric-card,
.stage-card,
.offer-card,
.record-row,
.lead-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.mini-card,
.quote-card,
.metric-card,
.stage-card,
.offer-card,
.record-row,
.lead-card {
  padding: 14px;
}

.mini-card h3,
.quote-card h3,
.stage-card h3,
.offer-card h3,
.lead-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.bill-card {
  display: grid;
  min-height: 232px;
  align-content: start;
  gap: 12px;
}

.bill-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.bill-amount,
.metric-value,
.price-value {
  font-variant-numeric: tabular-nums;
}

.bill-amount {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.bill-bars {
  display: grid;
  gap: 7px;
  margin-top: 3px;
}

.bill-bars i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}

.bill-bars i:nth-child(1) {
  width: 74%;
}

.bill-bars i:nth-child(2) {
  width: 54%;
}

.bill-bars i:nth-child(3) {
  width: 82%;
  background: rgba(245, 197, 66, 0.52);
}

.bill-bars i:nth-child(4) {
  width: 48%;
}

.roof-preview {
  position: relative;
  min-height: 232px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.17) 1px, transparent 1px),
    linear-gradient(0deg, rgba(37, 99, 235, 0.14) 1px, transparent 1px),
    #cbdccb;
  background-size: 24px 24px;
}

.roof-preview::before {
  content: "";
  position: absolute;
  inset: 46px 48px 44px 58px;
  border: 2px solid var(--blue-ink);
  background:
    repeating-linear-gradient(90deg, rgba(37, 99, 235, 0.20) 0 9px, rgba(246, 245, 240, 0.20) 9px 13px),
    #91a991;
  clip-path: polygon(12% 10%, 78% 0, 100% 45%, 84% 100%, 14% 88%, 0 42%);
}

.roof-preview::after {
  content: "Roof screenshot preview";
  position: absolute;
  bottom: 12px;
  left: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
}

.slug-chat-stage {
  display: grid;
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  justify-content: center;
  justify-items: center;
  overflow: hidden;
  background: #f5f5f7;
}

body.is-minimal-shell {
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #f5f5f7;
}

body.is-minimal-shell .app-shell.app-shell--minimal {
  max-width: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  padding: 0;
}

.slug-chat-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(100%, 460px);
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  background: var(--surface);
}

.slug-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  padding: 8px 12px;
}

.slug-chat-brand {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 9px;
}

.slug-chat-vendor-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--fg);
  color: var(--surface);
  object-fit: contain;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 760;
}

img.slug-chat-vendor-mark {
  display: block;
  object-fit: cover;
}

.slug-chat-vendor-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.slug-chat-vendor-copy h1 {
  overflow: hidden;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slug-chat-vendor-copy span,
.slug-chat-progress-label,
.slug-chat-file-name,
.slug-chat-state-line {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.slug-chat-status {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-height: 26px;
  max-width: 42%;
  overflow: hidden;
  border-radius: 999px;
  background: #f1f1f3;
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slug-chat-status.is-ready {
  background: #e8f8ef;
  color: var(--green);
}

.slug-chat-progress-block {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  padding: 7px 12px 8px;
}

.slug-chat-progress-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 12px;
}

.slug-chat-progress-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slug-chat-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e5ea;
}

.slug-chat-progress span {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: #0a84ff;
  transition: width 0.2s ease;
}

.slug-chat-transcript {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  padding: 10px 10px 12px;
  -webkit-overflow-scrolling: touch;
}

.slug-chat-day-stamp {
  align-self: center;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
}

.slug-chat-fragment {
  display: contents;
}

.slug-chat-message {
  display: flex;
}

.slug-chat-message.is-user {
  justify-content: flex-end;
}

.slug-chat-message.is-system {
  justify-content: flex-start;
}

.slug-chat-bubble {
  display: grid;
  align-content: center;
  align-items: center;
  max-width: 86%;
  min-height: 34px;
  border-radius: 18px;
  background: #e9e9eb;
  padding: 7px 12px;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.28;
  white-space: pre-line;
}

.slug-chat-bubble.user {
  background: var(--sun);
  color: var(--sun-ink);
}

.slug-chat-bubble.system,
.slug-chat-bubble.tip {
  background: #e9e9eb;
}

.slug-chat-bubble.notice {
  background: var(--warn-soft);
  color: #7c4a03;
}

.slug-chat-typing-row {
  min-height: 34px;
}

.slug-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 54px;
  min-height: 34px;
}

.slug-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #8e8e93;
  animation: slug-chat-typing 1s ease-in-out infinite;
}

.slug-chat-typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.slug-chat-typing span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes slug-chat-typing {
  0%,
  72%,
  100% {
    opacity: 0.34;
    transform: translateY(0);
  }

  36% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.slug-chat-state-line {
  align-self: flex-start;
  border-radius: 999px;
  background: #f1f1f3;
  padding: 5px 9px;
}

.slug-chat-state-line.is-ready {
  background: var(--green-soft);
  color: var(--green);
}

.slug-chat-composer {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--border);
  background: #f7f7f8;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
}

.slug-chat-details-trigger {
  position: relative;
  display: grid;
  align-items: center;
  width: 38px;
  height: 38px;
  justify-content: center;
  border-radius: 999px;
  background: #e9e9eb;
  cursor: pointer;
  padding: 0;
  color: var(--fg);
}

.slug-chat-details-trigger:hover,
.slug-chat-details-trigger:focus-visible {
  background: #dedee3;
  color: var(--fg);
  outline: 0;
}

.slug-chat-details-trigger-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.slug-chat-details-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.24);
}

.slug-chat-details-backdrop[hidden],
.slug-chat-details-sheet[hidden] {
  display: none;
}

.slug-chat-details-sheet {
  position: fixed;
  right: auto;
  bottom: 0;
  left: 50%;
  z-index: 90;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100vw, 460px);
  height: 70vh;
  height: 70dvh;
  max-height: 70vh;
  max-height: 70dvh;
  overflow: hidden;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 44px rgba(34, 42, 53, 0.18);
  transform: translateX(-50%);
}

.slug-chat-details-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 16px 16px 12px;
}

.slug-chat-details-head h2 {
  font-size: 18px;
  font-weight: 720;
  line-height: 1.18;
}

.slug-chat-details-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.slug-chat-details-close {
  min-height: 34px;
  border-radius: 999px;
  background: #f1f1f3;
  color: var(--fg);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.slug-chat-details-body {
  overflow-y: auto;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

.slug-chat-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 0;
}

.slug-chat-detail-grid label,
.slug-chat-consent {
  display: grid;
  gap: 5px;
}

.slug-chat-detail-grid span {
  color: var(--fg);
  font-size: 12px;
  font-weight: 650;
}

.slug-chat-detail-grid input,
.slug-chat-detail-grid select,
.slug-chat-input-row textarea {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--fg);
  font-size: 16px;
  box-shadow: inset 0 0 0 1px var(--border);
}

.slug-chat-detail-grid input,
.slug-chat-detail-grid select {
  min-height: 40px;
  padding: 8px 10px;
}

.slug-chat-consent {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  margin: 12px 0 0;
  border-radius: 12px;
  background: var(--green-soft);
  padding: 10px;
  color: var(--fg);
  font-size: 12px;
}

.slug-chat-consent input {
  margin-top: 3px;
}

.slug-chat-guide {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
}

.slug-chat-guide h3 {
  font-size: 13px;
  font-weight: 760;
}

.slug-chat-guide pre {
  overflow: auto;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
  padding: 9px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
}

.slug-chat-guide p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.slug-chat-summary {
  display: none;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 8px 10px;
  font-size: 12px;
}

.slug-chat-summary.is-visible {
  display: block;
}

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

.slug-chat-attach-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #e9e9eb;
  color: var(--fg);
  cursor: pointer;
}

.slug-chat-attach-button input {
  display: none;
}

.slug-chat-attach-button:focus-within,
.slug-chat-input-row textarea:focus,
.slug-chat-detail-grid input:focus,
.slug-chat-detail-grid select:focus {
  outline: 2px solid color-mix(in srgb, #0a84ff 58%, var(--border));
  outline-offset: 2px;
}

.slug-chat-input-row textarea {
  min-height: 38px;
  max-height: 112px;
  resize: none;
  overflow-y: hidden;
  border-radius: 19px;
  padding: 8px 12px;
  background: var(--surface);
}

.slug-chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  background: var(--sun);
  color: var(--sun-ink);
  padding: 0 13px;
  font-weight: 700;
}

.slug-chat-send.htmx-request,
.htmx-request .slug-chat-send {
  background: #f0bb31;
  color: var(--sun-ink);
}

.slug-chat-attachment-note {
  min-height: 14px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .slug-chat-stage {
    height: 100svh;
    min-height: 100svh;
  }

  .slug-chat-shell {
    width: 100%;
    height: 100svh;
    max-height: 100svh;
  }

  .slug-chat-head {
    min-height: 52px;
  }

  .slug-chat-status {
    max-width: 38%;
  }

  .slug-chat-progress-label {
    grid-template-columns: minmax(0, 1fr);
  }

  .slug-chat-progress-vendor {
    display: none;
  }

  .slug-chat-bubble {
    max-width: 88%;
  }

  .slug-chat-detail-grid {
    grid-template-columns: 1fr;
  }
}

@supports (height: 100dvh) {
  .slug-chat-stage,
  body.is-minimal-shell,
  .slug-chat-shell {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
  }
}

@media (min-width: 700px) {
  .slug-chat-stage {
    align-items: center;
    padding: 20px;
  }

  .slug-chat-shell {
    height: min(760px, calc(100svh - 40px));
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(34, 42, 53, 0.12);
  }
}

.quote-table {
  display: grid;
  gap: 8px;
}

.quote-card--comparison {
  display: grid;
  align-content: start;
  gap: 14px;
}

.quote-card--comparison p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

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

.quote-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.quote-row > * {
  overflow-wrap: anywhere;
}

.value-visual {
  display: grid;
  gap: 12px;
  align-content: center;
  min-height: 232px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.10), transparent 44%),
    var(--surface);
  padding: 16px;
}

.value-visual article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.value-visual p {
  color: var(--fg);
  font-size: 14px;
}

.two-col,
.three-col,
.four-col,
.bundle-grid,
.metrics-grid,
.stage-grid,
.upload-grid,
.responsive-grid {
  display: grid;
  gap: 14px;
}

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

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

.metrics-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

.feature {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 176px;
  border-top: 2px solid var(--sun-strong);
}

.feature.blue-line {
  border-top-color: var(--blue);
}

.badge {
  display: inline-flex;
  min-height: 26px;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.badge::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.good {
  border-color: #93b4f8;
  background: var(--blue-soft);
  color: var(--blue-ink);
}

.badge.sun {
  border-color: #e4b535;
  background: var(--sun-soft);
  color: var(--sun-ink);
}

.badge.warn {
  border-color: #efc27e;
  background: var(--warn-soft);
  color: #8a5707;
}

.badge.danger {
  border-color: #f2b8b8;
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.neutral {
  background: var(--surface-2);
}

.chat-demo {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 360px;
}

.chat-empty,
.empty-state {
  border: 1px dashed #d8d1bd;
  border-radius: var(--radius);
  background: var(--sun-soft);
  color: var(--sun-ink);
  padding: 16px;
}

.chat-empty {
  text-align: center;
}

.message {
  max-width: 82%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px 13px;
  overflow-wrap: anywhere;
}

.message.user {
  justify-self: end;
  border-color: #93b4f8;
  background: var(--blue-soft);
}

.message .meta {
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select,
input[type="text"],
input[type="datetime-local"],
input[type="email"],
input[type="file"],
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  padding: 10px 11px;
}

input[type="file"] {
  padding: 9px;
  color: var(--muted);
}

.field textarea,
.quote-input {
  min-height: 112px;
}

.calculator-section {
  scroll-margin-top: 92px;
}

.calculator-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.2vw, 22px);
}

.calculator-card-head {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.calculator-card-head h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
}

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

.calculator-note,
.calculator-disclaimer {
  color: var(--muted);
  font-size: 12px;
}

.calculator-note {
  max-width: 560px;
}

.calculator-error {
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 16px;
}

.calculator-error {
  border-color: #f2b8b8;
  background: var(--danger-soft);
  color: var(--danger);
}

.calculator-result {
  display: grid;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.2vw, 22px);
}

.calculator-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.calculator-summary h3 {
  margin: 3px 0 0;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.12;
}

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

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

.calculator-metrics article {
  display: grid;
  gap: 4px;
  min-height: 92px;
  border-left: 1px solid var(--line);
  padding: 13px;
}

.calculator-metrics article:first-child {
  border-left: 0;
}

.calculator-metrics span,
.calculator-table th span,
.calculator-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.calculator-metrics span,
.calculator-table th span {
  font-family: var(--font-mono);
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calculator-metrics strong {
  font-size: 24px;
  line-height: 1;
}

.calculator-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calculator-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

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

.calculator-table th:first-child,
.calculator-table td:first-child {
  text-align: left;
}

.calculator-table thead th {
  background: var(--surface-2);
}

.calculator-table thead th strong {
  display: block;
  font-size: 17px;
  text-transform: uppercase;
}

.calculator-table tbody th {
  color: var(--muted);
  font-size: 13px;
}

.calculator-table tr:last-child th,
.calculator-table tr:last-child td {
  border-bottom: 0;
}

.calculator-band th {
  background: var(--green-soft);
  color: #047857;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.calculator-band.muted th {
  background: var(--surface-2);
  color: var(--muted);
}

.money {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.money.good {
  color: #047857;
}

.money.warn {
  color: #ea580c;
}

.money span {
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.good-indicator {
  font-weight: 800;
}

.good-indicator {
  color: #047857;
}

.metric-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 96px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.metric-value {
  color: var(--fg);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.metric-note {
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table td {
  overflow-wrap: anywhere;
}

.mono,
.kv .value,
.activity-time {
  font-family: var(--font-mono);
  font-size: 12px;
}

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

.kv-row {
  display: grid;
  grid-template-columns: minmax(132px, 0.52fr) minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.kv-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.kv .key {
  color: var(--muted);
  font-size: 13px;
}

.kv .value {
  color: var(--fg);
  overflow-wrap: anywhere;
}

.warning-banner {
  display: flex;
  align-items: start;
  gap: 10px;
  border: 1px solid #efc27e;
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: #7c4a03;
  padding: 13px 14px;
}

.warning-banner strong {
  color: #5f3b07;
}

.stage-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.stage-card strong {
  display: block;
}

.price-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

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

.price-value {
  display: block;
  margin-top: 2px;
  color: var(--fg);
  font-size: 18px;
  font-weight: 800;
}

.offer-card,
.record-row,
.lead-card {
  display: grid;
  gap: 14px;
}

.offer-card {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.58fr);
}

.commerce-actions,
.record-row {
  align-items: start;
}

.record-row {
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
}

.stage-lane {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.stage-lane:first-child {
  border-top: 0;
  padding-top: 0;
}

.stage-lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.quote-form .field-wide,
.quote-form button {
  grid-column: 1 / -1;
}

.message-line {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.provider-placeholder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.provider-application-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.provider-application-form .field-wide,
.provider-application-form button {
  grid-column: 1 / -1;
}

.provider-hero {
  max-width: 960px;
}

.provider-workflow,
.supporting-doc-list {
  gap: 8px;
}

.supporting-doc-list {
  display: flex;
  flex-wrap: wrap;
  margin-top: 8px;
}

.flash {
  margin-bottom: 1rem;
  border: 1px solid #7fd1ad;
  border-radius: var(--radius);
  background: var(--green-soft);
  color: #065f46;
  padding: 0.75rem 1rem;
}

/* Utility aliases retained for existing templates. */
.min-h-screen {
  min-height: 100vh;
}

.bg-slate-100 {
  background: var(--bg);
}

.bg-slate-50 {
  background: var(--surface-2);
}

.bg-slate-900 {
  background: var(--fg);
}

.bg-white {
  background: var(--surface);
}

.bg-emerald-600 {
  background: var(--green);
}

.bg-blue-600 {
  background: var(--blue);
}

a.bg-emerald-600,
button.bg-emerald-600 {
  background: var(--sun);
  color: var(--sun-ink);
}

.bg-emerald-50 {
  background: var(--green-soft);
}

.bg-amber-50 {
  background: var(--warn-soft);
}

.bg-red-50 {
  background: var(--danger-soft);
}

.bg-red-600 {
  background: var(--danger);
}

.text-slate-900 {
  color: var(--fg);
}

.text-slate-700 {
  color: #4b5563;
}

.text-slate-600,
.text-slate-500 {
  color: var(--muted);
}

.text-emerald-600,
.text-emerald-700 {
  color: var(--blue-ink);
}

.text-amber-700,
.text-amber-800 {
  color: #7c4a03;
}

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

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

.text-white {
  color: #ffffff;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.block {
  display: block;
}

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.grid {
  display: grid;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

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

.justify-between {
  justify-content: space-between;
}

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

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

.self-end {
  align-self: end;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

.max-w-4xl {
  max-width: 64rem;
}

.w-full {
  width: 100%;
}

.min-w-full {
  min-width: 100%;
}

.min-h-24 {
  min-height: 6rem;
}

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

.cursor-pointer {
  cursor: pointer;
}

.list-none {
  list-style: none;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.p-5 {
  padding: 1.25rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.px-8 {
  padding-left: 2rem;
  padding-right: 2rem;
}

.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.py-5 {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.py-10 {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.pb-3 {
  padding-bottom: 0.75rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.rounded-lg,
.rounded-xl,
.rounded-2xl,
.rounded-3xl {
  border-radius: var(--radius);
}

.rounded-full {
  border-radius: 999px;
}

.border {
  border: 1px solid var(--border);
}

.border-b {
  border-bottom: 1px solid var(--line);
}

.border-dashed {
  border-style: dashed;
}

.border-slate-100,
.border-slate-200,
.border-slate-300 {
  border-color: var(--border);
}

.border-amber-200 {
  border-color: #efc27e;
}

.border-emerald-200 {
  border-color: #7fd1ad;
}

.border-red-200 {
  border-color: #f2b8b8;
}

.shadow-sm {
  box-shadow: var(--shadow);
}

.divide-y > * + * {
  border-top: 1px solid var(--line);
}

.divide-slate-200 > * + * {
  border-color: var(--line);
}

.space-y-1 > * + * {
  margin-top: 0.25rem;
}

.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-5 > * + * {
  margin-top: 1.25rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

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

.text-right {
  text-align: right;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1.45;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.5;
}

.text-base {
  font-size: 1rem;
  line-height: 1.6;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.4;
}

.text-xl {
  font-size: 1.35rem;
  line-height: 1.25;
}

.text-2xl {
  font-size: 1.6rem;
  line-height: 1.2;
}

.text-3xl {
  font-size: 2rem;
  line-height: 1.2;
}

.font-medium {
  font-weight: 560;
}

.font-normal {
  font-weight: 400;
}

.font-semibold {
  font-weight: 700;
}

.uppercase {
  text-transform: uppercase;
}

.tracking-wide {
  letter-spacing: 0.08em;
}

.leading-relaxed {
  line-height: 1.7;
}

.whitespace-pre-line {
  white-space: pre-line;
}

.whitespace-pre-wrap {
  white-space: pre-wrap;
}

.break-all {
  word-break: break-all;
}

.break-words {
  overflow-wrap: anywhere;
}

.last\:border-b-0:last-child {
  border-bottom: 0;
}

.last\:pb-0:last-child {
  padding-bottom: 0;
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:col-span-2 {
    grid-column: span 2 / span 2;
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .xl\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.chat-fragment {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  margin: 0;
  overflow-wrap: anywhere;
}

.chat-message--user,
.chat-message--assistant {
  max-width: min(100%, 36rem);
}

.inline-flash {
  border: 1px solid var(--blue-300);
  background: #eef5ff;
  color: #163a75;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
}

.vendor-profile-pending,
.vendor-profile-change-list,
.vendor-profile-change-card {
  display: grid;
  gap: 8px;
}

.vendor-profile-pending,
.vendor-profile-change-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
}

.vendor-profile-change-list {
  margin-top: 10px;
}

.vendor-profile-change-preview {
  width: 72px;
  height: 72px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

.workbench-body {
  background: #f7f8f5;
  color: var(--ink);
}

.vendor-workbench-app {
  display: grid;
  gap: 18px;
  max-width: 1680px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.workbench-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  padding: 12px 14px;
  backdrop-filter: blur(10px);
}

.workbench-header h1 {
  margin: 2px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.workbench-header-actions,
.workbench-metrics,
.compact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--sun);
  border-radius: 999px;
  background: #fff6d7;
  padding: 0 14px;
  color: #4b3514;
  font-weight: 800;
}

.workbench-tabs {
  position: sticky;
  top: 78px;
  z-index: 19;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px;
  backdrop-filter: blur(10px);
}

.workbench-tabs a {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.workbench-tabs a:hover,
.workbench-tabs a:focus {
  border-color: var(--sun);
  background: #fff6d7;
  color: var(--ink);
}

.workbench-alert {
  display: flex;
  gap: 8px;
  border: 1px solid #f2c46d;
  border-radius: 8px;
  background: #fff8e5;
  padding: 10px 12px;
  color: #5f4219;
}

.workbench-alert.compact {
  display: grid;
}

.workbench-section {
  display: grid;
  gap: 12px;
  scroll-margin-top: 150px;
}

.workbench-section-head,
.workbench-lane-head,
.workbench-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workbench-section-head h2,
.workbench-lane-head h3,
.workbench-card h3,
.quote-workbench-card h3,
.wallet-summary h3 {
  margin: 0;
}

.workbench-metrics span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  max-width: min(48vw, 420px);
  overflow: hidden;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.workbench-lane {
  display: grid;
  gap: 10px;
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbf8;
  padding: 10px;
}

.workbench-cards {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 265px);
  overflow: auto;
  padding-right: 2px;
}

.workbench-card,
.quote-workbench-card,
.wallet-summary {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 28px rgba(19, 25, 38, 0.04);
}

.lead-fact-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  font-size: 13px;
}

.lead-fact-grid span,
.mini-note {
  color: var(--muted);
  font-size: 12px;
}

.lead-fact-grid strong {
  overflow-wrap: anywhere;
}

.btn.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.lead-details {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.lead-details summary {
  cursor: pointer;
  color: #234fa7;
  font-weight: 800;
}

.lead-details p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.compact-table td,
.compact-table th {
  padding: 10px 12px;
}

.quote-workbench-grid,
.billing-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.vendor-profile-form,
.vendor-feedback-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 28px rgba(19, 25, 38, 0.04);
}

.vendor-feedback-form textarea {
  min-height: 120px;
}

.form-actions,
.profile-return-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-return-panel {
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 10px 28px rgba(19, 25, 38, 0.04);
}

.profile-return-panel h2 {
  margin: 0;
}

.compact-quote-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compact-quote-form textarea,
.compact-quote-form button {
  grid-column: 1 / -1;
}

.wallet-summary strong {
  font-size: clamp(42px, 8vw, 72px);
  line-height: 1;
}

.compact-bundles {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.payment-bundle-button .btn {
  display: grid;
  justify-items: start;
  width: 100%;
  min-height: 76px;
  text-align: left;
}

.payment-bundle-button small {
  color: #234fa7;
}

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

.record-row.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.empty-state.compact {
  min-height: 0;
  padding: 12px;
}

.last\:border-b-0:last-child {
  border-bottom: 0;
}

.last\:pb-0:last-child {
  padding-bottom: 0;
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .md\:grid-cols-\[1fr_auto\] {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .md\:grid-cols-\[1fr_auto_auto\] {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .md\:grid-cols-\[1fr_auto_auto_auto\] {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }

  .md\:col-span-2 {
    grid-column: span 2 / span 2;
  }

  .md\:items-center {
    align-items: center;
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .xl\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .xl\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .app-shell {
    padding: 20px 16px 50px;
  }

  .section {
    gap: 18px;
    margin-top: 38px;
  }

  .preview-board {
    justify-self: stretch;
    width: 100%;
  }

  .four-col,
  .calculator-form-grid,
  .metrics-grid,
  .metrics-grid--three,
  .stage-grid,
  .three-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .calculator-metrics article:nth-child(odd) {
    border-left: 0;
  }

  .calculator-metrics article:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .offer-card,
  .record-row,
  .record-row.compact,
  .workbench-header,
  .workbench-section-head {
    grid-template-columns: 1fr;
    align-items: stretch;
    flex-direction: column;
  }

  .workbench-board {
    grid-template-columns: repeat(4, minmax(240px, 80vw));
  }

  .workbench-cards {
    max-height: none;
  }

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

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .admin-v2-topbar-inner {
    min-height: auto;
    align-items: stretch;
    flex-direction: column;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .admin-v2-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .admin-v2-page {
    padding-top: 14px;
  }

  .admin-v2-page .page-title {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .admin-v2-page .page-title .actions,
  .admin-v2-page .page-title .eyebrow,
  .admin-v2-page .page-title h1,
  .admin-v2-page .page-title p {
    grid-column: 1;
    grid-row: auto;
  }

  .admin-v2-page .page-title .actions {
    justify-content: flex-start;
  }

  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 12px;
  }

  .desktop-nav {
    display: none;
  }

  .nav-menu {
    display: block;
  }

  .brand-subtitle {
    display: none;
  }

  .hero-copy h1 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .hero {
    gap: 18px;
    padding-top: 18px;
  }

  .section {
    gap: 16px;
    margin-top: 34px;
  }

  .preview-board,
  .calculator-form-grid,
  .calculator-metrics,
  .four-col,
  .three-col,
  .two-col,
  .bundle-grid,
  .metrics-grid,
  .metrics-grid--three,
  .stage-grid,
  .upload-grid,
  .provider-placeholder,
  .provider-application-form,
  .quote-form,
  .price-strip {
    grid-template-columns: 1fr;
  }

  .calculator-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .calculator-result-actions {
    justify-content: stretch;
  }

  .calculator-result-actions .btn {
    width: 100%;
  }

  .calculator-metrics article,
  .calculator-metrics article:nth-child(n + 3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .calculator-metrics article:first-child {
    border-top: 0;
  }

  .section-head,
  .form-actions,
  .stage-lane-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-card,
  .quote-card,
  .metric-card,
  .stage-card,
  .offer-card,
  .record-row,
  .lead-card {
    padding: 12px;
  }

  .feature {
    min-height: 0;
    gap: 6px;
  }

  .feature h3 {
    font-size: 15px;
  }

  .feature p {
    font-size: 13px;
    line-height: 1.45;
  }

  .value-visual {
    min-height: 0;
    padding: 12px;
  }

  .value-visual article {
    padding: 10px;
  }

  .message {
    max-width: 100%;
  }

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

  .table {
    min-width: 640px;
  }

  .vendor-workbench-app {
    padding: 10px;
  }

  .workbench-tabs {
    top: 70px;
  }

  .workbench-alert,
  .workbench-header-actions,
  .workbench-metrics,
  .compact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-quote-form,
  .compact-bundles {
    grid-template-columns: 1fr;
  }
}

.vendor-v2-shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
}

.vendor-v2 {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 16px 20px 56px;
}

.vendor-v2-topbar,
.vendor-v2-panel,
.vendor-v2-card,
.vendor-v2-stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.vendor-v2-topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  box-shadow: 0 14px 34px rgba(32, 40, 50, 0.06);
}

.vendor-v2-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.vendor-v2-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.vendor-v2-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.vendor-v2-nav a,
.vendor-v2-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 11px;
  color: var(--fg);
  font-weight: 750;
}

.vendor-v2-nav a.is-active,
.vendor-v2-btn.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.vendor-v2-btn.danger {
  border-color: #dc2626;
  color: #dc2626;
}

.vendor-v2-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 28px 0 16px;
}

.vendor-v2-hero h1 {
  margin-top: 3px;
  font-size: 30px;
  letter-spacing: 0;
}

.vendor-v2-muted {
  color: var(--muted);
}

.vendor-v2-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.vendor-v2-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.vendor-v2-stat {
  width: 100%;
  padding: 13px;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.vendor-v2-stat {
  cursor: pointer;
}

button.vendor-v2-stat:hover,
button.vendor-v2-stat:focus-visible {
  border-color: #93c5fd;
  outline: 0;
  box-shadow: 0 0 0 3px #dbeafe;
}

.vendor-v2-stat.blue {
  border-color: #bfdbfe;
  background: #eaf1ff;
}

.vendor-v2-stat.green {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.vendor-v2-stat.yellow {
  border-color: #fde68a;
  background: #fff7d1;
}

.vendor-v2-stat.viewed {
  background: #f1f3f2;
}

.vendor-v2-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 26px;
  line-height: 1;
}

.vendor-v2-board {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.vendor-v2-panel {
  padding: 14px;
}

.vendor-v2-controls {
  display: grid;
  gap: 10px;
}

.vendor-v2-controls .field {
  display: grid;
  gap: 5px;
}

.vendor-v2-controls .field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.vendor-v2-controls input,
.vendor-v2-controls select,
.vendor-v2-controls textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
}

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

.vendor-v2-card {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.vendor-v2-card.viewed {
  background: #f1f3f2;
}

.vendor-v2-card.is-viewed {
  border-color: #d1d5db;
  background: #f3f4f6;
}

.vendor-v2-card.quoted,
.vendor-v2-card.blue {
  border-color: #bfdbfe;
  background: #eaf1ff;
}

.vendor-v2-card.closed,
.vendor-v2-card.confirmed,
.vendor-v2-card.green {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.vendor-v2-card.awaiting,
.vendor-v2-card.yellow {
  border-color: #fde68a;
  background: #fff7d1;
}

.vendor-v2-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.vendor-v2-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  background: #f2f4f1;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.vendor-v2-pill.blue {
  background: #dbeafe;
  color: #1e40af;
}

.vendor-v2-pill.green {
  background: #dcfce7;
  color: #166534;
}

.vendor-v2-pill.yellow {
  background: #fef3c7;
  color: #92400e;
}

.vendor-v2-card-actions,
.vendor-v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vendor-v2-section {
  margin-top: 12px;
}

.vendor-v2-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.vendor-v2-funnel {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.vendor-v2-disclosure {
  border: 0;
}

.vendor-v2-disclosure > summary {
  display: grid;
  cursor: pointer;
  gap: 2px;
  list-style: none;
}

.vendor-v2-disclosure > summary::-webkit-details-marker {
  display: none;
}

.vendor-v2-disclosure > summary::after {
  content: "Hide";
  justify-self: start;
  margin-top: 5px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 760;
}

.vendor-v2-disclosure:not([open]) > summary::after {
  content: "Show";
}

.vendor-v2-disclosure > summary strong {
  font-size: 21px;
}

.vendor-v2-copy-row,
.vendor-v2-link-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.vendor-v2-copy-row code,
.vendor-v2-link-row code {
  display: block;
  min-width: 0;
  overflow: hidden;
  border-radius: 7px;
  background: #f3f4f6;
  padding: 7px 8px;
  color: #111827;
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vendor-v2-link-list {
  display: grid;
  gap: 10px;
}

.vendor-v2-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.vendor-v2-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f3f4f6;
  padding: 4px;
}

.vendor-v2-segmented label {
  cursor: pointer;
}

.vendor-v2-segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vendor-v2-segmented span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.vendor-v2-segmented .is-active span,
.vendor-v2-segmented input:checked + span {
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.08);
}

.vendor-v2-feed {
  display: grid;
  gap: 10px;
}

.vendor-v2-lead-card {
  min-height: 184px;
}

.vendor-v2-lead-card[role="link"] {
  cursor: pointer;
}

.vendor-v2-lead-card[role="link"]:hover,
.vendor-v2-lead-card[role="link"]:focus-visible {
  border-color: #93c5fd;
  outline: 0;
  box-shadow: 0 0 0 3px #dbeafe;
}

.vendor-v2-lead-card.is-selecting {
  opacity: 0.72;
}

.vendor-v2-card-select-form {
  display: none;
}

.vendor-v2-qa textarea {
  min-height: 112px;
}

.vendor-v2-qa-answer {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  white-space: pre-wrap;
}

.vendor-v2-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.vendor-v2-filter-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 780;
}

.vendor-v2-filter-chip:hover,
.vendor-v2-filter-chip:focus-visible {
  border-color: #2563eb;
  outline: 0;
}

.vendor-v2-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vendor-v2-tag-row span {
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 760;
}

.vendor-v2-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.vendor-v2-table-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.4fr 1.2fr auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 10px 12px;
}

.vendor-v2-table-row:first-child {
  border-top: 0;
}

.vendor-v2-table-row.is-head {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.vendor-v2-table-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.vendor-v2-detail-list,
.vendor-v2-fact-grid {
  display: grid;
  gap: 8px;
}

.vendor-v2-detail-list div,
.vendor-v2-fact-grid div,
.vendor-v2-note,
.vendor-v2-thread-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfbfc;
  padding: 10px;
}

.vendor-v2-detail-list dt,
.vendor-v2-fact-grid dt,
.vendor-v2-thread-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.vendor-v2-detail-list dd,
.vendor-v2-fact-grid dd {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.vendor-v2-workflow-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vendor-v2-thread {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
}

.vendor-v2-thread-row.is-user {
  background: #fff7d1;
}

.vendor-v2-thread-row p {
  margin-top: 4px;
  white-space: pre-wrap;
}

.vendor-v2-thread-row small,
.vendor-v2-note span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}

.vendor-v2-dialog {
  width: min(420px, calc(100vw - 28px));
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 22px 80px rgba(17, 24, 39, 0.28);
}

.vendor-v2-dialog::backdrop {
  background: rgba(17, 24, 39, 0.42);
}

.vendor-v2-dialog h2 {
  font-size: 20px;
}

.vendor-v2-dialog p {
  margin: 8px 0 14px;
  color: var(--muted);
}

.vendor-v2-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.vendor-v2-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.vendor-v2-list-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.vendor-v2-empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .vendor-v2-hero,
  .vendor-v2-board,
  .vendor-v2-stats,
  .vendor-v2-two-col,
  .vendor-v2-funnel {
    grid-template-columns: 1fr;
  }

  .vendor-v2-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .vendor-v2-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .vendor-v2 {
    padding: 10px;
  }

  .vendor-v2-card-grid {
    grid-template-columns: 1fr;
  }

  .vendor-v2-link-row,
  .vendor-v2-table-row {
    grid-template-columns: 1fr;
  }

  .vendor-v2-table-row.is-head {
    display: none;
  }

  .vendor-v2-copy-row,
  .vendor-v2-link-title {
    align-items: stretch;
    flex-direction: column;
  }
}

@media print {
  .vendor-v2-topbar,
  .vendor-v2-actions,
  .vendor-v2-btn {
    display: none !important;
  }

  .vendor-v2-shell {
    background: white;
    color: black;
  }

  .vendor-v2 {
    width: 100%;
    padding: 0;
  }

  .vendor-v2-panel,
  .vendor-v2-card,
  .vendor-v2-stat {
    break-inside: avoid;
    box-shadow: none;
  }
}
