/**
 * GovTender PRO - FAR 52.219-14 Self-Performance Calculator Stylesheet
 * High-performance, modern GovTech aesthetic honoring design tokens:
 * #0F172A Navy, #2563EB Blue, #059669 Emerald, #DC2626 Crimson, #D97706 Amber
 */

:root {
  --navy-950: #020617;
  --navy-900: #0F172A;
  --navy-850: #131E35;
  --navy-800: #1E293B;
  --navy-700: #334155;
  --navy-600: #475569;

  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-500: #3B82F6;
  --blue-100: #DBEAFE;
  --blue-50: #EFF6FF;

  --emerald-600: #059669;
  --emerald-500: #10B981;
  --emerald-100: #D1FAE5;
  --emerald-50: #ECFDF5;

  --crimson-600: #DC2626;
  --crimson-500: #EF4444;
  --crimson-100: #FEE2E2;
  --crimson-50: #FEF2F2;

  --amber-600: #D97706;
  --amber-500: #F59E0B;
  --amber-100: #FEF3C7;
  --amber-50: #FFFBEB;

  --purple-600: #7C3AED;
  --purple-100: #EDE9FE;

  --bg-canvas: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;

  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-dark: #94A3B8;

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

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

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.calculator-body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
}

/* Sticky Operational Header */
.calc-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--navy-900);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.calc-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.calc-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.calc-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--blue-600), #1E40AF);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.4);
}

.calc-brand-text {
  display: flex;
  flex-direction: column;
}

.calc-brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.calc-brand-pro {
  background-color: var(--amber-500);
  color: var(--navy-950);
  font-size: 10px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.calc-brand-sub {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
}

/* Solicitation Chip in Header */
.calc-sol-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--navy-800);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 30px;
  max-width: 520px;
}

.chip-dot {
  width: 8px;
  height: 8px;
  background-color: var(--emerald-500);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald-500);
  flex-shrink: 0;
}

.chip-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chip-id {
  font-size: 10px;
  color: var(--amber-500);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.chip-title {
  font-size: 12px;
  font-weight: 600;
  color: #F1F5F9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.chip-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--emerald-500);
  font-family: var(--font-mono);
  margin-left: auto;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

/* Header Buttons */
.calc-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-back-portal {
  background-color: transparent;
  color: #CBD5E1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-back-portal:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-print-pdf {
  background-color: var(--blue-600);
  color: #FFFFFF;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease;
}

.btn-print-pdf:hover {
  background-color: var(--blue-700);
}

/* Main Layout */
.calc-main-content {
  flex: 1;
  padding: 24px 20px 48px;
}

.calc-container {
  max-width: 1440px;
  margin: 0 auto;
}

/* Breadcrumbs */
.calc-breadcrumbs {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.calc-breadcrumbs a {
  color: var(--blue-600);
  text-decoration: none;
  font-weight: 500;
}

.calc-breadcrumbs a:hover {
  text-decoration: underline;
}

.crumb-sep {
  color: var(--border-medium);
}

.crumb-active {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Hero Card */
.calc-hero-card {
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.statute-badge {
  background-color: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93C5FD;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.sat-threshold-badge {
  background-color: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FCD34D;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
}

.calc-hero-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  color: #F8FAFC;
}

.calc-hero-desc {
  font-size: 14px;
  color: #94A3B8;
  max-width: 960px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Presets Bar */
.presets-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.presets-label {
  font-size: 12px;
  font-weight: 700;
  color: #CBD5E1;
  margin-right: 4px;
}

.preset-btn {
  background-color: var(--navy-800);
  color: #F1F5F9;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  background-color: var(--blue-600);
  border-color: var(--blue-500);
  color: #fff;
}

.preset-btn.warning:hover {
  background-color: var(--crimson-600);
  border-color: var(--crimson-500);
}

.preset-btn.outline {
  background: transparent;
  color: #94A3B8;
  border-color: rgba(255, 255, 255, 0.12);
}

.preset-btn.outline:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #F1F5F9;
}

/* Two Column Workbench Grid */
.workbench-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}

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

/* Card Panels */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-help {
  font-size: 12px;
  color: var(--text-muted);
}

/* Procurement Type Selector Grid */
.procurement-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

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

.proc-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.proc-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.proc-card-content {
  background-color: var(--bg-canvas);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}

.proc-option input[type="radio"]:checked + .proc-card-content {
  border-color: var(--blue-600);
  background-color: var(--blue-50);
  box-shadow: 0 0 0 1px var(--blue-600);
}

.proc-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.proc-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.proc-floor-pill {
  background-color: var(--navy-900);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.proc-option input[type="radio"]:checked + .proc-card-content .proc-floor-pill {
  background-color: var(--blue-600);
}

.proc-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
  flex: 1;
}

.proc-citation {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Metadata Fieldset */
.sol-meta-fieldset {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

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

.meta-legend {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--blue-600);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

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

.sol-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

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

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tooltip-icon {
  font-size: 12px;
  cursor: help;
  color: var(--text-muted);
}

.input-control {
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-primary);
  background-color: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.input-control:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-currency-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
  font-family: var(--font-mono);
}

.input-control.currency {
  padding-left: 28px;
  font-weight: 600;
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.text-emerald {
  color: var(--emerald-600);
}

.text-crimson {
  color: var(--crimson-600);
}

/* Cost Section Blocks */
.cost-schedule-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cost-section-block {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  background-color: var(--bg-canvas);
}

.cost-section-block.highlight-prime {
  border-left: 4px solid var(--emerald-500);
  background-color: var(--emerald-50);
}

.cost-section-block.highlight-sub {
  border-left: 4px solid var(--blue-600);
  background-color: var(--blue-50);
}

.cost-section-block.highlight-exclusions {
  border-left: 4px solid var(--amber-500);
  background-color: var(--amber-50);
}

.cost-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.cost-section-heading h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.4px;
}

.section-tag.emerald {
  background-color: var(--emerald-100);
  color: var(--emerald-600);
}

.section-tag.blue {
  background-color: var(--blue-100);
  color: var(--blue-700);
}

.section-tag.amber {
  background-color: var(--amber-100);
  color: var(--amber-600);
}

.input-row-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

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

/* Column 2: Dashboard Styling */
.dashboard-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 76px;
}

/* Primary Verdict Banner */
.status-verdict-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.status-verdict-card.status-pass {
  background: linear-gradient(135deg, #065F46 0%, #047857 100%);
  color: #fff;
  border: 1px solid #10B981;
}

.status-verdict-card.status-fail {
  background: linear-gradient(135deg, #991B1B 0%, #B91C1C 100%);
  color: #fff;
  border: 1px solid #EF4444;
}

.status-verdict-card.status-pending {
  background: linear-gradient(135deg, #92400E 0%, #B45309 100%);
  color: #fff;
  border: 1px solid #F59E0B;
}

.verdict-icon-box {
  width: 44px;
  height: 44px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  flex-shrink: 0;
}

.verdict-text-box {
  flex: 1;
}

.verdict-tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  opacity: 0.9;
  margin-bottom: 2px;
}

.verdict-heading {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.verdict-explanation {
  font-size: 12.5px;
  opacity: 0.92;
  line-height: 1.4;
}

/* Gauge Card */
.gauge-card {
  padding: 20px 22px;
}

.gauge-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.gauge-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gauge-value-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.gauge-number {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.gauge-target-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.gauge-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.gauge-badge.pass {
  background-color: var(--emerald-100);
  color: var(--emerald-600);
}

.gauge-badge.fail {
  background-color: var(--crimson-100);
  color: var(--crimson-600);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

/* Bar Progress Track */
.bar-progress-container {
  margin: 10px 0 14px;
}

.progress-track {
  position: relative;
  height: 22px;
  background-color: var(--border-subtle);
  border-radius: 11px;
  overflow: visible;
  display: flex;
}

.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.progress-fill.emerald {
  background-color: var(--emerald-500);
  border-top-left-radius: 11px;
  border-bottom-left-radius: 11px;
}

.progress-fill.blue {
  background-color: var(--blue-600);
}

.progress-fill.slate {
  background-color: var(--navy-600);
}

.floor-marker {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 3px;
  background-color: var(--crimson-600);
  z-index: 10;
  transition: left 0.3s ease;
}

.marker-flag {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--crimson-600);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.progress-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  color: var(--text-secondary);
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-swatch.emerald { background-color: var(--emerald-500); }
.legend-swatch.blue { background-color: var(--blue-600); }
.legend-swatch.slate { background-color: var(--navy-600); }

/* Quad Metrics Grid */
.metrics-quad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.metric-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.metric-card-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-card-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Remediation Box */
.remediation-box {
  background-color: var(--crimson-50);
  border: 1px solid var(--crimson-500);
  border-radius: var(--radius-md);
  padding: 16px;
  color: #7F1D1D;
  font-size: 12.5px;
  line-height: 1.5;
}

.remediation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--crimson-600);
  margin-bottom: 8px;
}

.remediation-steps {
  margin: 10px 0 0 18px;
  padding: 0;
}

.remediation-steps li {
  margin-bottom: 6px;
}

/* Narrative Card */
.narrative-card {
  padding: 18px 20px;
}

.narrative-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.narrative-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.narrative-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.btn-copy-narrative {
  background-color: var(--navy-900);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-copy-narrative:hover {
  background-color: var(--blue-600);
}

.narrative-textarea {
  width: 100%;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background-color: var(--bg-canvas);
  resize: vertical;
  line-height: 1.5;
}

.narrative-textarea:focus {
  outline: none;
  border-color: var(--blue-600);
}

.narrative-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.narrative-cite-tag {
  font-size: 10.5px;
  color: var(--text-muted);
}

.copied-indicator {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--emerald-600);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.copied-indicator.visible {
  opacity: 1;
}

/* Statutory Explainer Section */
.statutory-explainer-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border-medium);
}

.explainer-header {
  margin-bottom: 24px;
}

.explainer-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--blue-600);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.explainer-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 4px 0 8px;
}

.explainer-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: 900px;
  line-height: 1.6;
}

.explainer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

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

.explainer-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.explainer-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.explainer-chip {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.explainer-chip.emerald { background: var(--emerald-100); color: var(--emerald-600); }
.explainer-chip.blue { background: var(--blue-100); color: var(--blue-700); }
.explainer-chip.amber { background: var(--amber-100); color: var(--amber-600); }
.explainer-chip.purple { background: var(--purple-100); color: var(--purple-600); }

.explainer-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.explainer-card p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.explainer-subtext {
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 8px;
}

/* Footer */
.calc-footer {
  background-color: var(--navy-900);
  color: #94A3B8;
  padding: 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  margin-top: auto;
}

.calc-footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.calc-footer strong {
  color: #F8FAFC;
}

.footer-sub {
  font-size: 11px;
  color: #64748B;
  margin-top: 2px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-link {
  color: #94A3B8;
  text-decoration: none;
}

.footer-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* Printable Certificate (Hidden in Screen View) */
.printable-compliance-certificate {
  display: none;
}

/* ========================================================================= */
/* Print Optimization Stylesheet (@media print)                             */
/* Renders formal proposal compliance certificate for PDF export            */
/* ========================================================================= */
@media print {
  body.calculator-body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  /* Hide interactive screen UI */
  .calc-header,
  .calc-breadcrumbs,
  .calc-hero-card,
  .workbench-grid,
  .statutory-explainer-section,
  .calc-footer {
    display: none !important;
  }

  /* Show Printable Certificate */
  .printable-compliance-certificate {
    display: block !important;
    padding: 0;
    margin: 0;
  }

  .cert-border {
    border: 2px solid #0F172A;
    padding: 24px;
    border-radius: 4px;
  }

  .cert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0F172A;
    padding-bottom: 8px;
    margin-bottom: 16px;
  }

  .cert-brand {
    font-weight: 800;
    font-size: 13pt;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .cert-stamp {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 10pt;
    background: #EEE;
    padding: 3px 8px;
    border: 1px solid #999;
  }

  .cert-title {
    font-size: 14pt;
    font-weight: 800;
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
  }

  .cert-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 10pt;
    background: #F8F9FA;
    padding: 12px;
    border: 1px solid #CCC;
    margin-bottom: 18px;
  }

  .cert-cost-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5pt;
    margin-bottom: 18px;
  }

  .cert-cost-table th,
  .cert-cost-table td {
    border: 1px solid #CBD5E1;
    padding: 6px 10px;
    text-align: left;
  }

  .cert-cost-table th {
    background-color: #0F172A !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: 700;
  }

  .cert-cost-table td.mono {
    font-family: var(--font-mono);
    text-align: right;
  }

  .cert-subtotal-row {
    background-color: #E6F4EA !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cert-denom-row {
    background-color: #F1F5F9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cert-total-row {
    background-color: #E2E8F0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 10.5pt;
  }

  .cert-determination-box {
    border: 2px solid #059669;
    background-color: #ECFDF5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 24px;
  }

  .cert-verdict-tag {
    font-weight: 800;
    font-size: 11pt;
    color: #065F46;
    margin-bottom: 4px;
  }

  .cert-signatures {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
    margin-top: 40px;
  }

  .sig-line {
    border-bottom: 1px solid #000;
    height: 32px;
    margin-bottom: 6px;
  }

  .sig-label {
    font-size: 9pt;
    color: #444;
    text-transform: uppercase;
  }
}
