/* ============================================================
   Homewood Tools — framework chrome
   Tokens + topbar + sidebar + home + login.
   Module interiors keep their own brand packs.
   Sourced from the design handoff (May 2026).
   ============================================================ */

:root {
  /* ── Homewood Creations parent brand ────────────────── */
  --hc-red:         #A71C20;
  --hc-red-deep:    #7E1518;
  --hc-brown:       #603913;
  --hc-brown-soft:  #8A5A2B;
  --hc-brown-tint:  #E9DEC9;
  --hc-earth-1:     #C9A678;  /* tan / oak */
  --hc-earth-2:     #8C6A3D;  /* walnut */
  --hc-earth-3:     #4D3A22;  /* dark walnut */
  --hc-earth-4:     #D9C9A8;  /* maple */

  /* ── Framework surfaces ─────────────────────────────── */
  --hw-paper:       #F1ECE0;
  --hw-kraft:       #E7DFCB;
  --hw-card:        #FBF8F1;
  --hw-card-2:      #F5F0E5;
  --hw-ink:         #18140F;
  --hw-ink-muted:   #6F665A;
  --hw-ink-soft:    #9C9286;
  --hw-rule:        rgba(24,20,15,0.14);
  --hw-rule-strong: rgba(24,20,15,0.22);
  --hw-white:       #FFFFFF;

  /* ── Type ───────────────────────────────────────────── */
  --hw-font-display: "DM Serif Display", "Adriane Text", Georgia, serif;
  --hw-font-ui:      "Inter", "Helvetica Neue", Helvetica, system-ui, sans-serif;
  --hw-font-mark:    "Work Sans", Inter, system-ui, sans-serif;
  --hw-font-mono:    "JetBrains Mono", "IBM Plex Mono", Menlo, monospace;

  /* ── Geometry ───────────────────────────────────────── */
  --hw-s-1: 4px;  --hw-s-2: 8px;  --hw-s-3: 12px; --hw-s-4: 16px;
  --hw-s-5: 24px; --hw-s-6: 32px; --hw-s-7: 48px; --hw-s-8: 64px;
  --hw-r-sm: 3px;
  --hw-r-md: 6px;
  --hw-r-lg: 10px;
  --hw-r-xl: 14px;

  /* ── Shadows ────────────────────────────────────────── */
  --hw-shadow-sm: 0 1px 0 rgba(24,20,15,0.05), 0 1px 2px rgba(24,20,15,0.04);
  --hw-shadow-md: 0 2px 4px rgba(24,20,15,0.06), 0 4px 12px rgba(24,20,15,0.05);
  --hw-shadow-lg: 0 8px 24px rgba(24,20,15,0.10), 0 2px 6px rgba(24,20,15,0.06);

  /* ── Module accents (mirror each module's own pack) ── */
  --co-teal:        #1F4548;
  --co-teal-deep:   #13302F;
  --co-teal-tint:   #D9E3E2;
  --co-open:        #C88A2B;
  --sr-oxblood:     #6B2323;
  --sr-oxblood-deep:#4A1818;
  --sr-amber:       #D4A13A;
  --bb-rust:        #B8532A;
  --bb-ink:         #18140F;

  /* Shell defaults — picked per the handoff's "sensible defaults":
     paper bg, paper topbar, hex off, sidebar full. */
  --hw-bg:               var(--hw-paper);
  --hw-topbar-bg:        var(--hw-card);
  --hw-topbar-fg:        var(--hw-ink);
  --hw-topbar-fg-muted:  var(--hw-ink-muted);
  --hw-topbar-hc-color:  var(--hc-red);
  --hw-sidebar-bg:       var(--hw-card);
}

/* Webfont stack — load via Google Fonts in base.ejs. */

/* ── Base reset + body ───────────────────────────────── */
html.hw, body.hw {
  margin: 0; padding: 0;
}
body.hw {
  font-family: var(--hw-font-ui);
  background: var(--hw-bg);
  color: var(--hw-ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.hw a { color: var(--hw-ink); text-decoration: none; }
body.hw a:hover { text-decoration: underline; }
body.hw button { font-family: inherit; cursor: pointer; }

/* ── Hexagon SVG background — opt-in via .hw-hex-bg ── */
.hw-hex-bg {
  background-color: var(--hw-paper);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='49' viewBox='0 0 56 49'><g fill='none' stroke='%23603913' stroke-opacity='0.06' stroke-width='1'><path d='M14 0.5 L42 0.5 L56 24.5 L42 48.5 L14 48.5 L0 24.5 Z'/></g></svg>");
}

/* ── Module chips ──────────────────────────────────── */
.hw-chip {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--hw-font-mark); font-weight: 800;
  font-size: 11px; letter-spacing: -0.02em;
  flex: 0 0 auto;
  line-height: 1;
}
.hw-chip--co  { background: var(--co-teal);    color: var(--hw-paper); }
.hw-chip--sr  { background: var(--sr-oxblood); color: var(--hw-paper); transform: rotate(-3deg); }
.hw-chip--bb  { background: var(--hw-ink);     color: var(--hw-paper); }
.hw-chip--tk  { background: var(--hc-earth-2); color: var(--hw-paper); }
.hw-chip--cnc { background: var(--hw-ink);     color: var(--hc-earth-1); border: 1px dashed var(--hc-earth-1); font-size: 9px; }
.hw-chip--hc  { background: var(--hw-paper);   color: var(--hc-red); border: 1.5px solid var(--hc-red); }
.hw-chip--lg  { width: 56px; height: 56px; font-size: 22px; border-radius: 10px; }
.hw-chip--xl  { width: 80px; height: 80px; font-size: 32px; border-radius: 14px; }
.hw-chip--cnc.hw-chip--xl { font-size: 22px; }

/* ── Shop Pulse brand pack (HT-31) ───────────────────
   Tokens + the SP chip (EKG line baked into the mark)
   that drops into the sidebar nav alongside CO/SR/BB.
   The TV scoreboard tokens (--sp-tv-*) are used only
   inside the per-stage / all-stages TV dashboards. */
:root {
  --sp-red:        #E63946;   /* signal red — brighter, pinker than HC red */
  --sp-red-deep:   #B82939;   /* hover / pressed */
  --sp-red-soft:   #FBDEE3;   /* tinted backgrounds */
  --sp-red-bright: #F25865;   /* hi-vis on dark TV */
  --sp-tv-bg:      #0B0908;
  --sp-tv-bg-2:    #161210;
  --sp-tv-rule:    #2A241F;
  --sp-tv-paper:   #ECE6D8;
  --sp-tv-dim:     #7A6F62;
  --sp-tv-done:    #4A9D5C;
}
.hw-chip--sp {
  background: var(--sp-red);
  color: var(--hw-paper);
  position: relative;
  overflow: hidden;
  padding-bottom: 6px;          /* shift letters up; EKG sits in this strip */
}
.hw-chip--sp.hw-chip--lg { padding-bottom: 14px; }
.hw-chip--sp.hw-chip--xl { padding-bottom: 24px; }

/* Static EKG line — always visible. The chip's silhouette. */
.hw-chip--sp::before {
  content: "";
  position: absolute;
  left: 4px; right: 4px; bottom: 4px;
  height: 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8' preserveAspectRatio='none'><polyline points='0,4 13,4 15.5,1 18,7 20.5,4 40,4' fill='none' stroke='%23F1ECE0' stroke-width='1.4' stroke-linecap='square' vector-effect='non-scaling-stroke'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}
.hw-chip--sp.hw-chip--lg::before { left: 9px;  right: 9px;  bottom: 8px;  height: 6px; }
.hw-chip--sp.hw-chip--xl::before { left: 15px; right: 15px; bottom: 14px; height: 9px; }

/* Sweep highlight — bright traveler riding the EKG path. Same path
   used as a mask; a moving white gradient is masked into the line. */
.hw-chip--sp::after {
  content: "";
  position: absolute;
  pointer-events: none;
  left: 4px; right: 4px; bottom: 4px;
  height: 4px;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8' preserveAspectRatio='none'><polyline points='0,4 13,4 15.5,1 18,7 20.5,4 40,4' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='square' vector-effect='non-scaling-stroke'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8' preserveAspectRatio='none'><polyline points='0,4 13,4 15.5,1 18,7 20.5,4 40,4' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='square' vector-effect='non-scaling-stroke'/></svg>");
  -webkit-mask-size: 100% 100%;     mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;   mask-repeat: no-repeat;
  background: linear-gradient(90deg, transparent 35%, rgba(255,255,255,0.95) 50%, transparent 65%);
  background-size: 300% 100%;
  animation: sp-sweep 1.8s linear infinite;
}
.hw-chip--sp.hw-chip--lg::after { left: 9px;  right: 9px;  bottom: 8px;  height: 6px; }
.hw-chip--sp.hw-chip--xl::after { left: 15px; right: 15px; bottom: 14px; height: 9px; }
.hw-chip--sp[data-mini] { padding-bottom: 0; }
.hw-chip--sp[data-mini]::before,
.hw-chip--sp[data-mini]::after { display: none; }
@keyframes sp-sweep {
  from { background-position: 220% 0; }
  to   { background-position: -120% 0; }
}
@keyframes sp-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,0.55); }
  50%      { box-shadow: 0 0 0 8px rgba(230,57,70,0); }
}

/* ── Pipeline brand pack (HT-37) ─────────────────────
   Forest-green CRM module. The chip is a circular
   bullseye of concentric stage rings (no letters) —
   intentionally different from the lettered square
   chips other modules use. Tokens + helper classes
   (.pl-pipe chevron bar, .pl-pill stages, .pl-temp
   urgency dots, .pl-deal cards, .pl-kcol kanban) are
   the brand surface; views opt into them where they
   render deal-shaped data.

   Sourced from the May 2026 brand-pack handoff —
   verbatim tokens; the .hw-chip--pl size overrides at
   the bottom force the chip to stay circular across
   all four framework chip sizes. */
:root {
  /* Primary palette — forest family */
  --pl-forest:       #2D5A3D;
  --pl-forest-deep:  #1E3F2A;
  --pl-forest-tint:  #DCE5D6;
  --pl-moss:         #5C7F4F;
  --pl-pine:         #14291C;
  --pl-fern:         #A7B89C;
  /* Pipeline stage colors — cold → warm → forest */
  --pl-stage-1:      #8C9A8E;
  --pl-stage-2:      #5C7F4F;
  --pl-stage-3:      #D4A13A;
  --pl-stage-4:      #B8532A;
  --pl-stage-5:      #2D5A3D;
  --pl-stage-lost:   #6F665A;
  /* Temperature (urgency, independent of stage) */
  --pl-cold:         #5A748B;
  --pl-cold-tint:    #DEE5EB;
  --pl-warm:         #C88A2B;
  --pl-warm-tint:    #F4E6C9;
  --pl-hot:          #A71C20;
  --pl-hot-tint:     #F1D7D8;
  --pl-won-tint:     #D4E0CC;
  --pl-lost-tint:    #E3DFD8;
  --pl-rule:         rgba(45,90,61,0.18);
  --pl-rule-strong:  rgba(45,90,61,0.32);
}

/* The chip — concentric stage rings with paper hairlines,
   HC-red bullseye in the center. Reads as "funnel collapses
   inward, the hot deal lands." Force-overrides the lettered-
   chip background + border-radius. */
.hw-chip--pl {
  background: transparent;
  color: transparent;
  position: relative;
  overflow: hidden;
  border-radius: 50% !important;
  padding: 0;
  background-image:
    radial-gradient(circle at 50% 50%,
      #A71C20 0       12.5%,
      #F1ECE0 12.5%   15%,
      #B8532A 15%     30%,
      #F1ECE0 30%     32.5%,
      #D4A13A 32.5%   50%,
      #F1ECE0 50%     52.5%,
      #5C7F4F 52.5%   70%,
      #F1ECE0 70%     72.5%,
      #8C9A8E 72.5%   100%);
}
.hw-chip--pl::after { display: none; }
/* Framework's --lg / --xl override .hw-chip's border-radius — we
   re-pin to 50% so the bullseye stays circular at every size. */
.hw-chip--pl.hw-chip--lg,
.hw-chip--pl.hw-chip--xl { border-radius: 50% !important; }

/* Wordmark — used in section headers + module banner */
.pl-stamp {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--hw-font-mark);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pl-forest);
  font-size: 14px;
}
.pl-stamp__chev {
  display: inline-block;
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid currentColor;
}

/* Chevron pipeline — the signature motif. Five segments,
   cool → warm → forest. Render once per view as a top-of-page
   summary; child .pl-pipe__seg--{1..5} pick stage colors. */
.pl-pipe {
  --pl-pipe-h:   56px;
  --pl-pipe-gap: 4px;
  display: flex;
  align-items: stretch;
  gap: var(--pl-pipe-gap);
  height: var(--pl-pipe-h);
  font-family: var(--hw-font-mark);
}
.pl-pipe__seg {
  flex: 1;
  position: relative;
  background: var(--seg-bg, var(--hw-card));
  color: var(--seg-fg, var(--hw-ink));
  border: 1px solid var(--seg-stroke, var(--pl-rule));
  display: flex; align-items: center; justify-content: center;
  padding: 0 22px 0 26px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
}
.pl-pipe__seg:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
  padding-left: 18px;
}
.pl-pipe__seg:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%);
  padding-right: 18px;
}
.pl-pipe__count {
  font-family: var(--hw-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin-left: 6px;
}
.pl-pipe__seg--1 { --seg-bg: #ECECEA;            --seg-fg: var(--pl-pine);  --seg-stroke: rgba(0,0,0,0.08); }
.pl-pipe__seg--2 { --seg-bg: var(--pl-fern);     --seg-fg: var(--pl-pine);  --seg-stroke: rgba(0,0,0,0.05); }
.pl-pipe__seg--3 { --seg-bg: var(--pl-moss);     --seg-fg: var(--hw-paper); --seg-stroke: rgba(0,0,0,0.05); }
.pl-pipe__seg--4 { --seg-bg: var(--pl-stage-4);  --seg-fg: var(--hw-paper); --seg-stroke: rgba(0,0,0,0.05); }
.pl-pipe__seg--5 { --seg-bg: var(--pl-forest);   --seg-fg: var(--hw-paper); --seg-stroke: rgba(0,0,0,0.05); }
.pl-pipe[data-style="flat"] .pl-pipe__seg {
  clip-path: none;
  border-radius: 4px;
}
.pl-pipe[data-style="tab"] .pl-pipe__seg {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  border-radius: 0;
  border-right: 1px solid rgba(0,0,0,0.1);
}

/* Temperature dot — set on each lead per follow-up urgency */
.pl-temp {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--hw-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pl-temp__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.pl-temp--cold { color: var(--pl-cold); }
.pl-temp--warm { color: var(--pl-warm); }
.pl-temp--hot  { color: var(--pl-hot);  }
.pl-temp--won  { color: var(--pl-forest); }
.pl-temp--lost { color: var(--pl-stage-lost); }

/* Status pills — stage chips for tables and cards */
.pl-pill {
  font-family: var(--hw-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: var(--hw-r-sm);
  display: inline-block;
}
.pl-pill--cold { background: var(--pl-cold-tint); color: var(--pl-cold); }
.pl-pill--warm { background: var(--pl-warm-tint); color: #7A5A0B; }
.pl-pill--hot  { background: var(--pl-hot-tint);  color: var(--hc-red-deep); }
.pl-pill--won  { background: var(--pl-won-tint);  color: var(--pl-forest-deep); }
.pl-pill--lost { background: var(--pl-lost-tint); color: var(--pl-stage-lost); }

/* Deal card — used in the kanban + pinned at top of detail views */
.pl-deal {
  background: var(--hw-card);
  border: 1px solid var(--hw-rule);
  border-top: 3px solid var(--deal-accent, var(--pl-stage-1));
  border-radius: var(--hw-r-md);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.pl-deal__top  { display: flex; justify-content: space-between; align-items: center; }
.pl-deal__id   { font-family: var(--hw-font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--hw-ink-soft); }
.pl-deal__name { font-family: var(--hw-font-display); font-size: 19px; line-height: 1.15; letter-spacing: -0.01em; color: var(--hw-ink); }
.pl-deal__meta { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed var(--hw-rule); padding-bottom: 8px; }
.pl-deal__value  { font-family: var(--hw-font-mark); font-weight: 800; font-size: 18px; color: var(--pl-forest); letter-spacing: -0.01em; }
.pl-deal__source { font-family: var(--hw-font-mono); font-size: 11px;  color: var(--hw-ink-muted); }
.pl-deal__next   { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.pl-deal__next-l { font-family: var(--hw-font-mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--hw-ink-soft); }
.pl-deal__next-t { font-size: 13px; color: var(--hw-ink); font-weight: 500; }
.pl-deal__next-d {
  font-family: var(--hw-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pl-forest);
  background: var(--pl-forest-tint);
  padding: 3px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.pl-deal__foot  { display: flex; justify-content: space-between; align-items: center; padding-top: 4px; border-top: 1px dashed var(--hw-rule); }
.pl-deal__owner { font-family: var(--hw-font-mono); font-size: 11px; color: var(--hw-ink-muted); letter-spacing: 0.04em; }

/* Kanban column + mini card — the main Pipeline screen */
.pl-kcol {
  background: var(--hw-card-2);
  border: 1px solid var(--hw-rule);
  border-top: 3px solid var(--col-accent, var(--pl-stage-1));
  border-radius: var(--hw-r-md);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 240px;
}
.pl-kcol--1 { --col-accent: var(--pl-stage-1); }
.pl-kcol--2 { --col-accent: var(--pl-stage-2); }
.pl-kcol--3 { --col-accent: var(--pl-stage-3); }
.pl-kcol--4 { --col-accent: var(--pl-stage-4); }
.pl-kcol--5 { --col-accent: var(--pl-stage-5); }
.pl-kcol__head  { display: flex; justify-content: space-between; align-items: center; }
.pl-kcol__label { font-family: var(--hw-font-mark); font-weight: 800; font-size: 10.5px; letter-spacing: 0.12em; color: var(--hw-ink); text-transform: uppercase; }
.pl-kcol__count {
  font-family: var(--hw-font-mono);
  font-size: 11px;
  color: var(--hw-ink-muted);
  background: var(--hw-card);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--hw-rule);
}
.pl-kcol__total { font-family: var(--hw-font-mark); font-weight: 800; font-size: 13px; color: var(--col-accent); letter-spacing: -0.01em; }
.pl-kcol__body  { display: flex; flex-direction: column; gap: 6px; }
.pl-kcard {
  background: var(--hw-card);
  border: 1px solid var(--hw-rule);
  border-radius: var(--hw-r-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  display: block;
  color: inherit;
  text-decoration: none;
}
.pl-kcard:hover { border-color: var(--pl-rule-strong); text-decoration: none; }
.pl-kcard__name { font-weight: 500; margin-bottom: 4px; color: var(--hw-ink); line-height: 1.3; }
.pl-kcard__row  { display: flex; justify-content: space-between; align-items: center; }
.pl-kcard__v    { font-family: var(--hw-font-mono); font-size: 11px; font-weight: 600; color: var(--pl-forest); }
.pl-kcard__muted{ color: var(--hw-ink-muted); font-size: 11px; }
.pl-kcard__next {
  margin-top: 6px;
  padding: 5px 7px;
  font-size: 11px;
  background: var(--pl-forest-tint);
  color: var(--pl-forest-deep);
  border-radius: 3px;
}
.pl-kcard__next--overdue {
  background: var(--pl-hot-tint);
  color: var(--hc-red-deep);
}

/* Module banner — full-bleed forest band that anchors every pipeline
   page. Rendered by buildSubnav(), so any view that already includes
   ${pipelineSubnav} picks it up automatically. */
.pl-banner {
  background: var(--pl-forest);
  color: var(--hw-paper);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  /* Negative top + horizontal margins escape the parent section's
     padding (the views use padding: 20px 28px) so the band reads
     as a full-width header. */
  margin: -20px -28px 0;
  border-bottom: 4px solid var(--pl-forest-deep);
}
.pl-banner__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.pl-banner__chip {
  width: 38px; height: 38px;
  flex: 0 0 auto;
  /* Same bullseye gradient, scoped to this size so it doesn't fight
     framework chip sizing. */
  border-radius: 50%;
  background-image: radial-gradient(circle at 50% 50%,
    #A71C20 0       12.5%,
    #F1ECE0 12.5%   15%,
    #B8532A 15%     30%,
    #F1ECE0 30%     32.5%,
    #D4A13A 32.5%   50%,
    #F1ECE0 50%     52.5%,
    #5C7F4F 52.5%   70%,
    #F1ECE0 70%     72.5%,
    #8C9A8E 72.5%   100%);
  box-shadow: 0 0 0 2px rgba(241,236,224,0.18);
}
.pl-banner__mark {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pl-banner__title {
  font-family: var(--hw-font-mark);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hw-paper);
  font-size: 17px;
  line-height: 1;
}
.pl-banner__sub {
  font-family: var(--hw-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(241,236,224,0.7);
  line-height: 1.2;
}
.pl-banner__nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pl-banner__nav a {
  font-family: var(--hw-font-ui);
  font-size: 13px;
  color: rgba(241,236,224,0.85);
  text-decoration: none;
}
.pl-banner__nav a:hover { color: var(--hw-paper); }

/* Pipeline subnav — banner sits above; this is the tab strip below.
   Tabs split into Pipeline + Marketing groups, each headed by a small
   mono uppercase label positioned above its tab row. The previous
   incarnation rendered the labels inline with the tabs, which read as
   rogue "PIPELINE"/"MARKETING" tabs without underlines. The shared
   bottom rule spans both groups so the active-tab underline still
   reads as part of one continuous strip.

   Layout:
     .pl-subnav (flex row, bottom-aligned, shared underline)
       .pl-subnav__group (flex column)
         .pl-subnav__group-label (small mono caps)
         .pl-subnav__tabs (flex row of <a> tabs)
       .pl-subnav__group (marketing — only when allowed) */
.pl-subnav {
  display: flex;
  align-items: flex-end;
  gap: 32px;
  background: var(--hw-card);
  border-bottom: 1px solid var(--hw-rule);
  padding: 0 28px;
  margin: 0 -28px 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.pl-subnav__group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pl-subnav__group-label {
  font-family: var(--hw-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hw-ink-soft);
  padding: 10px 14px 4px;
  white-space: nowrap;
}
.pl-subnav__tabs {
  display: flex;
  align-items: stretch;
}
.pl-subnav__tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px 10px;
  color: var(--hw-ink-muted);
  text-decoration: none;
  font-family: var(--hw-font-mark);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}
.pl-subnav__tab:hover { color: var(--pl-forest); text-decoration: none; }
.pl-subnav__tab.is-active {
  color: var(--pl-forest);
  border-bottom-color: var(--pl-forest);
}

/* Brand-mark images used in place of the text chip when a module
   supplies its own logo. Geometry matches the chips so the sidebar
   and launcher cards stay on-grid. */
.hw-nav__mark {
  width: 26px; height: 26px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 6px;
  display: block;
}
.hw-mc__mark {
  width: 80px; height: 80px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

/* ── Shell layout ────────────────────────────────────── */
/* Fixed-height shell so the sidebar stays put and ONLY the main
   content scrolls. min-height: 100vh let the whole document scroll,
   which dragged the sidebar (and the Settings/footer at the bottom of
   it) off-screen on tall pages. */
.hw-shell {
  height: 100vh;
  display: flex; flex-direction: column;
  background: var(--hw-bg);
  overflow: hidden;     /* outer scroll is suppressed; .hw-content owns it */
}
.hw-main {
  flex: 1;
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: 0;
}
.hw-content {
  overflow-y: auto;
  background: var(--hw-bg);
  min-width: 0;        /* lets inner wide tables shrink instead of overflowing */
  min-height: 0;
}

/* ── Top bar ─────────────────────────────────────────── */
.hw-topbar {
  display: flex; align-items: center;
  padding: 14px 24px;
  background: var(--hw-topbar-bg);
  color: var(--hw-topbar-fg);
  border-bottom: 1px solid var(--hw-rule);
  position: relative;
}
/* Brand (logo + Tools) sits flush with the left side of the topbar,
 * right next to the sidebar hamburger. The right-side group
 * (Help / user / sign-out) gets pushed all the way right via
 * margin-left: auto so the middle is just empty space. */
.hw-topbar__right { margin-left: auto; }
.hw-topbar__brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: inherit;
  padding: 4px 8px; margin: -4px -8px;
  border-radius: var(--hw-r-sm);
  transition: background 120ms ease;
}
.hw-topbar__brand:hover {
  text-decoration: none;
  background: rgba(0,0,0,0.04);
}
.hw-topbar__logo {
  height: 44px; width: auto; display: block;
}
.hw-topbar__tools {
  font-family: var(--hw-font-mark);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--hw-rule-strong);
  border-radius: var(--hw-r-sm);
  line-height: 1;
  color: var(--hw-topbar-fg);
}
.hw-topbar__right { display: flex; align-items: center; gap: 4px; }
.hw-topbar__btn {
  background: transparent; border: 0;
  color: var(--hw-topbar-fg);
  padding: 8px 12px;
  font-size: 13px;
  border-radius: var(--hw-r-sm);
  text-decoration: none;
  display: inline-flex; align-items: center;
}
.hw-topbar__btn:hover { background: rgba(0,0,0,0.08); text-decoration: none; }
.hw-topbar__user {
  color: var(--hw-topbar-fg);
  padding: 8px 6px;
  font-size: 13px;
  font-weight: 600;
}
.hw-topbar__sep {
  width: 1px; height: 18px;
  background: var(--hw-rule);
  margin: 0 4px;
}

/* Sidebar toggle — mobile open/close drawer, desktop collapse to give
 * the main pane the full viewport width. Visible on all sizes now
 * (was mobile-only); the JS picks behavior based on viewport. */
.hw-topbar__menu {
  display: inline-flex;
  background: transparent; border: 0;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: var(--hw-r-sm);
  color: var(--hw-topbar-fg);
  margin-right: 8px;
  cursor: pointer;
}
.hw-topbar__menu:hover { background: rgba(0,0,0,0.06); }

/* Desktop collapsed: narrow the sidebar to an icons-only rail so the
 * module chips stay reachable but the labels + section headers fold
 * away. Reclaims about 145px of horizontal space for the main pane.
 * Persisted to localStorage so the preference survives reloads. */
.hw-shell[data-sidebar-collapsed="true"] .hw-main {
  grid-template-columns: 64px 1fr;
}
.hw-shell[data-sidebar-collapsed="true"] .hw-sidebar {
  padding: 8px 6px;
}
.hw-shell[data-sidebar-collapsed="true"] .hw-nav__section,
.hw-shell[data-sidebar-collapsed="true"] .hw-nav__label,
.hw-shell[data-sidebar-collapsed="true"] .hw-sidebar__footer {
  display: none;
}
.hw-shell[data-sidebar-collapsed="true"] .hw-nav__item {
  justify-content: center;
  padding: 8px 4px;
}
/* Active accent rail still indicates which module you're on. */
.hw-shell[data-sidebar-collapsed="true"] .hw-nav__bar {
  left: 0;
}
/* Tooltip on hover so the label is still discoverable when collapsed.
 * Uses the native <a title="..."> attr on .hw-nav__item links if set;
 * if not, browsers fall back gracefully. */

/* ── Sidebar ─────────────────────────────────────────── */
.hw-sidebar {
  background: var(--hw-sidebar-bg);
  border-right: 1px solid var(--hw-rule);
  padding: 16px 12px 12px;
  display: flex; flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.hw-nav__section {
  font-family: var(--hw-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hw-ink-soft);
  padding: 18px 12px 8px;
}
/* First section heading sits flush with the sidebar top — no extra
   18px top padding when there's nothing above it. */
.hw-sidebar > .hw-nav__section:first-child { padding-top: 4px; }
.hw-nav__item {
  --hw-nav-accent: var(--hw-ink);
  position: relative;
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 0;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--hw-r-md);
  color: var(--hw-ink);
  font-size: 13.5px; font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.hw-nav__item:hover {
  background: rgba(24,20,15,0.04);
  text-decoration: none;
}
.hw-nav__item.is-active {
  background: rgba(24,20,15,0.06);
  color: var(--hw-ink);
  font-weight: 600;
}
.hw-nav__bar {
  position: absolute;
  left: -1px; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--hw-nav-accent);
  border-radius: 0 2px 2px 0;
}
.hw-nav__label { line-height: 1.1; }

.hw-sidebar__spacer { flex: 1; }
.hw-sidebar__footer {
  margin-top: 12px;
  padding: 12px;
  border-top: 1px dashed var(--hw-rule);
  display: flex; align-items: center; justify-content: center;
}
.hw-sidebar__footer-mark {
  width: 100px; height: auto;
  display: block;
}

/* ── Backdrop for mobile sidebar ─────────────────────── */
.hw-sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(24,20,15,0.4);
  z-index: 39;
}

/* ── Mobile breakpoint ───────────────────────────────── */
@media (max-width: 800px) {
  .hw-topbar__menu { display: inline-flex; }
  .hw-main { grid-template-columns: 1fr; }
  .hw-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 268px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--hw-shadow-lg);
  }
  .hw-shell[data-sidebar-open="true"] .hw-sidebar { transform: translateX(0); }
  .hw-shell[data-sidebar-open="true"] .hw-sidebar-backdrop { display: block; }
}

/* ── HOME page ───────────────────────────────────────── */
.hw-home {
  padding: 20px 40px 32px;
  max-width: 1280px;
  margin: 0 auto;
}
.hw-home__hero {
  display: grid;
  grid-template-columns: 1fr 180px;
  align-items: center;
  gap: 32px;
  padding: 8px 0 24px;
  border-bottom: 1px solid var(--hw-rule);
  margin-bottom: 24px;
}
.hw-home__greeting {
  font-family: var(--hw-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hw-ink-muted);
  margin-bottom: 8px;
}
.hw-home__title {
  font-family: var(--hw-font-display);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--hw-ink);
  text-wrap: balance;
}
.hw-home__title em {
  font-style: italic;
  color: var(--hc-red);
}
.hw-home__sub {
  display: flex; gap: 10px;
  font-family: var(--hw-font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hw-ink-muted);
  flex-wrap: wrap;
}
.hw-home__pip { color: var(--hw-ink-soft); }
.hw-home__hero-mark { display: flex; align-items: center; justify-content: center; }
.hw-home__logo { width: 180px; height: auto; }

.hw-home__section { margin-top: 28px; }
.hw-home__section:first-of-type { margin-top: 0; }
.hw-home__section-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px;
}
.hw-home__section-tag {
  font-family: var(--hw-font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hw-ink-muted);
  padding: 4px 9px;
  border: 1px solid var(--hw-rule-strong);
  border-radius: var(--hw-r-sm);
}
.hw-home__section-title {
  margin: 0;
  font-family: var(--hw-font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
}
.hw-home__section-rule {
  flex: 1; height: 1px;
  background: var(--hw-rule);
}

/* ── Launcher cards ─────────────────────────────────── */
.hw-launcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 980px) {
  .hw-launcher { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hw-launcher { grid-template-columns: 1fr; }
  .hw-home { padding: 24px 16px 40px; }
  .hw-home__hero { grid-template-columns: 1fr; padding-bottom: 28px; margin-bottom: 28px; }
  .hw-home__title { font-size: 36px; }
  .hw-home__hero-mark { display: none; }
}
.hw-mc {
  --mc-accent: var(--hw-ink);
  background: var(--hw-card);
  border: 1px solid var(--hw-rule);
  border-radius: var(--hw-r-lg);
  padding: 0;
  text-align: left;
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: transform 120ms ease, box-shadow 120ms ease;
  text-decoration: none;
  color: var(--hw-ink);
}
.hw-mc:hover {
  transform: translateY(-2px);
  box-shadow: var(--hw-shadow-lg);
  border-color: var(--mc-accent);
  text-decoration: none;
}
.hw-mc::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--mc-accent);
}
.hw-mc__top {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 20px 8px;
}
.hw-mc__open {
  font-family: var(--hw-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hw-ink-muted);
  align-self: center;
}
.hw-mc:hover .hw-mc__open { color: var(--mc-accent); }
.hw-mc__body { padding: 6px 20px 18px; flex: 1; }
.hw-mc__name {
  font-family: var(--hw-font-display);
  font-size: 24px;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  line-height: 1.1;
}
.hw-mc__tag {
  font-family: var(--hw-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mc-accent);
  margin-bottom: 8px;
}
.hw-mc__blurb {
  font-size: 13px;
  color: var(--hw-ink-muted);
  line-height: 1.5;
}

/* ── Login / auth page ───────────────────────────────── */
.hw-auth {
  min-height: 100vh;
  background: var(--hw-paper);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}
.hw-auth__card {
  background: var(--hw-card);
  border: 1px solid var(--hw-rule);
  border-radius: var(--hw-r-lg);
  padding: 36px 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--hw-shadow-md);
}
.hw-auth__brand {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 24px;
}
.hw-auth__logo {
  width: 140px; height: auto;
  margin-bottom: 10px;
}
.hw-auth__tools {
  font-family: var(--hw-font-mark);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--hw-rule-strong);
  border-radius: var(--hw-r-sm);
  color: var(--hw-ink);
}
.hw-auth__h {
  font-family: var(--hw-font-display);
  font-weight: 400;
  font-size: 24px;
  margin: 0 0 18px;
  text-align: center;
  color: var(--hw-ink);
}
.hw-auth__alert {
  background: rgba(167,28,32,0.08);
  border: 1px solid rgba(167,28,32,0.22);
  color: var(--hc-red-deep);
  padding: 10px 12px;
  border-radius: var(--hw-r-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.hw-auth__field { margin-bottom: 14px; }
.hw-auth__label {
  display: block;
  font-family: var(--hw-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hw-ink-muted);
  margin-bottom: 5px;
}
.hw-auth__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hw-rule-strong);
  border-radius: var(--hw-r-sm);
  font: inherit;
  font-size: 14px;
  background: var(--hw-white);
  color: var(--hw-ink);
  box-sizing: border-box;
}
.hw-auth__input:focus {
  outline: 2px solid var(--hc-red);
  outline-offset: 1px;
  border-color: var(--hc-red);
}
.hw-auth__submit {
  display: block;
  width: 100%;
  padding: 11px 16px;
  background: var(--hw-ink);
  color: var(--hw-paper);
  border: 0;
  border-radius: var(--hw-r-md);
  font-family: var(--hw-font-mark);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 8px;
}
.hw-auth__submit:hover { background: #000; }
.hw-auth__foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--hw-rule);
  text-align: center;
  font-family: var(--hw-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hw-ink-muted);
}

/* ── Generic help / placeholder page ─────────────────── */
.hw-placeholder {
  max-width: 720px;
  margin: 56px auto;
  padding: 0 24px;
}
.hw-placeholder__h {
  font-family: var(--hw-font-display);
  font-size: 36px;
  font-weight: 400;
  margin: 0 0 12px;
}
.hw-placeholder__body {
  background: var(--hw-card);
  border: 1px solid var(--hw-rule);
  border-radius: var(--hw-r-lg);
  padding: 24px 28px;
  color: var(--hw-ink-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ── Compatibility shim — keep old page chrome from spilling out ──
   The new shell uses .hw-* classes; the previous version used
   .app-header / .app-nav / .app-main. Page content still uses
   .card / .btn / .form etc. from core.css and renders unchanged. */
.hw-content > main.app-main {
  margin: 0;
  padding: 0;
  background: transparent;
  min-height: 0;
}
.hw-content main.app-main.no-pad { padding: 0; }
