/* ============================================================
   EDITING BOT — design system
   Warm retro neo-brutalist. Space Mono display + Hanken body.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Hanken+Grotesk:wght@400;500;600;700;800&display=swap');

/* ---------- TOKENS ---------- */
:root {
  /* canvas */
  --bg:        #E9DEC4;   /* page */
  --bg-2:      #E2D5B6;   /* deeper panel */
  --surface:   #FBF5E5;   /* cards */
  --surface-2: #F4EAD2;   /* tinted card */
  --ink:       #201C16;   /* warm near-black */
  --ink-60:    #6a6052;
  --ink-40:    #8f8676;
  --line:      #201C16;

  /* retro accents */
  --orange:  #E5703A;
  --tomato:  #D33F26;
  --sage:    #6FA791;   /* primary action + green-good */
  --sage-d:  #4F8A73;
  --mustard: #EAB93E;
  --blue:    #9DB7DF;
  --pink:    #E6A6C5;

  /* health tints (light fills behind colored signal) */
  --green-fill:  #DDEBE0;
  --yellow-fill: #F6E7BE;
  --red-fill:    #F3D9CF;
  --blue-fill:   #DCE6F5;

  /* signal colors (saturated) */
  --green:  #4F8A73;
  --yellow: #D89E1F;
  --red:    #CF3B22;

  /* type */
  --font-mono: "Space Mono", ui-monospace, monospace;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  /* shape — driven by intensity theme */
  --bw: 2px;          /* border width */
  --sh: 4px;          /* hard-shadow offset */
  --r:  9px;          /* radius */
  --r-sm: 6px;

  --shadow:  var(--sh) var(--sh) 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);

  --maxw: 1200px;
}

/* intensity themes */
html[data-intensity="soft"] {
  --bw: 1.5px; --sh: 3px; --r: 16px; --r-sm: 11px;
}
html[data-intensity="hard"] {
  --bw: 3px; --sh: 6px; --r: 3px; --r-sm: 2px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* faint paper texture */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(32,28,22,.035) 1px, transparent 0);
  background-size: 22px 22px;
}

/* film grain — matte material feel across the whole surface */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  background-image: url("grain.png");
  background-size: 200px 200px;
  opacity: .42;
  mix-blend-mode: overlay;
}

a { color: inherit; }

/* ---------- TYPE ---------- */
h1, h2, h3, h4 { font-family: var(--font-mono); font-weight: 700; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 40px; line-height: 1.05; }
h2 { font-size: 26px; line-height: 1.1; }
h3 { font-size: 18px; line-height: 1.2; }
p  { margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-60);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 14px; height: 2px;
  background: var(--ink);
  display: inline-block;
}
.eyebrow.no-rule::before { display: none; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-60); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- LAYOUT ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.page { padding: 34px 0 90px; }
.stack > * + * { margin-top: var(--gap, 18px); }
.row { display: flex; align-items: center; gap: 14px; }
.row.wrap-row { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.grow { flex: 1; }

/* ---------- TOP NAV ---------- */
.topnav {
  background: var(--surface);
  border-bottom: var(--bw) solid var(--ink);
  position: sticky; top: 0; z-index: 40;
}
.topnav__in {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand__mark {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--orange);
  border: var(--bw) solid var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 20px;
  color: var(--ink); line-height: 1;
  box-shadow: 2px 2px 0 var(--ink);
}
.brand__name { font-family: var(--font-mono); font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.brand__name small { display:block; font-size: 10px; letter-spacing: .22em; color: var(--ink-60); font-weight: 400; }

.nav-links { display: flex; gap: 4px; margin-left: 10px; }
.nav-links a {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  text-decoration: none; color: var(--ink-60);
  padding: 8px 13px; border-radius: var(--r-sm);
  border: var(--bw) solid transparent;
  transition: color .12s, background .12s, border-color .12s;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.active {
  color: var(--ink); background: var(--bg);
  border-color: var(--ink);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.who { font-family: var(--font-mono); font-size: 12px; color: var(--ink-60); }
.who b { color: var(--ink); font-weight: 700; }

/* ---------- BUTTONS — signature press ---------- */
.btn {
  --bsh: var(--sh);
  font-family: var(--font-mono);
  font-weight: 700; font-size: 14px;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 20px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--bsh) var(--bsh) 0 var(--ink);
  transition: transform .09s cubic-bezier(.2,.8,.3,1), box-shadow .09s cubic-bezier(.2,.8,.3,1), background .12s;
  position: relative;
  user-select: none;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: calc(var(--bsh) + 1px) calc(var(--bsh) + 1px) 0 var(--ink); }
.btn:active { transform: translate(var(--bsh), var(--bsh)); box-shadow: 0 0 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.btn .ico { width: 17px; height: 17px; display: grid; place-items: center; }
.btn svg { display: block; }

.btn--primary { background: var(--sage); color: #11261f; }
.btn--alert   { background: var(--orange); color: #2a140a; }
.btn--ink     { background: var(--ink); color: var(--surface); }
.btn--ghost   { background: var(--surface); }
.btn--mustard { background: var(--mustard); color: #2a2208; }
.btn--lg { padding: 16px 26px; font-size: 15px; }
.btn--sm { padding: 9px 13px; font-size: 12px; --bsh: 3px; }
.btn--block { display: flex; width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* icon-only chip button */
.iconbtn {
  width: 38px; height: 38px; padding: 0;
  border: var(--bw) solid var(--ink); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .09s, box-shadow .09s, background .12s;
}
.iconbtn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); background: var(--surface-2); }
.iconbtn:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--ink); }

/* ---------- CARD ---------- */
.card {
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card--flush { padding: 0; overflow: hidden; }
.card--tint { background: var(--surface-2); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }

/* ---------- PILLS / STATUS ---------- */
.pill {
  font-family: var(--font-mono); font-weight: 700; font-size: 11.5px;
  letter-spacing: .04em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 100px;
  border: var(--bw) solid var(--ink);
  background: var(--surface);
  white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); flex: none; }
.pill--green  { background: var(--green-fill); }
.pill--green  .dot { background: var(--green); }
.pill--yellow { background: var(--yellow-fill); }
.pill--yellow .dot { background: var(--yellow); }
.pill--red    { background: var(--red-fill); }
.pill--red    .dot { background: var(--red); }
.pill--blue   { background: var(--blue-fill); }
.pill--blue   .dot { background: #4d72b3; }
.pill--ink    { background: var(--ink); color: var(--surface); }
.pill--ink    .dot { background: var(--mustard); }

/* live / in-progress dot pulse */
.pill--live .dot { background: var(--orange); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(229,112,58,.6); }
  50%     { box-shadow: 0 0 0 5px rgba(229,112,58,0); }
}

/* ---------- TAGS / CHIPS ---------- */
.tag {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 100px;
  border: var(--bw) solid var(--ink);
  background: var(--surface);
  display: inline-flex; align-items: center; gap: 6px;
}
.tag--blue { background: var(--blue-fill); }
.tag--pink { background: #f4dceb; }
.tag--sage { background: var(--green-fill); }

/* ---------- FORM ---------- */
.field { display: block; }
.field > label, .lbl {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-60);
  display: block; margin-bottom: 8px;
}
.input, .select, textarea.input {
  width: 100%;
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  padding: 13px 14px;
  box-shadow: inset 0 0 0 0 var(--ink);
  transition: box-shadow .12s, background .12s;
}
.input::placeholder { color: var(--ink-40); }
.input:focus, textarea.input:focus, .select:focus {
  outline: none;
  box-shadow: var(--shadow-sm);
  background: #fffdf6;
}
textarea.input { resize: vertical; min-height: 92px; line-height: 1.5; }
.hint { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-40); margin-top: 7px; }

/* radio-cards (segmented choices) */
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  position: relative; cursor: pointer;
  border: var(--bw) solid var(--ink); border-radius: var(--r-sm);
  background: var(--surface);
  padding: 12px 15px; min-width: 120px;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .1s, box-shadow .1s, background .12s;
}
.choice:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__t { font-family: var(--font-mono); font-weight: 700; font-size: 14px; }
.choice__d { font-size: 12.5px; color: var(--ink-60); margin-top: 2px; }
.choice:has(input:checked) { background: var(--green-fill); }
.choice:has(input:checked)::after {
  content: "✓"; position: absolute; top: -9px; right: -9px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--sage); color: #11261f; border: var(--bw) solid var(--ink);
  display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  animation: pop .18s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

/* checkbox */
.check { display: inline-flex; align-items: flex-start; gap: 11px; cursor: pointer; font-size: 14.5px; }
.check input { position: absolute; opacity: 0; }
.check .box {
  width: 22px; height: 22px; flex: none; border: var(--bw) solid var(--ink);
  border-radius: 6px; background: var(--surface); display: grid; place-items: center;
  box-shadow: 2px 2px 0 var(--ink); transition: background .12s;
}
.check .box svg { opacity: 0; transform: scale(.4); transition: .15s cubic-bezier(.2,1.4,.4,1); }
.check input:checked + .box { background: var(--sage); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- TABLE / ROWS ---------- */
.rows { display: flex; flex-direction: column; gap: 12px; }
.jobrow {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 150px 150px;
  align-items: center; gap: 16px;
  background: var(--surface);
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  padding: 15px 18px;
  box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .1s;
}
.jobrow:hover { transform: translate(-1px,-1px); box-shadow: calc(var(--sh) + 1px) calc(var(--sh) + 1px) 0 var(--ink); }
.colhead {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 150px 150px;
  gap: 16px; padding: 0 18px 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-40);
}
.file-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-ico {
  width: 34px; height: 40px; flex: none; border: var(--bw) solid var(--ink);
  border-radius: 4px; background: var(--blue-fill);
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  position: relative;
}
.file-name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { font-family: var(--font-mono); font-size: 12px; color: var(--ink-60); }

/* ---------- SECTION HEADER ---------- */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.sec-h h2 { display: flex; align-items: center; gap: 12px; }
.count-chip {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  border: var(--bw) solid var(--ink); border-radius: 7px;
  padding: 2px 9px; background: var(--surface);
}

/* ---------- BREADCRUMB ---------- */
.crumb { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-60); margin-bottom: 18px; }
.crumb b { color: var(--ink); }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ---------- DIVIDER ---------- */
.hr { height: var(--bw); background: var(--ink); border: 0; margin: 0; opacity: .12; }
.hr-dash { border: 0; border-top: var(--bw) dashed var(--ink); opacity: .3; margin: 0; }

/* ---------- SEGMENTED CONTROL (toggles) ---------- */
.seg {
  display: inline-flex; gap: 0; border: var(--bw) solid var(--ink);
  border-radius: 100px; background: var(--surface); padding: 3px;
  box-shadow: 2px 2px 0 var(--ink);
}
.seg button {
  font-family: var(--font-mono); font-weight: 700; font-size: 12.5px;
  border: 0; background: transparent; color: var(--ink-60);
  padding: 7px 15px; border-radius: 100px; cursor: pointer;
  transition: color .12s; white-space: nowrap;
}
.seg button.on { background: var(--ink); color: var(--surface); }

/* ---------- HEALTH (report) ---------- */
.health-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hcard {
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  background: var(--surface); overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .12s, box-shadow .12s;
}
.hcard:hover { transform: translate(-1px,-2px); box-shadow: calc(var(--sh)+1px) calc(var(--sh)+2px) 0 var(--ink); }
.hcard__top { padding: 16px 16px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hcard__cat { font-family: var(--font-mono); font-weight: 700; font-size: 14.5px; }
.signal { width: 26px; height: 26px; border-radius: 50%; border: var(--bw) solid var(--ink); flex: none; }
.signal--green  { background: var(--green); }
.signal--yellow { background: var(--mustard); }
.signal--red    { background: var(--tomato); }
.hcard__body { padding: 0 16px 14px; font-size: 13.5px; color: var(--ink-60); line-height: 1.45; flex: 1; }
.hcard__foot {
  border-top: var(--bw) solid var(--ink); padding: 11px 16px;
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--font-mono); background: var(--surface-2);
}
.hcard__foot .big { font-size: 20px; font-weight: 700; }
.hcard__foot .lab { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-60); }
.hcard.is-green  .hcard__foot { background: var(--green-fill); }
.hcard.is-yellow .hcard__foot { background: var(--yellow-fill); }
.hcard.is-red    .hcard__foot { background: var(--red-fill); }

/* health — bars direction */
.hbars { display: flex; flex-direction: column; }
.hbar { display: grid; grid-template-columns: 190px 1fr 120px; align-items: center; gap: 18px; padding: 15px 4px; border-bottom: var(--bw) dashed rgba(32,28,22,.25); }
.hbar:last-child { border-bottom: 0; }
.hbar__cat { display: flex; align-items: center; gap: 11px; font-family: var(--font-mono); font-weight: 700; font-size: 14.5px; }
.hbar__track { display: block; height: 18px; border: var(--bw) solid var(--ink); border-radius: 100px; background: var(--surface); overflow: hidden; }
.hbar__fill { display: block; height: 100%; transform-origin: left center; }
[data-health-view="bars"].go .hbar__fill { animation: hgrow .55s cubic-bezier(.2,.8,.3,1); }
@keyframes hgrow { from { transform: scaleX(0); } }
.hbar__fill.green  { background: var(--sage); }
.hbar__fill.yellow { background: var(--mustard); }
.hbar__fill.red    { background: var(--tomato); }
.hbar__meta { font-family: var(--font-mono); font-size: 13px; text-align: right; }
.hbar__meta b { font-size: 16px; }

/* health — compact list */
.hlist { display: flex; flex-direction: column; }
.hli { display: grid; grid-template-columns: 20px 180px 1fr 92px; align-items: center; gap: 16px; padding: 13px 6px; border-bottom: var(--bw) dashed rgba(32,28,22,.22); font-size: 13.5px; }
.hli:last-child { border-bottom: 0; }
.hli .dot-l { width: 13px; height: 13px; border-radius: 50%; border: var(--bw) solid var(--ink); }
.hli .dot-l.green { background: var(--sage); }
.hli .dot-l.yellow { background: var(--mustard); }
.hli .dot-l.red { background: var(--tomato); }
.hli .cat { font-family: var(--font-mono); font-weight: 700; }
.hli .fig { font-family: var(--font-mono); text-align: right; }
.hli .fig b { font-size: 15px; }

/* ---------- STAT BLOCKS ---------- */
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: var(--bw) solid var(--ink); border-radius: var(--r); overflow: hidden; }
.stat { padding: 16px 18px; border-right: var(--bw) solid var(--ink); }
.stat:last-child { border-right: 0; }
.stat .v { font-family: var(--font-mono); font-weight: 700; font-size: 24px; line-height: 1; }
.stat .k { font-size: 12px; color: var(--ink-60); margin-top: 6px; }

/* ---------- PIPELINE (status) ---------- */
.pipe { display: flex; flex-direction: column; }
.stage { display: grid; grid-template-columns: 46px 1fr auto; gap: 16px; padding: 4px 0; position: relative; }
.stage__rail { display: flex; flex-direction: column; align-items: center; }
.stage__node {
  width: 36px; height: 36px; border-radius: 50%; border: var(--bw) solid var(--ink);
  background: var(--surface); display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px; z-index: 2;
}
.stage__line { width: var(--bw); flex: 1; background: var(--ink); opacity: .25; min-height: 26px; }
.stage:last-child .stage__line { display: none; }
.stage__body { padding: 4px 0 22px; }
.stage__title { font-family: var(--font-mono); font-weight: 700; font-size: 16px; }
.stage__detail { font-size: 13.5px; color: var(--ink-60); margin-top: 3px; }
.stage__time { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-60); padding-top: 6px; }
.stage.done .stage__node { background: var(--sage); }
.stage.active .stage__node { background: var(--orange); animation: nodepulse 1.4s ease-in-out infinite; }
.stage.active .stage__line { background: linear-gradient(var(--ink), rgba(32,28,22,.25)); opacity: 1; }
.stage.done ~ .stage .stage__line, .stage.pending .stage__line { opacity: .22; }
@keyframes nodepulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(229,112,58,.5); }
  50% { box-shadow: 0 0 0 7px rgba(229,112,58,0); }
}
.stage.done .stage__title, .stage.pending .stage__title { }
.stage.pending .stage__node { color: var(--ink-40); border-color: var(--ink-40); }
.stage.pending .stage__title, .stage.pending .stage__detail { color: var(--ink-40); }

/* ---------- WATCH ITEMS ---------- */
.watch { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.witem { border: var(--bw) solid var(--ink); border-radius: var(--r); background: var(--surface); padding: 16px 17px; box-shadow: var(--shadow-sm); }
.witem__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.witem__t { font-family: var(--font-mono); font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 9px; }
.witem__c { font-family: var(--font-mono); font-weight: 700; font-size: 22px; }
.witem__loc { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-60); margin-bottom: 9px; }
.snippet { background: var(--surface-2); border: var(--bw) solid var(--ink); border-radius: var(--r-sm); padding: 9px 11px; font-size: 13px; line-height: 1.45; }
.snippet + .snippet { margin-top: 7px; }
.snippet .q { color: var(--orange); font-weight: 700; }

/* ---------- PATTERNS ---------- */
.pat { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 4px; border-bottom: var(--bw) dashed rgba(32,28,22,.22); }
.pat:last-child { border-bottom: 0; }
.pat__l { display: flex; align-items: center; gap: 13px; }
.pat__cat { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-60); background: var(--surface-2); border: var(--bw) solid var(--ink); border-radius: 100px; padding: 3px 9px; white-space: nowrap; }
.pat__d { font-size: 14.5px; }
.pat__r { display: flex; align-items: center; gap: 14px; }
.conf { font-family: var(--font-mono); font-size: 11px; color: var(--ink-60); }
.pat__n { font-family: var(--font-mono); font-weight: 700; font-size: 15px; background: var(--green-fill); border: var(--bw) solid var(--ink); border-radius: 7px; padding: 3px 10px; white-space: nowrap; }

/* ---------- COLLAPSIBLE ---------- */
details.fold { border: var(--bw) solid var(--ink); border-radius: var(--r); background: var(--surface-2); overflow: hidden; }
details.fold > summary { list-style: none; cursor: pointer; padding: 15px 20px; font-family: var(--font-mono); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .chev { transition: transform .2s; }
details.fold[open] > summary .chev { transform: rotate(90deg); }
.fold__body { padding: 0 20px 18px; }

/* ---------- COST TABLE ---------- */
.ctable { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 13px; }
.ctable td, .ctable th { text-align: left; padding: 8px 10px; border-bottom: var(--bw) dashed rgba(32,28,22,.25); }
.ctable th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-60); }
.ctable td:last-child, .ctable th:last-child { text-align: right; }

/* ---------- DECORATIVE SHAPES ---------- */
.deco { position: absolute; border: var(--bw) solid var(--ink); }
.shape-circ { border-radius: 50%; }
.shape-tri { width: 0; height: 0; border: none; border-left: 30px solid transparent; border-right: 30px solid transparent; }

/* ---------- MISC ---------- */
.spinner { width: 16px; height: 16px; border: 2.5px solid rgba(32,28,22,.25); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- EXPANDING BUTTON (circle → label on hover) ---------- */
.btn-x {
  --xw: 200px;
  display: inline-flex; align-items: center; flex: none;
  height: 50px; width: 50px; padding: 0; overflow: hidden;
  border: var(--bw) solid var(--ink); border-radius: 100px;
  background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--sh) var(--sh) 0 var(--ink);
  transition: width .36s cubic-bezier(.2,.85,.25,1), transform .1s, box-shadow .1s, background .15s;
}
.btn-x:hover { width: var(--xw); transform: translate(-1px,-1px); box-shadow: calc(var(--sh) + 1px) calc(var(--sh) + 1px) 0 var(--ink); }
.btn-x:active { transform: translate(var(--sh), var(--sh)); box-shadow: 0 0 0 var(--ink); }
.btn-x:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.btn-x__ico { width: 48px; height: 46px; flex: none; display: grid; place-items: center; }
.btn-x__ico svg { display: block; }
.btn-x__label {
  font-family: var(--font-mono); font-weight: 700; font-size: 13.5px;
  opacity: 0; transform: translateX(-8px);
  transition: opacity .16s, transform .28s cubic-bezier(.2,.85,.25,1);
  padding-right: 22px;
}
.btn-x:hover .btn-x__label { opacity: 1; transform: none; transition-delay: .07s; }
.btn-x--primary { background: var(--sage); color: #11261f; }
.btn-x--ink { background: var(--ink); color: var(--surface); }
.btn-x--alert { background: var(--orange); color: #2a140a; }
.btn-x:hover .rt-arrow { animation: rtspin .7s cubic-bezier(.3,.7,.3,1); transform-origin: 12px 12px; }
@keyframes rtspin { from { transform: rotate(0); } to { transform: rotate(-360deg); } }
/* large (hero downloads) */
.btn-x--lg { height: 56px; width: 56px; --xw: 254px; }
.btn-x--lg .btn-x__ico { width: 54px; height: 54px; }
.btn-x--lg .btn-x__label { font-size: 14px; }
/* small (in-row downloads) */
.btn-x--sm { height: 40px; width: 40px; --xw: 152px; box-shadow: 2px 2px 0 var(--ink); }
.btn-x--sm:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-x--sm .btn-x__ico { width: 38px; height: 38px; }
.btn-x--sm .btn-x__label { font-size: 12.5px; padding-right: 16px; }
.btn-x--sm.btn-x--rev .btn-x__label { padding-left: 14px; padding-right: 0; }
/* small / nav size */
.btn-x--nav { height: 40px; width: 40px; --xw: 124px; box-shadow: 2px 2px 0 var(--ink); }
.btn-x--nav:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-x--nav .btn-x__ico { width: 38px; height: 36px; }
.btn-x--nav .btn-x__label { font-size: 12.5px; padding-right: 16px; }
/* reverse (anchored right, expands leftward, icon stays on the right) */
.btn-x--rev { flex-direction: row-reverse; }
.btn-x--rev .btn-x__label { transform: translateX(8px); padding-right: 0; padding-left: 18px; }
.btn-x--rev.btn-x--nav .btn-x__label { padding-left: 14px; }
.btn-x--rev:hover .btn-x__label { transform: none; }

/* floating download FAB (report) */
.fab-x {
  position: fixed; right: 26px; bottom: 26px; z-index: 50;
  --xw: 214px; height: 58px; width: 58px;
  transition: width .36s cubic-bezier(.2,.85,.25,1), transform .25s cubic-bezier(.2,.85,.25,1), opacity .25s, box-shadow .1s;
}
.fab-x.fab-hidden { opacity: 0; transform: translateY(14px) scale(.88); pointer-events: none; }
.fab-x .btn-x__ico { width: 54px; height: 54px; }
.fab-x:hover .dl-arrow { animation: dlbob .7s ease-in-out infinite; }
@keyframes dlbob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(2.5px); } }

/* hero download arrow nudge on hover */
.btn--primary:hover .dl-arrow, .btn:hover .dl-arrow { animation: dlbob .7s ease-in-out infinite; }

/* ---------- BOT MASCOT — full body (simple shapes only) ---------- */
.bot { position: relative; width: 152px; height: 254px; flex: none; animation: bothop 5s ease-in-out infinite; }
.bot__float { position: absolute; inset: 0; animation: botfloat 3.6s ease-in-out infinite alternate; transform-origin: 50% 60%; }
@keyframes botfloat { from { transform: translateY(2px) rotate(-1deg); } to { transform: translateY(-8px) rotate(1.4deg); } }
@keyframes bothop { 0%,78%,100% { transform: translateY(0); } 84% { transform: translateY(-13px); } 90% { transform: translateY(0); } 94% { transform: translateY(-5px); } 98% { transform: translateY(0); } }

/* antenna */
.bot__antenna { position: absolute; left: 50%; top: 16px; width: 3px; height: 20px; background: var(--ink); transform: translateX(-50%); transform-origin: bottom center; animation: botsway 2.8s ease-in-out infinite alternate; z-index: 2; }
@keyframes botsway { from { transform: translateX(-50%) rotate(-10deg); } to { transform: translateX(-50%) rotate(10deg); } }
.bot__bulb { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--mustard); border: var(--bw) solid var(--ink); animation: botbulb 1.6s ease-in-out infinite; }
@keyframes botbulb { 0%,100% { box-shadow: 0 0 0 0 rgba(234,185,62,.7); } 50% { box-shadow: 0 0 0 7px rgba(234,185,62,0); } }

/* head */
.bot__head { position: absolute; top: 32px; left: 28px; width: 96px; height: 82px; background: var(--orange); border: var(--bw) solid var(--ink); border-radius: 22px; box-shadow: 4px 4px 0 var(--ink); z-index: 5; }
.bot__ear { position: absolute; top: 34px; width: 9px; height: 22px; background: var(--orange); border: var(--bw) solid var(--ink); border-radius: 5px; }
.bot__ear.l { left: -5px; } .bot__ear.r { right: -5px; }
.bot__face { position: absolute; top: 15px; left: 14px; right: 14px; height: 40px; background: var(--surface); border: var(--bw) solid var(--ink); border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.bot__eye { width: 12px; height: 14px; border-radius: 48%; background: var(--ink); animation: botblink 4.4s infinite; transform-origin: center; }
.bot__eye.r { animation-delay: .07s; }
@keyframes botblink { 0%,90%,100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.bot__mouth { position: absolute; bottom: 9px; left: 0; right: 0; text-align: center; font-family: var(--font-mono); font-weight: 700; font-size: 16px; line-height: 1; color: rgba(32,17,8,.82); transition: transform .2s; }

/* legs + feet (behind body) */
.bot__leg { position: absolute; top: 184px; left: 50%; width: 17px; height: 40px; background: var(--orange); border: var(--bw) solid var(--ink); border-radius: 9px; z-index: 1; transform-origin: top center; }
.bot__leg.l { margin-left: -27px; animation: botlegA 2.6s ease-in-out infinite alternate; }
.bot__leg.r { margin-left: 10px; animation: botlegB 2.6s ease-in-out .3s infinite alternate; }
@keyframes botlegA { from { transform: rotate(-5deg); } to { transform: rotate(4deg); } }
@keyframes botlegB { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
.bot__foot { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); width: 27px; height: 14px; background: var(--orange); border: var(--bw) solid var(--ink); border-radius: 7px 7px 8px 8px; }

/* arms + hands */
.bot__arm { position: absolute; top: 116px; width: 15px; height: 46px; background: var(--orange); border: var(--bw) solid var(--ink); border-radius: 8px; z-index: 6; transform-origin: top center; }
.bot__arm.l { left: 22px; animation: botarmL 3s ease-in-out infinite alternate; }
.bot__arm.r { right: 22px; animation: botwave 7.2s ease-in-out infinite; }
@keyframes botarmL { from { transform: rotate(-10deg); } to { transform: rotate(-16deg); } }
@keyframes botwave {
  0%, 10% { transform: rotate(13deg); }
  20% { transform: rotate(132deg); }
  32% { transform: rotate(150deg); }
  44% { transform: rotate(132deg); }
  56% { transform: rotate(150deg); }
  68% { transform: rotate(132deg); }
  80% { transform: rotate(13deg); }
  100% { transform: rotate(13deg); }
}
.bot__hand { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--orange); border: var(--bw) solid var(--ink); }

/* body */
.bot__body { position: absolute; top: 110px; left: 32px; width: 88px; height: 80px; background: var(--orange); border: var(--bw) solid var(--ink); border-radius: 26px 26px 30px 30px; box-shadow: 4px 4px 0 var(--ink); z-index: 3; }
.bot__belly { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: 40px; height: 40px; border-radius: 50%; background: var(--sage); border: var(--bw) solid var(--ink); }
.bot__belly::after { content: "^"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 17px; color: #11261f; }

/* floating proof-marks (big version only) */
.bot__marks { position: absolute; inset: -10px -10px auto; height: 120px; pointer-events: none; }
.bot__marks span { position: absolute; font-family: var(--font-mono); font-weight: 700; color: var(--ink-40); opacity: 0; }
.bot__marks span:nth-child(1) { left: 4px;  bottom: 30px; font-size: 17px; animation: botrise 4.4s ease-in infinite; }
.bot__marks span:nth-child(2) { right: 6px; bottom: 44px; font-size: 13px; animation: botrise 4.4s ease-in 1.1s infinite; }
.bot__marks span:nth-child(3) { right: 20px; bottom: 20px; font-size: 19px; animation: botrise 4.4s ease-in 2.2s infinite; }
.bot__marks span:nth-child(4) { left: 18px; bottom: 50px; font-size: 12px; animation: botrise 4.4s ease-in 3.3s infinite; }
@keyframes botrise { 0% { opacity: 0; transform: translateY(0) rotate(0); } 18% { opacity: .6; } 100% { opacity: 0; transform: translateY(-46px) rotate(14deg); } }

/* excited (drag-over / happy) */
.bot.is-excited { animation-duration: 2.2s; }
.bot.is-excited .bot__float { animation-duration: 1.5s; }
.bot.is-excited .bot__bulb { background: var(--sage); animation-duration: .55s; }
.bot.is-excited .bot__eye { animation: none; height: 16px; transform: scaleY(1.12); }
.bot.is-excited .bot__head { transform: rotate(-3deg); }
.bot.is-excited .bot__mouth { transform: scale(1.3) translateY(-1px); }
.bot.is-excited .bot__arm.r { animation-duration: 1.4s; }
.bot.is-excited .bot__arm.l { animation: none; transform: rotate(-30deg); }

/* head-only variant (no torso/arms/legs) */
.bot--head { height: 132px; animation: none; }
.bot--head .bot__body, .bot--head .bot__arm, .bot--head .bot__leg { display: none; }

/* corner peek mascot (injected on working pages) */
.bot-corner { position: fixed; left: 16px; bottom: 0; z-index: 36; pointer-events: none;
  transform: translateY(84%) scale(.5); transform-origin: bottom left;
  transition: transform .55s cubic-bezier(.2,1,.3,1); }
.bot-corner.peek { transform: translateY(2%) scale(.5); }

/* mini bot face — nav brand mark (echoes the full bot) */
.brand__mark { position: relative; overflow: visible; }
.brand__mark .bm-face { background: var(--surface); border: 1.5px solid var(--ink); border-radius: 4px; padding: 3px 5px; display: flex; gap: 4px; align-items: center; }
.brand__mark .bm-face i { width: 5px; height: 7px; border-radius: 48%; background: var(--ink); display: block; animation: botblink 4.6s infinite; }
.brand__mark .bm-face i:nth-child(2) { animation-delay: .08s; }
.brand__mark::before { content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 2px; height: 9px; background: var(--ink); }
.brand__mark::after { content: ""; position: absolute; top: -13px; left: 50%; transform: translateX(-50%); width: 7px; height: 7px; border-radius: 50%; background: var(--mustard); border: 1.5px solid var(--ink); animation: botbulb 1.8s ease-in-out infinite; }

.reveal { opacity: 0; transform: translateY(10px); animation: reveal .5s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes reveal { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- RESPONSIVE (desktop-first, graceful down) ---------- */
@media (max-width: 1080px) {
  .health-grid { grid-template-columns: repeat(2, 1fr); }
  .watch { grid-template-columns: 1fr; }
  .statgrid { grid-template-columns: repeat(2,1fr); }
  .stat:nth-child(2) { border-right: 0; }
}
