/* ==========================================================================
   HomeGuide design system ("hg" shell): tokens + shared components.
   Source: design/final/tokens.css + DESIGN-SPEC.md (warm paper, deep green,
   restrained gold, Fraunces + DM Sans).

   SCOPING. Propshaft's `stylesheet_link_tag :app` links every file in
   app/assets/stylesheets, so this file also loads on pages that have not been
   migrated. Every rule is therefore scoped under `.hg`, which the layouts put
   on <body> only when a view opts in with `content_for :design, "hg"`.
   Nothing here touches a bare element or :root. Tokens live on `.hg` too.

   On opted-in pages the layout links, in this order: tailwind.css, this file,
   then the page file(s) (hg_landing.css, hg_start.css, hg_guides.css).
   Page files scope every selector under `.hg-<page>` (see the note at the
   end of this file). The element reset is Tailwind's preflight, which sits in
   a cascade layer, so these unlayered rules always win over it.

   No CSS nesting, :has() only as a nicety: the browser floor is Safari 15.4.
   Rules: nothing below 13px; gold is never body text; one italic line per
   page (the H1); primary controls are 48px tall, secondary ones 40-44px.
   ========================================================================== */

.hg {
  /* ---- Paper and surfaces ------------------------------------------------ */
  --paper:        #F6F1E8;  /* page ground */
  --paper-deep:   #EEE6D8;  /* sunken bands, tracks */
  --surface:      #FFFDF9;  /* cards */
  --surface-sunk: #FAF6EE;  /* panels inside cards */
  --line:         #E3DACB;  /* hairlines */
  --line-strong:  #CBBDA5;  /* dividers that must be seen */
  --line-field:   #8F8672;  /* input and control boundaries, 3.3:1 on surface */

  /* ---- Ink (deep green, replaces black) --------------------------------- */
  --ink:    #14271D;  /* headings, body.            13.9:1 on paper, 15.4:1 on surface */
  --ink-2:  #36443A;  /* secondary body.             9.1:1 on paper */
  --ink-3:  #586259;  /* captions, meta.             5.6:1 on paper, 5.1:1 on paper-deep */

  /* ---- Brand green ------------------------------------------------------- */
  --green-900: #10241A;
  --green-800: #1B3A2B;  /* primary button, dark panels.  surface text 12.3:1 */
  --green-700: #24503A;  /* primary hover */
  --green-600: #2C6146;  /* links, progress fill.          6.4:1 on paper */
  --green-300: #A9C6B0;
  --green-200: #CFE0D3;
  --green-100: #E2ECE2;  /* "done" tint */
  --green-50:  #EFF4EC;

  /* ---- Gold (restrained: rules, markers, one highlight per view) -------- */
  --gold-700: #7A5708;  /* gold as text.                   5.8:1 on paper, 5.3:1 on paper-deep */
  --gold-500: #B98A2A;  /* decorative rules and dots only: 2.8:1, never text or a sole indicator */
  --gold-400: #D8B255;  /* on dark green only.             6.2:1 on green-800 */
  --gold-100: #F3E5BF;  /* marker highlight */
  --gold-50:  #FAF3DE;

  /* ---- Urgency scale: colour + icon + label + weight -------------------- */
  --urgent:        #A5311F;  /* solid chip bg, white text 6.9:1; as text on paper 6.1:1 */
  --urgent-tint:   #F9E3DC;
  --urgent-ink:    #8A2616;  /* on urgent-tint 7.2:1 */
  --important:     #C4722A;  /* bars and borders only */
  --important-tint:#F8E4CF;
  --important-ink: #7C420F;  /* on important-tint 6.4:1 */
  --minor:         #A39A88;  /* bars and borders only */
  --minor-tint:    #ECE5D8;
  --minor-ink:     #4B4A3F;  /* on minor-tint 7.1:1 */
  --monitor:       #C9CFCB;  /* bars and borders only */
  --monitor-ink:   #4F5B62;  /* on surface 6.9:1 */
  --on-dark-2:     #D6E2D8;  /* secondary text on green-800, 9.6:1 */

  /* ---- Type -------------------------------------------------------------- */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans:    "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --text-display-1: clamp(2.25rem, 1.35rem + 3.7vw, 4rem);     /* 36 -> 64  hero */
  --text-display-2: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);   /* 28 -> 44  section titles */
  --text-display-3: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);  /* 22 -> 28  card titles */
  --text-title:   1.25rem;    /* 20 */
  --text-lead:    1.1875rem;  /* 19 */
  --text-body:    1rem;       /* 16  minimum for running text */
  --text-small:   0.875rem;   /* 14 */
  --text-micro:   0.8125rem;  /* 13  labels and meta only */

  --leading-tight: 1.06;
  --leading-snug:  1.25;
  --leading-body:  1.55;

  /* ---- Space (4px base) -------------------------------------------------- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-8: 32px; --s-10: 40px; --s-14: 56px; --s-18: 72px; --s-24: 96px; --s-32: 128px;
  --gutter: 16px;            /* phone side gutter */
  --container: 1200px;
  --header-h: 64px;          /* sticky header height (72px from 1000px) */

  /* ---- Radii ------------------------------------------------------------- */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px; --r-pill: 999px;

  /* ---- Shadows (warm, green-tinted, never grey) -------------------------- */
  --shadow-1: 0 1px 2px rgba(20, 39, 29, .05), 0 1px 1px rgba(20, 39, 29, .03);
  --shadow-2: 0 2px 4px rgba(20, 39, 29, .04), 0 8px 20px -6px rgba(20, 39, 29, .10);
  --shadow-3: 0 4px 8px rgba(20, 39, 29, .04), 0 24px 48px -16px rgba(20, 39, 29, .22);
  --ring: 0 0 0 3px var(--paper), 0 0 0 5px var(--green-600);  /* for custom radio/checkbox tiles */
}
@media (min-width: 720px) { .hg { --gutter: 32px; } }
@media (min-width: 1000px) { .hg { --header-h: 72px; } }

/* ==========================================================================
   Base
   ========================================================================== */
/* <html class="hg-html"> is set by the layouts together with body.hg; it only
   carries what must sit on the scroll container (anchors clear the sticky header). */
html.hg-html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body.hg {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--text-body)/var(--leading-body) var(--font-sans);
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* Zero-specificity defaults, so any class rule (here or in a page file) wins. */
:where(.hg) *, :where(.hg) *::before, :where(.hg) *::after { box-sizing: border-box; }
:where(.hg) img, :where(.hg) svg { display: block; max-width: 100%; }
:where(.hg) a { color: inherit; text-decoration: underline; }   /* preflight removes underlines; links here keep them unless a class says otherwise */
:where(.hg) :focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }
.hg .panel-dark :focus-visible, .hg .on-dark :focus-visible { outline-color: var(--gold-400); }
@media (prefers-reduced-motion: reduce) {
  html.hg-html { scroll-behavior: auto; }
  .hg *, .hg *::before, .hg *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.hg .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hg .nowrap { white-space: nowrap; }
@media (max-width: 719px) { .hg .only-wide { display: none !important; } }
@media (min-width: 720px) { .hg .only-narrow { display: none !important; } }

.hg .skip-link { position: absolute; left: 8px; top: -80px; z-index: 60; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-md); background: var(--green-800); color: var(--surface); font-weight: 600; text-decoration: none; }
.hg .skip-link:focus { top: 8px; }
.hg #content:focus { outline: none; }

.hg .container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.hg .container-narrow { max-width: calc(760px + 2 * var(--gutter)); }

/* ---- Type classes -------------------------------------------------------- */
.hg .display-1, .hg .display-2, .hg .display-3 {
  font-family: var(--font-display); font-weight: 480; color: var(--ink);
  letter-spacing: -0.022em; text-wrap: balance;
}
.hg .display-1 { font-size: var(--text-display-1); line-height: var(--leading-tight); }
.hg .display-2 { font-size: var(--text-display-2); line-height: 1.1; }
.hg .display-3 { font-size: var(--text-display-3); line-height: 1.18; letter-spacing: -0.015em; }
.hg .display-1 em, .hg .display-2 em { font-style: normal; color: var(--green-600); }
.hg h1.display-1 em, .hg h1.display-2 em { font-style: italic; font-weight: 400; }  /* the one italic line per page */
.hg .lead  { font-size: var(--text-lead); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.hg .small { font-size: var(--text-small); line-height: 1.5; }
.hg .micro { font-size: var(--text-micro); line-height: 1.45; }
.hg .muted { color: var(--ink-3); }
.hg .num   { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
.hg .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--text-small); font-weight: 600; color: var(--gold-700); letter-spacing: .01em;
}
.hg .eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--gold-500); border-radius: 2px; }
.hg .link { color: var(--green-600); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: var(--green-300); }
.hg .link:hover { text-decoration-color: currentColor; }
.hg .panel-dark .link, .hg .on-dark .link { color: var(--surface); text-decoration-color: rgba(255, 253, 249, .5); }

/* ---- Icon (one family: 24px grid, 1.75 stroke, round joins) -------------- */
.hg .icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Section rhythm and headings ----------------------------------------- */
.hg .section { padding-block: var(--s-14); }
.hg .section-deep { background: var(--paper-deep); }
@media (min-width: 900px) { .hg .section { padding-block: var(--s-24); } }
.hg .sec-head { max-width: 760px; margin-bottom: 28px; }
.hg .sec-head .eyebrow { margin-bottom: 14px; }
.hg .sec-head .lead { margin-top: 14px; }
@media (min-width: 900px) { .hg .sec-head { margin-bottom: 44px; } }
.hg .chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ==========================================================================
   Components
   ========================================================================== */

/* ---- Button -------------------------------------------------------------- */
.hg .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-md);
  border: 1.5px solid transparent; background: none; cursor: pointer;
  font: 600 1rem/1.2 var(--font-sans); text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
.hg .btn:active { transform: translateY(1px); }
.hg .btn-primary   { background: var(--green-800); color: var(--surface); box-shadow: inset 0 1px 0 rgba(255,255,255,.10), var(--shadow-1); }
.hg .btn-primary:hover { background: var(--green-700); }
.hg .btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-field); }
.hg .btn-secondary:hover { border-color: var(--ink-3); }
.hg .btn-quiet     { background: transparent; color: var(--green-600); padding-inline: 10px; }
.hg .btn-quiet:hover { background: var(--green-50); }
.hg .btn-on-dark   { background: var(--surface); color: var(--green-800); }
.hg .btn-on-dark:hover { background: #fff; }
.hg .btn-lg { min-height: 58px; padding: 0 26px; font-size: 1.0625rem; border-radius: 14px; }
.hg .btn-sm { min-height: 40px; padding: 0 14px; font-size: var(--text-small); border-radius: 10px; gap: 7px; }
.hg .btn-block { display: flex; width: 100%; }
.hg .btn[disabled], .hg .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.hg .btn[disabled]:active, .hg .btn[aria-disabled="true"]:active { transform: none; }
/* Phones: a long label wraps onto a second line instead of pushing the page
   sideways. Header and sticky-bar buttons stay on one line. */
@media (max-width: 719px) {
  .hg .btn { max-width: 100%; white-space: normal; text-align: center; padding-block: 8px; }
  .hg .site-header .btn, .hg .stickybar .btn { white-space: nowrap; }
}
/* Phones: a small button in a row of its own still gets a 44px target. */
@media (pointer: coarse) { .hg .btn-sm { min-height: 44px; } }

/* ---- Chip ---------------------------------------------------------------- */
.hg .chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px;
  border-radius: var(--r-pill); border: 1px solid transparent; white-space: nowrap;
  font: 600 var(--text-micro)/1 var(--font-sans); letter-spacing: .005em;
}
.hg .chip .icon { width: 14px; height: 14px; stroke-width: 2; }
.hg .chip-urgent    { background: var(--urgent); color: #fff; }
.hg .chip-important { background: var(--important-tint); color: var(--important-ink); }
.hg .chip-minor     { background: var(--minor-tint); color: var(--minor-ink); }
.hg .chip-monitor   { background: transparent; color: var(--monitor-ink); border: 1px dashed #98A3A6; }
.hg .chip-safety    { background: transparent; color: var(--ink); border-color: var(--ink); }
.hg .chip-done      { background: var(--green-100); color: var(--green-800); }
.hg .chip-gold      { background: var(--gold-100); color: #4E3700; }
.hg .chip-plain     { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.hg .chip-count     { padding: 0 9px; }

/* ---- Card ---------------------------------------------------------------- */
.hg .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.hg .card-raised { box-shadow: var(--shadow-2); }
.hg .card-pad { padding: var(--s-5); }
@media (min-width: 720px) { .hg .card-pad { padding: var(--s-8); } }
.hg .panel { background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--r-md); }
.hg .panel-dark { background: var(--green-800); color: var(--surface); border-radius: var(--r-lg); }

/* ---- Progress: bar ------------------------------------------------------- */
.hg .progress { height: 8px; border-radius: var(--r-pill); background: var(--paper-deep); overflow: hidden; }
.hg .progress > i { display: block; height: 100%; border-radius: inherit; background: var(--green-600); }

/* ---- Progress: journey stepper (contact -> visit -> quote -> fixed) ------ */
.hg .steps { display: grid; grid-template-columns: repeat(4, 1fr); }
.hg .step { position: relative; display: grid; justify-items: center; gap: 6px; font-size: var(--text-small); font-weight: 500; color: var(--ink-3); text-align: center; }
.hg .step::before { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: var(--line-strong); }
.hg .step:first-child::before { display: none; }
.hg .step > i {
  position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-strong); color: transparent;
}
.hg .step > i .icon { width: 13px; height: 13px; stroke-width: 3; }
.hg .step:not(.is-done) > i .icon { display: none; }
.hg .step.is-done { color: var(--ink-2); }
.hg .step.is-done::before, .hg .step.is-current::before { background: var(--green-600); }
.hg .step.is-done > i { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.hg .step.is-current { color: var(--ink); font-weight: 700; }
.hg .step.is-current > i { border-color: var(--green-600); box-shadow: 0 0 0 4px var(--green-100); }
.hg .step.is-current > i::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green-600); }
/* compact form for rows and rails: four pips */
.hg .mini-steps { display: inline-flex; gap: 3px; }
.hg .mini-steps i { width: 14px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.hg .mini-steps i.on { background: var(--green-600); }

/* ---- Progress strip: Upload / We analyze / Your plan ---------------------- */
.hg .way { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; counter-reset: way; list-style: none; }
.hg .way li { counter-increment: way; display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 3px solid var(--line-strong); font-size: var(--text-small); font-weight: 500; color: var(--ink-3); }
.hg .way li::before { content: counter(way); display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); font: 700 var(--text-micro)/1 var(--font-sans); }
.hg .way .is-done { border-color: var(--green-600); color: var(--ink-2); }
.hg .way .is-done::before { content: "\2713"; background: var(--green-600); border-color: var(--green-600); color: #fff; }
.hg .way .is-on { border-color: var(--green-800); color: var(--ink); font-weight: 700; }
.hg .way .is-failed { border-color: var(--urgent); color: var(--urgent-ink); font-weight: 700; }
.hg .way .is-failed::before { background: var(--urgent); border-color: var(--urgent); color: #fff; }
.hg .steps-expect { margin-top: 12px; font-size: var(--text-small); line-height: 1.45; color: var(--ink-2); }
.hg .way .is-on::before { background: var(--green-800); border-color: var(--green-800); color: var(--surface); }

/* ---- Form field ---------------------------------------------------------- */
.hg .field { display: grid; gap: 6px; }
.hg .field > label, .hg .label { font-size: var(--text-small); font-weight: 600; color: var(--ink); }
.hg .field .hint { font-size: var(--text-micro); color: var(--ink-3); }
.hg .field .error { display: flex; gap: 6px; align-items: flex-start; font-size: var(--text-small); font-weight: 600; color: var(--urgent); }
.hg .field .error .icon { width: 16px; height: 16px; margin-top: 2px; }
.hg .input {
  width: 100%; min-height: 52px; padding: 0 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1.5px solid var(--line-field); color: var(--ink); font-size: 1rem;
}
.hg .input::placeholder { color: #6E776F; opacity: 1; }
.hg .input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 4px var(--green-100); }
.hg .input[aria-invalid="true"] { border-color: var(--urgent); }
.hg textarea.input { padding: 12px 14px; min-height: 84px; resize: vertical; line-height: 1.45; }
.hg select.input { padding-right: 40px; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23586259' stroke-width='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 12px center; background-size: 18px; }

/* ---- Flash / notice bar --------------------------------------------------- */
.hg .flash { display: flex; gap: 10px; align-items: flex-start; margin: var(--s-4) auto 0; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-size: .9375rem; line-height: 1.45; }
.hg .flash .icon { width: 18px; height: 18px; margin-top: 2px; }
.hg .flash-notice { background: var(--green-50); border-color: var(--green-200); color: var(--green-800); }
.hg .flash-alert  { background: var(--urgent-tint); border-color: #EBC2B6; color: var(--urgent-ink); }

/* ---- Site header (sticky, light, in normal flow) --------------------------- */
.hg .site-header { position: sticky; top: 0; z-index: 30; background: rgba(246, 241, 232, .92); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.hg .site-header > .container { display: flex; align-items: center; gap: 10px; min-height: var(--header-h); }
.hg .logo { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; text-decoration: none; color: var(--ink); font: 560 1.3125rem/1 var(--font-display); letter-spacing: -0.02em; white-space: nowrap; }
.hg .logo svg { width: 28px; height: 28px; flex: none; }
.hg .beta { font: 600 var(--text-micro)/1 var(--font-sans); color: var(--gold-700); border: 1px solid var(--gold-500); border-radius: var(--r-pill); padding: 4px 8px; white-space: nowrap; }
.hg .site-nav { display: none; margin-left: auto; gap: var(--s-5); font-size: .9375rem; font-weight: 500; }
.hg .site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.hg .site-nav a:hover, .hg .site-nav a[aria-current="page"] { color: var(--ink); }
.hg .site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold-500); }
/* Count beside a nav link (conversations waiting on the buyer), and the dot
   that stands in for it on the menu button below 1000px. */
.hg .nav-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 8px; padding: 0 6px; border-radius: var(--r-pill); background: var(--green-800); color: var(--surface); font: 600 var(--text-micro)/1 var(--font-sans); }
.hg .site-menu > summary { position: relative; }
.hg .site-menu .menu-dot { position: absolute; top: 8px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--green-600); border: 2px solid var(--surface); }
.hg .site-menu[open] .menu-dot { display: none; }
.hg .site-menu-panel .menu-label { display: inline-flex; align-items: center; }
.hg .site-header .actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.hg .site-header .actions > form { display: contents; }
.hg .site-header .actions .btn-sm { min-height: 44px; }
.hg .site-user { font-size: var(--text-small); color: var(--ink-3); white-space: nowrap; }
/* Narrow phones. Logo, Beta, the button and the menu need 366px once the
   fonts have loaded, so the Beta tag goes below 375px (a 360px Android phone
   scrolled sideways with it). Signed in, the button reads "+ New", which is
   wider than "Upload": below 390px it loses the plus. */
@media (max-width: 374px) { .hg .site-header .beta { display: none; } }
@media (max-width: 389px) { .hg .site-header .actions .btn-primary .icon { display: none; } }
@media (min-width: 720px) { .hg .site-header > .container { gap: var(--s-4); } }
@media (min-width: 1000px) {
  .hg .site-nav { display: flex; }
  .hg .site-nav + .actions { margin-left: var(--s-4); }
  .hg .site-header .actions .btn-sm { min-height: 40px; }
}
@media (min-width: 1100px) { .hg .site-nav { gap: var(--s-6); } }
/* A signed-in visitor on a marketing page has four links plus three account
   controls, which do not fit until 1100px: keep the menu button until then. */
@media (min-width: 1000px) and (max-width: 1099px) {
  .hg .site-header.is-crowded .site-nav { display: none; }
  .hg .site-header.is-crowded .actions { margin-left: auto; }
  .hg .site-header.is-crowded .actions .btn-sm { min-height: 44px; }
}

/* Phone and tablet menu: a native <details>, so it opens on tap or Enter with
   no JavaScript (hg_menu_controller.js only adds Escape / tap-outside). */
.hg .site-menu > summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.hg .site-menu > summary::-webkit-details-marker { display: none; }
.hg .site-menu > summary:hover { background: var(--green-50); }
.hg .site-menu > summary .icon { width: 24px; height: 24px; }
.hg .site-menu > summary .icon-close, .hg .site-menu[open] > summary .icon-open { display: none; }
.hg .site-menu[open] > summary .icon-close { display: block; }
.hg .site-menu-panel { position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 4px var(--gutter) 16px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2); }
.hg .site-menu-panel a, .hg .site-menu-panel button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; text-align: left; text-decoration: none; color: var(--ink); font: 500 1.0625rem/1.3 var(--font-sans); }
.hg .site-menu-panel .icon { width: 18px; height: 18px; color: var(--ink-3); }
.hg .site-menu-panel > :last-child, .hg .site-menu-panel > form:last-child button { border-bottom: 0; }
.hg .site-menu-panel form { display: block; }
@media (min-width: 1000px) { .hg .site-menu { display: none; } }
@media (min-width: 1000px) and (max-width: 1099px) { .hg .site-header.is-crowded .site-menu { display: block; } }

/* ---- Site footer ------------------------------------------------------------ */
.hg .site-footer { border-top: 1px solid var(--line); padding: var(--s-10) 0 var(--s-14); color: var(--ink-3); font-size: var(--text-small); }
.hg .site-footer > .container { display: grid; gap: var(--s-6); }
.hg .site-footer .footer-note { margin-top: 12px; max-width: 46ch; }
.hg .site-footer .footer-legal { margin-top: 10px; }
.hg .site-footer nav { display: flex; flex-wrap: wrap; gap: 0 var(--s-6); }
.hg .site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; }
.hg .site-footer nav a:hover { text-decoration: underline; }
@media (min-width: 900px) { .hg .site-footer > .container { grid-template-columns: 1.1fr 1fr; align-items: start; } .hg .site-footer nav { justify-content: flex-end; } }

/* ---- Sticky phone bar (landing: upload; report: next step) ------------------ */
/* Render it with the `hidden` attribute and reveal it once the control it
   mirrors has scrolled away. Give the page bottom padding so it never covers
   the footer links: body.hg.has-stickybar does that. */
.hg .stickybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 253, 249, .96); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -10px rgba(20, 39, 29, .22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hg .stickybar small { display: block; font-size: var(--text-micro); color: var(--ink-3); }
.hg .stickybar b { display: block; font-size: .9375rem; line-height: 1.25; }
.hg .stickybar .btn { min-height: 44px; padding-inline: 18px; }
.hg .stickybar > .btn-block { min-height: 48px; }
.hg .stickybar[hidden] { display: none; }
@media (max-width: 959px) { body.hg.has-stickybar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); } }
@media (min-width: 960px) { .hg .stickybar { display: none; } }

/* ---- Outreach status dot (sent / opened / replied) ------------------------ */
.hg .t-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.hg .t-opened { border-color: var(--gold-500); background: var(--gold-100); }
.hg .t-replied { border-color: var(--green-600); background: var(--green-600); }

/* ---- Dropzone (landing hero on phones, landing closing band, /start) ------- */
.hg .drop { display: grid; justify-items: center; gap: 6px; padding: 26px 16px 24px; text-align: center; cursor: pointer; border-radius: var(--r-lg); border: 2px dashed var(--green-300); background: var(--green-50); transition: border-color .15s, background .15s; }
.hg .drop:hover, .hg .drop:focus-within, .hg .drop.is-over { border-color: var(--green-600); background: #E9F1E7; }
.hg .drop:focus-within { outline: 2px solid var(--green-600); outline-offset: 2px; }
.hg .drop-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--surface); color: var(--green-600); box-shadow: var(--shadow-1); margin-bottom: 6px; }
.hg .drop-ic .icon { width: 24px; height: 24px; }
.hg .drop-t { font-size: 1.0625rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.hg .drop-t u { color: var(--green-600); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.hg .drop-h { font-size: var(--text-small); color: var(--ink-3); }
.hg .drop .btn { margin-top: 8px; pointer-events: none; }            /* the whole label is the target */
.hg .drop-compact { grid-template-columns: minmax(0, 1fr); padding: 16px 14px 14px; gap: 4px; }
.hg .drop-compact .btn { width: 100%; margin-top: 10px; }
.hg .drop.is-picked { border-style: solid; border-color: var(--green-600); background: var(--surface); }
.hg .drop.is-error { border-color: var(--urgent); background: var(--urgent-tint); }
.hg .drop.is-error .drop-h { color: var(--urgent-ink); font-weight: 600; }
.hg .drop-on-dark { background: rgba(255, 253, 249, .06); border-color: rgba(255, 253, 249, .38); }
.hg .drop-on-dark:hover, .hg .drop-on-dark:focus-within { background: rgba(255, 253, 249, .10); border-color: var(--gold-400); }
.hg .drop-on-dark:focus-within { outline-color: var(--gold-400); }
.hg .drop-on-dark .drop-t { color: var(--surface); }
.hg .drop-on-dark .drop-h { color: var(--on-dark-2); }

/* ---- Pull quote: "What the inspector wrote" --------------------------------- */
.hg .pullquote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--gold-500); background: var(--gold-50); border-radius: 0 10px 10px 0; font: italic 400 .9375rem/1.5 var(--font-display); color: var(--ink-2); }
.hg .pullquote > span { display: block; font: 600 var(--text-micro)/1.4 var(--font-sans); font-style: normal; color: var(--gold-700); margin-bottom: 4px; }
.hg .pullquote > small { display: block; font: 400 var(--text-micro)/1.4 var(--font-sans); font-style: normal; color: var(--ink-3); margin-top: 6px; }

/* ---- Feedback card: "Was this useful?" --------------------------------------- */
.hg .feedback { padding: 20px; }
.hg .feedback h2 { font: 500 1.375rem/1.2 var(--font-display); letter-spacing: -.015em; margin-bottom: 4px; }
.hg .fb-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
.hg .fb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 68px; border-radius: 12px; border: 1.5px solid var(--line-field); background: var(--surface); font-size: var(--text-small); font-weight: 600; cursor: pointer; }
.hg .fb:hover { border-color: var(--ink-3); }
.hg .fb[aria-pressed="true"] { border-color: var(--green-600); background: var(--green-50); color: var(--green-800); box-shadow: inset 0 0 0 1px var(--green-600); }
.hg .fb .icon { width: 20px; height: 20px; }
.hg .fb-more { display: grid; gap: 10px; }
.hg .fb-more .input { font-size: .9375rem; min-height: 68px; }
@media (min-width: 720px) {
  .hg .feedback { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px 40px; padding: 28px 32px; align-items: start; }
  .hg .fb-btns { margin-top: 0; }
  .hg .fb-side { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---- FAQ (native <details>, no JavaScript) ------------------------------------ */
.hg .faq-list details { border-top: 1px solid var(--line-strong); }
.hg .faq-list details:last-child { border-bottom: 1px solid var(--line-strong); }
.hg .faq-list summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; min-height: 64px; font: 600 1.125rem/1.35 var(--font-sans); }
.hg .faq-list summary::-webkit-details-marker { display: none; }
.hg .faq-list summary .icon { color: var(--ink-3); transition: transform .2s; }
.hg .faq-list details[open] summary .icon { transform: rotate(45deg); }
.hg .faq-list details p { padding: 0 0 22px; margin-top: -4px; color: var(--ink-2); max-width: 62ch; }
.hg .faq-list details p + p { margin-top: -10px; }

/* ---- Tick list ----------------------------------------------------------------- */
.hg .ticks { display: grid; gap: 9px; list-style: none; }
.hg .ticks li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; line-height: 1.4; }
.hg .ticks .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--green-600); stroke-width: 2.5; }

/* ---- Long-form text (legal pages, guide articles, help) ------------------------- */
/* <div class="prose"> around plain h2 / p / ul / ol / a markup. */
.hg .prose { max-width: 68ch; color: var(--ink-2); font-size: 1.0625rem; line-height: 1.65; overflow-wrap: break-word; }
.hg .prose > * + * { margin-top: 1em; }
.hg .prose h2 { margin-top: 2em; font: 500 1.5rem/1.2 var(--font-display); letter-spacing: -.015em; color: var(--ink); text-wrap: balance; }
.hg .prose h3 { margin-top: 1.6em; font: 600 1.125rem/1.3 var(--font-sans); color: var(--ink); }
.hg .prose h2 + *, .hg .prose h3 + * { margin-top: .6em; }
.hg .prose ul, .hg .prose ol { padding-left: 1.25em; }
.hg .prose ul { list-style: disc; }
.hg .prose ol { list-style: decimal; }
.hg .prose li + li { margin-top: .4em; }
.hg .prose li::marker { color: var(--ink-3); }
.hg .prose strong, .hg .prose b { font-weight: 600; color: var(--ink); }
.hg .prose a { color: var(--green-600); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: var(--green-300); }
.hg .prose a:hover { text-decoration-color: currentColor; }

/* ---- Simple page header (legal, guides index, error pages) ---------------------- */
.hg .page-head { padding-block: var(--s-10) var(--s-8); }
.hg .page-head .eyebrow { margin-bottom: 14px; }
.hg .page-head .lead, .hg .page-head .muted { margin-top: 12px; }
@media (min-width: 900px) { .hg .page-head { padding-block: var(--s-18) var(--s-10); } }
.hg .page-body { padding-bottom: var(--s-18); }

/* ==========================================================================
   Page files (hg_landing.css, hg_start.css, hg_guides.css, ...)

   - One file per page area, linked by the layout AFTER this file when the
     view sets `content_for :hg_page, "landing"` (file hg_landing.css,
     <body class="hg hg-landing">).
   - Start EVERY selector with the page scope: `.hg-landing .hero { ... }`.
     That keeps the rule off un-migrated pages (the file is linked on every
     page by `:app`), off the other hg pages, and gives it the same
     specificity as the shared rules above, so source order decides, exactly
     as in the mockups (tokens.css first, page CSS second).
   - Use the tokens (var(--ink), var(--s-6), ...). No new colours, no
     element selectors without the scope, no :root, no @import, no nesting.
   ========================================================================== */
