/* ==========================================================================
   Jan Michael Maglinao, CPA · Accounting & Advisory
   Philippine Individual Tax Regime Optimizer · Fully Fluid Responsive Stylesheet
   ========================================================================== */

/* Universal Fluid Reset for Optimizer */
.optimizer-section *,
.optimizer-section *::before,
.optimizer-section *::after {
  box-sizing: border-box;
  min-width: 0;
}

/* Fluid Container */
.optimizer-container {
  width: 100%;
  max-width: 1380px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 3.5vw, 2.5rem);
  padding-right: clamp(1rem, 3.5vw, 2.5rem);
}

/* Internal Review Banner */
.review-mode-banner {
  background: linear-gradient(90deg, #1e2834 0%, #2a3849 100%);
  color: #f4f1ea;
  padding: 0.65rem clamp(1rem, 3vw, 2rem);
  font-size: 0.82rem;
  border-bottom: 2px solid var(--color-brass);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 100;
  position: relative;
}
.review-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(164, 148, 114, 0.25);
  border: 1px solid var(--color-brass);
  color: #f7f6f4;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.review-mode-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.review-btn-pill {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 3px 10px;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.review-btn-pill:hover {
  background-color: var(--color-brass);
  color: var(--color-navy-dark);
  border-color: var(--color-brass);
}

/* Tool Hero Section */
.tool-hero {
  background: linear-gradient(180deg, #f7f6f4 0%, #ffffff 100%);
  border-bottom: 1px solid var(--color-line);
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem);
}
.tool-hero-inner {
  max-width: 960px;
}
.tool-hero h1 {
  margin-top: 0.85rem;
  font-size: clamp(1.85rem, 4.2vw, 3.2rem);
  color: var(--color-navy);
  line-height: 1.18;
}
.tool-hero .lead {
  font-size: clamp(0.98rem, 1.8vw, 1.18rem);
  color: #4a5568;
  margin-top: 1rem;
  line-height: 1.6;
}
.hero-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.35rem;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-paper);
  border: 1px solid var(--color-line);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-navy);
}
.stat-pill svg {
  color: var(--color-brass-text);
  flex-shrink: 0;
}

/* Optimizer Workspace Layout */
.optimizer-section {
  padding: clamp(1.75rem, 4vw, 4rem) 0 clamp(3rem, 6vw, 6rem);
  background-color: #fdfdfc;
  width: 100%;
}
.optimizer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.75rem, 3vw, 2.75rem);
  width: 100%;
}
@media (min-width: 1024px) {
  .optimizer-grid {
    grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
    align-items: start;
    gap: 2.25rem;
  }
}
@media (min-width: 1280px) {
  .optimizer-grid {
    grid-template-columns: minmax(380px, 430px) minmax(0, 1fr);
    gap: 2.75rem;
  }
}
@media (min-width: 1536px) {
  .optimizer-grid {
    grid-template-columns: minmax(420px, 470px) minmax(0, 1fr);
    gap: 3.5rem;
  }
}

/* Quick Anchor Jump Bar for Mobile/Tablet */
.mobile-jump-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-line);
}
@media (min-width: 1024px) {
  .mobile-jump-nav {
    display: none;
  }
}
.jump-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: var(--color-paper);
  border: 1px solid var(--color-line);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--color-navy);
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.2s ease;
}
.jump-chip:hover, .jump-chip.active {
  background-color: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}

/* Controls Panel */
.controls-panel {
  background-color: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  width: 100%;
}
@media (min-width: 1024px) {
  .controls-panel {
    position: sticky;
    top: calc(var(--header-height) + 16px);
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
  }
}
.controls-header {
  background-color: var(--color-navy);
  color: #ffffff;
  padding: 1.15rem clamp(1.15rem, 2vw, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: calc(var(--radius-lg) - 1px);
  border-top-right-radius: calc(var(--radius-lg) - 1px);
  flex-shrink: 0;
}
.controls-header h2 {
  font-size: clamp(1.05rem, 1.8vw, 1.18rem);
  color: #ffffff;
  margin: 0;
}
.controls-header .reset-btn {
  background: none;
  border: none;
  color: var(--color-brass-light);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}
.controls-header .reset-btn:hover {
  color: #ffffff;
}
.controls-body {
  padding: clamp(1.2rem, 2.5vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 1.45rem;
}
@media (min-width: 1024px) {
  .controls-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-grow: 1;
  }
}

/* Form Controls & Toggles */
.control-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}
.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  gap: 0.5rem;
}
.control-hint {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--color-muted);
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
}
.control-desc {
  font-size: 0.8rem;
  color: #5a6472;
  line-height: 1.45;
  margin-top: -0.15rem;
}

/* Segmented Buttons */
.segmented-control {
  display: flex;
  flex-wrap: wrap;
  background-color: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  width: 100%;
}
.segmented-btn {
  flex: 1 1 calc(50% - 3px);
  min-width: 110px;
  background: none;
  border: none;
  padding: 0.55rem 0.5rem;
  border-radius: 3px;
  font-family: var(--font-base);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-ink);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  line-height: 1.25;
}
.segmented-btn:hover {
  background-color: rgba(255, 255, 255, 0.6);
}
.segmented-btn.active {
  background-color: var(--color-navy);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(42, 56, 73, 0.2);
}

/* Currency Input Field & Presets */
.input-currency-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.currency-symbol {
  position: absolute;
  left: 0.85rem;
  font-family: var(--font-base);
  font-weight: 700;
  color: var(--color-brass-text);
  font-size: 1.1rem;
  pointer-events: none;
}
.currency-input {
  width: 100%;
  padding: 0.75rem 0.85rem 0.75rem 2.15rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  font-family: var(--font-base);
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 700;
  color: var(--color-navy);
  background-color: #ffffff;
  transition: all 0.2s ease;
}
.currency-input:focus {
  outline: none;
  border-color: var(--color-brass);
  box-shadow: 0 0 0 3px rgba(164, 148, 114, 0.18);
}
.quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
  width: 100%;
}
.quick-chip {
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line);
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.quick-chip:hover {
  background-color: var(--color-brass-light);
  border-color: var(--color-brass);
  color: var(--color-navy);
}
.quick-chip.active {
  background-color: var(--color-brass);
  color: var(--color-navy-dark);
  border-color: var(--color-brass);
  font-weight: 700;
}

/* Custom Range Slider */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
  width: 100%;
}
.custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #d8dadf;
  outline: none;
  cursor: pointer;
}
.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-brass);
  border: 2px solid var(--color-navy);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}
.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.custom-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-brass);
  border: 2px solid var(--color-navy);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--color-muted);
}

/* Toggle Switch Control */
.switch-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line);
  padding: 0.8rem clamp(0.75rem, 1.5vw, 1rem);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
}
.switch-control:hover {
  background-color: var(--color-paper);
}
.switch-control.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f0f0f0;
}
.switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
}
.switch-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.3;
}
.switch-sub {
  font-size: 0.72rem;
  color: var(--color-muted);
  line-height: 1.35;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-switch {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: .25s;
  border-radius: 24px;
}
.slider-switch:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
input:checked + .slider-switch {
  background-color: var(--color-brass);
}
input:checked + .slider-switch:before {
  transform: translateX(20px);
}

/* Results & Analysis Container */
.results-container {
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 3vw, 2.5rem);
  width: 100%;
}

/* The Champion Banner */
.champion-card {
  background: linear-gradient(135deg, #1e2834 0%, #2a3849 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-brass);
  box-shadow: 0 12px 30px rgba(30, 40, 52, 0.18);
  position: relative;
  overflow: hidden;
  padding: clamp(1.4rem, 3.5vw, 2.25rem);
  width: 100%;
}
.champion-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(164, 148, 114, 0.24) 0%, rgba(164, 148, 114, 0) 70%);
  pointer-events: none;
}
.champion-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 1.15rem;
}
.champion-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, #a49472 0%, #8f8060 100%);
  color: #1e2834;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.champion-tag {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
}
.champion-body {
  margin-top: 1.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
}
.champion-body-main {
  flex: 1 1 300px;
}
.champion-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  color: #ffffff;
  margin-bottom: 0.45rem;
  line-height: 1.22;
}
.champion-desc {
  font-size: clamp(0.86rem, 1.5vw, 0.94rem);
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
}
.champion-savings-box {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(164, 148, 114, 0.4);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-align: center;
  flex: 0 1 250px;
  min-width: 200px;
  width: 100%;
}
.savings-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-brass-light);
  font-weight: 700;
}
.savings-value {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: #f4f1ea;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.15;
}
.savings-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
}

/* Voluntary VAT Advisory Callout Banner */
.voluntary-vat-advisory {
  background: linear-gradient(135deg, #fdfaf2 0%, #f7f3e8 100%);
  border: 1.5px solid var(--color-brass);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  box-shadow: 0 4px 14px rgba(164, 148, 114, 0.12);
  width: 100%;
}
.voluntary-vat-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-brass);
  color: var(--color-navy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.95rem;
}
.voluntary-vat-text h4 {
  font-size: 0.95rem;
  color: var(--color-navy);
  margin-bottom: 0.25rem;
  font-weight: 700;
}
.voluntary-vat-text p {
  font-size: 0.82rem;
  color: #4a5568;
  line-height: 1.5;
  margin: 0;
}

/* Regime Comparison Cards Grid */
.regimes-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  width: 100%;
}
.regime-card {
  background-color: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: clamp(1.2rem, 2vw, 1.5rem);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  width: 100%;
}
.regime-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(42, 56, 73, 0.25);
}
.regime-card.is-winner {
  border: 2px solid var(--color-brass);
  background: linear-gradient(180deg, #faf9f6 0%, #ffffff 100%);
  box-shadow: 0 6px 20px rgba(164, 148, 114, 0.16);
}
.regime-card.is-disqualified {
  opacity: 0.65;
  background-color: #fcfcfc;
  border-style: dashed;
}

/* Regime Card Header (Fixes comment 3: Prevents badge overflowing card boundary) */
.regime-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  width: 100%;
}
.regime-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
.regime-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--color-navy);
  font-weight: 700;
  line-height: 1.28;
}
.regime-sec-cite {
  font-size: 0.68rem;
  color: var(--color-muted);
  font-family: monospace;
  margin-top: 2px;
}
.regime-status-badge {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: normal;
  text-align: right;
  line-height: 1.2;
  max-width: 125px;
  flex-shrink: 0;
  word-break: break-word;
}
.regime-status-badge.badge-winner {
  background-color: var(--color-brass-light);
  color: var(--color-brass-text);
  border: 1px solid var(--color-brass);
}
.regime-status-badge.badge-eligible {
  background-color: var(--color-paper);
  color: var(--color-navy);
  border: 1px solid var(--color-line);
}
.regime-status-badge.badge-disqualified {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Primary Metric Box */
.regime-tax-box {
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 1.15rem;
}
.regime-card.is-winner .regime-tax-box {
  background-color: var(--color-brass-light);
  border-color: rgba(164, 148, 114, 0.4);
}
.tax-total-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  font-weight: 600;
}
.tax-total-figure {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.55rem);
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.2;
  margin-top: 2px;
}
.tax-net-remit {
  font-size: 0.78rem;
  color: #4a5568;
  margin-top: 4px;
}

/* Breakdown Line Items */
.regime-details-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  flex-grow: 1;
}
.details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #4a5568;
  gap: 0.5rem;
}
.details-row.highlight {
  font-weight: 700;
  color: var(--color-navy);
}

/* Complexity & Admin Tags */
.regime-compliance-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--color-muted);
}
.compliance-tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.complexity-pill {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.complexity-pill.low {
  background-color: #dcfce7;
  color: #15803d;
}
.complexity-pill.medium {
  background-color: #fef3c7;
  color: #b45309;
}
.complexity-pill.high {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* Audit Comparative Table (Non-scrollable, fits 100% width cleanly per Comment 5 & 6) */
.audit-table-wrapper {
  background-color: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-top: 0.85rem;
  width: 100%;
  overflow: hidden; /* No side-scrolling! */
}
.audit-table {
  width: 100%;
  table-layout: fixed; /* Evenly distributes columns across 100% of container width */
  border-collapse: collapse;
  font-size: clamp(0.7rem, 1vw, 0.82rem);
  text-align: left;
}
.audit-table th, .audit-table td {
  padding: clamp(0.45rem, 0.9vw, 0.75rem) clamp(0.25rem, 0.6vw, 0.6rem);
  border-bottom: 1px solid var(--color-line);
  vertical-align: middle;
  word-wrap: break-word;
}
.audit-table th {
  background-color: var(--color-navy);
  color: #ffffff;
  font-family: var(--font-base);
  font-size: clamp(0.68rem, 0.95vw, 0.78rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.25;
}
.audit-table th:first-child, .audit-table td:first-child {
  text-align: left;
  width: 28%;
  font-weight: 600;
  padding-left: clamp(0.5rem, 1.2vw, 0.85rem);
}
.audit-table th:not(:first-child), .audit-table td:not(:first-child) {
  text-align: right;
  padding-right: clamp(0.4rem, 1vw, 0.75rem);
}
/* Winning Column Header: High contrast Bluewood Dark with Brass border & pure white text (Fixes comment 6) */
.audit-table th.col-winner {
  background-color: var(--color-navy-dark) !important;
  color: #ffffff !important;
  border-top: 3px solid var(--color-brass);
  border-left: 2px solid var(--color-brass);
  border-right: 2px solid var(--color-brass);
}
.audit-table th.col-winner small {
  color: var(--color-brass-light) !important;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
}
/* Winning Column Data Cells: Warm paper background with dark navy text */
.audit-table td.col-winner {
  background-color: #f7f5f0 !important;
  color: var(--color-navy) !important;
  font-weight: 700;
  border-left: 2px solid var(--color-brass);
  border-right: 2px solid var(--color-brass);
}
.audit-table tr:hover td {
  background-color: var(--color-paper-light);
}
.audit-table tr:hover td.col-winner {
  background-color: #f1ede3 !important;
}
.audit-table td.money {
  font-family: monospace;
  font-size: clamp(0.72rem, 1vw, 0.88rem);
  font-weight: 700;
}
.audit-table tr.total-row td {
  background-color: var(--color-paper);
  font-weight: 800;
  color: var(--color-navy);
  border-top: 2px solid var(--color-navy);
  border-bottom: 2px solid var(--color-navy);
}

/* Break-Even & Sensitivity Analysis Box */
.sensitivity-card {
  background-color: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-sm);
  width: 100%;
}
.sensitivity-card h3 {
  font-size: clamp(1.15rem, 2vw, 1.3rem);
  color: var(--color-navy);
  margin-bottom: 0.4rem;
}
.sensitivity-meter-wrapper {
  margin: 1.5rem 0 1rem;
  width: 100%;
}
.sensitivity-bar {
  height: 14px;
  background-color: var(--color-paper);
  border-radius: 7px;
  position: relative;
  overflow: visible;
  width: 100%;
}
.sensitivity-fill {
  height: 100%;
  background: linear-gradient(90deg, #2a3849 0%, #a49472 100%);
  border-radius: 7px;
  transition: width 0.3s ease;
}
.sensitivity-marker {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 26px;
  background-color: #b91c1c;
  transform: translateX(-50%);
  border-radius: 2px;
}
.marker-tooltip {
  position: absolute;
  bottom: 28px;
  transform: translateX(-50%);
  background-color: var(--color-navy-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
}
.marker-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: var(--color-navy-dark) transparent transparent transparent;
}
.sensitivity-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--color-muted);
  margin-top: 0.65rem;
}

/* Compliance Alerts & Caveats */
.alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.15rem;
  width: 100%;
}
.compliance-alert {
  background-color: var(--color-paper-card);
  border: 1px solid var(--color-line);
  border-left: 4px solid var(--color-brass);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  width: 100%;
}
.compliance-alert.warning {
  border-left-color: #d97706;
  background-color: #fffbeb;
}
.compliance-alert.danger {
  border-left-color: #dc2626;
  background-color: #fef2f2;
}
.compliance-alert h4 {
  font-size: 0.92rem;
  color: var(--color-navy);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}
.compliance-alert p {
  font-size: 0.82rem;
  color: #4b5563;
  line-height: 1.5;
  margin: 0;
}

/* Filing Checklist Tabs */
.checklist-box {
  background-color: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  width: 100%;
}
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-line);
}
.checklist-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.check-badge {
  background-color: var(--color-brass-light);
  color: var(--color-navy);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
}
.checklist-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.checklist-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.35;
}
.checklist-desc {
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.45;
}

/* Lead Capture CTA Banner */
.lead-capture-section {
  background: linear-gradient(135deg, var(--color-navy-dark) 0%, var(--color-navy) 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 3.25rem);
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  width: 100%;
}
.lead-capture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  width: 100%;
}
.lead-capture-content h3 {
  color: #ffffff;
  font-size: clamp(1.4rem, 2.5vw, 2.1rem);
  line-height: 1.25;
}
.lead-capture-content p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.94rem;
  margin-top: 0.75rem;
}
.lead-capture-form {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  color: var(--color-ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  width: 100%;
}
.lead-capture-form h4 {
  font-size: 1.15rem;
  color: var(--color-navy);
  margin-bottom: 0.35rem;
}
.lead-capture-form p {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 1.15rem;
}

/* Mobile Live Summary Bottom Sticky Bar */
.mobile-live-summary-bar {
  display: none;
}
@media (max-width: 1023px) {
  .mobile-live-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: #1e2834;
    color: #fff;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
    border-top: 2px solid var(--color-brass);
  }
  .live-summary-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .live-summary-winner {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-brass-light);
  }
  .live-summary-tax {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.8);
  }
  .live-summary-btn {
    font-size: 0.76rem !important;
    padding: 0.45rem 0.85rem !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  /* Offset footer space so sticky bar doesn't obscure content */
  .optimizer-section {
    padding-bottom: 5rem;
  }
}

/* Printable Memorandum Styles (@media print) */
#printable-memo-wrapper {
  display: none;
}

@media print {
  .review-mode-banner,
  .top-bar,
  #site-header,
  .tool-hero,
  .controls-panel,
  .lead-capture-section,
  #site-footer,
  #sticky-call-bar,
  .mobile-live-summary-bar,
  .mobile-jump-nav,
  .optimizer-grid,
  .hero-actions,
  button,
  .btn {
    display: none !important;
  }

  body {
    background-color: #ffffff !important;
    color: #111827 !important;
    font-size: 10pt;
    line-height: 1.4;
  }

  #printable-memo-wrapper {
    display: block !important;
    padding: 0;
    margin: 0;
    width: 100%;
  }

  .memo-header {
    border-bottom: 2px solid #2a3849;
    padding-bottom: 12pt;
    margin-bottom: 14pt;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
  .memo-firm-name {
    font-family: 'Merriweather', serif;
    font-size: 18pt;
    font-weight: 700;
    color: #2a3849;
  }
  .memo-firm-sub {
    font-size: 9pt;
    font-weight: 700;
    color: #a49472;
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }
  .memo-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8pt;
    background-color: #f7f6f4;
    padding: 10pt;
    border: 1pt solid #ccc;
    font-size: 8.5pt;
    margin-bottom: 14pt;
  }
  .memo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
    margin-bottom: 14pt;
  }
  .memo-table th, .memo-table td {
    border: 1pt solid #ccc;
    padding: 5pt 7pt;
  }
  .memo-table th {
    background-color: #2a3849;
    color: #fff;
    font-weight: 700;
  }
  .memo-table td.money {
    text-align: right;
    font-family: monospace;
    font-weight: 600;
  }
  .memo-callout {
    border-left: 3pt solid #a49472;
    background-color: #fcfbf9;
    padding: 8pt 10pt;
    font-size: 8.5pt;
    margin-bottom: 12pt;
  }
  .memo-footer {
    border-top: 1pt solid #ccc;
    padding-top: 8pt;
    margin-top: 16pt;
    font-size: 7.5pt;
    color: #666;
    text-align: justify;
  }
}
