/* ── Page Layout ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 100px;
  position: relative;
  z-index: 1;

  /* Palette Overrides */
  --tool-red: #fb7185;
  --tool-red-soft: rgba(251, 113, 133, 0.12);
}


:root {
  --tool-emerald: #10b981;
  --tool-indigo: #6366f1;
  --tool-amber: #f59e0b;
}

/* ── Main Layout ── */
.tax-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
  align-items: start;
}

.left-col,
.right-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Panels ── */
.panel {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* ── Breakeven Info ── */
.breakeven-info {
  margin-top: 16px;
  padding: 12px;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--tool-indigo);
}

/* ── Inputs ── */
.input-group {
  margin-bottom: 20px;
}

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

.input-header label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
}

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

.inp-wrap span {
  position: absolute;
  left: 16px;
  color: var(--text-3);
  font-weight: 600;
}

.inp-wrap input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 16px 12px 32px;
  color: var(--text);
  font-family: 'Figtree', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
}

.inp-wrap input:focus {
  border-color: var(--tool-indigo);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 6px;
}

/* ── Dropdowns (Select) ── */
select {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 40px 12px 16px;
  color: var(--text);
  font-family: 'Figtree', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}

select:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

select:focus {
  border-color: var(--tool-indigo);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

select option {
  background: #1e1b4b;
  color: #fff;
  padding: 10px;
}

body.light select {
  background-color: #f9fafb;
  border-color: #e5e7eb;
  color: #111;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(0,0,0,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

body.light select option {
  background: #fff;
  color: #111;
}

/* ── Mode & Tab Styling ── */
.mode-toggle-wrap {
  max-width: 500px;
  margin: 0 auto 32px;
}

.mode-toggle, .hra-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

.tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--tool-indigo);
  border-radius: 10px;
  z-index: -1;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mode-btn, .hra-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: 'Figtree', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.3s;
  z-index: 2;
}

.mode-btn.active, .hra-tab.active {
  color: #fff;
}

/* ── CTC Split Grid ── */
.ctc-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.ctc-split-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  border-radius: 12px;
}

.ctc-split-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}

.ctc-split-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.ctc-split-pct {
  font-size: 0.65rem;
  color: var(--tool-indigo);
  margin-top: 2px;
}

/* ── HRA Styling ── */
#hra-auto-fields, #hra-manual-fields {
  margin-top: 16px;
}

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

.hra-result-row {
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed var(--tool-indigo);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* ── Action Buttons ── */
.action-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.action-btn {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  border-radius: 14px;
  font-family: 'Figtree', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn .btn-icon {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.action-btn:hover .btn-icon {
  transform: translateY(-1px);
}

.copy-btn:hover {
  border-color: var(--tool-emerald);
  background: rgba(16, 185, 129, 0.06);
  color: var(--tool-emerald);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
}

.share-btn:hover {
  border-color: var(--tool-indigo);
  background: rgba(99, 102, 241, 0.06);
  color: var(--tool-indigo);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.reset-btn:hover {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.06);
  color: #f87171;
  box-shadow: 0 4px 15px rgba(248, 113, 113, 0.15);
}

/* Light mode overrides for action buttons */
body.light .action-btn {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #4b5563;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

body.light .copy-btn:hover {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #16a34a;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.08);
}

body.light .share-btn:hover {
  background: #e0e7ff;
  border-color: #6366f1;
  color: #4f46e5;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

body.light .reset-btn:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08);
}

/* ── Tooltips ── */
.tooltip-wrap {
  display: inline-flex;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 0.65rem;
  align-items: center;
  justify-content: center;
  cursor: help;
  position: relative;
  color: var(--text-3);
}

.tooltip-text {
  visibility: hidden;
  width: 200px;
  background: #1e1b4b;
  color: #fff;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.75rem;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.tooltip-wrap:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ── Result KPIs (Extended) ── */
.result-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.kpi-card.rose::before { background: var(--tool-red); }

/* ── CTC Table ── */
.ctc-table {
  width: 100%;
  border-collapse: collapse;
}

.ctc-table th {
  text-align: left;
  font-size: 0.7rem;
  color: var(--text-3);
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ctc-table td {
  padding: 12px 10px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ctc-total-row {
  background: rgba(99, 102, 241, 0.05);
  font-weight: 700;
  color: var(--tool-indigo);
}


/* ── YoY Comparison ── */
.yoy-grid {
  display: flex;
  align-items: center;
  justify-content: space-around;
  text-align: center;
  gap: 12px;
}

.yoy-item { flex: 1; }
.yoy-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.yoy-val { font-size: 1.1rem; font-weight: 800; }
.yoy-val.highlight { color: var(--tool-indigo); }
.yoy-val.green { color: var(--tool-emerald); }
.yoy-arrow { font-size: 1.2rem; color: var(--text-3); }
.yoy-sub { font-size: 0.65rem; color: var(--text-3); margin-top: 2px; }

/* ── Result KPIs (Original) ── */
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.kpi-card.indigo::before {
  background: var(--tool-indigo);
}

.kpi-card.emerald::before {
  background: var(--tool-emerald);
}

.kpi-card.amber::before {
  background: var(--tool-amber);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.kpi-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Comparison Structure ── */
.comparison-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.regime-panel {
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.regime-panel.winner {
  border-color: var(--tool-emerald);
  background: rgba(16, 185, 129, 0.03);
}

.regime-tag {
  position: absolute;
  top: -10px;
  right: 10px;
  background: var(--tool-emerald);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.regime-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 4px;
}

.regime-tax {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-3);
}

.breakdown-row.total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  font-weight: 700;
}

.breakdown-row span.deduction {
  color: #f87171;
}

/* ── Chart Section ── */
.visual-panel {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 32px;
  align-items: center;
}

.chart-container {
  height: 240px;
  position: relative;
}

.chart-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.chart-center-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.chart-center-lbl {
  font-size: 0.65rem;
  color: var(--text-3);
  text-transform: uppercase;
}

/* ── Verdict Card ── */
.verdict-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.verdict-box.winner-new {
  border-color: var(--tool-emerald);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(99, 102, 241, 0.03));
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
}

.verdict-box.winner-old {
  border-color: var(--tool-amber);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(99, 102, 241, 0.03));
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
}

.verdict-box.winner-tie {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.verdict-icon {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.verdict-title {
  font-weight: 800;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 4px;
}

.verdict-text {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.4;
}

/* Light mode overrides for verdict box */
body.light .verdict-box.winner-new {
  background: #f0fdf4;
  border-color: #86efac;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.04);
}

body.light .verdict-box.winner-old {
  background: #fffbeb;
  border-color: #fde68a;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.04);
}

body.light .verdict-box.winner-tie {
  background: #f9fafb;
  border-color: #e5e7eb;
}

.breakeven-info {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 10px;
  color: var(--tool-emerald);
}

/* ── Slabs Reference ── */
.slabs-section {
  margin-top: 60px;
}

.slabs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
}

.slab-table {
  width: 100%;
  border-collapse: collapse;
}

.slab-table th {
  text-align: left;
  font-size: 0.75rem;
  color: var(--text-3);
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.slab-table td {
  padding: 10px 0;
  font-size: 0.85rem;
  color: var(--text-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.slab-rate {
  font-weight: 700;
  color: var(--tool-indigo);
  text-align: right;
}

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

  .left-col {
    order: 2;
  }

  .right-col {
    order: 1;
  }
}

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

  .comparison-card {
    grid-template-columns: 1fr;
  }

  .visual-panel {
    grid-template-columns: 1fr;
  }
}

/* ── Light Mode ── */
body.light .panel {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light .mode-toggle, body.light .hra-tabs {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

body.light .mode-btn, body.light .hra-tab {
  color: #4b5563;
}

body.light .mode-btn.active, body.light .hra-tab.active {
  color: #fff;
}

body.light .inp-wrap input {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #111;
}

body.light .kpi-card {
  background: #f9fafb;
  border-color: #e5e7eb;
}

body.light .kpi-val {
  color: #111;
}

body.light .regime-panel {
  background: #f9fafb;
  border-color: #e5e7eb;
}

body.light .regime-name {
  color: #4b5563;
}

body.light .regime-tax {
  color: #111;
}

body.light .breakdown-row {
  color: #6b7280;
}

/* ── Print Styles ── */
@media print {
  @page { margin: 1cm; size: A4 portrait; }
  body { background: #fff !important; color: #000 !important; font-family: 'Figtree', sans-serif !important; font-size: 10pt !important; }
  
  .bg-scene, #ts-header, #ts-footer, #ts-cookie, #ts-share, #ts-toast, 
  .left-col, .tool-header p, .breadcrumb, #tool-disclaimer, 
  .slabs-section, .panel:last-child, #tool-faq, button, .fy-badge,
  .panel-title::after, #ts-footer-minimal, .regime-tag {
    display: none !important;
  }
  
  .print-only-header { display: block !important; text-align: center; margin-bottom: 30px; border-bottom: 2px solid #eee; padding-bottom: 10px; }
  .print-only-header h2 { font-size: 18pt !important; margin: 0; color: #000; }
  
  .container { width: 100% !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .tool-header h1 { font-size: 24pt !important; color: #000 !important; text-align: center; margin-bottom: 5px !important; }
  
  .tax-grid { display: block !important; }
  .right-col { width: 100% !important; display: block !important; }
  
  .result-grid { 
    display: flex !important; 
    justify-content: space-between !important;
    gap: 15px !important;
    margin-bottom: 30px !important;
  }
  
  .kpi-card { 
    flex: 1 !important;
    border: 1px solid #eee !important; 
    padding: 15px !important;
    border-radius: 12px !important;
    text-align: center !important;
  }
  
  .kpi-val { font-size: 18pt !important; color: #000 !important; margin: 5px 0 !important; font-weight: 800 !important; }
  .kpi-label { font-size: 8pt !important; color: #666 !important; text-transform: uppercase; }
  
  .panel { 
    border: 1px solid #eee !important; 
    padding: 20px !important;
    border-radius: 16px !important;
    margin-bottom: 25px !important;
    break-inside: avoid;
    box-shadow: none !important;
  }
  
  .visual-panel {
    display: block !important;
    text-align: center !important;
  }
  
  .chart-container { 
    width: 200px !important; 
    height: 200px !important; 
    margin: 0 auto 20px !important;
  }
  
  #regime-comparison-box {
    text-align: left !important;
    max-width: 400px;
    margin: 0 auto !important;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
  }
  
  .comparison-card {
    display: flex !important;
    gap: 20px !important;
  }
  
  .regime-panel {
    flex: 1 !important;
    border: 1px solid #eee !important;
    padding: 20px !important;
    border-radius: 12px !important;
  }
  
  .regime-tax { font-size: 18pt !important; color: #000 !important; margin-bottom: 12px !important; }
  .regime-name { font-size: 9pt !important; margin-bottom: 4px !important; font-weight: bold !important; }
  
  .breakdown-row { color: #333 !important; font-size: 10pt !important; margin-bottom: 6px !important; }
  .breakdown-row.total { border-top: 2px solid #eee !important; padding-top: 10px !important; font-weight: 800 !important; }
  
  .verdict-box {
    background: #fcfcfc !important;
    border: 1px solid #eee !important;
    padding: 20px !important;
    border-radius: 12px !important;
    margin-top: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
  }
  .verdict-title { font-size: 12pt !important; margin-bottom: 4px !important; }
  .verdict-text { font-size: 10pt !important; line-height: 1.4 !important; }
  
  .title-line, .panel::before, .kpi-card::before { display: none !important; }
  .panel-title { font-size: 11pt !important; margin-bottom: 15px !important; text-align: center !important; }
}