/* Worthivo decision tools (F-034). Layered on worthivo-site.css tokens. */

.tool-article,
.tool-hub-hero,
.tool-grid {
  margin: 0 auto;
  max-width: 1280px;
  padding-inline: max(24px, calc((100vw - 1280px) / 2));
}

.tool-hero {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 64px 0 40px;
}

.tool-hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(34px, 5.6vw, 60px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0;
  max-width: 18ch;
}

.tool-dek {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.5;
  margin: 0;
  max-width: 62ch;
}

.section-label {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0;
  text-transform: uppercase;
}

/* ------------------------------- layout -------------------------------- */

.tool-layout {
  align-items: start;
  display: grid;
  gap: 40px;
  grid-template-columns: 1.05fr 0.95fr;
  padding: 48px 0 8px;
}

.tool-form { display: flex; flex-direction: column; gap: 26px; }

.tool-form fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 20px 0 0;
}

.tool-form legend {
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 0;
  text-transform: uppercase;
}

.tool-field { display: flex; flex-direction: column; gap: 6px; }

.tool-field label { font-size: 15px; font-weight: 700; }

.tool-field input,
.device-row input {
  background: var(--paper-bright);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  min-height: 48px;
  /* A grid item's default min-width is auto, which stops it shrinking below its
     content and pushes the row wider than its column. */
  min-width: 0;
  padding: 0 14px;
  width: 100%;
}

/* Numbers are short and the columns are the narrowest on the row, so they give
   back some of the padding the text field can afford to keep. */
.device-row input[type="number"] { padding: 0 10px; }

.tool-field input:focus-visible,
.device-row input:focus-visible {
  border-color: var(--teal);
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.tool-field small { color: var(--muted); font-size: 13px; line-height: 1.4; }

/* device table */

.device-head,
.device-row {
  display: grid;
  gap: 8px;
  /* Floors, not bare fr. The columns are proportional but the inputs carry a
     fixed 20-28px of horizontal padding, so between 900px (where the layout
     splits into form + results) and about 1150px the padding was eating the
     whole box and clipping the value: 60 rendered as a partial 6. minmax keeps
     every numeric field wide enough for a four-digit watt figure. */
  grid-template-columns:
    minmax(0, 2fr)
    minmax(78px, 1fr)
    minmax(78px, 1fr)
    minmax(70px, 0.7fr);
}

.device-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.device-row + .device-row { margin-top: 8px; }

.device-hint { color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Sizing only. Colour, border and hover come from worthivo-site.css. */
.button-outline {
  align-items: center;
  align-self: flex-start;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
}

.button-outline:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

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

.tool-results {
  background: var(--ink);
  color: var(--paper-bright);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 30px 28px 32px;
  position: sticky;
  top: 20px;
}

.tool-results .section-label { color: var(--lime); }

.tool-output-row { display: flex; flex-direction: column; gap: 3px; }

.tool-output-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.74;
  text-transform: uppercase;
}

.tool-output-row strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(24px, 3.4vw, 34px);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.tool-output-row small { font-size: 12px; line-height: 1.4; opacity: 0.7; }

.tool-output-split {
  border-top: 1px solid rgba(255, 250, 243, 0.22);
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  padding-top: 18px;
}

.tool-output-split .tool-output-row strong { font-size: 22px; }

.tool-output-highlight {
  border-top: 1px solid rgba(255, 250, 243, 0.22);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 18px;
}

.tool-output-highlight .tool-output-row strong {
  color: var(--lime);
  font-size: 19px;
  line-height: 1.25;
}

.tool-note { font-size: 12.5px; line-height: 1.5; margin: 0; opacity: 0.72; }

/* ------------------------------ explainer ------------------------------ */

.tool-explainer {
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 44px;
  padding: 40px 0 56px;
}

.tool-explainer h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}

.tool-explainer p { font-size: 16.5px; line-height: 1.62; margin: 0; max-width: 68ch; }

/* --------------------------------- hub --------------------------------- */

.tool-hub-hero {
  align-items: end;
  display: grid;
  gap: 30px;
  grid-template-columns: 1fr 1fr;
  padding-block: 64px 40px;
}

.tool-hub-hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 12px 0 0;
}

.tool-hub-hero h1 span { color: var(--teal); }
.tool-hub-hero > p { color: var(--muted); font-size: 17px; line-height: 1.55; margin: 0; }

.tool-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  padding-bottom: 64px;
}

.tool-card {
  background: var(--paper-bright);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px 28px 32px;
}

.tool-card > p:first-child {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0;
  text-transform: uppercase;
}

.tool-card h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

.tool-card h2 a:hover { color: var(--teal); }
.tool-card p { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0; }

.tool-card .card-link {
  border-bottom: 1px solid currentColor;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 800;
  margin-top: auto;
  padding-bottom: 3px;
}

@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; gap: 30px; }
  .tool-results { position: static; }
  .tool-hub-hero { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 560px) {
  .device-head { display: none; }
  .device-row { grid-template-columns: 1fr 1fr; }
  .device-row input:first-child { grid-column: 1 / -1; }
  .tool-output-split { grid-template-columns: 1fr; }
}
