/* EquiScape Growth Lab — page styles on top of site.css.
   Uses only the site's design tokens (brand green, leaf, gold, mint, Montserrat) so the
   lab follows light and dark mode like every other page. Prefix: gl- */

:root { --gl-hdr: 112px; }

/* ---------- hero ---------- */
.gl-hero .wrap { grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.gl-hero-copy { max-width: 760px; }
.gl-co-link { font: inherit; font-weight: 700; color: var(--brand); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.gl-co-link:hover { text-decoration-thickness: 2px; }
.gl-hero .wrap > * { min-width: 0; }
.gl-hero h1 em { font-style: normal; color: var(--brand); }
.gl-hero-copy { display: grid; gap: var(--space-4); }
.gl-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
@media (max-width: 920px) { .gl-hero .wrap { grid-template-columns: minmax(0, 1fr); } }

.gl-co { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); padding: var(--space-4); display: grid; gap: var(--space-3); }
@media (min-width: 560px) { .gl-co { padding: var(--space-6); } }
.gl-co-head { display: flex; justify-content: space-between; align-items: start; gap: var(--space-3); padding-bottom: var(--space-3); border-bottom: 3px solid var(--brand); }
.gl-co-head p:first-child { font-weight: 700; font-size: 18px; line-height: 1.3; color: var(--ink-heading); }
.gl-co-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.gl-co-stats .kpi { padding: var(--space-3); }
.gl-co-stats .kpi-value { font-size: 22px; line-height: 28px; }
.gl-co .btn { justify-self: start; }
@media (max-width: 480px) { .gl-co-stats { grid-template-columns: 1fr; } .gl-co .btn { justify-self: stretch; } }

/* ---------- app layout: tool list + one tool at a time ---------- */
.gl-section { padding-block: var(--space-8) clamp(48px, 7vw, 88px); }
.gl-app { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.gl-rail { position: sticky; top: calc(var(--gl-hdr) + 16px); display: grid; gap: var(--space-4); }
.gl-rail h2 { font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 var(--space-1); }
.gl-rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gl-rail button { width: 100%; display: flex; align-items: center; gap: var(--space-2); text-align: left; border: 1px solid transparent; background: transparent; padding: 7px 10px;
  border-radius: var(--radius-sm); color: var(--ink); cursor: pointer; font: 600 14px/1.35 var(--font-sans); }
.gl-rail button:hover { background: var(--surface-mint); color: var(--brand); }
.gl-rail button[aria-current="true"] { background: var(--brand); color: var(--on-brand); }
.gl-rail .ic { width: 18px; height: 18px; color: var(--brand); }
.gl-rail button[aria-current="true"] .ic { color: var(--on-brand); }
@media (max-width: 980px) {
  .gl-app { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .gl-rail { top: var(--gl-hdr); z-index: 40; display: block; overflow-x: auto; white-space: nowrap; background: var(--surface);
    margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding: var(--space-2) max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--border);
    scrollbar-width: thin; }
  .gl-rail h2 { display: none; }
  .gl-rail section { display: inline; }
  .gl-rail ul { display: inline-flex; gap: var(--space-2); margin-right: var(--space-2); }
  .gl-rail button { width: auto; white-space: nowrap; border-radius: var(--radius-full); border-color: var(--brand); background: var(--surface-card); color: var(--brand); padding: 6px 12px; font-size: 13px; }
  .gl-rail button[aria-current="true"] { background: var(--brand); color: var(--on-brand); }
}
@media (max-width: 980px) and (min-width: 720px) { .gl-rail { margin-inline: calc(-1 * max(32px, env(safe-area-inset-left, 0px))); padding-inline: max(32px, env(safe-area-inset-left, 0px)); } }

/* ---------- tool panel ---------- */
.gl-panel { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; min-width: 0; scroll-margin-top: calc(var(--gl-hdr) + 64px); }
.gl-panel-head { padding: var(--space-6) var(--space-6) var(--space-4); border-bottom: 3px solid var(--brand); display: flex; gap: var(--space-4); justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.gl-panel-head > div { display: grid; gap: var(--space-2); min-width: 0; flex: 1 1 320px; }
.gl-panel-head h2 { font-size: clamp(22px, 3vw, 28px); }
.gl-panel-head p.muted { max-width: 64ch; }
.gl-body { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); }
.gl-inputs { padding: var(--space-6); border-right: 1px solid var(--border); display: grid; gap: var(--space-4); align-content: start; background: var(--surface-mint); }
.gl-out { padding: var(--space-6); display: grid; gap: var(--space-4); align-content: start; min-width: 0; }
.gl-pad { padding: var(--space-6); }
@media (max-width: 760px) {
  .gl-body { grid-template-columns: minmax(0, 1fr); }
  .gl-inputs { border-right: 0; border-bottom: 1px solid var(--border); }
  .gl-panel-head, .gl-inputs, .gl-out, .gl-pad { padding: var(--space-4); }
}
.gl-group { font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.gl-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* fields: site inputs with a unit inside the box */
.gl-f { display: grid; gap: 6px; min-width: 0; }
.gl-f label { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.gl-f label output { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gl-in { display: flex; align-items: center; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-card); min-width: 0; }
.gl-in:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--brand); }
.gl-in span { padding: 0 10px; color: var(--ink-muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.gl-in span:first-child { padding-right: 0; }
.gl-in input[type="number"], .gl-in select { border: 0; background: transparent; outline: none; padding: 9px 10px; min-width: 0; flex: 1; border-radius: var(--radius-sm); }
.gl-in input:focus, .gl-in select:focus { outline: none; }
.gl-f .hint { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.gl-f input[type="range"] { width: 100%; accent-color: var(--brand); margin: 2px 0; }
.gl-reset { justify-self: start; }

/* results */
.gl-out .kpis, .gl-co-sum { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.gl-out .kpi-value { font-size: 24px; line-height: 30px; }
.kpi.gl-good .kpi-value { color: var(--brand); }
.kpi.gl-bad .kpi-value { color: var(--alert); }
.kpi-hl.gl-bad { border-color: var(--alert); background: var(--surface-cream); }
.kpi-hl.gl-bad .kpi-label, .kpi-hl.gl-bad .kpi-value { color: var(--alert); }
.gl-take { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-mint); border: 1px solid var(--brand); font-size: 15px; line-height: 1.55; }
.gl-take b { color: var(--brand); }
.gl-take a { white-space: nowrap; }
.gl-fine { font-size: 13px; color: var(--ink-muted); }
.gl-table-wrap { overflow-x: auto; }
.gl-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.gl-table th { text-align: right; font-size: 11px; line-height: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; padding: var(--space-2); border-bottom: 2px solid var(--brand); white-space: nowrap; }
.gl-table td { text-align: right; padding: var(--space-2); border-bottom: 1px solid var(--border); white-space: nowrap; font-weight: 600; }
.gl-table th:first-child, .gl-table td:first-child { text-align: left; }
.gl-table tr.hl td { background: var(--surface-mint); color: var(--brand); font-weight: 800; }
.gl-table td.pos { color: var(--brand); } .gl-table td.neg { color: var(--alert); }

/* charts: colors come from tokens via inline style */
.gl-chart { width: 100%; height: auto; display: block; overflow: visible; }
.gl-chart text { font: 500 12px var(--font-sans); fill: var(--ink-muted); font-variant-numeric: tabular-nums; }
.gl-chart .lbl { font: 600 13px var(--font-sans); fill: var(--ink); }
.gl-chart .grid { stroke: var(--border); }
.gl-chart .zero { stroke: var(--border-strong); }
.gl-out .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---------- hub ---------- */
.gl-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.gl-hub button { text-align: left; display: grid; justify-items: start; gap: var(--space-1); align-content: start; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface-card); cursor: pointer; color: inherit; font: 400 14px/1.45 var(--font-sans); min-width: 0; transition: border-color .15s; }
.gl-hub a.gl-hub-link { text-align: left; display: grid; justify-items: start; gap: var(--space-1); align-content: start; padding: var(--space-4); border: 1.5px dashed var(--brand); border-radius: var(--radius-md);
  background: var(--surface-mint); color: inherit; text-decoration: none; font: 400 14px/1.45 var(--font-sans); min-width: 0; }
.gl-hub a.gl-hub-link b::after { content: " →"; }
.gl-hub button:hover, .gl-hub button:focus-visible, .gl-hub a.gl-hub-link:hover { border-color: var(--brand); border-style: solid; }
.gl-hub .ico { width: 40px; height: 40px; border-radius: var(--radius-full); margin-bottom: var(--space-2); }
.gl-hub b { font-weight: 700; font-size: 16px; line-height: 22px; color: var(--brand); }
.gl-hub small { color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.gl-hub .gl-grp { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- health check ---------- */
.gl-quiz { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.gl-quiz .gl-inputs { gap: var(--space-3); }
.gl-quiz .gl-out { position: sticky; top: calc(var(--gl-hdr) + 16px); align-self: start; }
@media (max-width: 760px) { .gl-quiz { grid-template-columns: minmax(0, 1fr); } .gl-quiz .gl-out { position: static; } }
.gl-q { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4) var(--space-4); background: var(--surface-card); display: grid; gap: var(--space-2); min-width: 0; }
.gl-q-cat { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.gl-q-text { font-weight: 700; color: var(--ink); font-size: 15px; line-height: 1.4; }
.gl-q .opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); }
.gl-q label { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 14px; line-height: 1.35; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; background: var(--surface-card); }
.gl-q label:hover { border-color: var(--brand); }
.gl-q label:has(input:checked) { border-color: var(--brand); background: var(--surface-mint); color: var(--brand); font-weight: 600; }
.gl-q input { accent-color: var(--brand); margin-top: 2px; flex: none; }

/* ---------- glossary flip cards ---------- */
.gl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-3); }
.gl-flip { perspective: 900px; min-height: 180px; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit; border-radius: var(--radius-md); }
.gl-flip .in2 { position: relative; height: 100%; min-height: 180px; transition: transform .5s; transform-style: preserve-3d; }
.gl-flip.on .in2 { transform: rotateY(180deg); }
.gl-flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--radius-md); padding: var(--space-4); display: grid; align-content: start; gap: var(--space-2); border: 1px solid var(--border); }
.gl-flip .front { background: var(--surface-card); }
.gl-flip:hover .front { border-color: var(--brand); }
.gl-flip .front b { font-size: 18px; font-weight: 700; color: var(--brand); line-height: 1.3; }
.gl-flip .front span { font-size: 14px; color: var(--ink-muted); }
.gl-flip .front .flip-hint { position: absolute; left: var(--space-4); bottom: var(--space-3); font-size: 12px; font-weight: 700; color: var(--gold-text); }
.gl-flip .back { background: var(--brand); border-color: var(--brand); color: var(--on-brand); transform: rotateY(180deg); font-size: 14px; line-height: 1.5; }
.gl-flip .back em { font-style: normal; font-weight: 700; font-size: 13px; padding-top: var(--space-2); border-top: 1px solid color-mix(in srgb, var(--on-brand) 35%, transparent); font-variant-numeric: tabular-nums; }

/* ---------- company numbers drawer ---------- */
.gl-drawer { position: fixed; inset: 0; z-index: 90; background: rgba(15,25,15,.45); display: grid; justify-items: end; }
.gl-drawer[hidden] { display: none !important; }
.gl-sheet { width: min(440px, 100%); height: 100%; overflow-y: auto; background: var(--surface); border-left: 3px solid var(--brand); box-shadow: var(--shadow-panel);
  padding: calc(var(--space-6) + env(safe-area-inset-top, 0px)) max(var(--space-6), env(safe-area-inset-right, 0px)) calc(var(--space-6) + env(safe-area-inset-bottom, 0px)) var(--space-6);
  display: grid; gap: var(--space-4); align-content: start; }
@media (max-width: 480px) { .gl-sheet { padding-left: var(--space-4); padding-right: max(var(--space-4), env(safe-area-inset-right, 0px)); border-left: 0; } }
.gl-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.gl-sheet-head h2 { font-size: 22px; }
.gl-co-fields { display: grid; gap: var(--space-4); }

/* closing band + fine print */
.gl-disclaimer { font-size: 13px; color: var(--ink-muted); max-width: 90ch; margin-top: var(--space-6); }
.cta-band .lede { max-width: 56ch; }
.gl-call { font-weight: 700; }

@media (prefers-reduced-motion: reduce) { .gl-flip .in2 { transition: none; } }

/* ---------- flagship tools (valuation + job estimator) ---------- */
.gl-flag-section { padding-bottom: 0; }
.gl-flagship { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 760px) { .gl-flagship { grid-template-columns: minmax(0, 1fr); } }
.gl-flag { display: grid; justify-items: start; align-content: start; gap: var(--space-2); padding: var(--space-6); border: 2px solid var(--brand); border-radius: var(--radius-lg);
  background: var(--surface-card); color: inherit; text-decoration: none; box-shadow: var(--shadow-panel); transition: background .15s; }
.gl-flag:hover, .gl-flag:focus-visible { background: var(--surface-mint); }
.gl-flag .ico { width: 48px; height: 48px; }
.gl-flag .gl-grp { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.gl-flag b { font-size: clamp(20px, 2.4vw, 24px); line-height: 1.25; color: var(--brand); }
.gl-flag > span:not(.ico):not(.gl-grp):not(.link-arrow) { font-size: 15px; line-height: 1.5; color: var(--ink); }
.gl-flag .link-arrow { margin-top: var(--space-2); font-weight: 700; }
.gl-section .section-head { margin-bottom: var(--space-6); }
/* which calculators read the company numbers */
.gl-hub .gl-co-tag { margin-top: var(--space-2); font-size: 11px; line-height: 14px; font-weight: 700; color: var(--brand); background: var(--surface-mint); border: 1px solid var(--brand); border-radius: var(--radius-full); padding: 2px 8px; }
.gl-co-note { font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.gl-co-note .gl-co-link { font-size: 14px; }
