:root {
  --bg: #f3eee6;
  --surface: #fdfbf8;
  --surface-soft: #f8f3ec;
  --surface-muted: #f1e9de;
  --text: #251d15;
  --muted: #6a5f54;
  --brand: #6b5038;
  --brand-dark: #4e3a29;
  --line: #dccfbe;
  --high: #b94a3f;
  --medium: #a97a1d;
  --low: #5f7540;
}

.cv-progress-wrap {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.35rem;
}

.cv-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cv-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.cv-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6b5038 0%, #3f2f22 100%);
  transition: width 240ms ease;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 15% -20%, #e4d4bf 0%, transparent 60%),
    linear-gradient(180deg, #fbf8f3 0%, var(--bg) 100%);
}

body.industry-page {
  background:
    radial-gradient(1100px 460px at 15% -20%, var(--industry-glow, #e4dacc) 0%, transparent 60%),
    linear-gradient(180deg, var(--industry-top, #faf7f2) 0%, var(--industry-bg, #f1eadf) 100%);
}

body.industry-page .nav {
  background: var(--industry-nav, #f8f3ebcc);
}

body.industry-page .alt {
  background: var(--industry-alt, #efe5d8);
}

body.industry-page .card {
  background: var(--industry-card, #ffffff);
}

body.industry-page .btn {
  background: var(--industry-btn, #6b5038);
}

body.industry-page .btn:hover {
  background: var(--industry-btn-hover, #4e3a29);
}

body.industry-page .btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

body.industry-construction {
  --industry-bg: #f1f0ec;
  --industry-top: #f8f7f4;
  --industry-glow: #e6e2d7;
  --industry-nav: #f6f4efcc;
  --industry-alt: #ece9e1;
  --industry-card: #ffffff;
  --industry-btn: #6f563b;
  --industry-btn-hover: #523f2b;
}

h1, h2, h3 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0 0 0.6rem;
}

p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

code {
  background: var(--surface-muted);
  padding: 0.08rem 0.35rem;
  border-radius: 0.3rem;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.nav {
  position: static;
  backdrop-filter: blur(8px);
  background: #fbf7f1cc;
  border-bottom: 1px solid var(--line);
  z-index: 50;
  box-shadow: 0 6px 18px rgba(37, 29, 21, 0.08);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
  min-height: 92px;
}

.nav-main-actions {
  align-items: center;
  justify-content: flex-end;
}

.nav-menu {
  position: relative;
}

.nav-menu > summary {
  list-style: none;
  cursor: pointer;
}

.nav-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 230px;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(16, 35, 28, 0.12);
  padding: 0.5rem;
  display: grid;
  gap: 0.4rem;
  z-index: 40;
}

.nav-menu:not([open]) .nav-menu-panel {
  display: none;
}

.nav-menu-panel .btn {
  width: 100%;
  text-align: left;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}

.logo-img {
  height: 78px;
  width: auto;
  max-width: min(420px, 70vw);
  display: block;
  border-radius: 0;
  object-fit: contain;
}

.logo-title {
  display: none;
}

.hero {
  padding: 5.5rem 0 3.5rem;
}

.trust-strip {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: #5b4330;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
}

.eyebrow {
  color: var(--brand-dark);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.08;
}

.sub {
  margin-top: 1rem;
  max-width: 64ch;
}

.actions, .inline-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.quickstart-card {
  background: linear-gradient(180deg, #fffdf9 0%, #f8f1e6 100%);
}

.simple-steps {
  margin: 0.25rem 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.simple-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.35;
}

.quick-step-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid #d9c8b2;
  background: #fff;
  color: #6f4c2a;
  font-size: 0.76rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.connector-subpanel h4 {
  margin: 0 0 0.35rem;
}

.connector-subpanel .form {
  margin-top: 0.45rem;
}

.connector-subpanel details > summary {
  cursor: pointer;
}

.dead-letter-action-result {
  min-height: 1.2rem;
  margin-top: 0.2rem;
}

.dead-letter-action-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dead-letter-action-result.is-success {
  color: #0a7756;
}

.dead-letter-action-result.is-error {
  color: #b42318;
}

.btn-inline-loader {
  display: inline-block;
  width: 0.78rem;
  height: 0.78rem;
  margin-right: 0.35rem;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  vertical-align: -0.1rem;
  animation: vm-spin 0.8s linear infinite;
}

@keyframes vm-spin {
  to {
    transform: rotate(360deg);
  }
}

.nav .inline-actions {
  margin-top: 0;
}

.run-upload-btn {
  font-weight: 700;
}

.last-run-sticky {
  position: sticky;
  top: 84px;
  z-index: 2;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fefcf9 0%, #f5ede2 100%);
}

.last-run-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.run-center-headline {
  margin-top: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.run-center-autorefresh {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  font-size: 0.78rem;
  color: #5f4632;
  user-select: none;
}

.run-center-autorefresh input {
  accent-color: #9f6a35;
}

.run-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid #d7e1e8;
  background: #f4f7f9;
  color: #2f4958;
}

.run-status-chip.is-neutral {
  background: #f4f7f9;
  color: #2f4958;
  border-color: #d7e1e8;
}

.run-status-chip.is-success {
  background: #eaf8f1;
  color: #0a7756;
  border-color: #b8e4cb;
}

.run-status-chip.is-warning {
  background: #fff4dd;
  color: #8b5a12;
  border-color: #f0d7a5;
}

.run-status-chip.is-danger {
  background: #fdecec;
  color: #b42318;
  border-color: #f3c4c0;
}

.last-run-cell {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.55rem 0.65rem;
  background: #ffffff;
}

.last-run-cell strong {
  display: block;
  font-size: 1.05rem;
  color: var(--text);
}

.run-center-timeline {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.run-center-item {
  border: 1px solid #decdb7;
  background: #fff;
  color: #573d2a;
  border-radius: 0.6rem;
  padding: 0.35rem 0.5rem;
  display: inline-grid;
  gap: 0.08rem;
  cursor: pointer;
  min-width: 126px;
  text-align: left;
}

.run-center-item strong {
  font-size: 0.8rem;
  line-height: 1.1;
}

.run-center-item span {
  font-size: 0.72rem;
  color: #6d5441;
}

.run-center-item.is-active {
  border-color: #9f6a35;
  box-shadow: 0 0 0 2px rgba(159, 106, 53, 0.16) inset;
}

.run-center-item:hover,
.run-center-item:focus-visible {
  border-color: #9f6a35;
  box-shadow: 0 0 0 2px rgba(159, 106, 53, 0.12);
  outline: none;
}

.btn {
  display: inline-block;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  padding: 0.78rem 1rem;
  border-radius: 0.8rem;
  font-weight: 600;
}

.btn:hover {
  background: var(--brand-dark);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-sm {
  padding: 0.55rem 0.8rem;
}

.nav-home-pill {
  border-color: #c8b6a1;
  background: #f3e9dc;
  color: #5b4330;
}

.nav-home-pill:hover {
  background: #ebddcb;
}

.section {
  padding: 3.4rem 0;
}

.alt {
  background: var(--surface-muted);
  border-block: 1px solid var(--line);
}

.grid-2 {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.grid-3 {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.connector-card {
  border-width: 2px;
}

.connector-card-starter {
  border-color: #d4c6b4;
  background: #faf5ee;
}

.connector-card-pro {
  border-color: #d0dcf2;
  background: #f7f9ff;
}

.model-grid {
  align-items: start;
}

.history-stack {
  margin-top: 1rem;
  display: block;
}

.history-stack > .card + .card {
  margin-top: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.15rem;
  box-shadow: 0 10px 26px rgba(49, 37, 26, 0.05);
}

.checklist {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.form {
  display: grid;
  gap: 0.8rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
}

.checkbox-row {
  grid-template-columns: 1rem 1fr;
  align-items: start;
  gap: 0.5rem;
  font-weight: 400;
}

.checkbox-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  padding: 0;
  margin-top: 0.15rem;
}

.status-picker-fieldset {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.6rem 0.7rem;
  margin: 0;
}

.status-picker-fieldset legend {
  padding: 0 0.2rem;
  color: var(--muted);
}

.status-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.status-chip-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 0.25rem 0.55rem;
  font-size: 0.88rem;
  color: #5b4330;
}

.status-chip-option input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
}

.consent-box {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
}

.consent-row {
  margin: 0;
}

.consent-row span {
  line-height: 1.45;
  font-size: 0.92rem;
}

.auth-helper-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: -0.2rem;
  min-height: 1.4rem;
}

.link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--brand-dark);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
}

.link-btn:hover {
  color: var(--brand-dark);
}

[hidden] {
  display: none !important;
}

input, select, textarea {
  padding: 0.72rem;
  border-radius: 0.7rem;
  border: 1px solid #cdbca8;
  background: #fffdfb;
  font: inherit;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.msg {
  min-height: 1.35rem;
  font-size: 0.95rem;
  color: var(--brand-dark);
  transition: color 0.15s ease;
}

.msg.msg-state-loading {
  color: #8a5a22;
}

.msg.msg-state-success {
  color: #0a7756;
}

.msg.msg-state-error {
  color: #b42318;
}

.msg.msg-state-empty {
  color: #6b7280;
}

.msg.msg-state-loading::before {
  content: "⏳ ";
}

.msg.msg-state-success::before {
  content: "✓ ";
}

.msg.msg-state-error::before {
  content: "⚠ ";
}

.msg.msg-state-empty::before {
  content: "ℹ ";
}

.strong {
  font-weight: 600;
}

.lead {
  margin-bottom: 0.9rem;
  font-size: 1.03rem;
  max-width: 70ch;
}

#auth .container,
#dashboard .container {
  max-width: 980px;
}

#dashboard {
  border-top: 1px solid var(--line);
}

body:not(.workspace-open) #dashboard {
  display: none !important;
}

.small {
  font-size: 0.95rem;
}

.connector-alert-banner {
  margin-top: 0.55rem;
  border: 1px solid #f3d3d3;
  background: #fff5f5;
  color: #8f1f1f;
  border-radius: 0.65rem;
  padding: 0.55rem 0.7rem;
  line-height: 1.4;
}

.usage-panel {
  margin-bottom: 1rem;
}

#usageContent,
#billingStatusContent {
  min-height: 5.5rem;
}

.dashboard-layout {
  display: block;
}

.dashboard-content {
  min-width: 0;
}

.dashboard-sidebar {
  display: none;
}

.sidebar-links {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

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

.view-hidden {
  display: none !important;
}

body.workspace-slim .workspace-optional {
  display: none !important;
}

.compact-toggle > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  outline: none;
}

.compact-toggle > summary::-webkit-details-marker {
  display: none;
}

.compact-toggle > summary::before {
  content: "▸";
  margin-right: 0.45rem;
  color: var(--brand-dark);
}

.compact-toggle[open] > summary::before {
  content: "▾";
}

.compact-toggle > *:not(summary) {
  margin-top: 0.85rem;
}

.quick-jump-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.focus-toggle {
  margin-top: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.insight-card {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface-soft);
  padding: 0.65rem 0.7rem;
  display: grid;
  gap: 0.3rem;
}

.insight-card strong {
  font-size: 1.1rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: end;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  height: 100%;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: #5b4330;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.33rem 0.66rem;
  cursor: pointer;
}

.toggle-chip input {
  margin: 0;
}

.toggle-chip input:checked + span {
  color: var(--brand-dark);
}

.delta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.7rem;
}

.delta-item {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.55rem 0.65rem;
  background: var(--surface-soft);
  display: grid;
  gap: 0.2rem;
}

.delta-item strong {
  font-size: 1.05rem;
}

.delta-up {
  color: #b53a2f;
}

.delta-down {
  color: #5f7540;
}

.delta-flat {
  color: var(--muted);
}

.bulk-actions-row {
  margin-top: 0.85rem;
  margin-bottom: 0.35rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: end;
}

.bulk-actions-row label {
  min-width: 160px;
}

.btn.is-loading {
  opacity: 0.75;
  cursor: wait;
}

.onboarding-list li {
  transition: color 0.2s ease;
}

.onboarding-list li.is-done {
  color: var(--brand-dark);
  font-weight: 600;
}

.onboarding-list li.is-done::marker {
  content: "✔ ";
}

.upload-helper {
  margin-top: 0.8rem;
  background: var(--surface-soft);
  border-style: dashed;
  display: grid;
  gap: 0.55rem;
}

.precheck-msg {
  min-height: 1.35rem;
  border-radius: 0.65rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #dbcdbb;
  background: #f5eee4;
}

.precheck-msg.tone-success {
  color: #4f6a31;
  border-color: #cdd6b8;
  background: #f1f5e8;
}

.precheck-msg.tone-warn {
  color: #7a5b07;
  border-color: #ecdca6;
  background: #fffaea;
}

.precheck-msg.tone-error {
  color: #9a2e2e;
  border-color: #efc9c9;
  background: #fff3f3;
}

.priority-chip,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.13rem 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  margin-left: 0.35rem;
  letter-spacing: 0.01em;
}

.manual-review-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.13rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: #fff1dd;
  color: #7c4c0f;
  border: 1px solid #eed2ab;
}

.manual-review-pill.compact {
  font-size: 0.72rem;
  padding: 0.11rem 0.5rem;
}

.manual-review-inline {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.3rem;
}

.manual-review-reason {
  font-size: 0.75rem;
  line-height: 1.3;
  color: #6a4a2f;
  white-space: normal;
  word-break: break-word;
}

.priority-chip.high {
  background: #fde9e7;
  color: #9b2f24;
}

.priority-chip.medium {
  background: #fff6df;
  color: #8a5d04;
}

.priority-chip.low {
  background: #eef3e4;
  color: #4f6a31;
}

.status-badge.open {
  background: #eef2f4;
  color: #3d4f58;
}

.status-badge.in_progress {
  background: #eaf1ff;
  color: #2d4d95;
}

.status-badge.contacted {
  background: #eef7ff;
  color: #1f628a;
}

.status-badge.closed {
  background: #f0edf8;
  color: #5f4a8a;
}

.status-badge.saved {
  background: #eef3e4;
  color: #4f6a31;
}

.status-badge.lost {
  background: #fdecec;
  color: #9a2e2e;
}

.connector-health {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.connector-health-healthy {
  background: #eef3e4;
  color: #4f6a31;
}

.connector-health-warning {
  background: #fff7e8;
  color: #8a5a11;
}

.connector-health-error {
  background: #fdecec;
  color: #9a2e2e;
}

td .status-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.member-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 28px rgba(44, 33, 24, 0.2);
  transform: translateX(105%);
  transition: transform 0.2s ease;
  z-index: 10010;
  padding: 1rem;
  overflow-y: auto;
  display: grid;
  gap: 0.55rem;
}

.member-drawer.is-open {
  transform: translateX(0);
}

.member-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 28, 22, 0.35);
  z-index: 10000;
}

.wizard-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 28, 22, 0.35);
  z-index: 10020;
}

.wizard-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(560px, 94vw);
  transform: translate(-50%, -46%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 10030;
  background: #ffffff;
  border: 1px solid #d4e3db;
  border-radius: 0.9rem;
  box-shadow: 0 18px 48px rgba(16, 35, 28, 0.22);
  padding: 1rem;
  display: grid;
  gap: 0.55rem;
}

.wizard-modal.is-open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

body.vm-focus #usagePanel,
body.vm-focus #billingStatusPanel,
body.vm-focus #weeklyEmailCard,
body.vm-focus #proFeatureGate,
body.vm-focus #dashboardViewLinksCard,
body.vm-focus #starterDedicatedPagesCard,
body.vm-focus #dataSourcesPanel,
body.vm-focus #smartUploadCard,
body.vm-focus #uploadLockedCard,
body.vm-focus #onboardingCard,
body.vm-focus #uploadDeltaCard,
body.vm-focus #latestPanel,
body.vm-focus #staffOptimizerPanel,
body.vm-focus #offerOptimizerPanel,
body.vm-focus #modelHistoryCard,
body.vm-focus #predictionHistoryCard,
body.vm-focus #auditLogsCard,
body.vm-focus #ownerActivityPanel,
body.vm-focus #enterpriseOpsPanel,
body.vm-focus #starterServicesPanel,
body.vm-focus #proServicesPanel,
body.vm-focus #planNextStepsCard {
  display: none !important;
}

body.vm-focus #interventionsPanel,
body.vm-focus #outcomesPanel,
body.vm-focus #insightsCard,
body.vm-focus #ownerMetricsPanel,
body.vm-focus #filtersCard {
  border-color: #cfbda8;
  box-shadow: 0 6px 20px rgba(60, 45, 33, 0.1);
}

.workflow-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0 0.9rem;
}

.workflow-step {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface-soft);
  padding: 0.4rem 0.35rem;
  text-align: center;
  color: var(--muted);
}

.workflow-step span {
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  border: 1px solid #d4c4af;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.workflow-step small {
  display: block;
  font-size: 0.74rem;
}

.workflow-step.is-active {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #f3ece2;
}

.workflow-step.is-active span {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.workflow-step.is-done {
  border-color: #d2c1ab;
  color: #5b4330;
  background: #f6eee3;
}

.workflow-step.is-done span {
  background: #eadcc9;
  color: #5b4330;
  border-color: #d2c1ab;
}

.empty-state-cell {
  white-space: normal;
  text-align: center;
  padding: 1rem 0.6rem;
}

.empty-state-wrap {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
}

.toast-container {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9999;
  display: grid;
  gap: 0.45rem;
}

.toast {
  min-width: 220px;
  max-width: 340px;
  border-radius: 0.7rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d0e3d9;
  background: #f6fcf8;
  color: #0e6f51;
  box-shadow: 0 10px 20px rgba(16, 35, 28, 0.12);
  font-size: 0.9rem;
}

.toast.error {
  border-color: #f0cbcb;
  background: #fff5f5;
  color: #8e2d2d;
}

.feature-gate {
  margin-bottom: 1rem;
}

.roi-card {
  margin-top: 1rem;
}

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

.risk-summary {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 0.4rem 0 1rem;
}

.risk-summary-badges {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  width: 100%;
}

.risk-summary-detail {
  width: 100%;
  border: 1px solid #e5d9c7;
  border-radius: 0.65rem;
  background: #fffaf2;
  padding: 0.7rem 0.8rem;
}

.risk-summary-detail table {
  table-layout: auto;
}

.risk-viz {
  margin: 0.85rem 0 1rem;
  display: grid;
  gap: 0.55rem;
}

.risk-viz h4 {
  margin: 0.25rem 0 0.1rem;
  font-size: 0.95rem;
}

.risk-bar-row {
  display: grid;
  grid-template-columns: 58px 1fr 56px;
  gap: 0.6rem;
  align-items: center;
}

.risk-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #ece2d5;
  overflow: hidden;
}

.risk-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 260ms ease;
}

.risk-bar-fill.high {
  background: #cf2f25;
}

.risk-bar-fill.medium {
  background: #f4aa2f;
}

.risk-bar-fill.low {
  background: #5f7540;
}

.bucket-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.bucket-card {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.45rem;
  background: var(--surface-soft);
  text-align: center;
}

.data-viz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.7rem 0 0.95rem;
}

.viz-card {
  border: 1px solid #d8e5dd;
  border-radius: 0.7rem;
  background: #fbfdfc;
  padding: 0.65rem;
}

.viz-card h4 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}

.viz-bar-list {
  display: grid;
  gap: 0.42rem;
}

.viz-bar-row {
  display: grid;
  grid-template-columns: minmax(84px, 130px) 1fr minmax(72px, auto);
  gap: 0.55rem;
  align-items: center;
}

.viz-label {
  font-size: 0.8rem;
  color: #2f4a3f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viz-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e8efea;
  overflow: hidden;
}

.viz-fill {
  height: 100%;
  width: 0%;
  background: #0f766e;
}

.viz-fill-location {
  background: #3366cc;
}

.viz-fill-atrisk {
  background: #5f6f85;
}

.viz-fill-saved {
  background: #1b8f5a;
}

.viz-fill-lost {
  background: #c94b4b;
}

.viz-value {
  font-size: 0.8rem;
  color: #234235;
  text-align: right;
}

#revenueTrendBars {
  display: grid;
  gap: 0.65rem;
}

.revenue-month-row {
  border: 1px dashed #d5e4db;
  border-radius: 0.6rem;
  padding: 0.45rem 0.5rem;
  display: grid;
  gap: 0.35rem;
}

.revenue-series-list {
  display: grid;
  gap: 0.34rem;
}

.revenue-series-row {
  display: grid;
  grid-template-columns: minmax(58px, 72px) 1fr minmax(84px, auto);
  gap: 0.48rem;
  align-items: center;
}

.revenue-series-label {
  font-size: 0.74rem;
  color: #456356;
}

.confidence-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0.35rem 0 0.25rem;
}

#previewTable {
  table-layout: auto;
  min-width: 920px;
}

#previewTable th,
#previewTable td {
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.35;
}

#previewTable td:first-child {
  min-width: 120px;
  font-weight: 600;
}

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0.6rem 0;
}

.funnel-step {
  border: 1px solid #d8e5dd;
  border-radius: 0.65rem;
  background: #fbfdfc;
  padding: 0.5rem;
  text-align: center;
}

.funnel-step strong {
  display: block;
  font-size: 1.2rem;
}

.analytics-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin: 0.35rem 0 0.8rem;
}

.analytics-controls label {
  min-width: 170px;
}

.run-history {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.2rem 0 0.9rem;
}

.run-chip {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: #5b4330;
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.run-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.55rem 0 0.85rem;
}

.kpi-grid-advanced {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.kpi-card {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface-soft);
  padding: 0.55rem;
}

.kpi-card strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.1rem;
}

.kpi-value-positive {
  color: var(--brand-dark);
}

.kpi-value-negative {
  color: #b42318;
}

.kpi-value-neutral {
  color: var(--text);
}

.roi-spotlight-grid {
  margin-bottom: 0.8rem;
}

.roi-spotlight strong {
  font-size: 1.35rem;
}

.roi-spotlight p {
  margin: 0.3rem 0 0;
}

.value-stack {
  display: flex;
  width: 100%;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f1e8dc;
  margin: 0.45rem 0 0.35rem;
}

.value-segment {
  height: 100%;
  transition: width 300ms ease;
}

.value-segment.at-risk {
  background: #5b92e5;
}

.value-segment.saved {
  background: #5f7540;
}

.value-segment.lost {
  background: #cf2f25;
}

.value-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.analytics-explain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.45rem 0 0.85rem;
}

.analytics-explain-item {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface-soft);
  padding: 0.5rem 0.6rem;
  display: grid;
  gap: 0.2rem;
}

.analytics-explain-item strong {
  color: #5b4330;
  font-size: 0.88rem;
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: end;
  min-height: 170px;
  margin: 0.35rem 0 0.85rem;
}

.trend-col {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.35rem;
  min-height: 150px;
  cursor: pointer;
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  align-items: end;
  height: 120px;
  padding: 0 0.15rem;
}

.trend-bar {
  border-radius: 0.35rem 0.35rem 0 0;
  min-height: 2px;
}

.trend-bar.saved {
  background: #5f7540;
}

.trend-bar.created {
  background: #3f7fd8;
}

.trend-bar.completed {
  background: var(--brand-dark);
}

.trend-bar.lost {
  background: #cf2f25;
}

.trend-label {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.cohort-chart {
  display: grid;
  gap: 0.45rem;
  margin: 0.35rem 0 0.85rem;
}

.cohort-row {
  display: grid;
  grid-template-columns: 95px 1fr 85px;
  gap: 0.55rem;
  align-items: center;
  cursor: pointer;
}

.cohort-track {
  height: 10px;
  border-radius: 999px;
  background: #ece2d5;
  overflow: hidden;
}

.cohort-fill {
  height: 100%;
  background: linear-gradient(90deg, #6b5038 0%, #8b6a4e 100%);
}

.month-detail-card {
  margin-top: 0.75rem;
  border-style: dashed;
}

.mock-report {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fefcf9;
  padding: 0.45rem;
  overflow-x: auto;
}

.mock-report table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.mock-report th,
.mock-report td {
  text-align: left;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid #e3d7c8;
  white-space: nowrap;
}

.badge {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.sample-report-page .lead {
  max-width: 760px;
}

.sample-report-layout {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 1rem;
  align-items: start;
}

.finding-list,
.action-list {
  display: grid;
  gap: 0.8rem;
}

.finding-item,
.action-item,
.recommendation-box {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #fefcf9;
  padding: 0.9rem;
}

.finding-item {
  border-left-width: 5px;
}

.finding-item.severity-high {
  border-left-color: var(--high);
}

.finding-item.severity-medium {
  border-left-color: var(--medium);
}

.finding-item-header,
.action-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.finding-item h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.severity-badge,
.status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  background: #f3e9dc;
  color: #5b4330;
}

.severity-high .severity-badge {
  background: #f7dedb;
  color: #8e2f27;
}

.severity-medium .severity-badge {
  background: #f4e7c9;
  color: #76520f;
}

.finding-details {
  margin: 0.8rem 0 0;
  display: grid;
  gap: 0.7rem;
}

.finding-details dt,
.summary-metric span,
.action-meta {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.finding-details dd {
  margin: 0.18rem 0 0;
  color: var(--text);
  line-height: 1.55;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.summary-metric {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #fefcf9;
  padding: 0.85rem;
  min-height: 104px;
}

.summary-metric strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.summary-metric small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  line-height: 1.35;
}

.recommendation-box {
  margin-top: 0.8rem;
}

.recommendation-box p {
  margin-top: 0.2rem;
}

.action-item strong {
  display: block;
  margin-top: 0.18rem;
  line-height: 1.45;
}

.badge-high {
  color: var(--high);
  background: #fff2f1;
  border: 1px solid #f2cbca;
}

.badge-medium {
  color: #7a5b07;
  background: #fff8e5;
  border: 1px solid #f1d897;
}

.badge-low {
  color: #4f6a31;
  background: #eef3e4;
  border: 1px solid #d1d9bf;
}

.table-wrap {
  overflow-x: auto;
  min-height: 150px;
}

body.results-page #resultsMeta {
  color: #4f3d30;
  font-weight: 600;
}

body.results-page .card {
  padding: 1.25rem;
}

body.results-page .history-toggle {
  margin-top: 0.35rem;
}

body.results-page .history-toggle > summary {
  padding: 0.35rem 0;
}

body.results-page #cvRefinementPanel {
  border-width: 1px;
  border-style: solid;
  border-color: #decdb7;
  background: linear-gradient(180deg, #fffcf8 0%, #f8f1e8 100%);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

body.results-page #cvRefinementPanel[data-status="running"],
body.results-page #cvRefinementPanel[data-status="queued"],
body.results-page #cvRefinementPanel[data-status="pending"] {
  border-color: #b7d7d2;
  background: linear-gradient(180deg, #f7fefd 0%, #eef8f7 100%);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.08) inset;
}

body.results-page #cvRefinementPanel[data-status="completed"] {
  border-color: #b6dec6;
  background: linear-gradient(180deg, #f6fdf8 0%, #eaf7ef 100%);
  box-shadow: 0 0 0 1px rgba(10, 119, 86, 0.08) inset;
}

body.results-page #cvRefinementPanel[data-status="failed"] {
  border-color: #efc0bc;
  background: linear-gradient(180deg, #fff9f8 0%, #fdf1ef 100%);
  box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.08) inset;
}

body.results-page #cvRefinementPanel h3 {
  margin-bottom: 0.45rem;
}

body.results-page #cvRefinementStatus {
  font-weight: 700;
}

body.results-page #cvRefinementDetails {
  line-height: 1.45;
}

body.results-page #confidenceDiagnosticsHint {
  margin: 0.35rem 0 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #e4d8ca;
  border-radius: 0.55rem;
  background: #fcf8f3;
  color: #614a35;
  line-height: 1.4;
}

body.results-page #confidenceTrendTable,
body.results-page #confidenceQualityTable {
  table-layout: auto;
  font-size: 0.88rem;
}

body.results-page #confidenceTrendTable th,
body.results-page #confidenceTrendTable td,
body.results-page #confidenceQualityTable th,
body.results-page #confidenceQualityTable td {
  white-space: normal;
  line-height: 1.35;
  vertical-align: top;
}

body.results-page #confidenceQualityTable td:first-child,
body.results-page #confidenceTrendTable td:first-child {
  font-weight: 600;
  color: #3e3024;
}

body.results-page #confidenceQualityTable tbody tr:nth-child(even) td,
body.results-page #confidenceTrendTable tbody tr:nth-child(even) td {
  background: #fcfaf7;
}

body.results-page .table-wrap {
  border-radius: 0.55rem;
}

body.results-page #interventionsTable th {
  background: #f8f2ea;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  table-layout: fixed;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

#offerOptimizerSummary {
  margin-top: 0.7rem;
}

#staffOptimizerSummary {
  margin-top: 0.7rem;
}

.owner-window {
  margin-bottom: 0.55rem;
}

.owner-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.owner-kpi-tile {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface-soft);
  padding: 0.48rem 0.56rem;
  display: grid;
  gap: 0.16rem;
}

.owner-kpi-label {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #4f6a60;
  font-weight: 700;
}

.owner-kpi-value {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.2;
}

.owner-col-email {
  min-width: 180px;
  word-break: break-word;
}

.owner-col-event {
  min-width: 180px;
  font-weight: 600;
}

.owner-col-activity-summary {
  min-width: 320px;
  max-width: 520px;
  word-break: break-word;
}

.owner-range-actions {
  margin-top: 0.55rem;
  margin-bottom: 0.3rem;
}

.owner-range-actions .btn.is-active {
  background: var(--brand-dark);
  color: #ffffff;
  border-color: var(--brand-dark);
}

.owner-range-actions .btn.is-active:hover {
  background: #3f2f22;
}

.owner-updates-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.owner-activity-toggle {
  margin-top: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface-soft);
  padding: 0.35rem 0.45rem;
}

.owner-activity-toggle > summary {
  cursor: pointer;
  color: #5b4330;
  font-weight: 700;
  list-style: none;
}

.owner-activity-toggle > summary::-webkit-details-marker {
  display: none;
}

.owner-activity-toggle > summary::before {
  content: "▸";
  margin-right: 0.4rem;
  color: var(--brand-dark);
}

.owner-activity-toggle[open] > summary::before {
  content: "▾";
}

.owner-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: lowercase;
  background: #eef2f4;
  color: #3d4f58;
  border: 1px solid #d8e2e7;
}

.service-toggle {
  margin-top: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface-soft);
  padding: 0.35rem 0.45rem;
}

.service-toggle > summary {
  cursor: pointer;
  color: #5b4330;
  font-weight: 700;
  list-style: none;
}

.service-toggle > summary::-webkit-details-marker {
  display: none;
}

.service-toggle > summary::before {
  content: "▸";
  margin-right: 0.4rem;
  color: var(--brand-dark);
}

.service-toggle[open] > summary::before {
  content: "▾";
}

.service-summary-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.service-summary-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: #5b4330;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
}

#starterServicesTable,
#proServicesTable {
  table-layout: auto;
  min-width: 640px;
}

#starterServicesTable th,
#starterServicesTable td,
#proServicesTable th,
#proServicesTable td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.35;
  word-break: break-word;
}

.service-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: lowercase;
  border: 1px solid #d8e2e7;
  background: #eef2f4;
  color: #3d4f58;
}

.service-status-chip.active {
  background: #eef3e4;
  color: #4f6a31;
  border-color: #d1d9bf;
}

.service-status-chip.check {
  background: #fff8e8;
  color: #7a5b07;
  border-color: #eeddaa;
}

.service-status-chip.inactive {
  background: #fdecec;
  color: #9a2e2e;
  border-color: #efc9c9;
}

.service-status-chip.owner_only {
  background: #eef1ff;
  color: #364f9a;
  border-color: #d6def7;
}

#ownerSignupsTable,
#ownerActivityTable {
  table-layout: auto;
  min-width: 620px;
}

#ownerSignupsTable th,
#ownerSignupsTable td,
#ownerActivityTable th,
#ownerActivityTable td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.35;
}

#modelsTable,
#predictionsTable {
  width: 100%;
  table-layout: auto;
  min-width: 640px;
}

#modelsTable th,
#modelsTable td,
#predictionsTable th,
#predictionsTable td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.35;
  word-break: break-word;
}

.history-id-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eef3f6;
  color: #2f4958;
  border: 1px solid #d6e1e8;
}

.history-engine-chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 700;
  background: #f3ebdf;
  color: #6b5038;
  border: 1px solid #dbcdbb;
}

.history-metrics-stack {
  display: grid;
  gap: 0.15rem;
  white-space: nowrap;
}

.history-risk-row {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.history-actions .btn {
  white-space: nowrap;
}

.history-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 0.55rem;
}

.history-table-wrap.is-virtualized {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--line);
}

#predictionsTable thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

#predictionsTable tr.virtual-spacer td {
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.history-toggle {
  margin-top: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface-soft);
  padding: 0.35rem 0.45rem;
}

.history-toggle > summary {
  cursor: pointer;
  color: #5b4330;
  font-weight: 700;
  list-style: none;
}

.history-toggle > summary::-webkit-details-marker {
  display: none;
}

.history-toggle > summary::before {
  content: "▸";
  margin-right: 0.4rem;
  color: var(--brand-dark);
}

.history-toggle[open] > summary::before {
  content: "▾";
}

#modelsTable td:nth-child(5),
#predictionsTable td:nth-child(4) {
  white-space: nowrap;
}

#interventionsTable {
  width: 100%;
  table-layout: auto;
  min-width: 1320px;
}

#interventionsTable th,
#interventionsTable td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.35;
  word-break: break-word;
}

#interventionsTable th {
  white-space: nowrap;
}

#interventionsTable th.queue-col-id,
#interventionsTable td.queue-col-id,
#interventionsTable th.queue-col-probability,
#interventionsTable td.queue-col-probability,
#interventionsTable th.queue-col-priority,
#interventionsTable td.queue-col-priority,
#interventionsTable th.queue-col-due,
#interventionsTable td.queue-col-due,
#interventionsTable th.queue-col-update,
#interventionsTable td.queue-col-update {
  white-space: nowrap;
}

#interventionsTable th.queue-col-id,
#interventionsTable td.queue-col-id {
  min-width: 140px;
}

#interventionsTable th.queue-col-location,
#interventionsTable td.queue-col-location {
  min-width: 150px;
}

#interventionsTable th.queue-col-probability,
#interventionsTable td.queue-col-probability {
  min-width: 115px;
}

#interventionsTable th.queue-col-priority,
#interventionsTable td.queue-col-priority {
  min-width: 150px;
}

#interventionsTable th.queue-col-action-text,
#interventionsTable td.queue-col-action-text {
  min-width: 280px;
  max-width: 420px;
}

#interventionsTable td.queue-col-action-text .queue-action-text {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

#interventionsTable th.queue-col-status,
#interventionsTable td.queue-col-status {
  min-width: 200px;
}

#interventionsTable th.queue-col-due,
#interventionsTable td.queue-col-due {
  min-width: 140px;
}

#interventionsTable th.queue-col-update,
#interventionsTable td.queue-col-update {
  min-width: 110px;
  text-align: center;
}

#interventionsTable td.queue-col-status .task-status-select {
  width: 100%;
  min-width: 160px;
}

.task-status-save-btn.queue-save-btn {
  min-width: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

#interventionsTable tr.is-selected,
#revenueTrendTable tr.is-selected {
  background: #f3ece2;
}

.cohort-row.is-selected {
  border-radius: 0.5rem;
  background: #f3ece2;
  padding-inline: 0.35rem;
}

.queue-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 0.55rem;
}

.queue-col-action {
  min-width: 240px;
  max-width: 360px;
}

.queue-owner-input {
  min-width: 120px;
  width: 100%;
  max-width: 160px;
}

.queue-status-select {
  min-width: 140px;
}

.queue-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem;
  margin: 0.55rem 0 0.45rem;
}

.queue-controls label {
  min-width: 180px;
}

.queue-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.queue-page-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.queue-page-buttons {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.queue-page-btn.is-active {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #ffffff;
}

.queue-page-ellipsis {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0 0.2rem;
}

.analytics-narrative {
  margin: 0.2rem 0 0.7rem;
  padding: 0.5rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface-soft);
  color: #5a4b3e;
  font-size: 0.88rem;
}

.optimizer-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.optimizer-summary-tile {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface-soft);
  padding: 0.5rem 0.6rem;
  display: grid;
  gap: 0.2rem;
}

.optimizer-summary-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #4f6a60;
  font-weight: 700;
}

.optimizer-summary-value {
  color: var(--text);
  font-size: 0.97rem;
  line-height: 1.25;
}

#offerOptimizerTable {
  table-layout: auto;
  min-width: 1080px;
}

#offerOptimizerTable th,
#offerOptimizerTable td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.35;
}

#offerOptimizerTable td.offer-col-offer {
  min-width: 170px;
  font-weight: 600;
}

#offerOptimizerTable td.offer-col-reason {
  min-width: 320px;
  max-width: 460px;
  word-break: break-word;
}

#staffOptimizerTable {
  table-layout: auto;
  min-width: 980px;
}

#staffOptimizerTable th,
#staffOptimizerTable td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.35;
}

#staffOptimizerTable td.staff-col-owner {
  min-width: 150px;
  font-weight: 600;
}

#staffOptimizerTable td.staff-col-action {
  min-width: 300px;
  max-width: 460px;
  word-break: break-word;
}

.optimizer-detail {
  margin-top: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface-soft);
  padding: 0.45rem 0.55rem;
}

.optimizer-detail > summary {
  cursor: pointer;
  color: #5b4330;
  font-weight: 600;
}

.optimizer-staff-list {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.3rem;
}

.cell-collapse {
  margin: 0;
}

.cell-collapse > summary {
  cursor: pointer;
  color: #5b4330;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cell-collapse-body {
  margin-top: 0.35rem;
  white-space: normal;
  color: #5f5144;
}

.price-card {
  text-align: center;
}

.plan-btn {
  margin-top: 0.8rem;
  width: 100%;
}

.price {
  color: var(--text);
  font-size: 2rem;
  font-weight: 700;
}

.price span {
  font-size: 1rem;
  color: var(--muted);
}

.featured {
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(107, 80, 56, 0.18);
}

.footer {
  padding: 1.4rem 0 2rem;
  border-top: 1px solid var(--line);
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.footer-legal {
  position: relative;
}

.footer-legal > summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.footer-legal > summary::-webkit-details-marker {
  display: none;
}

.footer-legal > summary::after {
  content: " ▾";
}

.footer-legal-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.35rem);
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(43, 33, 24, 0.12);
  padding: 0.5rem;
  display: grid;
  gap: 0.35rem;
  z-index: 30;
}

.footer-legal:not([open]) .footer-legal-panel {
  display: none;
}

.footer-legal-panel a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.93rem;
}

.footer-legal-panel a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.sample-links-row {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.sample-links-row details {
  margin-top: 0;
}

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1200;
  background: #2b1f16;
  border: 1px solid #6b5038;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.cookie-banner-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
}

.cookie-banner-content p {
  margin: 0;
  color: #f8f0e3;
  max-width: 760px;
}

.cookie-banner-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-banner-link {
  color: #e1c199;
  font-weight: 600;
  text-decoration: none;
}

.cookie-banner-link:hover {
  text-decoration: underline;
}

@media (max-width: 920px) {
  .logo-img {
    height: 64px;
    max-width: min(320px, 78vw);
  }

  .nav-wrap {
    align-items: flex-start;
    gap: 0.7rem;
  }

  .nav-main-actions {
    justify-content: flex-start;
  }

  .nav-menu-panel {
    position: static;
    margin-top: 0.4rem;
    min-width: min(260px, 85vw);
  }

  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-legal-panel {
    position: static;
    margin-top: 0.35rem;
    min-width: min(260px, 85vw);
  }

  .hero-grid,
  .sample-report-layout,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .roi-grid {
    grid-template-columns: 1fr;
  }

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

  .insight-grid,
  .filter-grid,
  .delta-grid {
    grid-template-columns: 1fr 1fr;
  }

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

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

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

  .analytics-explain-grid {
    grid-template-columns: 1fr;
  }

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

  .finding-item-header,
  .action-item {
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .finding-item-header,
  .action-item {
    display: grid;
  }

  .severity-badge,
  .status-badge {
    width: fit-content;
  }

  .bulk-actions-row label {
    min-width: 100%;
  }

  .queue-controls label {
    min-width: 100%;
  }

  .queue-pagination {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-banner {
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0.6rem;
  }

  .cookie-banner-content {
    align-items: flex-start;
  }

  .optimizer-summary-grid {
    grid-template-columns: 1fr;
  }

  .data-viz-grid {
    grid-template-columns: 1fr;
  }

  .viz-bar-row {
    grid-template-columns: minmax(72px, 110px) 1fr minmax(60px, auto);
  }

  .revenue-series-row {
    grid-template-columns: minmax(52px, 66px) 1fr minmax(72px, auto);
  }

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

  #modelsTable,
  #predictionsTable {
    min-width: 620px;
  }

  #starterServicesTable,
  #proServicesTable {
    min-width: 560px;
  }

  body.results-page .card {
    padding: 1rem;
  }

  body.results-page #confidenceDiagnosticsHint {
    font-size: 0.84rem;
  }

  body.results-page #confidenceTrendTable,
  body.results-page #confidenceQualityTable {
    font-size: 0.84rem;
  }
}

.bid-review-hero {
  padding-top: 3.2rem;
  padding-bottom: 2.1rem;
}

.bid-review-hero .lead {
  max-width: 74ch;
}

.bid-review-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #d7d1c8;
  background: linear-gradient(180deg, #fff, #f7f4ef);
  color: #5b4636;
  font-size: 0.82rem;
  font-weight: 600;
}

.bid-review-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

.bid-review-layout > * {
  min-width: 0;
}

.bid-review-side-stack {
  display: grid;
  gap: 0.9rem;
}

.bid-review-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.2rem 0 0.8rem;
}

.step-chip {
  border: 1px solid #d7d1c8;
  background: #fbf8f4;
  color: #5f4a3a;
  border-radius: 0.6rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.82rem;
  text-align: center;
}

.step-chip.active {
  border-color: #b67f39;
  background: #fff2de;
  color: #5a3610;
}

.bid-review-source-toggle {
  margin-top: 0.2rem;
  min-width: 0;
  overflow: hidden;
}

.bid-review-source-toggle details {
  min-width: 0;
}

.bid-review-upload-grid {
  margin-top: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bid-review-upload-grid > label {
  min-width: 0;
}

.bid-review-upload-grid input[type="file"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.bid-review-hint {
  margin-top: -0.4rem;
  margin-bottom: 0.25rem;
}

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

#projectTasksCard .table-wrap table {
  min-width: 980px;
}

#projectTasksCard td,
#projectTasksCard th {
  vertical-align: middle;
  white-space: nowrap;
}

#projectTasksCard td:nth-child(2),
#projectTasksCard th:nth-child(2),
#projectTasksCard td:nth-child(6),
#projectTasksCard th:nth-child(6) {
  white-space: normal;
}

#projectTasksCard [data-field="status"] {
  min-width: 128px;
}

#projectTasksCard [data-field="owner"] {
  min-width: 150px;
}

#projectTasksCard [data-field="due_at"] {
  min-width: 136px;
}

.project-graph-canvas-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #d6cec0;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, #fff, #f8f4ee);
}

.project-graph-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.project-graph-zoom-controls {
  gap: 0.45rem;
}

.project-graph-filter-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: #5f4a3a;
}

.project-graph-filter-controls label {
  display: inline-flex;
  align-items: center;
  gap: 0.33rem;
  font-weight: 600;
}

.project-graph-svg {
  width: 100%;
  min-width: 920px;
  height: 420px;
  display: block;
  cursor: grab;
  touch-action: none;
}

.graph-node-group {
  cursor: pointer;
}

.graph-node-group:hover circle {
  stroke: #111827;
  stroke-width: 1.8;
}

@media (max-width: 980px) {
  .bid-review-layout {
    grid-template-columns: 1fr;
  }

  .bid-review-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bid-review-stepper {
    grid-template-columns: 1fr;
  }

  .bid-review-upload-grid {
    grid-template-columns: 1fr;
  }

  .project-graph-filter-controls {
    width: 100%;
  }
}
