/* Tool pages (tools/*.html) — shared with styles.css */
.tools-page main { max-width: 720px; padding-top: 56px; }

.tool-hero { padding: 24px 0 40px; }
.tool-hero h1 {
  font-size: clamp(28px, 5vw, 36px); font-weight: 800; letter-spacing: -0.03em;
  margin: 0 0 12px; line-height: 1.1;
}
.tool-hero .tag { margin-bottom: 20px; }
.tool-lede { color: var(--secondary); margin: 0 0 8px; max-width: 42em; }

.tool { margin: 28px 0 0; }

.field { margin: 0 0 20px; }
.field label, .field-label {
  display: block; font-size: 14px; font-weight: 600; color: var(--secondary);
  margin: 0 0 8px;
}
.field input[type="number"], .field select {
  width: 100%; max-width: 320px;
  background: var(--raised); border: 1px solid var(--hairline-bright);
  border-radius: var(--radius-btn); color: var(--text);
  font-size: 18px; padding: 12px 16px;
  font-family: inherit;
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--mint); outline-offset: 2px;
}

.unit-toggle {
  display: inline-flex; border: 1px solid var(--hairline-bright);
  border-radius: var(--radius-btn); overflow: hidden;
}
.unit-toggle button {
  background: var(--raised); color: var(--secondary); border: 0;
  padding: 10px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.unit-toggle button.is-active { background: var(--cobalt); color: #fff; }

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preset {
  background: var(--raised); color: var(--secondary);
  border: 1px solid var(--hairline-bright); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.preset:hover { color: var(--text); border-color: var(--hairline-bright); }
.preset.is-active { background: var(--cobalt); color: #fff; border-color: transparent; }

.checkbox-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-grid label {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--raised); border: 1px solid var(--hairline-bright);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.checkbox-grid input { accent-color: var(--cobalt); }

.result { margin: 24px 0 0; }
.result h2 { font-size: 20px; margin: 28px 0 12px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.result-card { padding: 18px 20px; }
.result-card .label { font-size: 13px; color: var(--secondary); margin: 0 0 4px; }
.result-card .value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 0; }
.note { color: var(--tertiary); font-size: 14px; margin: 16px 0 0; }

.table-scroll { overflow-x: auto; margin-top: 8px; }
.percent-table { width: 100%; border-collapse: collapse; margin-top: 12px; min-width: 460px; }
.percent-table th, .percent-table td {
  text-align: right; padding: 8px 14px; font-variant-numeric: tabular-nums; font-size: 14px;
}
.percent-table th:first-child, .percent-table td:first-child { text-align: left; }
.percent-table th { color: var(--secondary); font-weight: 600; border-bottom: 1px solid var(--hairline-bright); }
.percent-table td { border-bottom: 1px solid var(--hairline); }

.tool-explain { padding: 40px 0 8px; }
.tool-explain h2 { font-size: 20px; margin: 0 0 10px; }
.tool-explain p { color: var(--secondary); line-height: 1.7; margin: 0; }

.tool-cta { padding: 40px 0 96px; }
.tool-cta-card { padding: 36px 40px; text-align: center; }
.tool-cta-card h2 { font-size: 24px; }
.tool-cta-card p { color: var(--secondary); margin: 8px 0 22px; }

.rpe-table-wrap { overflow-x: auto; }
.rpe-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.rpe-table th, .rpe-table td { text-align: center; padding: 8px 6px; font-variant-numeric: tabular-nums; font-size: 13px; }
.rpe-table th:first-child, .rpe-table td:first-child { text-align: left; font-weight: 600; color: var(--secondary); }
.rpe-table thead th { color: var(--secondary); font-weight: 600; border-bottom: 1px solid var(--hairline-bright); }
.rpe-table td { border-bottom: 1px solid var(--hairline); }

@media (max-width: 719px) {
  .result-grid { grid-template-columns: 1fr; }
  .tool-cta-card { padding: 32px 24px; }
}
