:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #121826;
  --bg-card: #192237;
  --bg-card-hover: #1e2942;
  --border-color: #26334d;
  --border-focus: #3b82f6;
  
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-green: #10b981;
  --accent-green-bg: rgba(16, 185, 129, 0.12);
  --accent-blue: #3b82f6;
  --accent-blue-bg: rgba(59, 130, 246, 0.12);
  --accent-orange: #f59e0b;
  --accent-orange-bg: rgba(245, 158, 11, 0.12);
  --accent-red: #ef4444;

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

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-title span {
  color: var(--accent-green);
}

.header-pills {
  display: flex;
  gap: 0.75rem;
}

.pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* Hero */
.hero-section {
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Main Grid */
.calc-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2rem;
  align-items: start;
}

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

.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.step-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-blue);
  background: var(--accent-blue-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.sub-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: 1.25rem;
}

.panel-divider {
  height: 1px;
  background: var(--border-color);
  margin: 1.75rem 0;
}

/* Inputs */
.input-group {
  margin-bottom: 1.5rem;
}

.input-group label, .select-col label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

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

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

.currency-input-wrap .prefix {
  position: absolute;
  left: 1.1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

.currency-input-wrap input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem 0.85rem 2.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.currency-input-wrap input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.quick-chips {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover, .chip.active {
  background: var(--accent-blue-bg);
  border-color: var(--accent-blue);
  color: #fff;
}

/* Range Slider */
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.slider-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-green);
  background: var(--accent-green-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-card);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-green);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  border: 2px solid #fff;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.mileage-deduction-callout {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
}

.mileage-deduction-callout strong {
  font-family: var(--font-mono);
  color: var(--accent-green);
  font-size: 1rem;
}

/* Deduction Item Switches */
.deduction-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.deduction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  transition: all 0.15s ease;
}

.deduction-item:hover {
  background: var(--bg-card-hover);
}

.deduction-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ded-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.ded-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.2s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-green);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.mini-currency-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem;
  max-width: 100px;
}

.mini-currency-wrap span {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.2rem;
}

.mini-currency-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  text-align: right;
}

/* Selects */
.select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.select-col select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  outline: none;
  font-family: var(--font-sans);
  cursor: pointer;
}

/* Results Hero */
.summary-hero {
  background: linear-gradient(135deg, rgba(30, 41, 66, 0.9) 0%, rgba(18, 24, 38, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.summary-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.summary-amount {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  font-family: var(--font-sans);
  margin: 0.25rem 0 0.5rem;
}

.effective-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Quarterly Card */
.quarterly-card {
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.q-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-orange);
}

.q-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.q-amount {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-sans);
  color: #fff;
  letter-spacing: -0.02em;
}

.q-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Metrics Grid */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.metric-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-val {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0.25rem 0 0.15rem;
  font-family: var(--font-sans);
}

.highlight-green {
  color: var(--accent-green);
}

.highlight-orange {
  color: var(--accent-orange);
}

.metric-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Breakdown Table */
.breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
}

.breakdown-head {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 0.4rem 0;
  color: var(--text-muted);
}

.breakdown-row strong {
  font-family: var(--font-mono);
  color: var(--text-main);
  font-size: 0.9rem;
}

.breakdown-row.minus strong {
  color: var(--accent-green);
}

.breakdown-row.plus strong {
  color: #cbd5e1;
}

.breakdown-row.subtotal {
  border-top: 1px dashed var(--border-color);
  border-bottom: 1px dashed var(--border-color);
  margin: 0.4rem 0;
  padding: 0.55rem 0;
  font-weight: 700;
  color: #fff;
}

.breakdown-row.total {
  border-top: 1px solid var(--border-color);
  margin-top: 0.4rem;
  padding-top: 0.65rem;
  font-weight: 800;
  color: #fff;
  font-size: 0.95rem;
}

.breakdown-row.total strong {
  font-size: 1.1rem;
  color: #fff;
}

/* Affiliate Box */
.affiliate-box {
  background: linear-gradient(145deg, rgba(25, 34, 55, 0.95), rgba(18, 24, 38, 0.95));
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.aff-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.25rem;
}

.aff-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.aff-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

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

.aff-btn {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s ease;
}

.aff-btn.primary {
  background: var(--accent-blue);
  color: #fff;
}

.aff-btn.primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.aff-btn.secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
}

.aff-btn.secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.aff-btn span:first-child {
  font-size: 0.85rem;
  font-weight: 700;
}

.aff-discount {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-top: 0.15rem;
}

/* SEO Guide */
.seo-guide-section {
  max-width: 1280px;
  margin: 3rem auto 2rem;
  padding: 0 1.5rem;
}

.guide-inner h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-align: center;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.guide-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.guide-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

.guide-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  background: var(--bg-secondary);
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.footer-copy {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.footer-disclaimer {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.5;
}
