:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #64716e;
  --line: #dbe4df;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --mint: #1e8a6a;
  --gold: #d99a25;
  --coral: #d85f48;
  --blue: #3478b8;
  --violet: #6f5fb8;
  --shadow: 0 18px 55px rgba(28, 45, 40, 0.12);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

* {
  box-sizing: border-box;
}

/* CRITICAL FIX: Allow the page to fill the screen */
html, body {
    width: 100% !important;
    min-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden; /* Prevents accidental side-scrolling */
}

/* Ensure the main container is centered within the now full-width body */
main, .app-shell, .planner {
    margin-left: auto !important;
    margin-right: auto !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-left: 104px;
  background:
    linear-gradient(135deg, rgba(30, 138, 106, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(52, 120, 184, 0.12), transparent 30%),
    var(--paper);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font: inherit;
}


.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background: var(--mint);
  color: white;
  font-weight: 700;
  border-radius: 0 0 6px 6px;
  z-index: 1001;
}

.skip-link:focus {
  top: 0;
}

.app-shell {
  width: min(1180px, calc(100vw - 140px));
  margin: 0 auto;
  padding: 28px 0;
}

.planner,
.simulator {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

/* 1. Expand the overall container width */
.planner.salary-suite {
    max-width: 1200px !important;
    margin: 0 auto;
    width: 95%; /* Responsive width */
}

/* 2. Fix the Financial Planning Grid */
.planning-grid {
    display: grid;
    /* This tells the grid: "Fit as many 300px cards as you can, then fill the rest" */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 20px;
    width: 100%;
    overflow: visible; /* Ensures no weird clipping */
}

/* 3. Ensure cards don't shrink too much */
.metric-card {
    min-width: auto; /* Prevents cards from shrinking below their content */
    max-width: 100%; /* Ensures cards don't overflow */
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.salary-suite {
  overflow: hidden;
}

.salary-suite,
.salary-suite h1,
.salary-suite h2,
.salary-suite h3,
.salary-suite label,
.salary-suite p,
.salary-suite span,
.salary-suite strong,
.simulator,
.simulator h2,
.simulator h3,
.simulator label,
.simulator p,
.simulator span,
.simulator strong {
  color: var(--ink);
}

.topbar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--mint) !important;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4.3rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 0.95rem;
}

.topbar-copy,
.mini-copy,
.notice {
  margin: 10px 0 0;
  color: var(--muted) !important;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.input-panel,
.dashboard,
.simulator {
  padding: 24px;
}

.input-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  border-right: 1px solid var(--line);
}

.dashboard {
  min-width: 0;
}

.section-heading {
  margin-top: 24px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

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

.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.full-span {
  grid-column: 1 / -1;
}

label,
.segmented-field legend {
  display: grid;
  gap: 7px;
  color: var(--muted) !important;
  font-size: 0.84rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea {
  padding: 12px;
  resize: vertical;
}

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

input[type="number"] {
  appearance: textfield;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(30, 138, 106, 0.13);
}

.segmented-field {
  min-width: 0;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.compact-field {
  margin: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f8f5;
}

.segmented.two {
  grid-template-columns: repeat(2, 1fr);
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 36px;
  border-radius: 6px;
  color: var(--muted) !important;
  cursor: pointer;
  text-align: center;
}

.segmented input:checked + span {
  background: var(--ink);
  color: white !important;
}

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

.toggle-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
  color: var(--ink) !important;
}

.toggle-card input {
  width: 18px;
  min-height: 18px;
}

.submit-btn,
.ghost-btn {
  min-height: 44px;
  border-radius: 7px;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.submit-btn {
  width: 100%;
  margin-top: 16px;
  border: 0;
  background: var(--mint);
  color: white !important;
}

.submit-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(28, 45, 40, 0.12);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink) !important;
  padding: 0 14px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.premium-card,
.metric-card,
.future-card,
.chart-card,
.breakdown-card,
.offer-card,
.analyzer-result > article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.premium-card,
.metric-card,
.future-card,
.chart-card,
.offer-card {
  padding: 16px;
}

.premium-card:hover,
.metric-card:hover,
.future-card:hover,
.chart-card:hover,
.offer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(28, 45, 40, 0.1);
}

.premium-card > span,
.future-card span,
.offer-card span {
  color: var(--muted) !important;
  font-size: 0.84rem;
  font-weight: 800;
}

.premium-card > strong,
.future-card strong,
.metric-card > strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.salary-slip {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.salary-slip div,
.split-row,
.projection-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2ef;
}

.salary-slip div:last-child,
.split-row:last-child,
.projection-row:last-child {
  border-bottom: 0;
}

.salary-slip span,
.split-row span,
.projection-row span {
  color: var(--muted) !important;
  font-weight: 700;
}

.net-row {
  border-top: 2px solid var(--ink);
}

.net-row strong,
.highlight strong {
  color: var(--mint) !important;
}

.stars {
  margin-top: 8px;
  color: var(--gold) !important;
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.check-list,
.insight-panel ul,
.recommendation-panel ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li,
.insight-panel li,
.recommendation-panel li {
  border-left: 4px solid var(--mint);
  padding: 10px 12px;
  background: #f5faf7;
  color: #293532;
  line-height: 1.45;
}

.recommendation-panel {
  margin-top: 18px;
}

.breakdown-card {
  margin-top: 18px;
  padding: 16px;
  background: #fafbf9;
}

.breakdown-card summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.breakdown-rows {
  margin-top: 12px;
}

.mini-grid,
.planning-grid,
.chart-grid,
.offer-results {
  display: grid;
  gap: 14px;
}

.mini-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 18px;
}

.metric-card h3,
.chart-card h3 {
  margin-bottom: 12px;
  color: var(--muted) !important;
}

.simulator {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 22px;
}

.chart-grid {
  grid-template-columns: repeat(2, 1fr);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

canvas {
  width: 100%;
  min-height: 220px;
}

.offer-results {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.offer-card.best {
  border-color: var(--mint);
  background: #f2faf6;
}

.offer-card strong {
  display: block;
  margin: 8px 0;
  font-size: 1.4rem;
}

.offer-card p {
  margin: 6px 0;
  color: var(--muted) !important;
  line-height: 1.4;
}

.summary-card {
  background: #f8fbfa;
}

.projection-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.projection-row {
  padding: 12px 14px;
}

.total-card {
  width: min(360px, 100%);
}

.planning-grid {
  grid-template-columns: repeat(5, 1fr);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.analyzer-result {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.chat-box {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
}

.chat-box .submit-btn {
  margin: 0;
}

.chat-output {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--ink);
  line-height: 1.5;
}

/* ===========================
   Calculator + FAQ Layout
=========================== */

.tool-layout{

    grid-template-columns: minmax(0,1fr) 360px;

    gap:40px;

    align-items:start;

    margin-bottom:60px;

}

.planner.salary-suite{

    width:100%;

}

.faq-sidebar{

    position:sticky;

    top:100px;

}

.faq-card{

    background:#ffffff;

    border-radius:18px;

    padding:28px;

    box-shadow:0 12px 35px rgba(0,0,0,.08);

    border:1px solid #e8eef6;

}

.faq-card h2{

    margin-bottom:12px;

}

.faq-intro{

    color:#666;

    margin-bottom:25px;

    line-height:1.7;

}

.faq-card details{

    border:1px solid #edf0f5;

    border-radius:10px;

    margin-bottom:12px;

    padding:14px;

    transition:.25s;

}

.faq-card details:hover{

    border-color:#0a7f67;

}

.faq-card summary{

    cursor:pointer;

    font-weight:600;

    color:#0D1B2A;

}

.faq-card p{

    margin-top:12px;

    line-height:1.8;

    color:#555;

}

.faq-card details[open]{

    background:#f7fbff;

}

/* Container to hold both Form and FAQ side-by-side */
.layout {
  display: grid;
  grid-template-columns: 1fr 300px; /* Form takes main space, FAQ takes 300px */
  gap: 32px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

/* The FAQ Sidebar Container */
.faq-sidebar {
  position: sticky;
  top: 20px; /* Distance from top when scrolling */
  height: fit-content;
}

.faq-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.faq-card h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: #1a1a1a;
}

.faq-intro {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Accordion Styling */
details {
  border-bottom: 1px solid #f0f0f0;
  padding: 12px 0;
}

details summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #333;
}

details summary::after {
  content: '+';
  font-size: 1.2rem;
  color: #007bff;
}

details[open] summary::after {
  content: '−';
}

.faq-content {
  padding-top: 10px;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
}

/* Hide result sections by default */
.dashboard, .insight-panel, .recommendation-panel, .health-card {
  display: none;
}

/* Show them only when the parent has the active class */
.planner.results-active .dashboard,
.planner.results-active .insight-panel,
.planner.results-active .recommendation-panel,
.planner.results-active .health-card {
  display: block; /* or flex/grid depending on layout */
}

/* Initial state: Hidden */
.dashboard, 
.insight-panel, 
.recommendation-panel, 
.health-card {
  display: none !important;
}

/* Active state: Visible */
.planner.results-active .dashboard,
.planner.results-active .insight-panel,
.planner.results-active .recommendation-panel,
.planner.results-active .health-card {
  display: block !important; /* Use 'flex' or 'grid' if your layout requires it */
}




/* Mobile Responsive */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr; /* Stack vertically on mobile */
  }
  
  .faq-sidebar {
    position: static; /* Remove sticky on mobile */
  }
}



@media (max-width: 1024px) {
  body {
    padding-left: 92px;
  }

  .app-shell {
    width: min(100% - 32px, 1180px);
  }

  .layout,
  .hero-metrics,
  .mini-grid,
  .chart-grid,
  .offer-results,
  .planning-grid {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 768px) {
  body {
    padding-left: 0;
    padding-bottom: 92px;
  }

  .app-shell {
    width: 100%; /* Changed from min-width for better edge-to-edge flow */
    padding: 12px 0;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
  }

  .input-panel,
  .dashboard,
  .simulator {
    padding: 18px;
    width: 100% !important; /* Force panels to fill width */
  }

  /* Fixed Grid layouts for mobile */
  .field-grid,
  .three-col,
  .compact-grid,
  .toggle-grid,
  .chat-box,
  .mini-grid, /* Added this */
  .planning-grid { /* Added this */
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* --- SPECIFIC FIX FOR TAX OPTIMIZATION --- */
  .mini-grid .metric-card {
    width: 100%;
    padding: 16px;
  }

  /* If your tax values are in a row, stack them too */
  .tax-regime-row, .cost-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
  }

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

@media print {
  body {
    padding-left: 0;
    padding-bottom: 0;
  }

  .app-shell {
    width: 100%;
  }

  .planner,
  .simulator {
    box-shadow: none;
    break-inside: avoid;
  }

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

@media (min-width: 1024px) {
  /* Expand the main containers */
  main.app-shell, .planner {
    max-width: 1200px; /* Or 100% */
    margin: 0 auto;
  }

  /* Change grid to two columns */
  .layout {
    display: grid;
    grid-template-columns: 400px 1fr; /* Fixed width for inputs, flexible for results */
    gap: 2rem;
    align-items: start;
  }
}

/* 2-Column Desktop Layout */
@media (min-width: 1024px) {
    /* 1. Expand the container to use more screen space */
    .planner.salary-suite {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }

    /* 2. Set the input and dashboard side-by-side */
    .layout {
        display: grid;
        grid-template-columns: 420px 1fr; /* Left side fixed, Right side fills space */
        gap: 32px;
        align-items: start; /* Keeps panels at the top */
    }

    /* 3. Keep the "Simulators" below in a full-width grid */
    .simulator-grid {
        grid-column: 1 / -1; /* Spans both columns */
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 20px;
    }
}

.chart-card {
    position: relative;
    height: 300px; /* Force a height for Chart.js to fill */
    width: 100%;
}
canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .planner.salary-suite {
        width: 100% !important;
        max-width: 100vw;
        margin: 0;
        padding: 16px;
    }

    .layout {
        display: flex;
        flex-direction: column; /* Stacks inputs on top of results */
        grid-template-columns: 1fr !important;
        width: 100%;
        gap: 20px;
    }

    .input-panel, .dashboard {
        width: 100% !important;
    }
}

#downloadReportBtn.ghost-btn {
    display: none !important; /* Hide the duplicate download button */
}

/* Make the new main button look even more like a final action */
#calculateBtn.submit-btn {
    background-color: #1e8a6a;
    color: white;
    font-weight: 700;
    transition: transform 0.2s;
}

#calculateBtn.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 138, 106, 0.2);
}

@media (min-width: 1024px) {
    .chart-card {
        min-width: 400px !important; /* Give it more horizontal space */
        height: 350px !important;    /* Give it more vertical space */
    }
    
    .chart-card.wide {
        grid-column: span 2; /* Make the growth chart even wider */
        width: 100% !important;
    }
}


@media (max-width: 768px) {
  /* 1. Center the main container */
  .topbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
  }

  /* 2. Target the inner wrapper */
  .topbar > div {
    width: 100%;
    text-align: center;
  }

  /* 3. Force center all text elements */
  .topbar .eyebrow, 
  .topbar h1, 
  .topbar .topbar-copy {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
  }
}

@media(max-width:1200px){

.tool-layout{

    grid-template-columns:1fr;

}

.faq-sidebar{

    position:static;

    margin-top:40px;

}

}