/* The Tools pages. Colours come from landing.css. */
section.tool-hero { background: var(--aqua); padding: clamp(36px, 6vw, 64px) 0; }
.tool-hero p { margin-top: 14px; max-width: 42em; font-size: 1.1rem; }
.tool-hero .hero-question { margin-top: 8px; color: var(--navy); font: 700 clamp(1.25rem, 2.6vw, 1.7rem)/1.2 var(--head); }
.crumb { margin-bottom: 14px !important; font-size: .95rem !important; font-weight: 600; }
.crumb a { color: var(--blue); }

/* Tools list */
.tool-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.tool-card { display: block; padding: 26px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; text-decoration: none; transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--navy); transform: translateY(-2px); }
.tool-card p { margin: 10px 0 16px; color: var(--muted); }
.tool-card span { color: var(--blue); font-weight: 700; }

/* Calculator layout: figures on the left, answer stays in view on the right */
.calc-wrap { padding: clamp(28px, 5vw, 56px) 0 clamp(48px, 7vw, 88px); }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.calc-side { position: sticky; top: 92px; display: grid; gap: 18px; }
.calc-wrap .panel { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 2.4vw, 26px); }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 1.3rem; font-weight: 700; max-width: none; }
.panel-note { margin-top: 6px; color: var(--muted); font-size: .95rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .96rem; color: var(--navy); }
.field small { color: var(--muted); font-size: .85rem; line-height: 1.35; }
.field-row { display: flex; align-items: center; gap: 12px; }
.field-row input[type="range"] { flex: 1; min-width: 0; }
.input-box { display: flex; align-items: center; background: var(--white); border: 1px solid #8a8f94; border-radius: 10px; overflow: hidden; }
.input-box:focus-within { outline: 3px solid var(--blue); outline-offset: 1px; }
.input-box span { padding: 0 10px; color: var(--muted); font-size: .92rem; white-space: nowrap; }
.input-box input, .field select { width: 100%; min-width: 0; min-height: 44px; border: 0; background: transparent; padding: 8px 10px; font: 500 1rem var(--body); color: var(--ink); }
.input-box input:focus, .field select:focus { outline: none; }
.field select { border: 1px solid #8a8f94; border-radius: 10px; background: var(--white); }
.field select:focus { outline: 3px solid var(--blue); outline-offset: 1px; }
.field-row .input-box { width: 84px; flex: none; }
input[type="range"] { accent-color: var(--navy); height: 28px; }

/* Scenarios */
.scenarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.scenarios button { min-height: 46px; border: 2px solid var(--navy); border-radius: 12px; background: var(--white); color: var(--navy); font: 700 .98rem var(--body); cursor: pointer; }
.scenarios button:hover { background: var(--aqua); }
.scenarios button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.cuts { margin-top: 16px; }
.cuts summary { cursor: pointer; font-weight: 700; color: var(--blue); min-height: 32px; }
.cut { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 2px 10px; align-items: center; margin-top: 12px; }
.cut label { font-size: .94rem; font-weight: 500; }
.cut output { grid-row: span 2; text-align: right; font-weight: 700; color: var(--navy); }
.cut input { width: 100%; }

/* The answer */
.calc-wrap .headline { background: var(--navy); color: var(--white); border-radius: 18px; padding: clamp(20px, 3vw, 30px); }
.headline p { color: var(--aqua); font-weight: 600; }
.headline strong { display: block; margin: 6px 0 2px; font: 800 clamp(2.5rem, 6vw, 3.6rem)/1.05 var(--head); letter-spacing: -.02em; overflow-wrap: anywhere; }
.calc-wrap .headline.is-loss { background: #4b4d4f; }
.headline-sub { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 12px; font-size: .96rem; }
.headline-sub b { color: var(--white); }
.honest { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .14); color: var(--white) !important; font-weight: 500 !important; font-size: .96rem; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--paper); border-radius: 14px; padding: 14px; min-width: 0; }
.stat dt { color: var(--muted); font-size: .88rem; }
.stat dd { margin: 3px 0 0; font: 800 1.5rem/1.15 var(--head); color: var(--navy); overflow-wrap: anywhere; }
.stat small { display: block; margin-top: 3px; color: var(--muted); font-size: .84rem; line-height: 1.3; }
dl.stats { margin: 0; }

.totals { display: grid; gap: 8px; margin-top: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals b { color: var(--navy); }
.totals .total-line { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 700; }

.bars { display: grid; gap: 14px; margin-top: 16px; }
.bar-name { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; font-weight: 600; }
.bar-name span { flex: none; color: var(--muted); font-weight: 500; }
.bar-track { position: relative; height: 12px; margin-top: 5px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.bar-track i { position: absolute; inset: 0 auto 0 0; display: block; border-radius: 99px; }
.bar-now { background: #b3babc; }
.bar-then { background: var(--navy); }
.key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: .86rem; color: var(--muted); }
.key span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--navy); }
.key span.key-now::before { background: #b3babc; }

.compare { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: .94rem; }
.compare th, .compare td { padding: 9px 6px; text-align: right; border-top: 1px solid var(--line); }
.compare thead th { border-top: 0; color: var(--navy); }
.compare tbody th { text-align: left; font-weight: 500; }

.grow-note { margin-top: 10px; }
.grow-note b { color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions button { min-height: 44px; padding: 8px 16px; border: 2px solid var(--navy); border-radius: 999px; background: var(--white); color: var(--navy); font: 600 .94rem var(--body); cursor: pointer; }
.actions button:hover { background: var(--aqua); }
.action-status { min-height: 1.4em; margin-top: 8px; color: var(--blue); font-weight: 600; font-size: .92rem; }
.fine { margin-top: 20px; color: var(--muted); font-size: .9rem; max-width: 62em; }
.calc-wrap .next { background: var(--aqua); border: 0; }
.next .btn { margin-top: 14px; }

/* Margin calculator */
.leaks { display: grid; gap: 10px; margin-top: 16px; }
.leak { border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
.leak[open] { padding-bottom: 16px; border-color: var(--navy); }
.leak summary { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; font-weight: 600; color: var(--navy); }
.leak summary b { margin-left: auto; color: var(--orange); font: 800 1.05rem var(--head); white-space: nowrap; }
.leak-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--aqua); font-size: .86rem; }
.leak-name { min-width: 0; line-height: 1.25; }
.bar-leak { background: var(--orange); }
.gauges { display: grid; gap: 12px; margin-top: 14px; }
.gauge p { display: flex; justify-content: space-between; font-size: .94rem; font-weight: 600; }
.gauge b { color: var(--navy); }
.fix { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.top-list { display: grid; gap: 8px; margin-top: 12px; padding-left: 22px; list-style: decimal; }
.top-list b { color: var(--navy); }
.stat-wide { grid-column: 1 / -1; }
.tool-title { font-size: 1.35rem; font-weight: 700; max-width: none; }

/* The guide under each calculator */
.tool-guide { background: var(--white); }
.tool-guide h2 { max-width: none; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.guide-intro { margin-top: 14px; max-width: 46em; font-size: 1.08rem; }
.guide-steps { margin-top: 18px; padding-left: 24px; list-style: decimal; max-width: 46em; display: grid; gap: 8px; }
.guide-faq-title { margin-top: 40px; }
.guide-faqs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 36px; margin-top: 20px; }
.guide-faqs h3 { font-size: 1.15rem; }
.guide-faqs p { margin-top: 8px; color: var(--muted); }
.guide-other { margin-top: 36px; font-weight: 500; }
.guide-other a { color: var(--blue); font-weight: 700; }

/* Phones: the answer stays visible in a bar while filling in the figures */
.bar-mini { display: none; }
@media (max-width: 960px) {
  .calc-grid { grid-template-columns: minmax(0, 1fr); }
  .calc-side { position: static; }
  .bar-mini { position: fixed; inset: auto 0 0 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--navy); color: var(--white); text-decoration: none; }
  .bar-mini b { font: 800 1.25rem var(--head); }
  .tool-guide { padding-bottom: 110px !important; }
  .guide-faqs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .field-wide { grid-column: auto; }
  .compare { font-size: .86rem; }
}
@media print {
  .top, .foot, .tool-hero, .tool-guide, .bar-mini, .actions, .action-status, .next, .calc-form { display: none !important; }
  .calc-grid { display: block; }
  .calc-side { position: static; }
  .panel, .headline { break-inside: avoid; }
  .calc-wrap .headline { background: var(--white) !important; color: var(--navy); border: 2px solid var(--navy); }
  .headline p, .headline b, .honest { color: var(--navy) !important; }
  .bar-now, .bar-then { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
