/* Interactive tool layout. Loaded after styles.css, which supplies the tokens. */

.tool-head { padding: 1.5rem 0 0; max-width: 44rem; }
.tool-head h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin: 0.9rem 0 0; }
.tool-head .standfirst { font-size: 1.1rem; color: var(--muted); margin: 1.2rem 0 0; }

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: 2.5rem;
  padding: 2.5rem 0 0;
  align-items: start;
}
@media (max-width: 60rem) {
  .tool-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}

/* ---- inputs ---- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 1.1rem;
}
.panel + .panel { margin-top: 1.25rem; }

.field { margin-bottom: 0.9rem; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--muted);
}
.field input[type="number"] {
  width: 100%;
  font: inherit;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  padding: 0.55rem 0.7rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}
/* Keep the number readable: no spinner crowding the value. */
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.hint { font-size: 0.82rem; color: var(--faint); margin: 0.35rem 0 0; }

.toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem;
  background: var(--accent-soft);
  border-radius: 9px;
  margin-top: 1rem;
  cursor: pointer;
}
.toggle input { margin-top: 0.2rem; flex: 0 0 auto; }
.toggle span { font-size: 0.88rem; color: var(--ink); }
.toggle b { display: block; font-weight: 650; margin-bottom: 0.15rem; }

/* ---- results ---- */

.headline-result {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}
.headline-result .label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}
.headline-result .value {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0.35rem 0 0;
  font-variant-numeric: tabular-nums;
}
.headline-result .sub { font-size: 0.95rem; opacity: 0.85; margin: 0.5rem 0 0; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.stat {
  background: var(--surface);
  padding: 1rem 1.1rem;
}
.stat .k {
  font-size: 0.76rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat .v {
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-top: 0.2rem;
}

.verdict {
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.96rem;
  border: 1px solid;
}
.verdict b { display: block; margin-bottom: 0.3rem; font-size: 1rem; }
.verdict.ok { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.verdict.warn { background: transparent; border-color: var(--warn); color: var(--warn); }

.ladder { width: 100%; border-collapse: collapse; font-size: 0.94rem; font-variant-numeric: tabular-nums; }
.ladder th {
  text-align: right;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  font-weight: 650;
  padding: 0 0.9rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.ladder th:first-child, .ladder td:first-child { text-align: left; }
.ladder td { text-align: right; padding: 0.5rem 0.9rem 0.5rem 0; border-bottom: 1px solid var(--line); }
.ladder td:last-child, .ladder th:last-child { padding-right: 0; }
.ladder tr.loss td { color: var(--warn); }
.ladder tr.breakeven td {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.ladder tr.breakeven td:first-child { border-radius: 6px 0 0 6px; padding-left: 0.6rem; }
.ladder tr.breakeven td:last-child { border-radius: 0 6px 6px 0; padding-right: 0.6rem; }

.tool-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.noscript-note {
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
