/* =============================================================
   EDWIS · free-tool pages — hero, input/result layout, controls,
   result panel, unlock gate, disclosures, "more tools" band.
   Loads after edwis-base.css. Each tool adds only what is unique
   to it in its own page <style>, prefixed with its tool code.
   ============================================================= */

/* ---------- hero ---------- */
.ew-tool-hero { position: relative; overflow: hidden; padding: clamp(28px, 4vw, 56px) 0 clamp(28px, 3.5vw, 48px); }
.ew-tool-hero::before {
  content: ""; position: absolute; width: 640px; height: 640px; right: -180px; top: -300px; pointer-events: none;
  border-radius: 50%; background: radial-gradient(circle, var(--tool-glow, #DCE8FF) 0%, transparent 68%); opacity: .7;
}
.ew-tool-hero .ew-wrap { position: relative; }
.ew-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; font-size: 13.5px; color: var(--ew-ink-3); }
.ew-crumbs a { font-weight: 600; color: var(--ew-ink-2); }
.ew-crumbs a:hover { color: var(--ew-primary); }
.ew-crumbs span[aria-hidden] { color: var(--ew-line-2); }
.ew-tool-tag {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--ew-surface); border: 1px solid var(--ew-line);
  font-size: 12.5px; font-weight: 700; color: var(--ew-ink-2);
}
.ew-tool-tag i { width: 10px; height: 10px; border-radius: 50%; background: var(--tool-tone, var(--ew-primary)); }
.ew-tool-h1 {
  font-size: clamp(34px, 4vw, 54px); font-weight: 700; line-height: 1.08; letter-spacing: -0.035em;
  max-width: 17em; text-wrap: balance;
}
.ew-tool-lede { margin-top: 16px; font-size: clamp(16px, 1.1vw, 17.5px); line-height: 1.7; color: var(--ew-ink-2); max-width: 44em; }
.ew-tool-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; font-size: 13.5px; font-weight: 600; color: var(--ew-ink-2); }
.ew-tool-meta span { display: inline-flex; align-items: center; gap: 7px; }
.ew-tool-meta svg { width: 16px; height: 16px; color: var(--ew-good); }

/* tone per tool: set --tool-tone / --tool-glow on body */
.ew-tone--recruit  { --tool-tone: var(--ew-recruit);  --tool-glow: #DCE8FF; }
.ew-tone--enroll   { --tool-tone: var(--ew-enroll);   --tool-glow: #D7F3EF; }
.ew-tone--operate  { --tool-tone: var(--ew-operate);  --tool-glow: #E7E0FF; }
.ew-tone--graduate { --tool-tone: var(--ew-graduate); --tool-glow: #D9EEFF; }

/* ---------- layout ---------- */
.ew-tool-main { padding: 0 0 clamp(72px, 9vw, 128px); }
.ew-tool-layout {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(20px, 3vw, 40px); align-items: start;
}
.ew-tool-layout--wide { grid-template-columns: minmax(0, 1fr); }

.ew-panel-card {
  background: var(--ew-surface); border: 1px solid var(--ew-line);
  border-radius: var(--ew-r-lg); box-shadow: var(--ew-shadow-1);
}

/* numbered input steps */
.ew-steps-form { padding: clamp(8px, 1.2vw, 12px) clamp(18px, 2.4vw, 32px); }
.ew-step-sec { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; padding: clamp(20px, 2.2vw, 28px) 0; border-top: 1px solid var(--ew-line); }
.ew-step-sec:first-child { border-top: 0; }
.ew-step-sec[hidden] { display: none; }
.ew-step-num {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ew-tint); color: var(--ew-ink-2);
  font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background var(--ew-dur) ease, color var(--ew-dur) ease;
}
.ew-step-sec.is-done .ew-step-num { background: var(--tool-tone, var(--ew-primary)); color: #fff; }
.ew-step-body { display: grid; gap: 18px; min-width: 0; }
.ew-step-h { font-size: 16.5px; font-weight: 700; letter-spacing: -0.012em; line-height: 1.3; padding-top: 5px; }
.ew-step-p { margin-top: -10px; font-size: 14px; color: var(--ew-ink-3); line-height: 1.55; }

.ew-q { display: grid; gap: 8px; }
.ew-q-label { font-size: 14px; font-weight: 600; color: var(--ew-ink); }
.ew-q-hint { font-size: 13px; line-height: 1.55; color: var(--ew-ink-3); }
.ew-q-hint b { color: var(--ew-ink-2); }

/* option pills (single choice, aria-pressed) */
.ew-options { display: flex; flex-wrap: wrap; gap: 8px; }
.ew-options--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ew-option {
  position: relative; flex: 1 1 auto;
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--ew-line-2); border-radius: 12px; background: var(--ew-surface);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ew-ink-2); text-align: left; cursor: pointer;
  transition: border-color var(--ew-fast) ease, background var(--ew-fast) ease, color var(--ew-fast) ease, box-shadow var(--ew-fast) ease;
}
.ew-option::before {
  content: ""; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--ew-line-2); background: #fff;
  transition: border-color var(--ew-fast) ease, box-shadow var(--ew-fast) ease;
}
.ew-option:hover { border-color: var(--ew-ink-3); color: var(--ew-ink); }
.ew-option[aria-pressed="true"] {
  border-color: var(--tool-tone, var(--ew-primary)); color: var(--ew-ink);
  background: color-mix(in srgb, var(--tool-tone, var(--ew-primary)) 6%, #fff);
  box-shadow: 0 0 0 1px var(--tool-tone, var(--ew-primary)) inset;
}
.ew-option[aria-pressed="true"]::before { border-color: var(--tool-tone, var(--ew-primary)); box-shadow: inset 0 0 0 4px var(--tool-tone, var(--ew-primary)); }
.ew-option small { display: block; font-size: 12.5px; font-weight: 500; color: var(--ew-ink-3); }

/* inputs */
.ew-input {
  width: 100%; min-height: 48px; padding: 11px 14px;
  font: inherit; font-size: 16px; color: var(--ew-ink); font-variant-numeric: tabular-nums;
  background: var(--ew-surface); border: 1px solid var(--ew-line-2); border-radius: 12px;
  transition: border-color var(--ew-fast) ease, box-shadow var(--ew-fast) ease;
}
.ew-input::placeholder { color: #8A94AD; }
.ew-input:hover { border-color: var(--ew-ink-3); }
.ew-input:focus { outline: none; border-color: var(--ew-primary); box-shadow: 0 0 0 4px rgba(20, 97, 234, .14); }
select.ew-input {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6683' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.ew-affix { position: relative; display: block; }
.ew-affix > span { position: absolute; top: 50%; transform: translateY(-50%); font-weight: 600; color: var(--ew-ink-3); pointer-events: none; }
.ew-affix--pre > span { left: 14px; }
.ew-affix--pre .ew-input { padding-left: 30px; }
.ew-affix--post > span { right: 14px; }
.ew-affix--post .ew-input { padding-right: 44px; }
.ew-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

/* range + number pair */
.ew-range-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 14px; align-items: center; }
.ew-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer;
  --pct: 0%;
}
.ew-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--tool-tone, var(--ew-primary)) var(--pct), var(--ew-line) var(--pct));
}
.ew-range::-moz-range-track { height: 6px; border-radius: 6px; background: var(--ew-line); }
.ew-range::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--tool-tone, var(--ew-primary)); }
.ew-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: #fff; border: 2px solid var(--tool-tone, var(--ew-primary)); box-shadow: 0 2px 6px rgba(11, 21, 51, .2);
}
.ew-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--tool-tone, var(--ew-primary)); }
.ew-range:focus-visible { outline: none; }
.ew-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(20, 97, 234, .25); }
/* ticks sit at their real value: <span style="--at:30">30%</span> */
.ew-range-ticks { position: relative; height: 16px; margin-right: 118px; font-size: 11.5px; color: var(--ew-ink-3); font-variant-numeric: tabular-nums; }
.ew-range-ticks span { position: absolute; left: calc(11px + (100% - 22px) * var(--at) / 100); transform: translateX(-50%); white-space: nowrap; }
@media (max-width: 640px) { .ew-range-ticks { margin-right: 106px; } }

/* disclosure */
.ew-more { border: 1px solid var(--ew-line); border-radius: 14px; background: var(--ew-bg); }
.ew-more > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 600; color: var(--ew-ink);
}
.ew-more > summary::-webkit-details-marker { display: none; }
.ew-more > summary::after {
  content: ""; width: 9px; height: 9px; flex-shrink: 0; margin-top: -4px;
  border-right: 2px solid var(--ew-ink-3); border-bottom: 2px solid var(--ew-ink-3); transform: rotate(45deg);
  transition: transform var(--ew-dur) var(--ew-ease);
}
.ew-more[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.ew-more > div { padding: 0 16px 16px; display: grid; gap: 12px; }

/* ---------- result panel ---------- */
.ew-result { position: sticky; top: calc(var(--ew-hdr-h) + 16px); }
.ew-result-card {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(22px, 2.6vw, 34px);
  border-radius: var(--ew-r-lg);
  background: #0A1436; color: #fff;
  box-shadow: var(--ew-shadow-3);
}
.ew-result-card::before {
  content: ""; position: absolute; inset: -40% -30% auto auto; width: 420px; height: 420px; z-index: -1; pointer-events: none;
  border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tool-tone, var(--ew-primary)) 55%, transparent), transparent 65%);
  opacity: .7;
}
.ew-result-card :where(a, button):focus-visible { outline-color: #fff; }
.ew-result-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #AEB9D8; }
.ew-result-big {
  margin-top: 12px; font-size: clamp(42px, 5vw, 64px); font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ew-result-big.is-text { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.025em; line-height: 1.15; }
.ew-result-sub { margin-top: 12px; font-size: 15px; line-height: 1.6; color: #C7D0EA; }
.ew-result-sub b { color: #fff; }
.ew-result-empty { display: grid; gap: 14px; }
.ew-result-empty p { font-size: 15.5px; line-height: 1.6; color: #C7D0EA; }
.ew-result-ghost { display: grid; gap: 10px; margin-top: 8px; }
.ew-result-ghost i { display: block; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .08); }
.ew-result-ghost i:nth-child(1) { width: 62%; height: 44px; border-radius: 10px; }
.ew-result-ghost i:nth-child(2) { width: 88%; }
.ew-result-ghost i:nth-child(3) { width: 70%; }

.ew-chip-rule {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1);
  font-size: 13px; font-weight: 700; color: #fff;
}
.ew-chip-rule::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tool-glow-dot, #4FD1C5); }

/* split bar: part A vs part B of a total */
.ew-split { margin-top: 20px; }
.ew-split-bar { display: flex; height: 12px; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, .1); }
.ew-split-bar i { display: block; height: 100%; transition: width 600ms var(--ew-ease); }
.ew-split-bar i:first-child { background: linear-gradient(90deg, #22D3C2, #4FC3FF); }
.ew-split-bar i:last-child { background: rgba(255, 255, 255, .22); }
.ew-split-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: #AEB9D8; font-variant-numeric: tabular-nums; }
.ew-split-legend b { display: block; font-size: 15px; color: #fff; }
.ew-split-legend > div:last-child { text-align: right; }

.ew-result-more { margin-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); }
.ew-result-more > summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 600; color: #DDE3F5;
}
.ew-result-more > summary::-webkit-details-marker { display: none; }
.ew-result-more > summary::after {
  content: ""; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid #AEB9D8; border-bottom: 2px solid #AEB9D8; transform: rotate(45deg);
  transition: transform var(--ew-dur) var(--ew-ease);
}
.ew-result-more[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.ew-result-more-body { padding-bottom: 8px; font-size: 13.5px; line-height: 1.6; color: #C7D0EA; }
.ew-result-more-body ul { margin: 10px 0 0 18px; display: grid; gap: 6px; }
.ew-result-more-body a { color: #9FD0FF; text-decoration: underline; text-underline-offset: 2px; }
.ew-result-cite { margin-top: 10px; font-size: 12px; color: #93A0C4; }
.ew-result-cite b { color: #DDE3F5; }

.ew-warn {
  margin-top: 16px; padding: 14px 16px; border-radius: 14px;
  background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .45);
}
.ew-warn-h { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: #FCD34D; }
.ew-warn-h svg { width: 16px; height: 16px; flex-shrink: 0; }
.ew-warn ul { list-style: none; margin-top: 8px; display: grid; gap: 4px; }
.ew-warn li { font-size: 12.5px; line-height: 1.5; color: #E2E8F8; }
.ew-warn li b { color: #FCD34D; }

/* insight returned by a lead endpoint */
.ew-insight { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(79, 195, 255, .12); border: 1px solid rgba(79, 195, 255, .35); font-size: 13px; line-height: 1.55; color: #E2E8F8; }
.ew-insight[hidden] { display: none; }

/* ---------- unlock gate (on dark and on light) ---------- */
.ew-gate { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); display: grid; gap: 10px; }
.ew-gate-h { display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 700; color: #fff; }
.ew-gate-h svg { width: 18px; height: 18px; color: #9FD0FF; }
.ew-gate-p { font-size: 13.5px; line-height: 1.55; color: #AEB9D8; }
.ew-gate-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ew-gate-row .ew-input { flex: 1 1 200px; min-height: 46px; }
.ew-result-card .ew-gate-row .ew-input { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff; }
.ew-result-card .ew-gate-row .ew-input::placeholder { color: #8E9BC0; }
.ew-result-card .ew-gate-row .ew-input:focus { border-color: #9FD0FF; box-shadow: 0 0 0 4px rgba(159, 208, 255, .2); }
.ew-gate-row .ew-btn { flex: 0 0 auto; min-height: 46px; }
.ew-gate-msg { font-size: 13px; font-weight: 600; color: #9FD0FF; }
.ew-gate-msg.is-err { color: #FCA5A5; }
.ew-gate-msg:empty { display: none; }
.ew-gate-fine { font-size: 11.5px; line-height: 1.5; color: #8E9BC0; }
.ew-gate-fine a { color: #C7D0EA; text-decoration: underline; }
.ew-gate--light { border-top-color: var(--ew-line); }
.ew-gate--light .ew-gate-h { color: var(--ew-ink); }
.ew-gate--light .ew-gate-h svg { color: var(--ew-primary); }
.ew-gate--light .ew-gate-p, .ew-gate--light .ew-gate-fine { color: var(--ew-ink-3); }
.ew-gate--light .ew-gate-fine a { color: var(--ew-ink-2); }
.ew-gate--light .ew-gate-msg { color: var(--ew-primary); }
.ew-gate--light .ew-gate-msg.is-err { color: var(--ew-bad); }

/* light inset box (e.g. an editor inside the form) */
.ew-inset { padding: 16px; border-radius: 14px; background: var(--ew-bg); border: 1px solid var(--ew-line); display: grid; gap: 12px; }
.ew-inset[hidden] { display: none; }
.ew-inset-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14.5px; font-weight: 700; }
.ew-textbtn { border: 0; background: none; padding: 6px 2px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ew-primary); cursor: pointer; }
.ew-textbtn:hover { text-decoration: underline; }

/* ---------- mobile result bar ---------- */
.ew-resbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50;
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 8px 8px 8px 18px; border-radius: 16px;
  background: #0A1436; color: #fff; box-shadow: 0 18px 40px -16px rgba(11, 21, 51, .6);
  transform: translateY(140%); transition: transform 320ms var(--ew-ease);
}
.ew-resbar.is-on { transform: none; }
.ew-resbar-l { min-width: 0; }
.ew-resbar-l small { display: block; font-size: 11.5px; color: #AEB9D8; }
.ew-resbar-l b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- notes / terms ---------- */
.ew-tool-notes { padding: clamp(56px, 7vw, 96px) 0; border-top: 1px solid var(--ew-line); background: var(--ew-surface); }
.ew-tool-notes-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 80px); }
.ew-tool-notes h2 { font-size: clamp(22px, 2vw, 28px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.ew-tool-notes-body { display: grid; gap: 14px; font-size: 14.5px; line-height: 1.7; color: var(--ew-ink-2); }
.ew-tool-notes-body a { color: var(--ew-primary); text-decoration: underline; text-underline-offset: 2px; }
.ew-terms { margin-top: 6px; }
.ew-terms .ew-more > div { font-size: 13px; line-height: 1.65; color: var(--ew-ink-2); }

/* ---------- more tools + demo band ---------- */
.ew-tool-next { padding: clamp(72px, 9vw, 120px) 0; }
.ew-tool-next-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.ew-tool-next-head h2 { font-size: clamp(24px, 2.2vw, 32px); font-weight: 700; letter-spacing: -0.025em; }

/* ---------- print ---------- */
.ew-print { display: none; }
@page { margin: 14mm; }
@media print {
  body > * { display: none !important; }
  body > .ew-print { display: block !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .ew-tool-layout { grid-template-columns: minmax(0, 1fr); }
  .ew-result { position: static; }
  .ew-resbar { display: flex; }
  .ew-tool-notes-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ew-step-sec { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ew-step-num { width: 28px; height: 28px; font-size: 12.5px; }
  .ew-options--grid { grid-template-columns: minmax(0, 1fr); }
  .ew-option { flex: 1 1 100%; }
  .ew-range-row { grid-template-columns: minmax(0, 1fr) 92px; }
  .ew-gate-row .ew-btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ew-split-bar i, .ew-resbar { transition: none; }
}
