:root {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-light: #64748b;
  --border: #cbd5e1;
  --border-light: #e2e8f0;

  /* Brand Colors */
  --primary: #79B93C;
  --primary-hover: #67a230;
  --primary-light: #f0f9e8;

  --forest: #0E3B20;
  --forest-hover: #072212;
  --forest-light: #e7f3ec;

  /* Status Colors */
  --verified-bg: #dcfce7;
  --verified-text: #166534;
  --pending-bg: #dbeafe;
  --pending-text: #1e40af;
  --archived-bg: #f1f5f9;
  --archived-text: #475569;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

  /* Semantic Status Colors */
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;

  /* Surface */
  --bg-subtle: #f8fafc;

  /* Geometry */
  --radius-pill: 9999px;

  /* Type Scale */
  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 24px;
  --text-3xl: 28px;

  /* Spacing Scale (8-point) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Typography Helpers */
.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

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

/* ───────── HEADER ───────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, #eef7e4, #c9e7ab);
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.logo-icon-circle img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text-title {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--forest);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.logo-text-subtitle {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: var(--primary);
}

.divider-vertical {
  width: 1px;
  height: 28px;
  background-color: var(--border-light);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
}

.nav-home-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  font-weight: 500;
  cursor: pointer;
}

.nav-home-link:hover {
  text-decoration: underline;
}

.breadcrumbs a {
  font-weight: 500;
}

.breadcrumbs span {
  font-weight: 600;
  color: var(--text-main);
}

.nav-search-bar {
  width: 344px;
  display: flex;
  align-items: center;
  background: #f6f8f2;
  border: 1px solid #e5e8dd;
  border-radius: 999px;
  height: 40px;
  padding: 0 16px;
  gap: 8px;
}

.nav-search-icon-left {
  color: #9B9B9B;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  pointer-events: none;
}

.nav-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  font-size: 13px;
  color: var(--text-main);
  font-family: 'Funnel Display', sans-serif;
}

.nav-search-input::placeholder {
  color: #9B9B9B;
}

.nav-search-icon {
  display: none;
}

.nav-right-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.15s, color 0.15s;
}

.nav-icon-btn:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 1px solid var(--bg-card);
}

.nav-profile-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* ───────── APP LAUNCHER SCREEN ───────── */
.launcher-shell {
  min-height: calc(100vh - 64px);
  background: #edf3e7;
  padding: 44px 24px 40px;
}

.launcher-stage {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(var(--launcher-columns, 1), 136px);
  gap: 14px;
  justify-content: center;
  align-content: flex-start;
}

.launcher-card {
  width: 136px;
  height: 112px;
  border-radius: 8px;
  border: 1px solid #edf1e8;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(26, 45, 26, 0.02), 0 8px 18px rgba(26, 45, 26, 0.04);
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
}

.launcher-card--single {
  justify-self: center;
}

.launcher-card--active {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.launcher-card--active:hover {
  transform: translateY(-1px);
  border-color: #d7e4c9;
  box-shadow: 0 2px 0 rgba(26, 45, 26, 0.02), 0 10px 20px rgba(26, 45, 26, 0.06);
}

.launcher-card--active:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.launcher-card--placeholder {
  cursor: default;
}

.launcher-icon-frame {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #dde8cf;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcf8 100%);
  display: grid;
  place-items: center;
  color: #a1cf3a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a1cf3a;
}

.launcher-icon svg {
  width: 20px;
  height: 20px;
}

.launcher-card-label {
  font-size: 11px;
  line-height: 1.2;
  color: #707a6f;
  font-weight: 500;
  max-width: 108px;
  word-break: break-word;
}

@media (max-width: 920px) {
  .launcher-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .launcher-grid {
    grid-template-columns: repeat(var(--launcher-columns-mobile, 1), 136px);
  }

  .launcher-card {
    width: 136px;
    height: 112px;
  }
}

/* ───────── MAIN GRID LAYOUT ───────── */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 344px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }
}

/* ───────── SIDEBAR CARD ───────── */
.sidebar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.sidebar p.subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.toggle-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px;
  border: 2px solid #d5dccb;
  border-radius: 999px;
  background: #f6f7f3;
}

/* Inactive tab */
.toggle-tab-btn {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: #667085;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  text-align: center;
}

.toggle-tab-btn:hover {
  color: #4b5563;
}

/* Active (selected) tab — green pill with shadow */
.toggle-tab-btn.active {
  background: #8BC638;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.sidebar-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 8px;
}

.sidebar-form .form-field>label {
  font-family: 'Funnel Display', sans-serif;
  position: absolute;
  top: -1px;
  left: 18px;
  z-index: 1;
  padding: 0 6px;
  background: var(--bg-card);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #2C313B;
  letter-spacing: 0.01em;
}

.form-input,
.form-select {
  width: 100%;
  background-color: #ffffff;
  border: 2px solid #d5dce6;
  border-radius: 999px;
  min-height: 44px;
  padding: 8px 16px;
  font-family: 'Funnel Display', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #a0a3aa;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: rgba(0, 0, 0, 0.30);
}

.form-select {
  /* keep dropdown arrow visible */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 36px;
}

.form-input:focus,
.form-select:focus {
  border-color: #8BC638;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-group .form-input {
  padding-left: 26px;
}

.form-input-group::before {
  content: '$';
  position: absolute;
  left: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #a0a3aa;
  pointer-events: none;
}

.form-input-group-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-group-suffix .form-input {
  padding-right: 26px;
}

.form-input-group-suffix::after {
  content: '%';
  position: absolute;
  right: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #a0a3aa;
  pointer-events: none;
}

.slider-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-val-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.form-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background-color: #e2e8f0;
  outline: none;
}

.form-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s;
}

.form-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
}

.lock-expiry-hint {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
}

input[type="date"].form-input {
  color-scheme: light;
}

.radio-group-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.radio-group-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.radio-options {
  display: flex;
  gap: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════════════
   DESIGN SYSTEM — BUTTON VARIANTS
   Primary  : .btn-primary  — solid green CTA
   Outline  : .btn-outline  — bordered secondary
   Ghost    : .btn-ghost    — text-only navigation
   Dark     : .btn-dark     — forest-green confirm action
   ═══════════════════════════════════════════════════════════ */

/* Shared base — all action buttons inherit this */
.btn-primary,
.btn-outline,
.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  padding: 8px 18px;
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary-light);
}

.btn-ghost {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-size: var(--text-md);
  font-weight: 700;
  cursor: pointer;
}

.btn-ghost:hover {
  text-decoration: underline;
}

.btn-dark {
  background-color: var(--forest);
  color: #ffffff;
  border: none;
}

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

/* ─── Legacy button classes (preserved for compatibility) ─── */

.btn-generate {
  background: #8BC638;
  color: #ffffff;
  border: none;
  border-radius: 47px;
  padding: 15.5px 18px 16.5px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  width: 100%;
  height: 48px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background-color 0.15s, transform 0.1s;
}

/* Generate Pricing sits naturally at the bottom of the form */
.sidebar-form .btn-generate {
  margin-top: 8px;
}

.btn-generate:hover {
  background-color: #7aaf32;
}

.btn-generate:active {
  transform: translateY(1px);
}

.sidebar-separator {
  border: 0;
  border-top: 1px dashed var(--border);
  margin: 8px 0;
}

.recent-submissions-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recent-header-row h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.05em;
  margin: 0;
}

.recent-view-all {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.recent-item:hover {
  background-color: #f1f5f9;
  border-color: var(--border);
}

.recent-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recent-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.recent-details {
  display: flex;
  flex-direction: column;
}

.recent-filename {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-meta {
  font-size: 10px;
  color: var(--text-light);
}

.recent-tag {
  font-size: var(--text-2xs);
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

.recent-tag.verified {
  background-color: var(--verified-bg);
  color: var(--verified-text);
}

.recent-tag.pending {
  background-color: var(--pending-bg);
  color: var(--pending-text);
}

.recent-tag.archived {
  background-color: var(--archived-bg);
  color: var(--archived-text);
}

.recent-arrow {
  color: var(--text-light);
  font-size: 12px;
  font-weight: 700;
}

/* ───────── CONTENT AREA ───────── */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title-row h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.02em;
}

.section-title-row h1 {
  letter-spacing: -0.02em;
}

.live-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
}

.live-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(121, 185, 60, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(121, 185, 60, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(121, 185, 60, 0);
  }
}

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 4px;
  z-index: 30;
}

.filter-pills {
  display: flex;
  gap: 8px;
}

.filter-pill {
  background: #FBFCF8;
  border: 1px solid #E5E8DD;
  padding: 7px 32px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #9B9B9B;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-pill:hover {
  background: #f0f4ea;
  color: #444;
  border-color: #c8d0be;
}

.filter-pill.active {
  background: linear-gradient(to right, #81BF37, #256521);
  color: #ffffff;
  border-color: transparent;
}

.scenario-summary-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ───────── TABLE DESIGN ───────── */
.table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 75vh;
  position: relative;
}

.rates-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  min-width: 900px;
}

.rates-table th {
  background-color: var(--bg-subtle);
  color: var(--text-light);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1;
}

.rates-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
  font-weight: 500;
  vertical-align: middle;
}

.rates-table tbody tr:hover {
  background-color: var(--bg-subtle);
}

.rates-table tbody tr.selected {
  background-color: var(--primary-light);
}

.rates-table input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.table-product-cell {
  font-weight: 700;
  color: var(--text-main);
}

.table-rate-cell {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.table-piti-cell {
  font-size: 14px;
  font-weight: 700;
  color: var(--forest);
}

.badge-tvhl-float {
  position: absolute;
  top: -12px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.badge-tvhl-float img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* ───────── ADJUSTMENT PANEL ───────── */
.adjustment-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.adjustment-panel-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.adjustment-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.adjustment-panel-subtitle {
  font-size: 12px;
  color: var(--text-light);
}

.adjustment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.adjustment-table thead tr {
  border-bottom: 1px solid var(--border-light);
}

.adjustment-table th {
  padding: 6px 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
}

.adjustment-table td {
  padding: 5px 8px;
  color: var(--text-main);
  border-bottom: 1px solid #f1f5f9;
}

.adj-desc-cell {
  max-width: 520px;
  line-height: 1.4;
}

.adj-num-col {
  text-align: right;
  white-space: nowrap;
  width: 80px;
}

.adjustment-total-row td {
  font-weight: 700;
  font-size: 12px;
  border-top: 1px solid var(--border-light);
  border-bottom: none;
  padding-top: 8px;
  color: var(--text-main);
}

/* ───────── PRICE TIERS GRID ───────── */
.price-tiers-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--forest);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.price-tiers-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.price-tiers-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.price-tiers-subtitle {
  font-size: 12px;
  color: var(--text-light);
}

.price-tiers-scroll {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: auto;
}

.price-tiers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 680px;
}

.price-tiers-table thead th {
  background-color: var(--bg-subtle);
  padding: 7px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1;
}

.price-tiers-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-muted);
}

.price-tiers-table tbody tr:hover {
  background-color: var(--bg-subtle);
}

.tier-row-active {
  background-color: var(--primary-light) !important;
}

.tier-rate-cell {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.tier-expense-cell {
  font-size: 13px;
  font-weight: 700;
  color: var(--forest);
}

.tier-cost-cell {
  color: var(--color-error);
  font-weight: 600;
}

.tier-rebate-cell {
  color: var(--color-success);
  font-weight: 600;
}

/* ───────── MARKET TREND ───────── */
.market-trend-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.trend-left h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.05em;
  margin: 0 0 6px 0;
}

.trend-left h4 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.trend-left p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.trend-icon {
  font-size: 32px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* ───────── STATS ROW ───────── */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.stat-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
}

.stat-card-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.stat-card-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.stat-card-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.stat-progress-bar-bg {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background-color: #f1f5f9;
  overflow: hidden;
}

.stat-progress-bar-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: 99px;
}

/* ───────── LOAN COMPARISON ───────── */
.loan-comparison-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comparison-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comparison-header-row h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.comparison-header-row p {
  font-size: 12px;
  color: var(--text-light);
  margin: 4px 0 0 0;
}

.badge-comparison-float {
  position: absolute;
  top: -12px;
  left: 232px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.badge-comparison-float img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.comparison-deck {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 960px) {
  .comparison-deck {
    grid-template-columns: 1fr;
  }
}

/* Default (unselected) option card */
.comparison-card {
  border-radius: 10px;
  border: 1px solid rgba(49, 48, 53, 0.20);
  padding: 16px;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.comparison-card:hover {
  border-color: #8BC638;
}

/* Selected option card */
.comparison-card.active {
  background-color: #F9FFF3;
  border: 1px solid #8BC638;
}

/* Baseline card — gradient bg + gradient border */
.comparison-card.baseline,
.comparison-card.baseline.active {
  background: linear-gradient(to bottom right, #81BF37, #256521) padding-box,
    linear-gradient(to bottom right, #81BF37, #256521) border-box;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #ffffff;
  cursor: default;
}

.comp-card-badge {
  font-size: 12px;
  font-weight: 700;
  color: #0A1A10;
  text-transform: uppercase;
  letter-spacing: -0.12px;
}

.comparison-card.baseline .comp-card-badge {
  color: rgba(255, 255, 255, 0.60);
}

.comp-card-title {
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  color: #0A1A10;
  letter-spacing: -0.12px;
}

.comparison-card.baseline .comp-card-title {
  color: #ffffff;
}

.comp-card-metric-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comp-card-label {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.comparison-card.baseline .comp-card-label {
  color: rgba(255, 255, 255, 0.60);
}

/* Rate value — #8BC638 on option cards, white on baseline */
.comp-card-val {
  font-size: 12px;
  font-weight: 700;
  color: #8BC638;
  letter-spacing: -0.12px;
}

.comparison-card.baseline .comp-card-val {
  color: #ffffff;
}

/* APR value */
.comp-card-val--muted {
  color: #0A1A10;
}

.comparison-card.baseline .comp-card-val--muted {
  color: #ffffff;
}

.comp-card-monthly-label {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.comparison-card.baseline .comp-card-monthly-label {
  color: rgba(255, 255, 255, 0.60);
}

.comp-card-monthly-val {
  font-size: 16px;
  font-weight: 800;
  color: #8BC638;
}

.comparison-card.baseline .comp-card-monthly-val {
  color: #ffffff;
}

.comparison-card.active .comp-card-monthly-val {
  color: #8BC638;
}

.comparison-banner-row {
  background-color: var(--forest);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
  flex-wrap: wrap;
  gap: 12px;
}

.comparison-banner-text {
  font-size: 13px;
  font-weight: 500;
}

.comparison-banner-text strong {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
}

.btn-compare-action {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.15s;
}

.btn-compare-action:hover {
  background-color: var(--primary-hover);
}

/* ───────── DISCLOSURE ───────── */
.disc-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 48px 24px;
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.6;
}

.disc-section h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}

.disc-section p {
  margin: 0 0 10px 0;
}

.disc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ─── Rate table inline expand row ─────────────────────────── */
.rate-table-expand-row {
  background: #f4f9ef;
}

.rate-table-expand-cell {
  padding: 0 !important;
  border-bottom: 2px solid var(--primary);
}

.rate-table-expand-cell>.price-tiers-panel,
.rate-table-expand-cell>.adjustment-panel,
.rate-table-expand-cell>.lock-period-panel {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  box-shadow: none;
  margin: 0;
}

.rate-table-expand-cell>.price-tiers-panel {
  border-bottom: 1px solid var(--border-light);
}

/* ─── Lock Period Panel (Screen C) ─────────────────────── */
.lock-period-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.lock-period-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.lock-period-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.lock-period-meta-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.lock-chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.lock-chip {
  padding: 5px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  font-family: inherit;
}

.lock-chip:hover {
  background: var(--primary-light);
}

.lock-chip-active {
  background: var(--primary);
  color: #fff;
}

.lock-chip-active:hover {
  background: var(--primary-hover);
}

.lock-expiry-input {
  font-size: var(--text-sm);
  padding: 6px 10px;
  max-width: 160px;
}

.lock-pricing-update-value {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ─── Upload Zone (T10) ──────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.upload-zone:hover,
.upload-zone-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone-success {
  border-color: var(--color-success);
  border-style: solid;
  background: var(--color-success-bg);
  cursor: default;
}

.upload-zone-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.upload-zone-primary {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.upload-zone-secondary {
  font-size: 11px;
  color: var(--text-light);
}

.upload-zone-reset {
  margin-top: 12px;
  padding: 6px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}

.upload-zone-reset:hover {
  background: var(--primary-light);
}

.upload-zone-select {
  margin-top: 12px;
  pointer-events: auto;
}

/* ─── Live Market Trends (T6) ───────────────────────────── */
.live-market-trends-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}

/* D5: Header row with inline timestamp */
.live-market-trends-header-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}

.live-market-trends-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: 0.02em;
}

/* D5: Freshness timestamp */
.live-market-trends-ts {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
  white-space: nowrap;
}

.live-market-trends-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.live-trend-track {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px 12px;
}

/* Header: label+rate on left, delta on right */
.live-trend-track-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.live-trend-track-label-rate {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.live-trend-track-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0;
}

.live-trend-track-rate {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* D6: Delta chip — top right, text-right, two lines */
.live-trend-delta {
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.live-trend-delta-up {
  color: #e53e3e;
}

.live-trend-delta-down {
  color: var(--forest);
}

.live-trend-delta-neutral {
  color: var(--text-light);
  font-weight: 500;
}

/* ─── Quick Calculator (T7) ─────────────────────────────── */
.quick-calc-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}

/* D8: Payment breakdown visualization */
.qc-viz-panel {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.qc-viz-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.qc-viz-total-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.qc-viz-total-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--forest);
  font-variant-numeric: tabular-nums;
}

.qc-viz-bar-track {
  display: flex;
  height: 10px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  gap: 2px;
  margin-bottom: 8px;
}

.qc-viz-bar-seg {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.qc-viz-bar-pi {
  background: var(--primary);
}

.qc-viz-bar-ti {
  background: #94a3b8;
}

.qc-viz-bar-mi {
  background: #f59e0b;
}

.qc-viz-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.qc-viz-legend-item {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.qc-viz-legend-item::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.qc-viz-dot-pi::before {
  background: var(--primary);
}

.qc-viz-dot-ti::before {
  background: #94a3b8;
}

.qc-viz-dot-mi::before {
  background: #f59e0b;
}

/* D9: Personalize Quote button */
.qc-personalize-btn {
  width: 100%;
  margin-top: 4px;
  font-size: 13px;
  padding: 9px 16px;
}

.quick-calc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.quick-calc-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

@media (max-width: 700px) {
  .quick-calc-body {
    grid-template-columns: 1fr;
  }
}

.quick-calc-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quick-calc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-calc-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quick-calc-field-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.quick-calc-field-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.quick-calc-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--border-light);
  outline: none;
  cursor: pointer;
}

.quick-calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
}

.quick-calc-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-light);
  margin-top: 2px;
}

.quick-calc-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-calc-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.quick-calc-result-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-calc-result-item.primary {
  background: var(--forest);
  border-color: var(--forest);
}

.quick-calc-result-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quick-calc-result-item.primary .quick-calc-result-label {
  color: rgba(255, 255, 255, 0.7);
}

.quick-calc-result-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.quick-calc-result-item.primary .quick-calc-result-val {
  color: #fff;
}

/* D10: Credit score chip colors */
.qc-score-excellent {
  color: var(--forest);
  font-weight: 700;
}

.qc-score-very-good {
  color: var(--primary);
  font-weight: 700;
}

.qc-score-good {
  color: #16a34a;
  font-weight: 700;
}

.qc-score-fair {
  color: #d97706;
  font-weight: 700;
}

.qc-score-low {
  color: var(--color-error);
  font-weight: 700;
}

/* ─── Comparison action buttons + toast (T8) ─────────────── */
/* D3: Visually dominant primary CTA */
.btn-apply-action {
  padding: 11px 28px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  letter-spacing: -0.01em;
}

.btn-apply-action:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.comp-applied-toast {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  animation: fadeInOut 4s ease;
}

@keyframes fadeInOut {

  0%,
  100% {
    opacity: 0
  }

  10%,
  80% {
    opacity: 1
  }
}

/* ─── Detail Comparison Table (T9) ──────────────────────── */
.detail-comparison-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.detail-comparison-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}

.detail-comparison-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

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

.detail-comparison-table th,
.detail-comparison-table td {
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.detail-comparison-table thead th {
  background: var(--bg-subtle);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.detail-comparison-table tbody tr:hover td {
  background: #fafafa;
}

.detail-col-option {
  background: var(--color-success-bg);
}

.detail-col-highlight {
  color: var(--primary);
  font-weight: 700;
}

/* ─── Compare Selected button + hint (pricing screen) ─────────────────── */
.rate-table-selection-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-main);
  margin-bottom: 8px;
  position: sticky;
  top: 64px;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.rate-table-sel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.sel-baseline {
  background: var(--forest);
}

.sel-option {
  background: var(--primary);
}

.btn-compare-selected {
  padding: 7px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--forest);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-compare-selected:hover {
  background: var(--forest-hover);
}

.compare-hint-text {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
}

/* ─── Full Comparison Screen ─────────────────────────────────────────────── */
.cscreen-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  max-width: 1340px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .cscreen-wrapper {
    grid-template-columns: 1fr;
  }
}

.cscreen-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Back header */
.cscreen-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
}

.cscreen-back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: var(--text-md);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.cscreen-back-btn:hover {
  text-decoration: underline;
}

.cscreen-subtitle {
  font-size: 13px;
  color: var(--text-light);
}

/* Cards row */
.cscreen-cards-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding-bottom: 4px;
}

.cscreen-card {
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 960px) {
  .cscreen-cards-row {
    grid-template-columns: 1fr;
  }
}

.cscreen-card:hover {
  border-color: var(--primary);
}

.cscreen-card.cscreen-card-active {
  background-color: #F9FFF3;
  border: 1px solid #8BC638;
  box-shadow: none;
}

.cscreen-card-baseline {
  background: linear-gradient(to bottom right, #81BF37, #256521) padding-box,
    linear-gradient(to bottom right, #81BF37, #256521) border-box;
  border: 1px solid transparent;
  color: #fff;
  cursor: default;
}

.cscreen-card-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  opacity: 0.9;
}

.cscreen-card-baseline .cscreen-card-tag {
  color: rgba(255, 255, 255, 0.6);
}

.cscreen-card-title {
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cscreen-card-baseline .cscreen-card-title {
  color: #fff;
}

.cscreen-card-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
}

.cscreen-card-baseline .cscreen-card-row {
  color: rgba(255, 255, 255, 0.7);
}

.cscreen-card-row strong {
  color: var(--text-main);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cscreen-card-baseline .cscreen-card-row strong {
  color: #fff;
}

.cscreen-card-total {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

.cscreen-card-baseline .cscreen-card-total {
  border-top-color: rgba(255, 255, 255, 0.2);
}

/* Savings banner */
.cscreen-savings-banner {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.cscreen-savings-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.cscreen-savings-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.cscreen-savings-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--forest);
  font-variant-numeric: tabular-nums;
}

.cscreen-savings-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Action row */
/* D2/D3: Action row layout */
.cscreen-action-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cscreen-action-btns {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* D2: Outline compare button sizing matches Apply */
.btn-compare-action {
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-compare-inactive {
  opacity: 0.5;
  cursor: default !important;
  pointer-events: none;
}

/* Detail table section */
.cscreen-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cscreen-detail-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.cscreen-amort-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  align-self: flex-start;
  transition: border-color 0.15s, color 0.15s;
}

.cscreen-amort-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cscreen-disclaimer {
  font-size: 10px;
  color: var(--text-light);
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* Right sidebar */
.cscreen-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 80px;
}

.cscreen-sidebar .live-market-trends-panel,
.cscreen-sidebar .quick-calc-panel {
  margin-bottom: 0;
}

/* ─── Loan Comparison Deck — compare button + empty state ─── */
.btn-compare-deck {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 24px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-compare-deck:hover {
  background: var(--primary-hover);
}

.comparison-empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  background: var(--bg-page);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}

/* ══════════════════════════════════════════════════
   SPRINT 4 — Screen A Professionalization
   ══════════════════════════════════════════════════ */

/* ─── A5: Stats card month-over-month trend ─── */
.stat-card-trend {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

/* Placeholder style — clearly differs from real data once wired */
.stat-card-trend--placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* ─── V2: Comparison Deck — primary workflow step ─── */
.loan-comparison-container {
  border-left: 3px solid var(--primary);
}

.comparison-header-row h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0;
}

/* ─── V3: Scenario summary — informational, not interactive ─── */
.scenario-summary-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding-left: 12px;
  border-left: 1px solid var(--border);
  user-select: none;
  cursor: default;
  letter-spacing: 0.01em;
}

/* ─── U1/U2: Tooltip component ─── */
.label-with-tooltip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.th-with-tooltip {
  white-space: nowrap;
}

.tooltip-icon-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  color: var(--text-light);
  cursor: default;
  flex-shrink: 0;
}

.tooltip-icon-wrap:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 50%;
}

.tooltip-icon-svg {
  display: block;
  opacity: 0.55;
  transition: opacity 0.12s;
}

.tooltip-icon-wrap:hover .tooltip-icon-svg,
.tooltip-icon-wrap:focus .tooltip-icon-svg {
  opacity: 1;
}

.tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-main);
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  min-width: 180px;
  max-width: 260px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 100;
}

/* Arrow */
.tooltip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-main);
}

.tooltip-icon-wrap:hover .tooltip-bubble,
.tooltip-icon-wrap:focus .tooltip-bubble {
  opacity: 1;
}

/* Tooltip inside table header — bubble opens downward to avoid clipping */
.th-with-tooltip .tooltip-bubble {
  bottom: auto;
  top: calc(100% + 7px);
}

.th-with-tooltip .tooltip-bubble::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--text-main);
}

/* ─── U3: Reusable Empty State ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
  text-align: center;
  gap: 8px;
}

.empty-state-icon {
  color: var(--border);
  margin-bottom: 4px;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0;
}

.empty-state-body {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
  margin: 0;
  max-width: 320px;
}

/* Table cell wrapper for empty state — removes default padding */
.empty-state-table-cell {
  padding: 0 !important;
}

/* ─── Row expand toggle button ─── */
.table-expand-toggle-cell {
  width: 36px;
  text-align: center;
  padding: 0 4px;
}

.row-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-light);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color 0.12s, color 0.12s, transform 0.18s;
  padding: 0;
}

.row-expand-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.row-expand-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.row-expand-btn svg {
  transition: transform 0.18s;
  transform: rotate(90deg);
}

.row-expand-btn--open svg {
  transform: rotate(-90deg);
}

/* ─── QuickCalculator Figma-aligned layout ─── */
.quick-calc-sliders {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.quick-calc-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-calc-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-calc-chip-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quick-calc-chip-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}