/* ===============================
   GLOBAL
=============================== */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f7f1e6;
  color: #0b1f33;
}

input {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccd3dc;
  font-size: 14px;
}

/* ===============================
   GLOBAL HEADER (LOCKED)
=============================== */
.tt-header {
  background: #002357;/* HEADER NAVY */
}

.tt-header-inner {
  max-width: 1200px;
  margin: auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tt-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tt-brand img {
  height: 44px;
}

/* TITLE */
.tt-brand-title {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.05;
}

/* TAGLINE */
.tt-brand-tagline {
  font-size: 16.25px;
  font-weight: 550;
  color: #F6CC6D;
  margin-top: -4px;
}

.tt-nav a {
  color: #fff;
  margin-left: 20px;
  text-decoration: none;
  font-weight: 500;
}

/* ===============================
   HERO BAND (LOCKED)
=============================== */
.tt-hero {
  background: #003C85; /* HERO NAVY */
  text-align: center;
  padding: 38px 20px 25px;
  border-bottom: 4px solid #d4a047; /* GOLD DIVIDER */
}

.tt-hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.2px;    /* mild tightening */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.tt-hero p {
  margin-top: 8px;
  font-size: 33px;
  color: #EFC569;  /* testing this gold  #f0c75e;*/
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.1px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===============================
   HERO TEXT ON VIDEO (FIX)
=============================== */
.video-hero .tt-hero p {
  color: #ffffff;                 /* White for motion */
  font-weight: 800;               /* ExtraBold */
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}


/* ===============================
   CONTAINER
=============================== */
.tt-container {
  max-width: 1050px;
  margin: auto;
  padding: 40px 20px;
}

/* ===============================
   TABLE WRAPPER FIX
=============================== */
/* TABLE SHOULD RESPECT CARD PADDING */
.tt-card {
  padding-left: 26px;
  padding-right: 26px;
}

.tt-table {
  width: 100%;
}


/* ===============================
   CARDS
=============================== */
.tt-card {
  background: #fff;
  border-radius: 10px;
  padding: 26px;
  margin-bottom: 32px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}

/* ===============================
   TABLE TITLE SPACING FIX
=============================== */
.tt-card h2 {
  margin-top: 0;
  margin-bottom: 12px; /* tight but readable */
}

.tt-table {
  table-layout: fixed;
}

/* Column width control */
.tt-table th:nth-child(1),
.tt-table td:nth-child(1) { width: 20%; } /* Notes */

.tt-table th:nth-child(2),
.tt-table td:nth-child(2) { width: 10%; text-align: center; } /* Tax Year */

.tt-table th:nth-child(3),
.tt-table td:nth-child(3) { width: 18%; } /* Balance */

.tt-table th:nth-child(4),
.tt-table td:nth-child(4) { width: 12%; text-align: center; } /* CSED Months */

.tt-table th:nth-child(5),
.tt-table td:nth-child(5) { width: 20%; text-align: center; } /* Assessed Balance */

.tt-table th:nth-child(6),
.tt-table td:nth-child(6) { width: 20%; } /* Latest CSED */


.tt-table td input {
  width: 100%;
  box-sizing: border-box;
}

/* ===============================
   TOP INPUTS
=============================== */
/* PRELIMINARY INPUT ROW FIX */
.tt-grid-4 {
  display: grid;
  grid-template-columns: 2fr 1.3fr 1.4fr auto;
  gap: 20px;
  align-items: end; /* THIS fixes vertical alignment */
}

/* PRELIM LABELS — readable, not heavy */
.tt-grid-4 label {
  font-weight: 600; /* instead of bold */
  font-size: 13.5px;
  line-height: 1.25;
}

.tt-radio {
  display: flex;
  gap: 14px;
}

.case-inputs {
  margin-bottom: 24px;
}

select {
  padding: 8px 34px 8px 10px; /* room for arrow */
  border-radius: 6px;
  border: 1px solid #ccd3dc;
  background-color: #f4f6f9;
  font-size: 14px;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image:
    linear-gradient(45deg, transparent 50%, #333 50%),
    linear-gradient(135deg, #333 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

/* ===============================
   PRELIMINARY INPUTS — FINAL FIX
=============================== */

.tt-prelim-row {
  display: grid;
  grid-template-columns: 2.2fr 1.3fr 1.5fr;
  gap: 28px;
  align-items: center;
}

.tt-prelim-item {
  display: flex;
  flex-direction: column;
}

.tt-prelim-item label {
  font-weight: 600;
  margin-bottom: 6px;
}

/* Normalize Preliminary Inputs field sizing */
.tt-prelim-item select,
.tt-prelim-item input {
  height: 32px;              /* MATCH input height */
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 6px;
  box-sizing: border-box;
}


.tt-prelim-disclaimer {
  margin-top: 14px;
  font-size: 12px;
  text-align: center;
  color: #444;
}

/* ===============================
   TABLE
=============================== */

/* PRELIMINARY INPUT LABELS — like the titles BOLD */
.tt-prelim-label {
  font-weight: 600;
  color: #0b1f33;
}

.tt-table {
  width: 100%;
  border-collapse: collapse;
  margin-top:4px;          /* FIX: pulls header closer to section title */
}


.tt-table th {
  background: #eef3f8;
  padding: 12px 10px;
  text-align: center;        /* FIX BROWN */
  vertical-align: middle;
  font-weight: 700;          /* FIX GREEN */
  color: #0b1f33;
  border-bottom: 1px solid #dbe3ec;
}

.tt-table tbody tr {
  border-bottom: 1px solid #eef2f6;
}


.tt-table td {
  padding: 6px;
}

.tt-table .year {
  font-weight: 600;
}

.tt-table .calc {
  text-align: center;
  color: #555;
}

/* TABLE HEADER → ROW SPACING FIX */
.tt-table th {
  padding: 14px 10px 16px; /* more bottom padding */
}

.tt-table td {
  padding-top: 10px; /* pushes first input row down */
}

/* FIX B — Latest CSED width on + Add Tax Year rows */
.csed-cell {
  position: relative;
}

.csed-cell input.csed {
  width: 100%;
  min-width: 130px;
}

.csed-cell .delete-row {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-weight: 700;
  color: #999;
}

.csed-cell .delete-row:hover {
  color: #c00;
}

/* ===============================
   FOOTER TABLE AREA
=============================== */
.tt-table-footer {
  margin-top: 18px;
}

.tt-disclaimer {
  font-size: 13px;
  color: #555;
  text-align: center;
  margin: 12px 0;
}

.tt-ppia {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ===============================
   TABLE FOOTER FIX (RED BOX)
=============================== */
.tt-table-footer {
  margin-top: 26px;
}

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

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

.tt-footer-actions label {
  font-weight: 600;
}



/* ===============================
   BUTTONS
=============================== */
.tt-primary-btn {
  background: #0b3a6e;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
}

.tt-secondary-btn { /* CHAT THIS IS OUR WEBSITE BUTTONS */
    display: inline-block;
    margin-top: 22px;
    background: #F6CC6D; /* ORIGINAL LIGHT GOLD */
    padding: 11px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 11.50px;
    color: #071425;
    border: 2px solid #BC8A36; /* TINY DARK GOLD BORDER */
    box-shadow: 0 3px 6px rgba(0,0,0,0.12); /* REDUCED SHADOW */
}

/* ===============================
   SUMMARY BAND #f4e1ac    #f2dfb2
=============================== */
.tt-summary-band {
  background: #f2dfb2;
  border-radius: 10px;
  padding: 18px 22px;
  margin-top: 12px;
}

.tt-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 10px;
  column-gap: 24px;
  font-size: 14px;
}

.tt-summary-grid strong {
  font-weight: 700;
}

.tt-summary-grid span {
  margin-left: 4px;
}


/* ================================
   RESULT CARDS — PREMIUM UI
================================ */

#resultsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.results-header {
  background: #ffffff;
  border: 1px solid #D7B15F;
  border-radius: 14px;
  padding: 20px 24px;
  grid-column: 1 / -1;
}

.results-title {
  color: #013D85;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.results-global-disclaimer {
  margin: 0;
  font-size: .92rem;
  color: #000000;
  font-weight: 450;
  line-height: 1.2;
}

.results-global-disclaimer ul {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
}

.results-global-disclaimer li {
  margin-bottom: 6px;
}


/* ===============================
  New Results CSS 
=============================== */

.result-card {
  background: #ffffff;
  border: 1px solid #D7B15F;
  border-radius: 14px;
  padding: 22px;
}

/* Resolution name */
.result-title {
  color: #013D85;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 14px;
}

/* Rows */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.result-row.stacked {
  flex-direction: column;
  align-items: flex-start;
}

/* Labels */
.result-label {
  color: #073678;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Values */
.result-value {
  color: #000000;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: right;
  white-space: nowrap;
}

.result-row.stacked .result-value {
  text-align: left;
  white-space: normal;
  width: 100%;
}

/* Disclaimer */
.result-disclaimer-title {
  color: #013D85;
  font-size: .96rem;
  font-weight: 600;
  margin-top: 16px;
  letter-spacing: 0.02em;
}

.result-disclaimer {
  font-size: 0.90rem;
  color: #000000;
  margin: 8px 0 0 18px;
  font-weight: 460;
  line-height: 1.30;
}

/* =========================================
   HARD FIX — TABLE INPUT WIDTH REGRESSION
   ========================================= */

/* Force all inputs inside the IA table to behave */
.tt-table input,
.tt-table select {
  width: 100% !important;
  min-width: 140px;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Specific fix for the assessed / balance / csed inputs */
.tt-table td input.balance,
.tt-table td input.csed,
.tt-table td input.taxYear-input,
.tt-table td input.note {
  width: 100% !important;
  min-width: 140px;
}

/* Prevent flex/td shrink behavior */
/* .tt-table td {*/
/*   min-width: 150px;*/
/*   white-space: nowrap;*/
 }

/* Prevent input bleed between table columns */
.tt-table td {
  overflow: hidden;
}
/* =========================================
   FINAL FIX — TABLE CELL COLLAPSE
   ========================================= */

/* Force predictable table behavior */
.tt-table {
  table-layout: fixed;
  width: 100%;
}

/* Stop TDs from shrinking */
.tt-table td {
  width: auto;
  min-width: 160px;
  box-sizing: border-box;
  vertical-align: middle;
}

/* Force inputs to fill the cell */
.tt-table td input {
  width: 100% !important;
  min-width: 160px;
  box-sizing: border-box;
}

/* Kill flex shrink if any TD is flex */
.tt-table td,
.tt-table td * {
  flex-shrink: 0;
}

.locked-year {
  display: inline-block;
  width: 100%;
  text-align: center;
  font-weight: 600;
}

/* Lock Tax Year column so it never overlaps */
.tt-table th:nth-child(2),
.tt-table td:nth-child(2) {
  width: 120px;
  min-width: 120px;
  text-align: center;
}


/* ===============================
   FOOTER
=============================== */
.tt-footer {
  background: #071b2f;
  color: #fff;
  text-align: center;
  padding: 18px;
  font-size: 13px;
}

/* =========================================
   MOBILE FIX — IA TABLE (SAFE OVERRIDE)
   ========================================= */

@media (max-width: 768px) {

  /* Hide table headers on mobile */
  .tt-table thead {
    display: none;
  }

  /* Turn table + rows into block cards */
  .tt-table,
  .tt-table tbody,
  .tt-table tr {
    display: block;
    width: 100%;
  }

  .tt-table tr.year-row {
    background: #ffffff;
    border: 1px solid #e6dcc4;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
  }

  /* Reset TD layout */
  .tt-table td {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 6px 0;
    border: none;
  }

  /* Labels before inputs (mobile clarity) */
  .tt-table td::before {
    font-size: 12px;
    font-weight: 700;
    color: #073678;
    margin-bottom: 4px;
  }

  /* Manual labels by column */
  .tt-table td:nth-child(1)::before { content: "Notes"; }
  .tt-table td:nth-child(2)::before { content: "Tax Year"; }
  .tt-table td:nth-child(3)::before { content: "Balance"; }
  .tt-table td:nth-child(4)::before { content: "CSED Months"; }
  .tt-table td:nth-child(5)::before { content: "Assessed Balance"; }
  .tt-table td:nth-child(6)::before { content: "Latest CSED"; }

  /* Inputs full width */
  .tt-table input {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Locked tax year alignment */
  .locked-year {
    text-align: left;
    padding: 6px 0;
  }

  /* Delete button positioning */
  .csed-cell {
    position: relative;
  }

  .csed-cell .delete-row {
    position: absolute;
    right: 8px;
    top: 36px;
  }

  /* Footer buttons stack */
  .tt-table-footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .tt-ppia {
    flex-direction: column;
    align-items: stretch;
  }

}

@supports (-webkit-touch-callout: none) {
  .tt-table td {
    max-width: 100%;
  }
}

/* =========================================
   MOBILE TABLE FIX — SAFE FOR ALL BROWSERS
   ========================================= */

@media (max-width: 900px) {

  /* Allow horizontal scroll instead of compression */
  .tt-card {
    overflow-x: auto;
  }

  .tt-table {
    min-width: 820px; /* forces scroll instead of overlap */
    table-layout: fixed;
  }

  /* Lock column widths so they never collide */
  .tt-table th:nth-child(1),
  .tt-table td:nth-child(1) { width: 160px; } /* Notes */

  .tt-table th:nth-child(2),
  .tt-table td:nth-child(2) { width: 90px; text-align: center; } /* Tax Year */

  .tt-table th:nth-child(3),
  .tt-table td:nth-child(3) { width: 140px; } /* Balance */

  .tt-table th:nth-child(4),
  .tt-table td:nth-child(4) { width: 120px; text-align: center; } /* CSED Months */

  .tt-table th:nth-child(5),
  .tt-table td:nth-child(5) { width: 160px; text-align: center; } /* Assessed */

  .tt-table th:nth-child(6),
  .tt-table td:nth-child(6) { width: 170px; } /* Latest CSED */

  /* Inputs behave */
  .tt-table input {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  /* Prevent Safari flex weirdness */
  .tt-table td {
    overflow: hidden;
    vertical-align: middle;
  }
}

/* =========================================
   GLOBAL HARD STOP — NO HORIZONTAL SCROLL
========================================= */
html, body {
  overflow-x: hidden;
}

.tt-container,
.tt-card,
.tt-table {
  overflow-x: hidden;
}

/* =========================================
   DESKTOP — KEEP TABLE STABLE
========================================= */
@media (min-width: 769px) {
  .tt-table {
    table-layout: fixed;
    width: 100%;
  }

  .tt-table th,
  .tt-table td {
    white-space: nowrap;
  }
}

/* =========================================
   MOBILE — COMPACT STACKED YEAR CARDS (A)
========================================= */
@media (max-width: 768px) {

  /* Center the card visually */
  .tt-table tbody tr.year-row {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Each row becomes a clean 2-column layout */
  .tt-table tbody tr.year-row td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    gap: 12px;
  }

  /* Labels */
  .tt-table tbody tr.year-row td::before {
    flex: 1;
    text-align: left;
  }

  /* Inputs / values */
  .tt-table tbody tr.year-row td input,
  .tt-table tbody tr.year-row td .locked-year,
  .tt-table tbody tr.year-row td.assessed-cell {
    flex: 1;
    text-align: right;
    max-width: 55%;
  }

  /* Stop weird stretching */
  .tt-table input {
    width: 100% !important;
  }
}


/* === FORCE DELETE ICON VISIBILITY === */
.csed-cell {
  position: relative;
}

.csed-cell .delete-row {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-weight: 700;
  color: #999;
  font-size: 16px;
  z-index: 5;
}

.csed-cell .delete-row:hover {
  color: #c00;
}

@media (max-width: 768px) {

  /* Ensure Total Pre-Assessed always stays visible */
  #totalpreAssessed {
    width: 100% !important;
    min-width: 0 !important;
    display: block;
  }

  .tt-prelim-row,
  .tt-prelim-item {
    width: 100%;
  }
}

/* ===============================
   PDF EXPORT — ISOLATED STYLES
   =============================== */

@media print {
  body {
    background: white;
  }

  .page-break {
    page-break-before: always;
  }

  .watermark {
    position: fixed;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 72px;
    opacity: 0.08;
    z-index: 0;
  }

  .pdf-card {
    page-break-inside: avoid;
  }
}
