/* GIA vs ISA vs Pension: aligned with DB CETV / Lifetime Mortgage shell (RetirementCalculators.uk) */

:root {
  --bbduk-ink: #0f172a;
  --bbduk-muted: #475569;
  --bbduk-navy: #083141;
}

#bbduk-root.bbduk-app,
.bbduk-root.bbduk-app {
  width: auto;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 14px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.bbduk-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 30px;
  border: 2px solid rgba(8, 49, 65, 0.18);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.1);
  background: #fff;
  color: var(--bbduk-ink);
}

.bbduk-hero {
  border: 1px solid rgba(8, 49, 65, 0.2);
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(135deg, #fff 0%, #f0f9ff 52%, #e0f2fe 100%);
}

.bbduk-title {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 3.6vw, 2.15rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  letter-spacing: -0.02em;
}

.bbduk-sub {
  margin: 0;
  color: var(--bbduk-muted);
  font-weight: 650;
  line-height: 1.55;
}

.bbduk-hero-context {
  margin: 12px 0 0;
  color: #0c4a6e;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.55;
}

.bbduk-plain-english {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(8, 49, 65, 0.14);
  background: linear-gradient(165deg, #f8fafc 0%, #fff 100%);
}

.bbduk-plain-english__title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 950;
  color: var(--bbduk-navy);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.bbduk-plain-english__list {
  margin: 0;
  padding-left: 1.15rem;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.55;
}

.bbduk-plain-english__list li {
  margin: 0 0 8px;
}

.bbduk-plain-english__list li:last-child {
  margin-bottom: 0;
}

.bbduk-card {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
}

.bbduk-card--inputs {
  border: 2px solid rgba(8, 49, 65, 0.2);
  border-left: 5px solid var(--bbduk-navy);
  background: linear-gradient(165deg, #f1f5f9 0%, #fff 42%);
  box-shadow: 0 6px 22px rgba(8, 49, 65, 0.07);
}

.bbduk-card--inputs .bbduk-h3::before {
  content: "✎";
  display: inline-block;
  margin-right: 8px;
  font-size: 1em;
  opacity: 0.9;
}

.bbduk-h3 {
  margin: 0 0 10px;
  font-size: 1.3rem;
  font-weight: 950;
  color: var(--bbduk-navy);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.bbduk-card-lead {
  margin: -4px 0 14px;
  color: var(--bbduk-muted);
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.55;
}

.bbduk-input-section {
  margin-top: 18px;
  padding: 16px 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(8, 49, 65, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.bbduk-input-section:first-of-type {
  margin-top: 6px;
}

.bbduk-input-section--timeline {
  border-left: 4px solid #0e7490;
  background: linear-gradient(135deg, rgba(236, 254, 255, 0.5) 0%, rgba(255, 255, 255, 0.9) 48%);
}

.bbduk-input-section--contributions {
  margin-top: 22px;
  border-left: 4px solid #4f46e5;
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.55) 0%, rgba(255, 255, 255, 0.92) 50%);
}

.bbduk-input-section .bbduk-input-group-title {
  margin: 0 0 6px;
  font-size: 1.12rem;
  font-weight: 950;
  color: var(--bbduk-navy);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.bbduk-input-section-lead {
  margin: 0 0 14px;
  font-size: 0.84rem;
  font-weight: 650;
  color: #64748b;
  line-height: 1.5;
}

.bbduk-input-section .bbduk-grid {
  margin-top: 0;
}

.bbduk-input-section .bbduk-presets {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(8, 49, 65, 0.1);
}

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

.bbduk-field {
  display: grid;
  gap: 6px;
}

.bbduk-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--bbduk-navy);
}

.bbduk-hint {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: #64748b;
  line-height: 1.45;
}

.bbduk-input {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(8, 49, 65, 0.2);
  border-radius: 12px;
  box-sizing: border-box;
  font-size: max(16px, 1rem);
}

.bbduk-input:focus {
  outline: none;
  border-color: rgba(21, 94, 117, 0.55);
  box-shadow: 0 0 0 5px rgba(21, 94, 117, 0.12);
}

.bbduk-presets {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(8, 49, 65, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bbduk-presets-label {
  font-size: 0.82rem;
  font-weight: 850;
  color: #64748b;
  margin-right: 4px;
}

.bbduk-preset-btn {
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 800;
  background: #fff;
  border: 2px solid rgba(8, 49, 65, 0.18);
  color: var(--bbduk-navy);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.bbduk-preset-btn:hover {
  background: #f8fafc;
  border-color: rgba(21, 94, 117, 0.45);
}

/* Results: DB CETV rhythm */
.bbduk-results {
  margin-top: 24px;
  padding: 20px 16px 8px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(8, 49, 65, 0.12);
}

.bbduk-results-header {
  width: 100%;
  margin: 0 0 16px;
  padding: 0 0 14px;
  border-bottom: 3px solid rgba(8, 49, 65, 0.22);
}

.bbduk-results-heading.bbduk-h3 {
  margin: 0 0 8px;
}

.bbduk-results-lead {
  margin: 0;
  color: var(--bbduk-muted);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.55;
}

.bbduk-illustration-callout {
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 2px solid rgba(217, 119, 6, 0.35);
  background: linear-gradient(145deg, #fffbeb 0%, #fff 55%);
  box-shadow: 0 4px 14px rgba(180, 83, 9, 0.08);
}

.bbduk-illustration-callout__kicker {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b45309;
}

.bbduk-illustration-callout__text {
  margin: 0 0 12px;
  font-size: clamp(0.9rem, 2.2vw, 1rem);
  font-weight: 650;
  color: #451a03;
  line-height: 1.6;
}

.bbduk-illustration-callout__text:last-child {
  margin-bottom: 0;
}

.bbduk-illustration-callout__text a {
  color: #0e7490;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bbduk-illustration-callout__text--warn {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(217, 119, 6, 0.25);
  font-weight: 650;
  color: #78350f;
}

.bbduk-gap-panel {
  margin: 16px 0;
  padding: 18px 20px;
  border-radius: 16px;
  border: 2px solid rgba(21, 94, 117, 0.28);
  background: linear-gradient(135deg, #ecfeff 0%, #f0f9ff 45%, #fff 100%);
  text-align: center;
  box-shadow: 0 6px 20px rgba(8, 49, 65, 0.08);
}

.bbduk-gap-panel__eyebrow {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0e7490;
  margin-bottom: 8px;
}

.bbduk-gap-panel__figure {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-bottom: 10px;
}

.bbduk-gap-panel__text {
  margin: 0;
  font-size: clamp(0.88rem, 2.1vw, 0.98rem);
  font-weight: 650;
  color: #334155;
  line-height: 1.55;
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

.bbduk-visual-board {
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(8, 49, 65, 0.14);
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.08);
  background: #fff;
}

.bbduk-visual-board-intro {
  padding: 16px 18px;
  background: linear-gradient(135deg, #f0f9ff 0%, #fff 55%);
  border-bottom: 1px solid rgba(8, 49, 65, 0.1);
}

.bbduk-visual-board-title {
  margin: 0 0 8px;
  font-size: clamp(1.18rem, 2.85vw, 1.35rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  letter-spacing: -0.02em;
  line-height: 1.28;
}

.bbduk-visual-board-sub {
  margin: 0;
  font-size: clamp(0.86rem, 2vw, 0.95rem);
  font-weight: 650;
  color: #475569;
  line-height: 1.55;
}

/* Pot size bar chart (scaled to largest pot in run) */
.bbduk-pot-chart {
  border-top: 1px solid rgba(8, 49, 65, 0.1);
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 55%);
}

.bbduk-pot-chart__intro {
  margin-bottom: 14px;
}

.bbduk-pot-chart__title {
  margin: 0 0 6px;
  font-size: clamp(1.05rem, 2.55vw, 1.22rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.bbduk-pot-chart__lead {
  margin: 0;
  font-size: clamp(0.82rem, 2vw, 0.92rem);
  font-weight: 650;
  color: #64748b;
  line-height: 1.45;
}

.bbduk-pot-bar-row {
  display: grid;
  grid-template-columns: minmax(4.25rem, 5.25rem) minmax(0, 1fr) minmax(4.5rem, 6.5rem);
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 12px;
}

.bbduk-pot-bar-row:last-child {
  margin-bottom: 0;
}

.bbduk-pot-bar-row__label {
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--bbduk-navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bbduk-pot-bar-row__track {
  height: 16px;
  border-radius: 9px;
  background: rgba(8, 49, 65, 0.09);
  overflow: hidden;
  min-width: 0;
}

.bbduk-pot-bar-row__fill {
  height: 100%;
  min-width: 2px;
  border-radius: 9px;
  transition: width 0.38s ease;
}

.bbduk-pot-bar-row--gia .bbduk-pot-bar-row__fill {
  background: linear-gradient(90deg, #059669, #34d399);
}

.bbduk-pot-bar-row--isa .bbduk-pot-bar-row__fill {
  background: linear-gradient(90deg, #1d4ed8, #60a5fa);
}

.bbduk-pot-bar-row--pen .bbduk-pot-bar-row__fill {
  background: linear-gradient(90deg, #9a3412, #fb923c);
}

.bbduk-pot-bar-row__value {
  font-size: clamp(0.92rem, 2.4vw, 1.05rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 400px) {
  .bbduk-pot-bar-row {
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
    gap: 6px 8px;
  }

  .bbduk-pot-bar-row__value {
    font-size: 0.86rem;
  }
}

.bbduk-visual-columns--triple {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  align-items: stretch;
}

.bbduk-visual-path {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bbduk-visual-path--gia {
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 28%);
  border-right: 1px solid rgba(8, 49, 65, 0.08);
}

.bbduk-visual-path--isa {
  background: linear-gradient(180deg, #eff6ff 0%, #fff 28%);
  border-right: 1px solid rgba(8, 49, 65, 0.08);
}

.bbduk-visual-path--pen {
  background: linear-gradient(180deg, #fff7ed 0%, #fff 28%);
}

.bbduk-visual-path--winner {
  box-shadow: inset 0 0 0 3px rgba(220, 38, 38, 0.55);
  position: relative;
  z-index: 1;
}

.bbduk-visual-path-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-weight: 950;
  font-size: 0.95rem;
  color: #fff;
}

.bbduk-visual-path--gia .bbduk-visual-path-head {
  background: linear-gradient(135deg, #059669, #047857);
}

.bbduk-visual-path--isa .bbduk-visual-path-head {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.bbduk-visual-path--pen .bbduk-visual-path-head {
  background: linear-gradient(135deg, #c2410c, #9a3412);
}

.bbduk-visual-path-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.bbduk-visual-path-name {
  line-height: 1.25;
}

.bbduk-visual-path-tag {
  padding: 8px 16px;
  font-size: 0.72rem;
  font-weight: 750;
  color: #64748b;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(8, 49, 65, 0.06);
}

.bbduk-visual-path--gia .bbduk-visual-path-tag {
  background: rgba(236, 253, 245, 0.95);
}

.bbduk-visual-path--isa .bbduk-visual-path-tag {
  background: rgba(239, 246, 255, 0.95);
}

.bbduk-visual-path--pen .bbduk-visual-path-tag {
  background: rgba(255, 247, 237, 0.95);
}

.bbduk-visual-metrics {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.bbduk-visual-metric {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(8, 49, 65, 0.1);
}

.bbduk-visual-path--gia .bbduk-visual-metric {
  border-left: 3px solid #10b981;
}

.bbduk-visual-path--isa .bbduk-visual-metric {
  border-left: 3px solid #3b82f6;
}

.bbduk-visual-path--pen .bbduk-visual-metric {
  border-left: 3px solid #ea580c;
}

.bbduk-visual-metric-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bbduk-visual-metric-value {
  margin-top: 6px;
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  font-variant-numeric: tabular-nums;
}

.bbduk-visual-metric-note {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 650;
  color: #64748b;
  line-height: 1.35;
}

.bbduk-visual-metric--secondary {
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px dashed rgba(8, 49, 65, 0.12);
}

.bbduk-visual-metric--gain .bbduk-visual-metric-value {
  color: #0f766e;
}

.bbduk-visual-metric-value--sm {
  font-size: clamp(0.95rem, 2.5vw, 1.12rem);
  font-weight: 900;
}

.bbduk-verdict-strip {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 2px solid rgba(88, 28, 135, 0.22);
  background: linear-gradient(145deg, #faf5ff 0%, #fff 45%);
  font-size: clamp(0.92rem, 2.2vw, 1.02rem);
  font-weight: 700;
  color: #4c1d95;
  line-height: 1.55;
  text-align: center;
}

.bbduk-bridge-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.55;
}

.bbduk-bridge-panel--warn {
  background: linear-gradient(145deg, #fffbeb 0%, #fff 50%);
  border: 2px solid rgba(217, 119, 6, 0.35);
  color: #92400e;
}

.bbduk-bridge-panel--ok {
  background: linear-gradient(145deg, #ecfdf5 0%, #fff 50%);
  border: 2px solid rgba(22, 101, 52, 0.28);
  color: #14532d;
}

.bbduk-bridge-panel strong {
  font-weight: 900;
}

.bbduk-card--results {
  margin-top: 16px;
  border: 2px solid rgba(21, 94, 117, 0.2);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 8px 24px rgba(21, 94, 117, 0.08);
}

.bbduk-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin-top: 12px;
}

.bbduk-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.bbduk-table th,
.bbduk-table td {
  border: 1px solid #e2e8f0;
  padding: 10px;
}

.bbduk-table th {
  background: #f1f5f9;
  color: var(--bbduk-navy);
  font-weight: 900;
}

.bbduk-th-neutral {
  background: #f9fafb !important;
}

.bbduk-th-gia {
  background: #d1fae5 !important;
  color: #065f46;
}

.bbduk-th-isa {
  background: #dbeafe !important;
  color: #1e40af;
}

.bbduk-th-pen {
  background: #ffedd5 !important;
  color: #9a3412;
}

.bbduk-td-neutral {
  font-weight: 650;
  color: #334155;
}

.bbduk-td-gia {
  background: #f0fdf4;
  font-weight: 650;
  color: #065f46;
}

.bbduk-td-isa {
  background: #eff6ff;
  font-weight: 650;
  color: #1e40af;
}

.bbduk-td-pen {
  background: #fff7ed;
  font-weight: 650;
  color: #9a3412;
}

.bbduk-table tbody tr:nth-child(even) .bbduk-td-gia {
  background: #ecfdf5;
}

.bbduk-table tbody tr:nth-child(even) .bbduk-td-isa {
  background: #e0f2fe;
}

.bbduk-table tbody tr:nth-child(even) .bbduk-td-pen {
  background: #ffedd5;
}

.bbduk-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bbduk-mechanics-details {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(8, 49, 65, 0.22);
  background: #fafafa;
}

.bbduk-mechanics-summary {
  cursor: pointer;
  padding: 16px 18px;
  font-size: clamp(1.1rem, 2.55vw, 1.22rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  list-style: none;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.bbduk-mechanics-summary::-webkit-details-marker {
  display: none;
}

.bbduk-mechanics-body {
  padding: 0 18px 20px;
}

.bbduk-mechanics-body .bbduk-table-wrap--rules {
  margin-top: 0;
}

.bbduk-methodology-details {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid rgba(21, 94, 117, 0.22);
  background: linear-gradient(165deg, #f0fdfa 0%, #fff 55%);
  box-shadow: 0 4px 18px rgba(2, 6, 23, 0.06);
}

.bbduk-methodology-summary {
  cursor: pointer;
  padding: 16px 18px;
  font-size: clamp(1.02rem, 2.45vw, 1.15rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  list-style: none;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.bbduk-methodology-summary::-webkit-details-marker {
  display: none;
}

.bbduk-methodology-body {
  padding: 0 18px 18px;
}

.bbduk-methodology-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #334155;
  font-size: clamp(0.88rem, 2vw, 0.95rem);
  font-weight: 650;
  line-height: 1.55;
}

.bbduk-methodology-list li {
  margin-bottom: 10px;
}

.bbduk-methodology-list li:last-child {
  margin-bottom: 0;
}

.bbduk-rules-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: clamp(0.94rem, 2.1vw, 1.05rem);
}

.bbduk-rules-table th,
.bbduk-rules-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  line-height: 1.55;
}

.bbduk-rules-table th {
  background: #f8fafc;
  color: var(--bbduk-navy);
  text-align: left;
}

.bbduk-rules-table thead th {
  font-size: clamp(0.98rem, 2.2vw, 1.08rem);
  font-weight: 900;
  padding-bottom: 14px;
}

.bbduk-rules-table tbody th {
  font-weight: 800;
  font-size: clamp(0.95rem, 2.1vw, 1.02rem);
}

.bbduk-rules-table td {
  font-weight: 650;
  color: #334155;
}

.bbduk-rh-gia {
  background: rgba(5, 150, 105, 0.08);
}

.bbduk-rh-isa {
  background: rgba(37, 99, 235, 0.08);
}

.bbduk-rh-pen {
  background: rgba(194, 65, 12, 0.08);
}

.bbduk-results-footnote {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(254, 243, 199, 0.45);
  border: 1px solid rgba(217, 119, 6, 0.22);
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.45;
}

.bbduk-export {
  margin-top: 20px;
  padding: 20px;
  border-radius: 16px;
  border: 2px solid rgba(21, 94, 117, 0.3);
  background: linear-gradient(135deg, #fff 0%, #ecfeff 100%);
  text-align: center;
}

.bbduk-export-title {
  margin: 0 0 8px;
  color: var(--bbduk-navy);
  font-size: clamp(1.22rem, 3.25vw, 1.58rem);
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.bbduk-export-sub {
  margin: 0 0 14px;
  color: var(--bbduk-muted);
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.5;
}

.bbduk-export-btn {
  width: 100%;
  max-width: 420px;
  padding: 17px 18px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #0e7490 0%, #155e75 55%, #164e63 100%);
  box-shadow: 0 6px 0 #0c4a5f, 0 16px 34px rgba(21, 94, 117, 0.35);
}

.bbduk-export-btn:hover {
  filter: brightness(1.03);
}

.bbduk-export-btn:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #0c4a5f, 0 8px 20px rgba(21, 94, 117, 0.28);
}

/* Modal: DB CETV */
.bbduk-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
  overflow-y: auto;
}

.bbduk-modal {
  width: 100%;
  max-width: 560px;
  max-height: min(92vh, calc(100dvh - 32px));
  background: #fff;
  border: 3px solid var(--bbduk-navy);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.bbduk-modal-header {
  padding: 22px;
  background: linear-gradient(135deg, var(--bbduk-navy), #0a4a5f);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bbduk-modal-header-text {
  flex: 1;
  min-width: 0;
}

.bbduk-modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.22rem, 4.2vw, 1.55rem);
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.bbduk-modal-header-sub {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.875rem;
  font-weight: 550;
  line-height: 1.45;
}

.bbduk-modal-close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.bbduk-modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.bbduk-modal-lead {
  margin: 0 0 14px;
  color: #1e293b;
  font-weight: 650;
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  line-height: 1.55;
}

.bbduk-modal-label {
  display: block;
  margin: 10px 0 7px;
  font-weight: 900;
  color: #0f172a;
  font-size: 0.95rem;
}

.bbduk-modal-input {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(8, 49, 65, 0.28);
  border-radius: 12px;
  box-sizing: border-box;
  font-size: max(16px, 1rem);
}

.bbduk-modal-error {
  margin-top: 10px;
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.92rem;
}

.bbduk-modal-footer {
  padding: 18px 22px;
  background: #ecfeff;
  border-top: 2px solid rgba(21, 94, 117, 0.22);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.bbduk-modal-submit {
  flex: 1 1 auto;
  min-width: min(100%, 240px);
  min-height: 54px;
  border-radius: 14px;
  border: 2px solid #0c4a5f;
  background: linear-gradient(180deg, #0e7490 0%, #155e75 55%, #164e63 100%);
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.bbduk-modal-secondary {
  border: 2px solid rgba(8, 49, 65, 0.25);
  background: #fff;
  color: var(--bbduk-navy);
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 850;
  cursor: pointer;
  min-height: 54px;
}

.bbduk-modal-success {
  margin: 0;
  padding: 8px 0;
  text-align: center;
  color: #059669;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .bbduk-visual-columns--triple {
    grid-template-columns: 1fr;
  }

  .bbduk-visual-path--gia,
  .bbduk-visual-path--isa {
    border-right: none;
    border-bottom: 1px solid rgba(8, 49, 65, 0.08);
  }

  .bbduk-modal-overlay {
    align-items: flex-start;
    padding-top: max(12px, env(safe-area-inset-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  .bbduk-pot-bar-row__fill {
    transition: none;
  }

  .bbduk-metric-tile {
    transition: none;
  }

  .bbduk-metric-tile:hover {
    transform: none;
  }
}

@media (max-width: 520px) {
  #bbduk-root.bbduk-app,
  .bbduk-root.bbduk-app {
    padding: 0 10px;
  }

  .bbduk-shell {
    padding: 16px 12px 22px;
    border-radius: 16px;
  }

  .bbduk-hero {
    padding: 16px;
    border-radius: 14px;
  }

  .bbduk-card {
    padding: 14px;
  }

  .bbduk-results {
    padding: 16px 12px 2px;
    border-radius: 14px;
  }

  .bbduk-pot-chart {
    padding: 14px 12px 16px;
  }

  .bbduk-methodology-summary {
    padding: 14px 14px;
  }

  .bbduk-methodology-body {
    padding: 0 14px 14px;
  }

  .bbduk-export {
    padding: 16px 14px;
  }

  .bbduk-export-btn {
    max-width: none;
  }

  .bbduk-modal-header,
  .bbduk-modal-body,
  .bbduk-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .bbduk-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .bbduk-modal-submit,
  .bbduk-modal-secondary {
    width: 100%;
    min-width: 0;
  }

  .bbduk-metric-section {
    padding: 16px 14px 18px;
    border-radius: 16px;
  }

  .bbduk-strategy-spotlight {
    padding: 16px 14px;
  }

  .bbduk-table.bbduk-table--wide {
    min-width: 100%;
  }
}

/* Borrow / sell layout (verdict metrics, radios, checkbox) */
.bbduk-verdict-strip--mvp {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 22px;
  text-align: left;
}

.bbduk-verdict-item {
  flex: 1 1 148px;
  min-width: 120px;
  max-width: 220px;
}

.bbduk-verdict-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  color: #6b21a8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bbduk-verdict-value {
  display: block;
  margin-top: 4px;
  font-size: clamp(0.92rem, 2.1vw, 1.05rem);
  font-weight: 950;
  color: #312e81;
  font-variant-numeric: tabular-nums;
}

.bbduk-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 8px;
}

.bbduk-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--bbduk-navy);
  cursor: pointer;
}

.bbduk-radio-label input {
  width: auto;
  margin: 0;
  accent-color: #155e75;
}

.bbduk-field--full {
  grid-column: 1 / -1;
}

.bbduk-field--iht-toggle {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.bbduk-checkbox {
  width: auto;
  max-width: 28px;
  height: 1.15rem;
  margin-top: 4px;
  accent-color: #155e75;
}

.bbduk-compare-note {
  margin: 14px 0 0;
  font-size: 0.86rem;
  font-weight: 650;
  color: #475569;
  line-height: 1.55;
}

.bbduk-warning {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(254, 243, 199, 0.55);
  border: 1px solid rgba(217, 119, 6, 0.35);
  color: #92400e;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.45;
}

/* Results: theory block + metric tiles + compare panel */
.bbduk-results-heading--first {
  margin-top: 0;
}

.bbduk-h3.bbduk-results-heading.bbduk-results-heading--table {
  margin-top: 28px;
  margin-bottom: 8px;
}

.bbduk-theory-card {
  margin-top: 14px;
  margin-bottom: 4px;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(21, 94, 117, 0.2);
  background: linear-gradient(155deg, #e0f2fe 0%, #f8fafc 38%, #fff 70%);
  box-shadow: 0 6px 28px rgba(14, 116, 144, 0.1);
}

.bbduk-theory-card-title {
  margin: 0 0 10px;
  font-size: clamp(1rem, 2.4vw, 1.12rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.bbduk-theory-card-body {
  margin: 0;
  font-size: clamp(0.88rem, 2.1vw, 0.96rem);
  font-weight: 650;
  color: #334155;
  line-height: 1.6;
}

.bbduk-metric-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.bbduk-metric-tile {
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  border-top: 3px solid rgba(21, 94, 117, 0.35);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bbduk-metric-tile:hover {
  box-shadow: 0 8px 26px rgba(14, 116, 144, 0.12), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transform: translateY(-1px);
}

.bbduk-metric-tile-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 850;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

.bbduk-metric-tile-value {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.05rem, 2.7vw, 1.28rem);
  font-weight: 950;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.bbduk-metric-tile-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  font-weight: 650;
  color: #64748b;
  line-height: 1.45;
}

.bbduk-compare-panel {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 2px solid rgba(21, 94, 117, 0.2);
  background: linear-gradient(145deg, #ecfdf5 0%, #fff 55%);
}

.bbduk-compare-panel-title {
  margin: 0 0 8px;
  font-size: clamp(0.98rem, 2.3vw, 1.08rem);
  font-weight: 950;
  color: #14532d;
  letter-spacing: -0.02em;
}

.bbduk-compare-panel-body {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: #166534;
  line-height: 1.55;
}

/* Optional IHT toggle + borrow/sell IHT comparison table */
.bbduk-iht-option {
  display: flex;
  align-items: flex-start;
  gap: 16px 20px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(88, 28, 135, 0.18);
  background: linear-gradient(145deg, #faf5ff 0%, #fff 50%);
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.04);
}

.bbduk-iht-option-text {
  flex: 1 1 220px;
  min-width: 0;
}

.bbduk-iht-option-kicker {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b21a8;
  background: rgba(147, 51, 234, 0.12);
}

.bbduk-iht-option-title {
  display: block;
  font-size: clamp(0.98rem, 2.3vw, 1.08rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.bbduk-iht-option-desc {
  margin: 8px 0 0;
  font-size: 0.84rem;
  font-weight: 650;
  color: #475569;
  line-height: 1.55;
}

.bbduk-iht-switch {
  position: relative;
  flex-shrink: 0;
  align-self: center;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.bbduk-iht-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bbduk-iht-switch-track {
  display: block;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s ease;
}

.bbduk-iht-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.bbduk-iht-switch-input:focus-visible + .bbduk-iht-switch-track {
  outline: 3px solid rgba(21, 94, 117, 0.45);
  outline-offset: 3px;
}

.bbduk-iht-switch-input:checked + .bbduk-iht-switch-track {
  background: linear-gradient(180deg, #0e7490 0%, #155e75 100%);
}

.bbduk-iht-switch-input:checked + .bbduk-iht-switch-track .bbduk-iht-switch-thumb {
  transform: translateX(24px);
}

.bbduk-iht-compare-panel {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(30, 41, 59, 0.14);
  background: linear-gradient(165deg, #f8fafc 0%, #fff 55%);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.bbduk-iht-compare-title {
  margin: 0 0 10px;
  font-size: clamp(1.02rem, 2.4vw, 1.12rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  letter-spacing: -0.02em;
}

.bbduk-iht-compare-lead {
  margin: 0 0 14px;
  font-size: 0.86rem;
  font-weight: 650;
  color: #475569;
  line-height: 1.55;
}

.bbduk-table-wrap--iht-compare {
  margin-top: 0;
}

.bbduk-compare-iht-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.bbduk-compare-iht-table th,
.bbduk-compare-iht-table td {
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  vertical-align: top;
  line-height: 1.45;
}

.bbduk-compare-iht-table thead th {
  background: #f1f5f9;
  font-weight: 900;
  color: var(--bbduk-navy);
}

.bbduk-compare-iht-corner {
  background: #f8fafc !important;
  width: 34%;
}

.bbduk-compare-iht-rowhead {
  text-align: left;
  font-weight: 800;
  color: #334155;
  background: #fafafa;
}

.bbduk-table-caption {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 650;
  color: #64748b;
  line-height: 1.5;
  max-width: 72ch;
}

.bbduk-table.bbduk-table--wide {
  min-width: 720px;
}

/* Strategy spotlight + metric deck */
.bbduk-strategy-spotlight {
  margin-top: 20px;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 45%, #fff 100%);
  box-shadow: 0 6px 24px rgba(180, 83, 9, 0.12);
}

.bbduk-strategy-spotlight-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9a3412;
  background: rgba(251, 191, 36, 0.35);
  border: 1px solid rgba(217, 119, 6, 0.35);
}

.bbduk-strategy-spotlight-title {
  margin: 0 0 10px;
  font-size: clamp(1.02rem, 2.5vw, 1.18rem);
  font-weight: 950;
  color: #7c2d12;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.bbduk-strategy-spotlight-body {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: #78350f;
  line-height: 1.6;
}

.bbduk-strategy-spotlight-legal {
  color: #92400e;
}

.bbduk-metric-section {
  margin-top: 22px;
  padding: 22px 20px 24px;
  border-radius: 20px;
  border: 1px solid rgba(21, 94, 117, 0.18);
  background: linear-gradient(165deg, #ecfeff 0%, #f0fdfa 35%, #fff 78%);
  box-shadow: 0 8px 32px rgba(14, 116, 144, 0.1);
}

.bbduk-metric-section-head {
  margin-bottom: 4px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(21, 94, 117, 0.15);
}

.bbduk-metric-section-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0e7490;
}

.bbduk-metric-section-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  font-weight: 950;
  color: var(--bbduk-navy);
  letter-spacing: -0.02em;
}

.bbduk-metric-tile--lead {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #fff 0%, #ecfeff 55%, #f0fdfa 100%);
  border-color: rgba(14, 116, 144, 0.28);
  border-top-width: 4px;
  border-top-color: #0e7490;
}

.bbduk-metric-tile--lead .bbduk-metric-tile-value {
  color: #155e75;
  font-size: clamp(1.12rem, 2.9vw, 1.38rem);
}

.bbduk-metric-tile--iht {
  border-top-color: #7c3aed;
  background: linear-gradient(180deg, #faf5ff 0%, #fff 55%);
}

.bbduk-metric-tile--iht .bbduk-metric-tile-value {
  color: #5b21b6;
}

/* Audit: accessibility, errors, motion, small screens */
.bbduk-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bbduk-results-error {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(185, 28, 28, 0.45);
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}
