:root {
  --bg-main: #f0f4f9;
  --bg-gradient: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 45%),
                 radial-gradient(circle at 90% 85%, rgba(16, 185, 129, 0.07) 0%, transparent 50%),
                 #f0f4f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-focus: #6366f1;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.06);
  --accent-new: #059669;
  --accent-old: #ea580c;
  --danger: #ef4444;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.04), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
  --max-width: 1360px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(rgba(240, 244, 249, 0.42), rgba(240, 244, 249, 0.72)), 
              url('https://images.unsplash.com/photo-1554224155-8d04cb21cd6c?auto=format&fit=crop&q=80&w=1600') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
} 





.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===================== HEADER ===================== */
.site-header {
  position: relative;
  overflow: hidden;
  padding: 16px 0 12px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.6) 100%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  margin-bottom: 16px;
}

.header-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 150px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 2px;
}

.site-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  align-content: center;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-new);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--accent-new);
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

/* ===================== WORKSPACE GRID ===================== */
.layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  align-items: start;
  padding-bottom: 60px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px 20px;
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header-bar h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.badge-status {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-new);
  background: #d1fae5;
  padding: 3px 8px;
  border-radius: 12px;
}

.sticky-panel {
  position: sticky;
  top: 16px;
}

/* ===================== ITR SELECTOR TABS ===================== */
.itr-selector-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.itr-selector-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.itr-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.itr-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.tab-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  background: #cbd5e1;
  color: #475569;
  padding: 2px 6px;
  border-radius: 12px;
  letter-spacing: 0.05em;
}

.itr-tab:hover:not(:disabled) {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: var(--primary);
}

.itr-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.itr-tab:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

/* ===================== ACCORDIONS ===================== */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: #ffffff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.accordion[open] {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.06);
  overflow: visible;
}

.accordion summary {
  padding: 12px 14px;
  cursor: pointer;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  list-style: none;
  border-left: 4px solid transparent;
  transition: all 0.25s ease;
  border-top-left-radius: var(--radius-md); 
  border-top-right-radius: var(--radius-md);
}

.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { background: #f1f5f9; border-left-color: #cbd5e1; }
.accordion[open] summary {
  background: var(--primary-glow);
  border-left: 4px solid var(--primary);
  border-bottom: 1px solid var(--border);
}

.summary-left, .summary-right { display: flex; align-items: center; gap: 8px; }
.accordion-title { font-weight: 700; font-size: 13.5px; color: var(--text-primary); }
.accordion[open] summary .accordion-title { color: var(--primary); }
.accordion-icon { font-size: 15px; }
.chevron { font-size: 9px; color: var(--text-secondary); transition: transform 0.3s ease; margin-left: 4px; }
.accordion[open] summary .chevron { transform: rotate(-180deg); color: var(--primary); }

.badge {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}
.badge.both { background: #e0e7ff; color: var(--primary); }
.badge.old { background: #ffedd5; color: var(--accent-old); }

.accordion-content {
  padding: 14px 16px;
  background: #ffffff;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* ===================== INPUTS & CONTROLS ===================== */
.field-group {
  margin-bottom: 12px;
}

label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  position: relative;
}

.tooltip:hover { background: var(--primary); color: #ffffff; }

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 150%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 400;
  width: 200px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 20;
  pointer-events: none;
  white-space: pre-line;
}
.tooltip:hover::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.tooltip.tooltip-right::after {
  left: auto;
  right: -10px;
  transform: translateY(4px);
}

.tooltip.tooltip-right:hover::after {
  transform: translateY(0);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
  width: 100%;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fbfcfe;
  transition: all 0.2s ease;
}

input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.input-inline-group {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 8px;
}

.input-triple-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sub-field {
  display: flex;
  flex-direction: column;
}

.sub-field .sub-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

select {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: #f8fafc;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

/* ===================== HRA CALCULATOR LINK & MODAL ===================== */
.hra-calc-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  background: none;
  border: none;
  padding: 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hra-calc-link:hover {
  color: #3730a3;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 16px 20px;
}

.modal-help {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 14px;
}

.hra-result-box {
  margin-top: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.hra-result-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0;
}

.hra-result-row.hra-final {
  border-top: 1px dashed var(--border);
  margin-top: 4px;
  padding-top: 8px;
  font-weight: 800;
  font-size: 13px;
  color: var(--accent-new);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.modal-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--border);
}

.modal-btn.secondary {
  background: #f8fafc;
  color: var(--text-secondary);
}

.modal-btn.secondary:hover {
  background: #f1f5f9;
}

.modal-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.modal-btn.primary:hover {
  background: #4338ca;
}

/* ===================== RIGHT SECTION HEADER & FORMULA ===================== */
.table-header-panel {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-header-panel h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.formula-banner {
  background: #fafbfd;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.formula-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.formula-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.chip {
  background: #ffffff;
  color: #475569;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  font-size: 10.5px;
}

.operator {
  color: #94a3b8;
  font-weight: 700;
  font-size: 12px;
}

.highlight-chip {
  background: #ede9fe;
  color: var(--primary);
  border-color: #ddd6fe;
}

.final-chip {
  background: #ecfdf5;
  color: var(--accent-new);
  border-color: #a7f3d0;
  font-weight: 700;
}

/* ===================== TABLE SECTION ===================== */
.tax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tax-table th, .tax-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.tax-table th {
  background: #334155; 
  font-weight: 700;
  text-align: left;
  color: #f8fafc; 
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: none;
}

.tax-table .cat-label {
  font-weight: 700;
  background: #f8fafc;
  color: #475569; 
  vertical-align: middle;
  border-right: 1px solid var(--border);
  border-left: 3px solid #94a3b8; 
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tax-table .right-align {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.tax-table .subtotal td {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-primary);
}

.tax-table .subtotal td.text-success {
  color: var(--accent-new);
}

.tax-table .subtotal td.text-danger {
  color: var(--danger);
}

.tax-table .grand-total td {
  background: #f1f5f9;
  font-weight: 700;
  color: var(--text-primary);
}

.tax-table .highlight-row td {
  background: #eef2ff;
  color: var(--primary);
  font-weight: 700;
}

.tax-table .highlight-final td {
  background: linear-gradient(90deg, #ecfdf5 0%, #f0fdf4 100%);
  color: var(--accent-new);
  font-weight: 800;
  font-size: 13px;
}

.text-danger { color: var(--danger); }
.text-success { color: var(--accent-new); }

/* ===================== VISUAL SUMMARY CHART ===================== */
.visual-summary {
  padding: 20px;
  background: #ffffff;
  border-top: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.verdict {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  padding: 12px 16px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  border: 1px solid transparent;
  letter-spacing: -0.01em;
}

.verdict.win-new { background: #ecfdf5; color: var(--accent-new); border-color: #a7f3d0; }
.verdict.win-old { background: #fff7ed; color: var(--accent-old); border-color: #fed7aa; }

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  width: 75px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bar-track {
  flex: 1;
  height: 12px;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}

.bar-fill {
  height: 100%;
  border-radius: 8px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-100%);
  animation: barShimmer 2.5s infinite ease-in-out;
}

@keyframes barShimmer {
  100% { transform: translateX(100%); }
}

.bar-fill.old { 
  background: linear-gradient(90deg, #f97316, #ea580c); 
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.35); 
}
.bar-fill.new { 
  background: linear-gradient(90deg, #10b981, #059669); 
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35); 
}

.bar-amount {
  width: 65px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
  .sticky-panel {
    position: static;
  }
}

/* ===================== HEADER ACTIONS ===================== */
.header-actions {
  position: absolute;
  right: 24px;
  top: 5px; /* Aligns beautifully with the header title */
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 10;
}

.header-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

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

.header-btn {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  background: #0f172a;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.header-btn:hover {
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transform: translateY(-1px);
}

/* ===================== FOOTER ===================== */
.site-footer {
  margin-top: 20px;
  padding: 24px 0 24px; /* Halved the padding to reduce overall height */
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.9) 100%);
  backdrop-filter: blur(4px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 1.3fr; /* Gives the middle section more room for horizontal text */
  gap: 20px;
  align-items: start;
}

.footer-col strong {
  font-size: 13px; /* Slightly smaller header */
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px; /* Reduced gap below headers */
}

.footer-col p {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}
.text-center { text-align: center; }
.text-right { text-align: right; }

.footer-col.text-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Pushes the entire block to the right side */
  text-align: center; /* Centers the header exactly over the links */
  padding-right: 100px; /* CRITICAL: Adds empty space so the Feedback FAB doesn't overlap text */
}

.footer-links {
  display: flex;
  gap: 16px;
  justify-content: center; /* Centers the 4 links directly under "Connect & Explore" */
  font-size: 11.5px;
  margin-top: 4px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-col:nth-child(2) {
  text-align: center;
}

/* Keep mobile view clean */
@media (max-width: 768px) {
  .footer-col.text-right {
    align-items: center; /* Centers everything on small screens */
    padding-right: 0; 
    padding-bottom: 60px; /* Pushes content up above the FAB on mobile */
  }
}
/* Make it stack nicely on mobile screens */
@media (max-width: 768px) {
  .header-actions {
    position: relative;
    right: 0;
    top: 0;
    justify-content: center;
    margin-bottom: 20px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 30px;
  }
  .text-center, .text-right {
    text-align: center;
  }
  .footer-links {
    justify-content: center;
  }
}

/* ===================== SITEMAP & FOOTER ADDITIONS ===================== */
.sitemap-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center; /* Centers the links under the header */
  gap: 10px;
  margin-top: 4px;
  align-items: center;
  color: #cbd5e1;
  font-size: 11.5px;
}

.sitemap-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.sitemap-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.disclaimer {
  margin-top: 8px !important; /* Pulled disclaimer closer to the links */
  font-size: 9.5px !important;
  color: #94a3b8 !important;
}


/* Update header button to remove default button styling */
button.header-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
}


/* ===================== PRINT LAYOUT ===================== */
@media print {
  /* Hide headers, inputs, footers, and interactive UI elements */
  .site-header, 
  .input-section, 
  .site-footer, 
  .formula-banner,
  .itr-selector-container,
  .print-btn,
  .print-reminder,
  .fab-feedback,
  .reset-btn {    
    display: none !important;
  }

  /* 2. Tighten the spacing inside the table cells */
  .tax-table th, 
  .tax-table td {
    padding: 3.5px 8px !important; /* Reduced vertical padding */
    font-size: 10px !important; /* Slightly scale down text */
  }

  /* 3. Shrink the category labels slightly */
  .tax-table .cat-label {
    font-size: 10.5px !important;
  }

  /* 4. Reduce whitespace in the visual summary block */
  .visual-summary {
    padding: 12px 16px !important; /* Reduced from 20px */
    gap: 12px !important; /* Reduced from 18px */
  }

  .verdict {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }

  .table-header-panel {
    padding: 0 0 10px 0 !important;
    margin-bottom: 10px !important;
  }

  /* Reset body margins and remove background */
  body, html {
    background: #ffffff !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Remove max-width and padding from the main container */
  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Override the grid layout to stack normally */
  .layout-grid {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .table-section {
    width: 100% !important;
  }

  /* CRITICAL FIX: Remove sticky positioning which causes blank pages */
  .card.sticky-panel {
    position: static !important; 
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Adjust header padding for the printed page */
  .table-header-panel {
    padding: 0 0 16px 0 !important;
    border-bottom: 2px solid #000 !important;
    margin-bottom: 16px;
  }

  .live-subtitle {
    display: none !important; 
  }

  /* Ensure rows don't split awkwardly across pages */
  .tax-table {
    page-break-inside: auto;
  }
  
  .tax-table tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  
}


.print-btn {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  background: #eef2ff;
  border: 1.5px solid #c7d2fe;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.print-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transform: translateY(-1px);
}

/* Clean Reset Button */
.ghost-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.ghost-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: #cbd5e1;
}

/* Quick Summary Bar */
.quick-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Updated from 3 to 4 */
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.summary-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.highlight-metric {
  background: #f0fdf4;
  border-color: #a7f3d0;
}
.highlight-metric .metric-label {
  color: var(--accent-new);
}
.highlight-metric .metric-value {
  color: var(--accent-new);
}

/* Hide summary bar on print to save space */
@media print {
  .quick-summary-bar { display: none !important; }
}


.fab-feedback {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 100;
}

.fab-feedback:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

@media print {
  .fab-feedback { display: none !important; }
}


.reset-btn {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: var(--danger);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}

.reset-btn:hover {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}



/* ===================== MOBILE HEADER ALIGNMENT FIX ===================== */
@media (max-width: 768px) {
  .site-header {
    padding: 20px 16px 24px 16px !important;
  }

  .header-content {
    display: flex !important;
    flex-direction: column-reverse !important; /* Puts the reset button neatly above or below the text */
    align-items: center !important;
    text-align: center !important;
    gap: 16px !important;
  }

  /* Reset absolute positioning so the button behaves normally in the flow */
  .header-actions {
    position: static !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 4px;
  }

  .title-wrapper {
    width: 100% !important;
  }
}

/* ===================== MOBILE VIEWPORT ALIGNMENT FIX ===================== */
/* ===================== MOBILE VIEWPORT & CONTAINER ALIGNMENT FIX ===================== */
@media (max-width: 768px) {
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  /* Force all container elements to stay strictly within screen bounds with equal safety padding */
  .container, 
  main.container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
  }

  .site-header {
    width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    margin-bottom: 12px !important;
    box-sizing: border-box !important;
  }

  .header-content {
    display: flex !important;
    flex-direction: column-reverse !important;
    align-items: center !important;
    text-align: center !important;
    gap: 16px !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .header-actions {
    position: static !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 4px;
  }

  .title-wrapper {
    width: 100% !important;
  }

  /* Ensure cards and tables never overflow or get cropped on the right */
  .card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 10px !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
  }

  .quick-summary-bar {
    grid-template-columns: repeat(2, 1fr) !important; /* Stacks the 4 summary metrics cleanly 2x2 on mobile */
    gap: 8px !important;
    padding: 10px !important;
  }
}

#open-slabs-modal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2ff;
  border: 1.5px solid #c7d2fe;
  color: green;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

#open-slabs-modal:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transform: translateY(-1px);
}