/* keeper-rate.css — the board on /keeper-rate.html.
 *
 * Loads AFTER prompt-builder.css and deliberately reuses its shell: .tool-intro,
 * .eyebrow, .field, .tool-btn, .inline-access, .method, .faq-section and footer all
 * come from there. One design system for the tool pages; this file only adds the
 * pieces the board itself needs.
 *
 * 🔴 Every element whose content arrives from the API reserves its height up front.
 * The verdict line and the table rows are the two things that land late, and a page
 * that reflows under the reader's cursor when the fetch resolves is the failure this
 * guards against. Skeleton rows are the same height as real rows for the same reason.
 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Headline finding ─────────────────────────────────────────────────────── */

.verdict {
  padding: 0 0 34px;
}

.verdict-card {
  /* Holds the tallest state (two wrapped lines plus the sub) so nothing below it
     moves when the finding replaces the loading text. */
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 132px;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}

.verdict-line {
  margin: 0;
  color: var(--text);
  font: 500 26px/1.28 var(--disp);
  letter-spacing: 0;
}

.verdict-card[data-state="loading"] .verdict-line,
.verdict-card[data-state="empty"] .verdict-line {
  color: var(--dim);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
}

.verdict-line .fig {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 500;
  white-space: nowrap;
}

.verdict-sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.verdict-sub .n {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
}

/* Sits directly under the headline card: the correction travels with the number it
   corrects, because a reader who takes only the headline should not leave with the
   wrong cause. Static prose, so it needs no reserved height. */
.verdict-note {
  margin-top: 14px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101011;
}

.verdict-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font: 600 15px/1.3 var(--sans);
}

.verdict-note p {
  max-width: 74ch;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.verdict-note p:last-child {
  margin-bottom: 0;
}

.verdict-note-caveat {
  color: var(--dim) !important;
  font-size: 12.5px !important;
}

/* ── The board ────────────────────────────────────────────────────────────── */

.board {
  padding: 0 0 8px;
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.board-head h2 {
  margin: 0;
  font: 600 26px/1.2 var(--disp);
  letter-spacing: 0;
}

.board-head span {
  /* Reserved so the status text swapping length never nudges the heading. */
  min-height: 16px;
  color: var(--dim);
  font: 500 11px/1.4 var(--mono);
  text-align: right;
}

.board-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 12px;
  margin-bottom: 26px;
  padding: 18px 20px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.lane + .lane {
  margin-top: 30px;
}

.lane h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* Wide content scrolls inside its own box. The page body never scrolls sideways. */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.odds-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
}

.odds-table th,
.odds-table td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: middle;
}

.odds-table thead th {
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  font: 500 10.5px/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.odds-table tbody tr + tr td {
  border-top: 1px solid var(--border-subtle);
}

.odds-table .num {
  text-align: right;
  font-family: var(--mono);
  white-space: nowrap;
}

.odds-table thead .strong {
  color: var(--accent);
}

.odds-table td.strong {
  color: var(--accent);
  font-weight: 500;
}

.odds-table tbody td {
  height: 50px;
  color: var(--muted);
}

.odds-table .model {
  color: var(--text);
  font-weight: 500;
}

.odds-table .frame {
  margin-left: 8px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
}

.odds-table .retired {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--dim);
  font: 500 10px/1.4 var(--mono);
  text-transform: uppercase;
  vertical-align: middle;
}

.odds-table .best td {
  background: rgba(184, 184, 188, .05);
}

/* Same 50px as a filled row, so data landing never changes the table's height. */
.odds-table tr.skeleton td {
  height: 50px;
  color: transparent;
}

.odds-table .empty td {
  color: var(--dim);
  font-size: 13.5px;
  text-align: left;
}

.lane-note,
.board-source {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.5;
}

.board-source {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 11.5px;
}

/* ── Project estimate ─────────────────────────────────────────────────────── */

.planner {
  padding: 46px 0 6px;
}

.planner h2 {
  max-width: 700px;
  margin: 0 0 14px;
  font: 600 30px/1.2 var(--disp);
  letter-spacing: 0;
}

.planner-lede {
  max-width: 66ch;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
}

.planner-form {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.planner-form .field {
  margin-bottom: 0;
}

.planner-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #101011;
  color: var(--text);
  font-family: var(--mono);
}

/* Reserved: the estimate is two lines at every width this grid survives, so filling
   it in never moves the block below. */
.planner-out {
  min-height: 92px;
}

.planner-line {
  margin: 0;
  color: var(--text);
  font: 400 17px/1.5 var(--sans);
}

.planner-out[data-state="loading"] .planner-line {
  color: var(--dim);
}

.planner-line .fig {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 500;
  white-space: nowrap;
}

.planner-note {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ── The one call to action ───────────────────────────────────────────────── */

.tool-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 34px;
  padding: 22px 24px;
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  background: #101011;
}

.tool-cta[hidden] {
  display: none;
}

.tool-cta-copy {
  min-width: 0;
}

.tool-cta-copy strong {
  display: block;
  color: var(--text);
  font: 600 20px/1.25 var(--disp);
}

/* Reserved: the credit line is filled in from the live offer, and it must not push
   the button down when it arrives. */
.tool-cta-copy p {
  min-height: 20px;
  max-width: 60ch;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.tool-cta .tool-btn {
  flex: 0 0 auto;
}

.method-caveat {
  max-width: 74ch;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.method-caveat strong {
  color: var(--text);
}

@media (max-width: 780px) {
  .planner-form {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .planner h2 {
    font-size: 25px;
  }

  .planner-out {
    min-height: 118px;
  }

  .verdict-line {
    font-size: 22px;
  }

  .verdict-card {
    min-height: 148px;
  }

  .board-head h2 {
    font-size: 23px;
  }
}

@media (max-width: 560px) {
  .tool-cta {
    padding: 18px;
  }

  .tool-cta .tool-btn {
    width: 100%;
  }

  .board-controls {
    grid-template-columns: 1fr;
    padding: 16px 16px 2px;
  }

  .verdict-card {
    min-height: 176px;
    padding: 20px;
  }

  .verdict-line {
    font-size: 20px;
  }

  .board-head {
    flex-direction: column;
    gap: 4px;
  }

  .board-head span {
    text-align: left;
  }
}
