/* ======================================================================
   F5431 -- Wholesale Heaven design system.

   Derived from the AIPropertyPro system (static/css/style.css): the same
   near-black neutral ramp, the same Inter / JetBrains Mono pairing, the same
   12/8/20px radii and the same soft-large card shadow. Wholesale Heaven's own
   accent is the money green it already shipped with (#1a7f37 light,
   #3fb950 dark) -- in-family, since AIPropertyPro's own scheme carries
   --success #22c55e, and distinct enough that the two products never read as
   the same brand. The neutrals carry a slight green bias for the same reason.

   ALL colour lives in the three :root blocks below and nowhere else. Every
   rule and every inline style references var(--wh-*). tests/test_f5431_theme.py
   fails the build if a hex literal appears outside those blocks.

   Three blocks, in this order, so both directions of the toggle win:
     :root                                      -- light (the default)
     @media (prefers-color-scheme:dark) :root:not([data-theme="light"])
     :root[data-theme="dark"]
   ====================================================================== */

:root{
  /* accent */
  --wh-accent:#1a7f37; --wh-accent-hover:#15682d;
  --wh-accent-soft:rgba(26,127,55,.08); --wh-accent-glow:rgba(26,127,55,.18);
  --wh-on-accent:#ffffff;
  /* surfaces */
  --wh-bg:#f6f8f6; --wh-bg-2:#ffffff; --wh-bg-3:#eef2ee;
  --wh-surface:#ffffff; --wh-elevated:#ffffff; --wh-input:#ffffff;
  /* text */
  --wh-fg:#121814; --wh-fg-2:#55605a; --wh-muted:#6b756e;
  /* lines */
  --wh-border:#dce3dd; --wh-border-2:#c7d1c9;
  /* states */
  --wh-warn-bg:#fffbe6; --wh-warn-br:#e8d99a; --wh-warn-fg:#6b5300;
  --wh-danger:#b42318; --wh-danger-bg:#fef3f2; --wh-danger-br:#f3c4be;
  --wh-ok:#1a7f37; --wh-ok-bg:#eef7f0;
  --wh-info:#1d4ed8; --wh-info-bg:#eef2ff;
  /* elevation */
  --wh-shadow:0 1px 2px rgba(16,24,20,.06),0 8px 24px rgba(16,24,20,.06);
  --wh-shadow-lg:0 12px 40px rgba(16,24,20,.12);
  --wh-ring:0 0 0 3px var(--wh-accent-glow);
  /* basemap dim: transparent in light */
  --wh-map-dim:rgba(0,0,0,0);
  --wh-map-dim-opacity:0;

  /* --- non-colour scale (shared by both themes) --- */
  --wh-font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,system-ui,sans-serif;
  --wh-mono:'JetBrains Mono','SFMono-Regular',Menlo,Consolas,monospace;
  --wh-r:12px; --wh-r-sm:8px; --wh-r-lg:20px; --wh-r-pill:999px;
  --wh-maxw:1060px;
  --wh-gap:16px;
  --wh-t:all .22s cubic-bezier(.4,0,.2,1);
  color-scheme:light;
}

@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --wh-accent:#3fb950; --wh-accent-hover:#56d364;
    --wh-accent-soft:rgba(63,185,80,.12); --wh-accent-glow:rgba(63,185,80,.25);
    --wh-on-accent:#06170a;
    --wh-bg:#0a0b0a; --wh-bg-2:#111311; --wh-bg-3:#191d19;
    --wh-surface:#151815; --wh-elevated:#1a1e1a; --wh-input:#1e221e;
    --wh-fg:#f0f2f0; --wh-fg-2:#9aa39c; --wh-muted:#7c857e;
    --wh-border:#232723; --wh-border-2:#2e332e;
    --wh-warn-bg:#2b2410; --wh-warn-br:#5c4a15; --wh-warn-fg:#e3c86a;
    --wh-danger:#ff7b72; --wh-danger-bg:#2a1413; --wh-danger-br:#5c2a26;
    --wh-ok:#3fb950; --wh-ok-bg:#10210f;
    --wh-info:#7aa2f7; --wh-info-bg:#151b2b;
    --wh-shadow:0 1px 2px rgba(0,0,0,.5),0 8px 24px rgba(0,0,0,.45);
    --wh-shadow-lg:0 12px 40px rgba(0,0,0,.6);
    --wh-map-dim:#0a0b0a;
    --wh-map-dim-opacity:.62;
    color-scheme:dark;
  }
}

:root[data-theme="dark"]{
  --wh-accent:#3fb950; --wh-accent-hover:#56d364;
  --wh-accent-soft:rgba(63,185,80,.12); --wh-accent-glow:rgba(63,185,80,.25);
  --wh-on-accent:#06170a;
  --wh-bg:#0a0b0a; --wh-bg-2:#111311; --wh-bg-3:#191d19;
  --wh-surface:#151815; --wh-elevated:#1a1e1a; --wh-input:#1e221e;
  --wh-fg:#f0f2f0; --wh-fg-2:#9aa39c; --wh-muted:#7c857e;
  --wh-border:#232723; --wh-border-2:#2e332e;
  --wh-warn-bg:#2b2410; --wh-warn-br:#5c4a15; --wh-warn-fg:#e3c86a;
  --wh-danger:#ff7b72; --wh-danger-bg:#2a1413; --wh-danger-br:#5c2a26;
  --wh-ok:#3fb950; --wh-ok-bg:#10210f;
  --wh-info:#7aa2f7; --wh-info-bg:#151b2b;
  --wh-shadow:0 1px 2px rgba(0,0,0,.5),0 8px 24px rgba(0,0,0,.45);
  --wh-shadow-lg:0 12px 40px rgba(0,0,0,.6);
  --wh-map-dim:#0a0b0a;
  --wh-map-dim-opacity:.62;
  color-scheme:dark;
}

/* ---------------------------------------------------------------- reset */
*,*::before,*::after{box-sizing:border-box}

/* ------------------------------------------------------------ document
   Every Wholesale Heaven page is a plain sequence of top-level elements
   emitted by a _page() helper, so the page gutter and measure are applied
   to each top-level child rather than to a wrapper that does not exist. */
body.wh-doc{
  margin:0;
  background:var(--wh-bg);
  color:var(--wh-fg);
  font:400 16px/1.6 var(--wh-font);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
  min-height:100vh;
}
/* The measure lives on ONE wrapper. Per-child rules cannot work here: every
   heading below sets `margin:` as a shorthand, which would reset the
   margin-left:auto that centres it (proved by the F5431 headless run -- the
   /records table ran edge to edge). wh_page.page() emits this wrapper and
   wh_theme.inject() adds it to the six sibling _page() helpers. */
#wh-main{
  max-width:var(--wh-maxw);
  margin:0 auto;
  padding:1px 20px 2.5rem;   /* 1px top: contains the first child's margin */
}
#wh-main hr{
  border:none;border-top:1px solid var(--wh-border);
  margin:2.5rem 0 1rem;
}

/* ---------------------------------------------------------- typography */
body.wh-doc h1,body.wh-doc h2,body.wh-doc h3,body.wh-doc h4{
  font-family:var(--wh-font);font-weight:700;letter-spacing:-.021em;line-height:1.18;
  color:var(--wh-fg);
}
body.wh-doc h1{font-size:clamp(1.9rem,4.2vw,2.75rem);margin:1.4rem 0 .6rem}
body.wh-doc h2{font-size:clamp(1.35rem,2.6vw,1.75rem);margin:2rem 0 .5rem}
body.wh-doc h3{font-size:clamp(1.1rem,1.8vw,1.2rem);margin:1.4rem 0 .4rem}
body.wh-doc p{margin:.65rem 0}
body.wh-doc ul,body.wh-doc ol{margin:.65rem 0 .65rem 1.3rem}
body.wh-doc li{margin:.25rem 0}
body.wh-doc a{color:var(--wh-accent);text-decoration:none;transition:var(--wh-t)}
body.wh-doc a:hover{color:var(--wh-accent-hover);text-decoration:underline}
body.wh-doc a:focus-visible,body.wh-doc button:focus-visible,
body.wh-doc input:focus-visible,body.wh-doc select:focus-visible,
body.wh-doc textarea:focus-visible{outline:2px solid var(--wh-accent);outline-offset:2px}
body.wh-doc code,body.wh-doc pre{font-family:var(--wh-mono);font-size:.9em}
body.wh-doc code{background:var(--wh-bg-3);border:1px solid var(--wh-border);
  border-radius:5px;padding:.08em .34em}
body.wh-doc pre{background:var(--wh-bg-3);border:1px solid var(--wh-border);
  border-left:3px solid var(--wh-accent);border-radius:var(--wh-r-sm);
  padding:.9rem 1rem;overflow-x:auto;white-space:pre-wrap}
body.wh-doc strong,body.wh-doc b{font-weight:650;color:var(--wh-fg)}
body.wh-doc small{color:var(--wh-fg-2)}
body.wh-doc img{max-width:100%;height:auto}
.wh-eyebrow{display:inline-block;font-size:.72rem;font-weight:600;letter-spacing:.18em;
  text-transform:uppercase;color:var(--wh-accent);margin-bottom:.4rem}
.wh-lede{font-size:1.06rem;color:var(--wh-fg-2);max-width:66ch}

/* -------------------------------------------------------------- topbar */
.wh-topbar{
  position:sticky;top:0;z-index:40;
  background:color-mix(in srgb,var(--wh-bg-2) 86%,transparent);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--wh-border);
}
@supports not (background:color-mix(in srgb,red 50%,transparent)){
  .wh-topbar{background:var(--wh-bg-2)}
}
.wh-topbar-in{max-width:var(--wh-maxw);margin:0 auto;padding:10px 20px}
.wh-brandrow{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.wh-wordmark{display:inline-flex;align-items:center;gap:.5rem;text-decoration:none}
.wh-wordmark:hover{text-decoration:none}
.wh-mark{
  width:26px;height:26px;flex:0 0 26px;border-radius:7px;
  background:var(--wh-accent);color:var(--wh-on-accent);
  display:inline-flex;align-items:center;justify-content:center;
  box-shadow:0 2px 10px var(--wh-accent-glow);
}
.wh-mark svg{width:16px;height:16px;display:block}
.wh-wordmark-t{font-size:1.16rem;font-weight:800;letter-spacing:-.03em;color:var(--wh-fg)}
.wh-wordmark-t em{font-style:normal;color:var(--wh-accent)}
.wh-tagline{color:var(--wh-fg-2);font-size:.83rem}
.wh-spacer{flex:1 1 auto}
.wh-companion{
  display:flex;align-items:baseline;gap:.5rem;flex-wrap:wrap;
  background:var(--wh-accent-soft);border:1px solid var(--wh-border);
  border-radius:var(--wh-r-sm);padding:.4rem .6rem;
}

/* ----------------------------------------------------------------- nav */
.wh-nav{
  display:flex;flex-wrap:wrap;gap:.1rem .15rem;
  padding:.15rem 0 .3rem;font-size:.9rem;
}
.wh-nav a{
  color:var(--wh-fg-2);text-decoration:none;padding:.32rem .55rem;
  border-radius:var(--wh-r-pill);line-height:1.2;white-space:nowrap;
  transition:var(--wh-t);
}
.wh-nav a:hover{color:var(--wh-fg);background:var(--wh-bg-3);text-decoration:none}
.wh-nav a[aria-current="page"]{
  color:var(--wh-on-accent);background:var(--wh-accent);font-weight:600;
}
.wh-nav a[aria-current="page"]:hover{background:var(--wh-accent-hover);color:var(--wh-on-accent)}

/* -------------------------------------------------------- theme toggle */
.wh-theme-toggle{
  flex:0 0 auto;width:34px;height:34px;padding:0;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--wh-bg-3);color:var(--wh-fg-2);
  border:1px solid var(--wh-border);border-radius:var(--wh-r-pill);
  cursor:pointer;transition:var(--wh-t);
}
.wh-theme-toggle:hover{color:var(--wh-accent);border-color:var(--wh-accent);
  background:var(--wh-accent-soft)}
.wh-theme-toggle svg{width:17px;height:17px;display:block}
.wh-theme-toggle .wh-i-moon{display:none}
.wh-theme-toggle[aria-pressed="true"] .wh-i-moon{display:block}
.wh-theme-toggle[aria-pressed="true"] .wh-i-sun{display:none}

/* --------------------------------------------------------------- cards */
.wh-card{
  background:var(--wh-surface);border:1px solid var(--wh-border);
  border-radius:var(--wh-r);padding:1.05rem 1.15rem;box-shadow:var(--wh-shadow);
}
a.wh-card{display:block;text-decoration:none;color:inherit;transition:var(--wh-t)}
a.wh-card:hover{border-color:var(--wh-accent);box-shadow:var(--wh-shadow-lg);
  transform:translateY(-2px);text-decoration:none}
.wh-card h2,.wh-card h3{margin-top:0}
.wh-card-t{font-size:1.03rem;font-weight:700;color:var(--wh-fg);margin:0 0 .3rem}
.wh-card-d{color:var(--wh-fg-2);font-size:.92rem;margin:0}
.wh-grid{display:grid;gap:var(--wh-gap);grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.wh-grid-2{display:grid;gap:var(--wh-gap);grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}

/* ----------------------------------------------------------- hero/stat */
.wh-hero{
  position:relative;overflow:hidden;
  background:
    radial-gradient(120% 140% at 8% 0%,var(--wh-accent-soft) 0%,transparent 58%),
    var(--wh-surface);
  border:1px solid var(--wh-border);border-radius:var(--wh-r-lg);
  padding:1.6rem 1.5rem;box-shadow:var(--wh-shadow);
}
.wh-hero h1{margin-top:0}
.wh-stats{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  margin:1.1rem 0 0}
.wh-stat{background:var(--wh-bg-2);border:1px solid var(--wh-border);
  border-radius:var(--wh-r-sm);padding:.7rem .8rem}
.wh-stat-n{font-family:var(--wh-mono);font-size:1.5rem;font-weight:600;
  letter-spacing:-.02em;color:var(--wh-fg);font-variant-numeric:tabular-nums;display:block}
.wh-stat-l{font-size:.76rem;letter-spacing:.06em;text-transform:uppercase;color:var(--wh-muted)}

/* ------------------------------------------------------------- buttons */
.wh-btn,button.wh-btn,a.wh-btn{
  display:inline-flex;align-items:center;gap:.45rem;
  padding:.62rem 1.15rem;border-radius:var(--wh-r-sm);
  font:600 .93rem/1.1 var(--wh-font);cursor:pointer;text-decoration:none;
  background:var(--wh-bg-2);color:var(--wh-fg);
  border:1px solid var(--wh-border-2);transition:var(--wh-t);
}
.wh-btn:hover{border-color:var(--wh-accent);color:var(--wh-accent);
  background:var(--wh-accent-soft);text-decoration:none}
.wh-btn.primary,a.wh-btn.primary,button.wh-btn.primary{
  background:var(--wh-accent);border-color:var(--wh-accent);color:var(--wh-on-accent);
  box-shadow:0 3px 14px var(--wh-accent-glow);
}
.wh-btn.primary:hover{background:var(--wh-accent-hover);border-color:var(--wh-accent-hover);
  color:var(--wh-on-accent);transform:translateY(-1px);box-shadow:0 6px 22px var(--wh-accent-glow)}
.wh-btn.sm{padding:.4rem .75rem;font-size:.85rem}

/* --------------------------------------------------------------- forms */
body.wh-doc label{display:block;margin:.45rem 0;color:var(--wh-fg)}
body.wh-doc input,body.wh-doc select,body.wh-doc textarea{
  font:inherit;color:var(--wh-fg);background:var(--wh-input);
  border:1px solid var(--wh-border-2);border-radius:var(--wh-r-sm);
  padding:.5rem .6rem;max-width:100%;
}
body.wh-doc input:focus,body.wh-doc select:focus,body.wh-doc textarea:focus{
  border-color:var(--wh-accent);box-shadow:var(--wh-ring);outline:none}
body.wh-doc button:not(.wh-btn):not(.wh-theme-toggle):not(.wh-close){
  font:600 .93rem/1.1 var(--wh-font);cursor:pointer;padding:.62rem 1.15rem;
  border-radius:var(--wh-r-sm);background:var(--wh-accent);
  border:1px solid var(--wh-accent);color:var(--wh-on-accent);transition:var(--wh-t);
}
body.wh-doc button:not(.wh-btn):not(.wh-theme-toggle):not(.wh-close):hover{
  background:var(--wh-accent-hover);border-color:var(--wh-accent-hover)}

/* -------------------------------------------------------------- tables */
.wh-tw{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:1rem 0;
  border:1px solid var(--wh-border);border-radius:var(--wh-r);background:var(--wh-surface)}
body.wh-doc table{border-collapse:collapse;width:100%;max-width:100%;font-size:.92rem;
  background:var(--wh-surface);table-layout:auto}
/* a bare <table> emitted with no scroll wrapper must still not widen the page:
   a 90-character county list URL in one cell was pushing /tax-sales 284px wide
   at 390px (F5431 headless run). */
body.wh-doc td,body.wh-doc th{overflow-wrap:break-word;word-break:break-word;min-width:0}
body.wh-doc th{
  text-align:left;padding:.6rem .75rem;font-size:.76rem;letter-spacing:.06em;
  text-transform:uppercase;color:var(--wh-muted);font-weight:600;
  background:var(--wh-bg-3);border-bottom:1px solid var(--wh-border);
}
body.wh-doc td{padding:.55rem .75rem;border-bottom:1px solid var(--wh-border);
  vertical-align:top;color:var(--wh-fg)}
body.wh-doc tbody tr:last-child td{border-bottom:none}
body.wh-doc tbody tr:hover td{background:var(--wh-bg-3)}
/* legacy pages emit <table border=1 cellpadding=6>: neutralise the 3D border */
body.wh-doc table[border]{border:none}
body.wh-doc table[border] td,body.wh-doc table[border] th{border-width:0 0 1px 0;border-style:solid}

/* --------------------------------------------------------------- notes */
.wh-note,.wh-warn{background:var(--wh-warn-bg);border:1px solid var(--wh-warn-br);
  color:var(--wh-fg);padding:.7rem .95rem;border-radius:var(--wh-r-sm);margin:.9rem 0}
.wh-err{background:var(--wh-danger-bg);border:1px solid var(--wh-danger-br);
  color:var(--wh-danger);padding:.7rem .95rem;border-radius:var(--wh-r-sm);margin:.9rem 0}
.wh-ok{background:var(--wh-ok-bg);border:1px solid var(--wh-border);
  color:var(--wh-ok);padding:.7rem .95rem;border-radius:var(--wh-r-sm);margin:.9rem 0}
.wh-info{background:var(--wh-info-bg);border:1px solid var(--wh-border);
  color:var(--wh-fg);padding:.7rem .95rem;border-radius:var(--wh-r-sm);margin:.9rem 0}
.wh-fine{font-size:.85rem;color:var(--wh-fg-2)}
.wh-muted{color:var(--wh-fg-2)}
.wh-dim{color:var(--wh-muted);font-size:.8rem}
.wh-pill{display:inline-block;padding:.12em .55em;border-radius:var(--wh-r-pill);
  font-size:.78rem;border:1px solid var(--wh-border);color:var(--wh-fg-2);
  background:var(--wh-bg-3);margin:.1em .2em .1em 0}

/* -------------------------------------------------------------- footer */
.wh-foot{max-width:var(--wh-maxw);margin:2.5rem auto 0;padding:1.1rem 20px 2.5rem;
  border-top:1px solid var(--wh-border);font-size:.85rem;color:var(--wh-fg-2)}
@media (max-width:640px){.wh-foot{padding-left:16px;padding-right:16px}}
body.wh-doc .wh-foot a{color:var(--wh-fg-2);text-decoration:none}
body.wh-doc .wh-foot a:hover{color:var(--wh-accent);text-decoration:underline}
.wh-foot-links{display:flex;flex-wrap:wrap;gap:.35rem .9rem;margin:.4rem 0}

@media (max-width:640px){
  body.wh-doc{font-size:15.5px}
  #wh-main{padding-left:16px;padding-right:16px}
  .wh-topbar-in{padding:8px 16px}
  .wh-hero{padding:1.15rem 1rem;border-radius:var(--wh-r)}
  .wh-tagline{display:none}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none!important;animation:none!important}
  a.wh-card:hover,.wh-btn:hover{transform:none}
}
