/* ==========================================================================
   FinCalc Pro - Design System & Modern Responsive Stylesheet
   Crafted for Maximum User Engagement, High Dwell Time & AdSense Revenue
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  /* Color Palette - Cyber Dark (Default) */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2234;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(26, 34, 52, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(16, 185, 129, 0.4);

  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Accent Colors */
  --emerald-primary: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --cyan-primary: #06b6d4;
  --indigo-primary: #6366f1;
  --indigo-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --amber-primary: #f59e0b;
  --rose-primary: #f43f5e;

  /* UI Tokens - Soft Edges & Compact */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 5px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 6px 14px -2px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px -3px var(--emerald-glow);
  --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-active: rgba(16, 185, 129, 0.6);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --emerald-primary: #059669;
  --emerald-glow: rgba(5, 150, 105, 0.15);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 30px -5px rgba(5, 150, 105, 0.2);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(99, 102, 241, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
  transition: var(--transition);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--emerald-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 18px var(--emerald-glow);
}

.brand-pro-badge {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  color: #fff;
  text-transform: uppercase;
  margin-left: 4px;
}

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

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  border-color: var(--emerald-primary);
  transform: translateY(-2px);
}

.currency-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.currency-select:hover, .currency-select:focus {
  border-color: var(--emerald-primary);
}

/* Header Leaderboard Ad Slot */
.ad-slot-header {
  margin: 18px 0 10px 0;
  display: flex;
  justify-content: center;
}

.ad-container {
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  text-align: center;
}

.ad-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 4px 0;
  display: block;
}

/* Standard Google Ad Sizes */
.ad-leaderboard {
  width: 728px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-mock-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 24px;
  gap: 16px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), rgba(99, 102, 241, 0.08));
}

.ad-mock-badge {
  background: var(--emerald-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.ad-mock-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  flex: 1;
}

.ad-mock-btn {
  background: var(--indigo-gradient);
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Hero Section */
.hero-header {
  text-align: center;
  padding: 12px 0 8px 0;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--emerald-primary);
  margin-bottom: 6px;
}

.hero-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  line-height: 1.2;
}

.hero-title span {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  font-size: 0.86rem;
}

/* Navigation Tabs (Modular Micro-tools) */
.tool-tabs-container {
  margin: 12px 0;
  display: flex;
  justify-content: center;
}

.tool-tabs {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
  overflow-x: auto;
  max-width: 100%;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-tertiary);
}

.tab-btn.active {
  background: var(--emerald-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--emerald-glow);
}

/* Main Layout Grid (Content + Sticky Ad Rail) */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  align-items: start;
  margin-bottom: 24px;
}

/* Calculator Card */
.calculator-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* Split Pane for Calculator (Inputs on Left, Results on Right) */
.calc-split-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Form Controls */
.input-group {
  margin-bottom: 22px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.input-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-tooltip {
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.input-stepper-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 14px;
  transition: var(--transition);
}

.input-stepper-box:focus-within {
  border-color: var(--emerald-primary);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

.prefix, .suffix {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-muted);
}

.num-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
  padding: 8px;
  width: 100%;
}

/* Custom Range Slider */
.slider-container {
  margin-top: 10px;
}

.range-slider {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs);
  background: var(--emerald-primary);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px var(--emerald-glow);
  cursor: pointer;
  transition: var(--transition);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Preset Chips */
.preset-chips {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.preset-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover, .preset-chip.active {
  background: var(--bg-secondary);
  border-color: var(--emerald-primary);
  color: var(--emerald-primary);
}

/* Results Panel */
.results-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.primary-result-card {
  text-align: center;
  padding: 20px;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, transparent 100%);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.primary-result-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--emerald-primary);
  margin-bottom: 6px;
}

.primary-result-value {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.primary-result-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Secondary KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Doughnut Chart Box */
.chart-box {
  position: relative;
  height: 180px;
  width: 100%;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Action Buttons (Export, Share, Print) */
.action-btn-group {
  display: flex;
  gap: 10px;
}

.btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-action:hover {
  background: var(--bg-primary);
  border-color: var(--emerald-primary);
}

.btn-action-primary {
  background: var(--emerald-gradient);
  color: #fff;
  border: none;
}

.btn-action-primary:hover {
  box-shadow: 0 4px 15px var(--emerald-glow);
  transform: translateY(-2px);
}

/* In-Content Ad Placement */
.ad-slot-incontent {
  margin: 30px 0 20px 0;
}

.ad-banner-responsive {
  width: 100%;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
}

/* Sidebar Sticky Rail */
.sidebar-sticky-rail {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ad-skyscraper {
  width: 300px;
  min-height: 600px;
  margin: 0 auto;
}

.ad-mock-skyscraper {
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
  border-radius: var(--radius-md);
}

.ad-skyscraper-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-top: 10px;
}

.ad-skyscraper-feature-list {
  list-style: none;
  margin: 20px 0;
  width: 100%;
}

.ad-skyscraper-feature-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-skyscraper-feature-list li svg {
  color: var(--emerald-primary);
  flex-shrink: 0;
}

/* Amortization Table & Detailed Schedule */
.amortization-section {
  margin-top: 40px;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.table-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toggle-group {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
}

.toggle-opt {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.toggle-opt.active {
  background: var(--emerald-primary);
  color: #fff;
}

.table-wrapper {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-height: 440px;
  overflow-y: auto;
}

.amort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: right;
}

.amort-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border-subtle);
}

.amort-table th:first-child, .amort-table td:first-child {
  text-align: left;
}

.amort-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-mono);
}

.amort-table tr:hover td {
  background: rgba(16, 185, 129, 0.04);
}

/* Comprehensive Educational SEO & FAQ Section */
.seo-content-section {
  margin: 60px 0 40px 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.seo-heading {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-main);
}

.seo-text {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.formula-card {
  background: var(--bg-secondary);
  border-left: 4px solid var(--emerald-primary);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--emerald-primary);
}

/* FAQ Accordion */
.faq-grid {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-question {
  width: 100%;
  padding: 16px 20px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question:hover {
  color: var(--emerald-primary);
}

.faq-chevron {
  transition: transform 0.3s ease;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px 18px 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Footer Section */
.footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 40px 0 80px 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.footer-link:hover {
  color: var(--emerald-primary);
}

/* Floating Sticky Footer Ad (Mobile-first High RPM) */
.footer-anchor-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 99;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 12px;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.4);
}

.anchor-ad-close {
  position: absolute;
  top: 4px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.75rem;
}

/* Modals for AdSense Compliance (Privacy, Terms, About, Config) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.modal-body {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.modal-body h4 {
  color: var(--text-main);
  margin: 16px 0 8px 0;
  font-size: 1rem;
}

.modal-body p {
  margin-bottom: 12px;
}

/* Ad Config Modal Form */
.config-form-group {
  margin-bottom: 16px;
}

.config-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.config-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

.config-input:focus {
  border-color: var(--emerald-primary);
}

/* Cookie Banner (AdSense Compliance) */
.cookie-banner {
  position: fixed;
  bottom: 80px;
  left: 20px;
  max-width: 420px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 18px;
  z-index: 999;
  box-shadow: var(--shadow-md);
  display: none;
}

.cookie-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.cookie-actions {
  display: flex;
  gap: 8px;
}

/* Print Statement Header & Footer Defaults (Hidden on screen) */
.print-statement-header, .print-statement-footer {
  display: none;
}

/* Print Stylesheet for Formal PDF Generation - Pure Monochrome Black & White */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 15mm 15mm 15mm;
  }

  /* Universal monochrome reset: force all text to solid black and kill dark backgrounds */
  *, *::before, *::after {
    color: #000000 !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9pt !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  }

  .navbar, .hero-header, .ad-container, .tool-tabs-container, .btn-action, 
  .action-btn-group, .slider-container, .preset-chips, .sidebar-sticky-rail, 
  .footer-anchor-ad, .seo-content-section, .footer, .cookie-banner, 
  .modal-overlay, .inputs-panel, .chart-box, .table-controls, button, input, select {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .main-grid, .calc-split-pane {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .calculator-card, .results-panel {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  /* Formal Header */
  .print-statement-header {
    display: block !important;
    margin-bottom: 16px !important;
    border-bottom: 2px solid #000000 !important;
    padding-bottom: 10px !important;
  }

  .print-header-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
  }

  .print-title {
    font-size: 16pt !important;
    font-weight: 800 !important;
    color: #000000 !important;
    margin: 0 0 3px 0 !important;
    letter-spacing: -0.02em !important;
  }

  .print-subtitle {
    font-size: 8.5pt !important;
    color: #333333 !important;
  }

  .print-meta-info {
    text-align: right !important;
    font-size: 8pt !important;
    color: #000000 !important;
    line-height: 1.4 !important;
  }

  /* Parameters Summary Card */
  .print-params-card {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    background: #f4f4f4 !important;
    border: 1px solid #000000 !important;
    border-radius: 4px !important;
    padding: 8px 10px !important;
    margin: 12px 0 16px 0 !important;
    gap: 8px !important;
  }

  .print-param-item {
    font-size: 8.5pt !important;
  }

  .param-lbl {
    display: block !important;
    font-size: 6.5pt !important;
    color: #333333 !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
  }

  .param-val {
    font-family: monospace !important;
    font-weight: 700 !important;
    color: #000000 !important;
    font-size: 8.5pt !important;
  }

  /* Primary KPI */
  .primary-result-card {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 4px !important;
    padding: 10px 16px !important;
    margin-bottom: 14px !important;
    text-align: left !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .primary-result-label {
    font-size: 8.5pt !important;
    color: #333333 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
  }

  .primary-result-value {
    color: #000000 !important;
    font-size: 20pt !important;
    font-weight: 800 !important;
    font-family: monospace !important;
    line-height: 1 !important;
  }

  .primary-result-subtext {
    display: none !important;
  }

  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }

  .kpi-card {
    background: #ffffff !important;
    border: 1px solid #888888 !important;
    border-radius: 4px !important;
    padding: 8px 10px !important;
  }

  .kpi-label {
    font-size: 6.5pt !important;
    color: #333333 !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
  }

  .kpi-value {
    color: #000000 !important;
    font-size: 10.5pt !important;
    font-weight: 800 !important;
    font-family: monospace !important;
  }

  /* Amortization Table: Pure Black and White */
  .amortization-section {
    margin-top: 10px !important;
    page-break-inside: auto !important;
  }

  .section-title {
    font-size: 10pt !important;
    font-weight: 800 !important;
    margin-bottom: 6px !important;
    color: #000000 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
  }

  .table-wrapper {
    max-height: none !important;
    overflow: visible !important;
    border: 1.5px solid #000000 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
  }

  .amort-table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: auto !important;
    background: #ffffff !important;
  }

  .amort-table tr {
    page-break-inside: avoid !important;
    page-break-after: auto !important;
    background: #ffffff !important;
  }

  .amort-table th {
    background: #eeeeee !important;
    color: #000000 !important;
    font-size: 7.5pt !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 6px 8px !important;
    border: 1px solid #000000 !important;
    border-bottom: 2px solid #000000 !important;
  }

  .amort-table td {
    color: #000000 !important;
    font-size: 8pt !important;
    padding: 5px 8px !important;
    border: 1px solid #cccccc !important;
    background: #ffffff !important;
  }

  /* Formal Statement Footer */
  .print-statement-footer {
    display: flex !important;
    justify-content: space-between !important;
    margin-top: 20px !important;
    padding-top: 10px !important;
    border-top: 1px solid #000000 !important;
    font-size: 7.5pt !important;
    color: #333333 !important;
    line-height: 1.35 !important;
  }
}


/* Responsive Media Queries */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-sticky-rail {
    display: none;
  }

  .calc-split-pane {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .ad-leaderboard {
    width: 320px;
    min-height: 50px;
  }

  .ad-mock-content {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

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

  .action-btn-group {
    flex-direction: column;
  }
}
