/* Tool pages: loaded after /assets/site.css, which holds the tokens, type,
   header, prose, pre-order card, CTA and footer. This file only adds the
   interactive parts: inputs, choices, results. */

.tool {
  margin: 36px 0 0;
  padding: clamp(20px, 4vw, 44px);
  background: var(--soft);
  border: 1px solid var(--line);
}
.tool + .tool { margin-top: 20px; }
.tool-step { margin: 0 0 6px; color: #9a9aa0; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.tool h2 { margin: 0; font-size: clamp(22px, 2.6vw, 28px); font-weight: 620; letter-spacing: -.04em; line-height: 1.1; }
.tool-sub { max-width: 62ch; margin: 8px 0 0; color: var(--body); font-size: 15px; line-height: 1.5; }

/* Inputs */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px 24px; margin: 22px 0 0; }
.q { margin: 22px 0 0; }
.grid .q { margin: 0; }
.q > label, .q > .qlabel { display: block; margin: 0 0 8px; font-size: 15px; font-weight: 650; letter-spacing: -.015em; line-height: 1.3; }
.q .qhint { display: block; margin: -4px 0 8px; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.4; }
.input-wrap { position: relative; display: flex; align-items: stretch; }
.input-wrap .affix {
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid #c9c9ce;
  background: #fff;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.input-wrap .affix:first-child { border-right: 0; }
.input-wrap .affix:last-child { border-left: 0; }
input[type="number"], input[type="text"], select {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 1px solid #c9c9ce;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 550;
  letter-spacing: -.01em;
  -moz-appearance: textfield;
  appearance: none;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%231d1d1f' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
  font-size: 16px;
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--ink); outline-offset: -1px; }
input::placeholder { color: #a9a9af; font-weight: 400; }

/* Segmented choices and quiz answers: real radios, styled as buttons. */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.seg legend { padding: 0; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #c9c9ce;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.3;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.opt span:hover { border-color: var(--ink); }
.opt input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.seg.stack { flex-direction: column; }
.seg.stack .opt span { display: flex; width: 100%; padding: 13px 18px; text-align: left; }

/* The result: the typed answer style from the templates, big. */
.result {
  margin: 28px 0 0;
  padding: clamp(20px, 3.4vw, 34px);
  background: #fff;
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
}
.result-brow { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.answer {
  color: var(--answer-ink);
  font-family: var(--answer);
  font-weight: 400;
  letter-spacing: -.035em;
}
.verdict { margin: 8px 0 0; font-size: clamp(28px, 4.6vw, 44px); line-height: 1.12; }
.verdict-line { max-width: 56ch; margin: 12px 0 0; color: var(--body); font-family: var(--serif); font-size: clamp(17px, 1.6vw, 19px); line-height: 1.5; letter-spacing: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; margin: 24px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
.stat dt { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat dd { margin: 2px 0 0; font-size: 26px; font-weight: 650; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.note { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.flag { margin: 18px 0 0; padding: 12px 16px; border-left: 3px solid var(--cover-blue); background: #f3f5ff; color: var(--ink); font-size: 15px; line-height: 1.5; }
.flag b { font-weight: 650; }

/* Where you land between the goals */
.track { position: relative; margin: 30px 0 4px; }
.track-bar { position: relative; height: 8px; background: var(--line); }
.track-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--cover-blue); transition: width .5s cubic-bezier(.2, .75, .3, 1); }
.track-ticks { position: relative; height: 8px; margin-top: -8px; }
.track-ticks i { position: absolute; top: 0; width: 2px; height: 8px; background: #fff; }
.track-ends { display: flex; justify-content: space-between; margin: 8px 0 0; color: var(--muted); font-size: 12px; }

/* Goals table */
.goals { width: 100%; margin: 20px 0 0; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.goals th, .goals td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.goals th { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.goals td { font-size: 15px; }
.goals td.n, .goals th.n { text-align: right; padding-right: 0; padding-left: 10px; white-space: nowrap; }
.goals .gname { font-weight: 650; letter-spacing: -.015em; }
.goals .gsub { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.goals tr.reached td { color: var(--muted); }
.goals tr.reached .gname::after { content: " ✓"; color: var(--cover-blue); }
.goals tr.here td { background: #f3f5ff; }
.goals tr.here td:first-child { box-shadow: inset 3px 0 0 var(--cover-blue); padding-left: 12px; }

/* Small inline actions under a result */
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.row-actions .btn { min-height: 44px; padding: 10px 18px; font-size: 14px; }
.copied { align-self: center; color: var(--muted); font-size: 13px; }

/* The price sentence */
.sentence { margin: 10px 0 0; font-size: clamp(17px, 2.1vw, 21px); line-height: 1.5; letter-spacing: -.02em; }

/* Quiz */
.quiz { margin: 0; padding: 0; list-style: none; counter-reset: q; }
.quiz > li { padding: 24px 0; border-bottom: 1px solid var(--line); }
.quiz > li:first-child { padding-top: 8px; }
.quiz > li:last-child { border-bottom: 0; }
.quiz .qlabel { display: flex; gap: 12px; align-items: baseline; margin: 0 0 14px; font-size: 18px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }
.quiz .qlabel .num { transform: translateY(-2px); }
.quiz .seg { margin-left: 38px; }
.quiz-part { margin: 30px 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.quiz-part:first-child { margin-top: 0; }
.progress { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.race-facts { display: grid; gap: 0; margin: 22px 0 0; padding: 0; }
.race-facts div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.race-facts dt { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.race-facts dd { margin: 0; color: var(--body); font-size: 15px; line-height: 1.5; }
.mix { display: grid; gap: 8px; margin: 20px 0 0; }
.mix-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 40px; gap: 12px; align-items: center; font-size: 14px; }
.mix-bar { height: 8px; background: var(--line); }
.mix-bar i { display: block; height: 100%; background: var(--ink); transition: width .5s cubic-bezier(.2, .75, .3, 1); }
.mix-row.top .mix-bar i { background: var(--cover-blue); }
.mix-row b { font-weight: 600; }
.mix-row span:last-child { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Tools list on /tools */
.currency-pick { display: inline-flex; align-items: center; gap: 8px; margin: 22px 0 0; color: var(--muted); font-size: 14px; }
.currency-pick select { width: auto; height: 38px; font-size: 14px; }

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .quiz .seg { margin-left: 0; }
  .race-facts div { grid-template-columns: 1fr; gap: 4px; }
  .mix-row { grid-template-columns: 104px minmax(0, 1fr) 36px; }
  .goals .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .track-fill, .mix-bar i { transition: none; }
}
@media print {
  .tool { border: 0; padding: 0; background: #fff; }
  .row-actions, .currency-pick { display: none !important; }
}
