/* ============================================================
   Workflows page — animated builder, 25 nodes, 15 templates
============================================================ */

:root {
  --wf: var(--ink);
  --wf-ai: #D97757;
}

.nav-links a.active { color: var(--ink); font-weight: 500; }
.nav-links a.active::after {
  content: "";
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ink);
  margin-left: 6px;
  vertical-align: middle;
}

/* subnav */
.subnav {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 65px;
  z-index: 40;
}
.subnav-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px var(--pad-x);
  overflow-x: auto;
}
.subnav-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.subnav-inner a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  padding: 4px 0;
}
.subnav-inner a:hover { color: var(--ink); }
.subnav-inner a.active {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
}

.kicker.wf { background: rgba(var(--ink-rgb),0.05); border-color: var(--line); color: var(--ink-mid); }
.kicker .dot.wf { background: var(--ink); box-shadow: 0 0 0 3px rgba(var(--ink-rgb),0.18); }

.hero-wf .display { font-size: clamp(56px, 9vw, 124px); line-height: 0.94; }

/* trust stats row */
.wf-trust { padding: 50px 0 30px; }
.trust-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 4vw, 60px);
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px){ .trust-stats { grid-template-columns: 1fr 1fr; gap: 30px; } }
.ts { display: flex; flex-direction: column; gap: 6px; }
.ts b {
  font-weight: 500;
  font-size: clamp(34px, 4.4vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1;
}
.ts span { font-size: 13.5px; color: var(--muted); }

/* ============================================================
   HERO PEEK — running workflow canvas
============================================================ */
.wf-peek .peek-frame { background: var(--bg-card); }
.wf-toolbar { background: var(--bg-soft); }
.chip.live-chip i {
  width: 7px; height: 7px;
  background: #6ED27A;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(110,210,122,0.25);
  animation: pulse 1.4s ease-in-out infinite;
}

.wf-canvas-h {
  position: relative;
  height: 420px;
  background:
    radial-gradient(circle, rgba(var(--ink-rgb),0.08) 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--bg-soft);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  touch-action: none;
}

/* Dynamic-wire SVG (engine-injected) */
svg.wf-wires-dyn {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
svg.wf-wires-dyn .wf-wire {
  fill: none;
  stroke: rgba(var(--ink-rgb),0.32);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
  animation: dashflow 2.2s linear infinite;
  transition: stroke .25s ease, stroke-width .25s ease;
}
svg.wf-wires-dyn .wf-wire.wire-hot {
  stroke: var(--wf-ai);
  stroke-width: 1.8;
}
@keyframes dashflow { to { stroke-dashoffset: -18; } }

/* drag affordance */
.wf-draggable { cursor: grab; user-select: none; z-index: 2; }
.wf-draggable.dragging {
  cursor: grabbing;
  z-index: 50;
  box-shadow: 0 14px 38px -10px rgba(var(--ink-rgb),0.30), 0 0 0 1px var(--ink);
}
.wf-draggable .wfn-h,
.wf-draggable .bld-node-h { cursor: grab; }
.wf-draggable.dragging * { cursor: grabbing !important; }

/* corner hint */
.wf-canvas-h::after,
.bld-canvas::after {
  content: "drag · rearrange";
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb),0.32);
  pointer-events: none;
  z-index: 3;
}

.wfn {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  width: 200px;
  box-shadow: var(--shadow);
  font-size: 12px;
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.wfn.ai { border-color: var(--wf-ai); }
.wfn.active {
  border-color: #6ED27A;
  box-shadow: 0 0 0 3px rgba(110,210,122,0.20), var(--shadow);
  transform: translateY(-1px);
}
.wfn.n-trig { border-color: rgba(var(--ink-rgb),0.4); }
.wfn.out-node { border-color: var(--ink); }

.wfn-h {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-family: var(--f-mono);
  color: var(--muted);
  background: var(--bg-soft);
}
.wfn.ai .wfn-h { background: rgba(217,119,87,0.10); color: var(--wf-ai); }
.wfn.out-node .wfn-h { background: var(--ink); color: var(--bg); }
.wfn-b {
  padding: 9px 10px;
  display: flex; flex-direction: column; line-height: 1.3;
}
.wfn-b b { font-weight: 600; font-size: 13px; letter-spacing: -0.015em; }
.wfn-b span { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.wfn-pin {
  position: absolute;
  width: 8px; height: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  top: 50%; transform: translateY(-50%);
}
.wfn-pin.in { left: -5px; }
.wfn-pin.out { right: -5px; }

.wfn-prog {
  height: 3px;
  background: rgba(var(--ink-rgb),0.08);
  margin: 0 10px 9px;
  border-radius: 2px;
  overflow: hidden;
}
.wfn-prog > span {
  display: block; height: 100%;
  width: 50%;
  background: var(--wf-ai);
  animation: progSlide 2.2s ease-in-out infinite;
}
@keyframes progSlide {
  0% { transform: translateX(-110%); width: 30%; }
  60% { transform: translateX(120%); width: 80%; }
  100% { transform: translateX(120%); width: 80%; }
}

/* node-icon glyph */
.wni {
  width: 14px; height: 14px;
  display: inline-grid; place-items: center;
  border-radius: 3px;
  background: rgba(var(--ink-rgb),0.07);
  font-style: normal;
  font-size: 9px;
  color: var(--ink);
}
.wni.in::before  { content: "⏵"; }
.wni.ai { background: var(--wf-ai); color: #fff; }
.wni.ai::before  { content: "✦"; }
.wni.img::before { content: "◳"; }
.wni.gate::before { content: "◇"; }
.wni.out { background: var(--ink); color: var(--bg); }
.wni.out::before { content: "↗"; font-size: 10px; }

/* Activity panel under canvas */
.wf-activity {
  background: var(--bg-card);
}
.wa-h {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-soft);
}
.wa-tab { padding: 4px 0; }
.wa-tab.on { color: var(--ink); border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }
.wa-prog {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
}
.wa-prog-l { font-family: var(--f-sans); color: var(--muted); font-size: 12px; }
.wa-bar {
  width: 120px;
  height: 4px;
  background: rgba(var(--ink-rgb),0.08);
  border-radius: 2px;
  overflow: hidden;
}
.wa-bar > span {
  display: block; height: 100%;
  background: var(--ok);
  border-radius: 2px;
}
.wa-prog-n { font-size: 12px; color: var(--ink); }

.wa-rows {
  max-height: 180px;
  overflow-y: auto;
}
.wa-row {
  display: grid;
  grid-template-columns: 80px 16px 130px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 7px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
}
.wa-row:last-child { border-bottom: none; }
.wa-time { color: var(--muted); font-size: 11px; }
.wa-tag {
  font-family: var(--f-mono);
  font-size: 11px;
  background: rgba(var(--ink-rgb),0.06);
  color: var(--ink-mid);
  padding: 3px 8px;
  border-radius: 4px;
}
.wa-tag.ai { background: rgba(217,119,87,0.10); color: var(--wf-ai); }
.wa-cost { color: var(--muted); font-size: 11px; }

@media (max-width: 720px){
  .wa-row { grid-template-columns: auto auto 1fr; gap: 8px; font-size: 11.5px; }
  .wa-row .wa-time, .wa-row .wa-cost { display: none; }
}

/* ============================================================
   BUILDER (the big animation)
============================================================ */
.builder {
  padding: 0;
  overflow: hidden;
}
.bld-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.bld-zoom {
  display: flex;
  gap: 4px;
  background: rgba(var(--ink-rgb),0.06);
  border-radius: 7px;
  padding: 3px;
}
.bld-tab {
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--f-mono);
  letter-spacing: 0.02em;
  color: var(--muted);
  border-radius: 5px;
  cursor: default;
}
.bld-tab.on { background: var(--bg-card); color: var(--ink); box-shadow: 0 1px 3px rgba(var(--ink-rgb),0.06); }
.bld-name { color: var(--muted); font-size: 12px; }
.bld-status { margin-left: auto; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 7px; }
.bld-status.saved { color: var(--ok); }
.bld-status.live { color: var(--ok); }
.bld-status.live i { animation: pulse 1.4s ease-in-out infinite; }

.bld-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 420px;
}
@media (max-width: 820px){
  .bld-body { grid-template-columns: 1fr; }
  .bld-palette { display: none; }
}

.bld-palette {
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.bld-pal-h {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.bld-pal-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bld-pal-g {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 4px 6px;
}
.bld-pal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--ink-mid);
  transition: background .2s ease, transform .25s ease, box-shadow .25s ease;
}
.bld-pal-item.ai { color: var(--wf-ai); border-color: rgba(217,119,87,0.30); }
.bld-pal-item.grab {
  background: var(--ink);
  color: var(--bg);
  transform: translateX(6px) scale(0.96);
  box-shadow: 0 6px 18px -6px rgba(var(--ink-rgb),0.4);
}
.bld-pal-item.ai.grab {
  background: var(--wf-ai);
  border-color: var(--wf-ai);
}

/* Canvas */
.bld-canvas {
  position: relative;
  background:
    radial-gradient(circle, rgba(var(--ink-rgb),0.08) 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--bg-soft);
  overflow: hidden;
  touch-action: none;
  min-height: 420px;
}
.bld-wires {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.bld-wires .wire {
  fill: none;
  stroke: rgba(var(--ink-rgb),0.30);
  stroke-width: 1.4;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  transition: stroke-dashoffset 0.6s ease, stroke .25s ease;
}
.bld-wires .wire.drawn {
  stroke-dashoffset: 0;
}

/* Builder node (placed/running/done states) */
.bld-node {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  width: 200px;
  box-shadow: var(--shadow);
  font-size: 12px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.92);
  transition: opacity .35s ease, transform .35s cubic-bezier(.2,.8,.3,1.2), border-color .25s ease, box-shadow .25s ease;
}
.bld-node.placed { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.bld-node.ai.placed { border-color: var(--wf-ai); }
.bld-node.running {
  border-color: var(--wf-ai);
  box-shadow: 0 0 0 3px rgba(217,119,87,0.20), var(--shadow);
}
.bld-node.done {
  border-color: var(--ok);
  box-shadow: 0 0 0 2px rgba(84,181,106,0.22), var(--shadow);
}
.bld-node.done .wfn-h { background: rgba(84,181,106,0.12); color: var(--ok); }

/* hide the prog bar by default; show only while running */
.bld-node .wfn-prog { display: none; }
.bld-node.running .wfn-prog { display: block; }

/* Footer / shortcuts */
.bld-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-soft);
}
.bld-fs { display: inline-flex; align-items: center; gap: 6px; }
.bld-fs.ml-auto { margin-left: auto; }
.bld-fs kbd {
  font-family: var(--f-mono);
  font-size: 10.5px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--ink);
}

/* narrator below builder */
.bld-narrator {
  margin: 16px auto 0;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 10px;
  font-family: var(--f-mono);
  font-size: 13px;
  max-width: 720px;
  text-align: center;
}
.bn-step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.bn-step i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--wf-ai);
  box-shadow: 0 0 0 3px rgba(217,119,87,0.25);
  animation: pulse 1.4s ease-in-out infinite;
}
.bn-step.done i { background: #6ED27A; box-shadow: 0 0 0 3px rgba(110,210,122,0.25); }

/* ============================================================
   25 NODES GRID
============================================================ */
.nodes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 920px){ .nodes-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px){ .nodes-grid { grid-template-columns: 1fr; } }

.ng-col {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ng-col.ng-ai { background: rgba(217,119,87,0.04); border-color: rgba(217,119,87,0.18); }
.ng-col.ng-vis { background: rgba(149,191,72,0.04); border-color: rgba(149,191,72,0.20); }
.ng-col.ng-out { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.ng-h {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.ng-col.ng-out .ng-h { color: rgba(30,30,42,0.6); border-color: rgba(30,30,42,0.15); }

.ng-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.ng-item:last-child { border-bottom: none; }
.ng-col.ng-out .ng-item { border-color: rgba(30,30,42,0.15); }
.ng-item b {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  grid-column: 2;
}
.ng-col.ng-out .ng-item b { color: var(--bg); }
.ng-item span {
  grid-column: 2;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.ng-col.ng-out .ng-item span { color: rgba(30,30,42,0.65); }
.ngi-tag {
  grid-row: 1 / 3;
  width: 22px; height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(var(--ink-rgb),0.06);
  font-size: 11px;
  color: var(--ink);
}
.ngi-tag.ai  { background: var(--wf-ai); color: #fff; }
.ngi-tag.vis { background: #5F6E3D; color: #fff; }
.ng-col.ng-out .ngi-tag { background: rgba(30,30,42,0.10); color: var(--bg); }

.ng-meta {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 760px;
  margin: 18px auto 0;
  line-height: 1.55;
}

/* ============================================================
   15 TEMPLATES
============================================================ */
.tmpls-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 1100px){ .tmpls-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px){ .tmpls-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px){ .tmpls-grid { grid-template-columns: 1fr; } }

.tmpl-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: default;
}
.tmpl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tmpl-card.feat { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tmpl-card.feat span { color: rgba(30,30,42,0.7); }

.tmc-tag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 4px;
  align-self: flex-start;
  color: var(--ink-mid);
  background: rgba(var(--ink-rgb),0.06);
}
.tmpl-card.feat .tmc-tag { background: rgba(30,30,42,0.10); color: var(--bg); }
.tmc-tag.t-c { background: rgba(122,142,240,0.14); color: var(--info); }
.tmc-tag.t-p { background: rgba(149,191,72,0.16); color: #A9CB6B; }
.tmc-tag.t-s { background: rgba(217,119,87,0.18); color: #E8865F; }
.tmc-tag.t-m { background: rgba(var(--ink-rgb),0.08); color: var(--ink); }
.tmpl-card.feat .tmc-tag.t-c,
.tmpl-card.feat .tmc-tag.t-p,
.tmpl-card.feat .tmc-tag.t-s,
.tmpl-card.feat .tmc-tag.t-m { background: rgba(30,30,42,0.10); color: var(--bg); }

.tmpl-card b {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.2;
}
.tmpl-card span:last-child { font-size: 12px; color: var(--muted); }

/* ============================================================
   REAL-TIME PANEL (dark)
============================================================ */
.rt-panel {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
}
.rt-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-light);
  background: rgba(255,255,255,0.03);
}
.rt-name {
  font-family: var(--f-mono);
  font-size: 12px;
  color: rgba(255,255,255,0.85);
}
.rt-conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #6ED27A;
}
.rt-conn i {
  width: 7px; height: 7px;
  background: #6ED27A;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(110,210,122,0.20);
  animation: pulse 1.4s ease-in-out infinite;
}
.rt-feed {
  max-height: 280px;
  overflow-y: auto;
  padding: 8px 0;
}
.rt-evt {
  display: grid;
  grid-template-columns: 80px 130px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 18px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.rt-evt:last-child { border-bottom: none; }
.rt-t { color: rgba(255,255,255,0.45); font-size: 11px; }
.rt-typ {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}
.rt-typ.ok { background: rgba(110,210,122,0.14); color: #6ED27A; }
.rt-foot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-light);
  background: rgba(255,255,255,0.02);
}
.rt-foot > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rt-foot b {
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.022em;
  line-height: 1;
  color: #fff;
}
.rt-foot span span { color: rgba(255,255,255,0.55); font-size: 11px; }

/* ============================================================
   CONCURRENCY TIERS
============================================================ */
.tiers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 920px){ .tiers-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .tiers-grid { grid-template-columns: 1fr; } }

.tier {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 22px 22px;
}
.tier.featured { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tier.featured p { color: rgba(30,30,42,0.7); }

.tier-name {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.tier.featured .tier-name { color: rgba(30,30,42,0.6); }
.tier-num {
  font-weight: 500;
  font-size: clamp(40px, 4.2vw, 56px);
  letter-spacing: -0.04em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}
.tier-num .unit {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
  font-weight: 400;
  font-family: var(--f-mono);
}
.tier.featured .tier-num .unit { color: rgba(30,30,42,0.6); }
.tier p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.tier-foot {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 32px auto 0;
  max-width: 720px;
}

/* ============================================================
   COMPARE TABLE
============================================================ */
.compare-table { padding: 0; overflow: hidden; }
.cmp-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.cmp-row:last-child { border-bottom: none; }
.cmp-row > span { display: inline-flex; align-items: center; gap: 8px; }
.cmp-row .hl {
  background: rgba(var(--ink-rgb),0.04);
  margin: -16px 0;
  padding: 16px 14px;
  font-weight: 500;
}
.cmp-row.cmp-head {
  background: var(--bg-soft);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 24px;
}
.cmp-row.cmp-head .hl {
  background: var(--ink);
  color: var(--bg);
  margin: -14px 0;
  padding: 14px 14px;
}
.cmp-row .dim { color: var(--muted-2); }
.cmp-row .dim.partial { color: var(--warn); }
.cmp-row .dt { width: 9px; height: 9px; }
@media (max-width: 720px){
  .cmp-row { grid-template-columns: 1.4fr 1fr 1fr 1fr; padding: 12px 14px; font-size: 12.5px; }
  .cmp-row.cmp-head { padding: 12px 14px; }
  .cmp-row .hl { padding: 12px 8px; margin: -12px 0; }
}

.foot-cols a.on { color: #fff; }

/* light tick variant for dark sections */
.tick.light li { color: rgba(255,255,255,0.78); }
.tick.light li::before { background: var(--bg-card); }
.tick.light li::after { border-color: var(--ink); }

/* ── White mode (html[data-theme="light"]) overrides ── */

/* builder "done" state: original light-theme greens */
html[data-theme="light"] .bld-node.done {
  box-shadow: 0 0 0 2px rgba(29,122,58,0.18), var(--shadow);
}
html[data-theme="light"] .bld-node.done .wfn-h { background: rgba(29,122,58,0.10); }

/* node-gallery output column: its var(--ink) surface is dark again */
html[data-theme="light"] .ng-col.ng-out .ng-h {
  color: rgba(255,255,255,0.6);
  border-color: var(--line-light);
}
html[data-theme="light"] .ng-col.ng-out .ng-item { border-color: var(--line-light); }
html[data-theme="light"] .ng-col.ng-out .ng-item span { color: rgba(255,255,255,0.65); }
html[data-theme="light"] .ng-col.ng-out .ngi-tag { background: rgba(255,255,255,0.10); }

/* brightened tag text → original dark-on-light values */
html[data-theme="light"] .tmc-tag.t-p { color: #4F6F22; }
html[data-theme="light"] .tmc-tag.t-s { color: #B6512F; }

/* featured template card: white-on-dark chips/copy again */
html[data-theme="light"] .tmpl-card.feat span { color: rgba(255,255,255,0.7); }
html[data-theme="light"] .tmpl-card.feat .tmc-tag,
html[data-theme="light"] .tmpl-card.feat .tmc-tag.t-c,
html[data-theme="light"] .tmpl-card.feat .tmc-tag.t-p,
html[data-theme="light"] .tmpl-card.feat .tmc-tag.t-s,
html[data-theme="light"] .tmpl-card.feat .tmc-tag.t-m {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* featured pricing tier: dark pop card again */
html[data-theme="light"] .tier.featured p { color: rgba(255,255,255,0.7); }
html[data-theme="light"] .tier.featured .tier-name,
html[data-theme="light"] .tier.featured .tier-num .unit { color: rgba(255,255,255,0.6); }
