/* Air Industries contractor tools: one stylesheet for every tool page.
   Palette follows the live calculator (get.rubioadrian.com). Brand green is for buttons and the
   wordmark only; money marks use --pos / --neg, which pass the chart color checks.
   ONE light look on every device (Adrian 2026-10-06): the dark-mode variant was removed after a phone in
   dark mode rendered it half dark, half light (light text on a light page). `only light` also asks
   browsers not to auto-darken it. */
:root {
  color-scheme: only light;
  --bg: #ffffff;
  --panel: #f2f6f3;
  --ink: #1f2823;
  --sub: #5a665f;
  --muted: #6b766f;
  --line: #e3e8e4;
  --field: #ffffff;
  --brand: #1a6b4a;
  --brand-hover: #14523a;
  --on-brand: #ffffff;
  --pos: #0f7a4f;
  --neg: #b3372b;
  --warn: #8a5d06;
  --pos-soft: #e7f3ec;
  --neg-soft: #f8e9e7;
  --warn-soft: #f7efdc;
  --shadow: 0 1px 2px rgba(31, 40, 35, 0.04), 0 8px 24px rgba(31, 40, 35, 0.06);
  --head: "Lora", Georgia, "Times New Roman", serif;
  --body: "Lato", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }
p { margin: 0; }

/* ---- frame ---- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 720px; margin: 0 auto; padding: 18px 16px 0;
}
.mark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 600 17px/1 var(--head); }
.mark::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.top .crumb { color: var(--sub); font-size: 14px; text-decoration: none; }
.top .crumb:hover { color: var(--ink); text-decoration: underline; }
.wrap { max-width: 720px; margin: 0 auto; padding: 28px 16px 120px; display: grid; gap: 28px; }
@media (min-width: 600px) { .top { padding-inline: 24px; } .wrap { padding-inline: 24px; } }

.intro { display: grid; gap: 10px; }
.eyebrow { color: var(--pos); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
h1 { font-size: clamp(28px, 6.4vw, 38px); }
.lede { color: var(--sub); font-size: 17px; max-width: 60ch; }

/* ---- the answer ---- */
.answer {
  border: 1px solid var(--line); border-radius: 18px; background: var(--bg);
  box-shadow: var(--shadow); padding: 22px 20px; display: grid; gap: 14px;
}
@media (min-width: 600px) { .answer { padding: 28px; } }
.example-tag { color: var(--muted); font-size: 13px; }
.pill {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 14px; font-weight: 700;
}
.pill::before { font-size: 13px; line-height: 1; }
.pill.good { background: var(--pos-soft); color: var(--pos); }
.pill.good::before { content: "✓"; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.warn::before { content: "!"; font-weight: 900; }
.pill.bad { background: var(--neg-soft); color: var(--neg); }
.pill.bad::before { content: "✕"; }
.big-label { color: var(--sub); font-size: 15px; }
.big { font: 700 clamp(42px, 12vw, 60px)/1.02 var(--body); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.big.long { font-size: clamp(30px, 8.5vw, 44px); }
.big.neg { color: var(--neg); }
.big.pos { color: var(--pos); }
.says { font-size: 17px; max-width: 58ch; }
.says strong { font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 20px; border-top: 1px solid var(--line); }
.stat { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stat span { color: var(--sub); font-size: 14px; }
.stat b { font-size: 20px; font-weight: 700; }
.result { display: grid; gap: 14px; }
.answer .err { color: var(--neg); font-weight: 700; }
.answer .err:empty { display: none; }
.is-error #answer .result, .is-error .breakdown { opacity: 0.35; }

/* ---- inputs ---- */
.card { border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; display: grid; gap: 18px; background: var(--bg); }
@media (min-width: 600px) { .card { padding: 26px 28px; } }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.card h2 { font-size: 22px; }
.hint { color: var(--sub); font-size: 14px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
legend { padding: 0; margin-bottom: 4px; font-weight: 700; font-size: 15px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.f { display: grid; gap: 6px; align-content: start; min-width: 0; }
.f .l { font-size: 14px; font-weight: 700; }
.f .h { color: var(--muted); font-size: 13px; line-height: 1.35; }
.in {
  display: flex; align-items: center; height: 48px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--field); padding: 0 12px; gap: 6px; transition: border-color 0.15s;
}
.in:focus-within { border-color: var(--pos); box-shadow: 0 0 0 3px var(--pos-soft); }
.in:has(input[aria-invalid="true"]) { border-color: var(--neg); box-shadow: 0 0 0 3px var(--neg-soft); }
.field-err { color: var(--neg); font-size: 13px; font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.in i { font-style: normal; color: var(--sub); font-size: 16px; }
.in input {
  flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: 700 17px var(--body); padding: 0; height: 100%;
}
.in input[type="text"]:not(.num) { font-weight: 400; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: 700 15px var(--body); padding: 11px 16px; border-radius: 999px; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--sub); }
.btn:focus-visible, a:focus-visible, .stickybar button:focus-visible { outline: 2px solid var(--pos); outline-offset: 3px; }
.stickybar button:focus-visible { outline-offset: 6px; border-radius: 4px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

/* ---- breakdown ---- */
.breakdown { display: grid; gap: 14px; }
.breakdown h2 { font-size: 22px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--sub); font-weight: 700; font-size: 13px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; padding-left: 12px; }
td.n { white-space: nowrap; }
tr.total td { font-weight: 700; border-bottom: 0; }
td .sub { display: block; color: var(--muted); font-size: 13px; }
.neg-t { color: var(--neg); font-weight: 700; }
.pos-t { color: var(--pos); font-weight: 700; }

/* ---- next step + fine print ---- */
.cta { background: var(--panel); border-radius: 18px; padding: 22px 20px; display: grid; gap: 12px; }
@media (min-width: 600px) { .cta { padding: 26px 28px; } }
.cta h2 { font-size: 22px; }
.cta p { color: var(--sub); max-width: 58ch; }
.cta .btn { justify-self: start; }
.fine { color: var(--muted); font-size: 13px; display: grid; gap: 6px; max-width: 64ch; }
.foot { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 16px; }

/* ---- answer bar that follows you down the page ---- */
.stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06);
}
.stickybar button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; max-width: 688px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.stickybar .sb-label { color: var(--sub); font-size: 14px; }
.stickybar .sb-value { font-size: 22px; font-weight: 700; }
.stickybar.is-error .sb-label, .stickybar.is-error .sb-value { color: var(--neg); }
.stickybar.is-error .sb-value { font-size: 16px; }
.stickybar .sb-up { color: var(--sub); font-size: 13px; white-space: nowrap; }

/* ---- chart ---- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--body); fill: var(--sub); font-size: 12px; }
.chart .zero { stroke: var(--sub); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--bg);
  border-radius: 8px; padding: 6px 9px; font-size: 13px; font-weight: 700; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
}

.chart .area-pos { fill: var(--pos-soft); }
.chart .area-neg { fill: var(--neg-soft); }
.chart .line-pos { fill: none; stroke: var(--pos); stroke-width: 2; stroke-linejoin: round; }
.chart .line-neg { fill: none; stroke: var(--neg); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { stroke: var(--bg); stroke-width: 2; }
.chart .dot.neg { fill: var(--neg); }
.chart .dot.pos { fill: var(--pos); }
.chart .lbl { fill: var(--ink); font-weight: 700; paint-order: stroke; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; }
.chart .cross { stroke: var(--sub); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-cap { color: var(--sub); font-size: 14px; }

/* ---- job cost lines ---- */
.line-group { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.line-group:first-of-type { border-top: 0; padding-top: 0; }
.line-name { font-weight: 700; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

/* ---- tool list (home page) ---- */
.tools { display: grid; gap: 12px; }
.tool {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
  border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; text-decoration: none; background: var(--bg);
  transition: border-color 0.15s;
}
.tool:hover { border-color: var(--brand); }
.tool .t-q { font: 600 19px/1.3 var(--head); }
.tool .t-d { color: var(--sub); font-size: 15px; grid-column: 1; }
.tool .t-go { grid-row: 1 / span 2; grid-column: 2; color: var(--pos); font-size: 22px; }


/* ---- question-first flow (2026-10-06) ---- */
.q-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.link { border: 0; padding: 8px 2px; color: var(--pos); text-decoration: underline; text-underline-offset: 3px; }
.btn.link:hover { color: var(--brand-hover); }
.f .l.big-q { font-size: 16px; }
details.tune { border-top: 1px solid var(--line); padding-top: 14px; }
details.tune > summary { cursor: pointer; font-weight: 700; color: var(--pos); list-style: none; display: flex; align-items: center; gap: 8px; }
details.tune > summary::-webkit-details-marker { display: none; }
details.tune > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); font-weight: 700; }
details.tune[open] > summary::before { content: "\2212"; }
details.tune > .tune-body { display: grid; gap: 16px; padding-top: 14px; }
.tune-note { color: var(--sub); font-size: 14px; }
.waiting { display: none; color: var(--sub); font-size: 17px; }
.is-empty #answer .waiting { display: block; }
.is-empty #answer .result { display: none; }
body:not(.has-result) #answer .result { display: none; }   /* a typo before the first answer shows just the message */
.is-empty .stickybar { display: none; }

/* ---- the video + book a call ---- */
.next { display: grid; gap: 16px; }
.next h2 { font-size: 22px; }
.vsl { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.vsl iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vsl-soon { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--sub); text-align: center; padding: 16px; }
.vsl-soon b { color: var(--ink); font-size: 18px; }
.vsl-play { width: 56px; height: 56px; border-radius: 50%; background: var(--brand); position: relative; margin-bottom: 6px; opacity: 0.9; }
.vsl-play::after { content: ""; position: absolute; left: 22px; top: 17px; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.next .btn.primary { justify-self: start; font-size: 17px; padding: 14px 22px; }
.next .hint { margin-top: -6px; }

/* ---- the worked example at the bottom ---- */
.example { border-top: 1px solid var(--line); padding-top: 28px; display: grid; gap: 16px; }
.example h2 { font-size: 22px; }
.example .given { color: var(--sub); font-size: 15px; display: grid; gap: 2px; }
.example .answer { box-shadow: none; background: var(--panel); border-color: var(--panel); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
