/* ============================================================
   Public site — layered on top of /styles.css.
   Tuned for readability first: larger body text, generous line
   height, short measure. Tokens and .card/.badge/.btn/.field
   come from the app's design system.
   ============================================================ */

.gbody {
  background: var(--bg);
  padding-bottom: 0;
  font-size: 17px;
  line-height: 1.62;
  /* Column layout so a short page still pins the footer to the bottom
     instead of leaving a stripe of background below it. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.gshell { flex: 1; width: 100%; }

/* ---------- Technician "customer view" bar ---------- */
.techbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  background: #1d3a5c; color: #fff; padding: 8px 18px;
  font-size: .84rem;
}
.techbar .tb-eye { font-size: 1.1rem; }
.techbar .tb-txt { flex: 1; line-height: 1.3; }
.techbar .tb-txt strong { display: block; font-size: .8rem; letter-spacing: .02em; }
.techbar .tb-txt span { opacity: .8; font-size: .78rem; }
.techbar .btn.dark { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
.techbar .btn.dark:hover { background: rgba(255,255,255,.26); }
body.has-techbar .gtop { top: 0; }

/* ---------- Top bar ---------- */
.gtop {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  background: var(--charcoal); color: #fff;
  padding: 11px 18px; padding-top: calc(11px + env(safe-area-inset-top));
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.gtop .grow { flex: 1; }
.gbrand { display: flex; align-items: center; gap: 11px; color: #fff; cursor: pointer; }
.gbrand .logo-wrap { background: #fff; border-radius: 8px; padding: 5px 8px; display: flex; align-items: center; }
.gbrand .logo-wrap img { height: 22px; display: block; }
.gbrand-txt { font-size: .72rem; letter-spacing: .02em; opacity: .78; line-height: 1.25; }
.gbrand-txt strong { display: block; font-size: .95rem; letter-spacing: 0; opacity: 1; }
.gtop-links { display: flex; gap: 8px; align-items: center; }
.gtop-links .btn { cursor: pointer; }
.gtop-links .btn.ghost { color: #fff; border-color: rgba(255,255,255,.28); background: transparent; }
.gtop-links .btn.ghost:hover { background: rgba(255,255,255,.12); }
.gnav-toggle {
  display: none; background: rgba(255,255,255,.12); border: none; color: #fff;
  font-size: 1.1rem; border-radius: 8px; padding: 6px 11px; cursor: pointer;
}

/* ---------- Welcome modal ---------- */
.gmodal-wrap {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,18,20,.66); backdrop-filter: blur(3px);
  padding: 20px; animation: gfade .18s ease;
}
@keyframes gfade { from { opacity: 0 } to { opacity: 1 } }
.gmodal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 430px; padding: 32px 30px; text-align: center;
  animation: grise .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes grise { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }
.gmodal-logo { height: 34px; margin-bottom: 18px; }
.gmodal h2 { font-size: 1.3rem; letter-spacing: -.02em; margin-bottom: 8px; }
.gmodal p { color: var(--ink-2); font-size: .95rem; margin: 0 0 22px; }
.gmodal-btns { display: flex; flex-direction: column; gap: 9px; }
.gmodal-btns .btn { min-height: 46px; font-size: .95rem; }

/* ---------- Shell ---------- */
.gshell { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; align-items: start; box-sizing: border-box; }
.gside {
  position: sticky; top: 60px; max-height: calc(100vh - 60px); overflow-y: auto;
  padding: 24px 8px 40px 18px;
}
.gmain { min-width: 0; padding: 26px 26px 60px; }
body.bare .gside { display: none; }
body.bare .gshell { grid-template-columns: minmax(0, 1fr); max-width: 1000px; }

.gside .grp { font-size: .67rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); font-weight: 700; margin: 20px 0 6px 10px; }
.gside .grp:first-child { margin-top: 0; }
.gside a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: .9rem; font-weight: 500; cursor: pointer;
}
.gside a:hover { background: var(--surface); color: var(--ink); }
.gside a.on { background: var(--nws-maroon-tint); color: var(--nws-maroon); font-weight: 700; }
.gside a .ic { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }

/* ---------- Hero ---------- */
.ghero {
  background: linear-gradient(140deg, var(--charcoal), #14181a 58%, var(--nws-maroon-dark));
  color: #fff; border-radius: var(--radius); padding: 40px 34px; margin-bottom: 26px;
  box-shadow: var(--shadow-lg);
}
.ghero h1 { font-size: 2.05rem; line-height: 1.15; letter-spacing: -.025em; margin-bottom: 12px; max-width: 20ch; }
.ghero p { color: rgba(255,255,255,.85); font-size: 1.06rem; max-width: 56ch; margin: 0 0 22px; }
.ghero .btn-row .btn { min-height: 46px; }
.ghero .btn-row .btn.ghost { color: #fff; border-color: rgba(255,255,255,.32); }
.ghero .btn-row .btn.ghost:hover { background: rgba(255,255,255,.12); }

/* ---------- Page head ---------- */
.gpage-head { margin-bottom: 20px; }
.gpage-head h1 { font-size: 1.75rem; letter-spacing: -.025em; margin-bottom: 8px; max-width: 24ch; }
.gpage-head .lede { color: var(--ink-2); font-size: 1.05rem; max-width: 62ch; margin: 0; }

/* ---------- Prose ---------- */
.prose { max-width: 68ch; }
.prose p { margin: 0 0 1em; }
.prose h2 { font-size: 1.28rem; margin: 1.9em 0 .5em; letter-spacing: -.015em; }
.prose h3 { font-size: 1.05rem; margin: 1.5em 0 .35em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: .88em; }
.prose > .gtable-wrap { max-width: none; }

.prose .why {
  border-left: 4px solid var(--nws-maroon); background: var(--nws-maroon-tint);
  padding: 15px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.4em 0;
}
.prose .why b {
  display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--nws-maroon); margin-bottom: 5px;
}

/* ---------- Stakes grid (home) ---------- */
.stakes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 1.4em 0; }
.stake { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; }
.stake .ic { font-size: 1.5rem; display: block; margin-bottom: 8px; }
.stake h3 { font-size: .98rem; margin: 0 0 5px; }
.stake p { font-size: .88rem; color: var(--ink-2); margin: 0; line-height: 1.5; }

/* ---------- Steps (how it works) ---------- */
.steps { display: flex; flex-direction: column; gap: 4px; margin: 1.2em 0 0; }
/* Two columns: the numbered bubble, then everything else. The heading and body
   must share one grid child or the paragraph wraps into the 40px number column. */
.stepc { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.stepc:last-child { border-bottom: none; }
.stepc .n {
  width: 34px; height: 34px; border-radius: 50%; background: var(--nws-maroon); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
.stepc-body { min-width: 0; }
.stepc h3 { margin: 4px 0 4px; font-size: 1.05rem; }
.stepc p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* ---------- CTA ---------- */
.cta {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--charcoal), #2c3033);
  color: #fff; border-radius: var(--radius); padding: 26px 28px; margin: 34px 0 0;
  box-shadow: var(--shadow);
}
.cta-main { flex: 1; min-width: 260px; }
.cta-main h3 { font-size: 1.15rem; margin: 0 0 5px; letter-spacing: -.015em; }
.cta-main p { margin: 0; color: rgba(255,255,255,.76); font-size: .93rem; }
.cta-act { display: flex; gap: 9px; flex-wrap: wrap; }
.cta-act .btn { min-height: 44px; }
.cta-act .btn.ghost { color: #fff; border-color: rgba(255,255,255,.32); }
.cta-act .btn.ghost:hover { background: rgba(255,255,255,.12); }

/* ---------- Cards ---------- */
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 14px; margin: 18px 0; }
.card-link { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; display: flex; flex-direction: column; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-link .ic { font-size: 1.6rem; margin-bottom: 9px; display: block; }
.card-link h3 { margin-bottom: 5px; font-size: 1.02rem; }
.card-link p { flex: 1; line-height: 1.5; }
.card-go { display: block; margin-top: 12px; color: var(--nws-maroon); font-weight: 700; font-size: .84rem; }

/* ---------- Calculator ---------- */
.calc { border: 1px solid var(--line-strong); border-top: 3px solid var(--nws-maroon); margin-bottom: 26px; }
.calc .calc-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.calc .calc-head h3 { margin: 0; font-size: 1.12rem; letter-spacing: -.015em; }
.calc .calc-head .grow { flex: 1; }
.calc-note { color: var(--ink-2); font-size: .9rem; margin: 0 0 16px; max-width: 66ch; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 4px; }
.calc-out {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px 18px; margin-top: 16px;
}
.calc-out.pass { background: var(--pass-bg); border-color: #bfe3cc; }
.calc-out.fail { background: var(--fail-bg); border-color: #ecbfc2; }
.calc-out .big { font-size: 1.75rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.calc-out .big.sm { font-size: 1.15rem; }
.calc-out .big .u { font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-left: 3px; }
.calc-out .lbl { font-size: .73rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; margin-bottom: 6px; }
.calc-out .working { font-size: .89rem; color: var(--ink-2); margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line-strong); line-height: 1.55; }
.out-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px; }

.calc-cite { margin-top: 10px; font-size: .8rem; color: var(--ink-3); }
.calc-cite a { font-weight: 600; margin-left: 4px; cursor: pointer; }

table.gtable.calc-table input { padding: 9px 8px; text-align: center; font-size: .95rem; }
table.gtable.calc-table td { padding: 7px 6px; }
/* Verdict column: keep "PASS / out by 1.6 A, 0.1 V" on two tidy lines. */
table.gtable.calc-table td[data-res] { min-width: 132px; line-height: 1.35; }

/* Test-point chips */
.points { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.points .pt { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 16px; text-align: center; min-width: 84px; }
.points .pt.end { border-color: var(--nws-maroon); background: var(--nws-maroon-tint); }
.points .pv { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.points .pl { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; margin-top: 2px; }

/* Accept-window bar */
.window { margin-top: 16px; }
.window .track { position: relative; height: 32px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.window .band { position: absolute; top: 0; bottom: 0; background: rgba(31,138,76,.16); border-left: 2px solid var(--pass); border-right: 2px solid var(--pass); }
.window .target { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--charcoal); }
.window .marker { position: absolute; top: 3px; bottom: 3px; width: 5px; border-radius: 3px; background: var(--fail); box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.window .marker.ok { background: var(--pass); }
.window .scale { display: flex; justify-content: space-between; font-size: .74rem; color: var(--ink-3); margin-top: 5px; }

/* ---------- Auth page ---------- */
.authpage { max-width: 940px; margin: 0 auto; }
.auth-back { display: inline-block; margin-bottom: 16px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.auth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.auth-card { padding: 28px 26px; }
.auth-card h2 { font-size: 1.3rem; letter-spacing: -.02em; margin-bottom: 4px; }
.auth-card.alt { background: var(--surface-2); }
.auth-card.alt p { font-size: .93rem; color: var(--ink-2); }
.auth-logo { height: 30px; margin-bottom: 16px; }
.auth-err { color: var(--fail); font-size: .86rem; min-height: 1.2em; margin-bottom: 8px; }
.ticks { list-style: none; padding: 0; margin: 0 0 14px; }
.ticks li { position: relative; padding-left: 24px; margin-bottom: 7px; font-size: .93rem; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--pass); font-weight: 800; }

/* ---------- Tables ---------- */
.gtable-wrap { overflow-x: auto; margin: 16px 0; -webkit-overflow-scrolling: touch; }
table.gtable { width: 100%; border-collapse: collapse; font-size: .89rem; min-width: 440px; background: var(--surface); }
table.gtable th, table.gtable td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.gtable thead th { background: var(--surface-2); color: var(--ink-2); font-size: .71rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
table.gtable tbody tr:last-child td { border-bottom: none; }
table.gtable td.num, table.gtable th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.gtable tr.hl td { background: var(--nws-maroon-tint); font-weight: 600; }

/* ---------- Pager / footer ---------- */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { font-size: .9rem; font-weight: 600; cursor: pointer; }
.pager .nxt { margin-left: auto; text-align: right; }

.gfoot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 24px; }
.gfoot-in { max-width: 1240px; margin: 0 auto; padding: 28px 26px 34px; }
.gfoot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; margin-bottom: 20px; }
.gfoot-cols strong { display: block; font-size: .88rem; margin-bottom: 6px; }
.gfoot-cols p { margin: 0; line-height: 1.6; }
.gfoot-cols a { cursor: pointer; }
.gfoot-legal { max-width: 90ch; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .gshell { grid-template-columns: 1fr; }
  .gside {
    display: none; position: static; max-height: none; overflow: visible;
    padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .gside.open { display: block; }
  .gnav-toggle { display: block; }
  .gbrand-txt { display: none; }
  .gmain { padding: 20px 16px 46px; }
  .ghero { padding: 28px 22px; }
  .ghero h1 { font-size: 1.6rem; }
  .ghero p { font-size: 1rem; }
  .gpage-head h1 { font-size: 1.45rem; }
  .cta { padding: 22px; }
  .techbar { padding: 8px 14px; }
  .techbar .tb-txt span { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .gtop, .gside, .pager, .gnav-toggle, .cta, .techbar, .gmodal-wrap { display: none !important; }
  .gshell { display: block; }
  .gmain { padding: 0; }
  .calc, .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
