/* Live UI cards — shared by index.html and portfolio/index.html.
   Reads the host page's tokens (--surface, --border, --text, --muted, --dim, --accent, ...)
   and falls back to sane defaults, so both themes work without extra wiring. */

.wtl {
  --w-surface: var(--surface, #141b19);
  --w-bg: var(--bg2, var(--bg, #0b0f0e));
  --w-line: var(--border, #22302c);
  --w-line2: var(--border2, #2c3e39);
  --w-text: var(--text, #eaf1ee);
  --w-muted: var(--muted, #a7b8b2);
  --w-dim: var(--dim-text, var(--dim, #7c918a));
  --w-accent: var(--accent, #38b6ff);
  --w-ink: var(--accent-ink, var(--accent, #38b6ff));
  --w-on: var(--on-accent, #04101f);
  --w-warn: #e7a23a;
  --w-mono: var(--font-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  font-family: var(--font-body, system-ui, sans-serif);
  color: var(--w-text);
}

/* ── card shell ─────────────────────────────── */
.wtl-card {
  display: flex; flex-direction: column;
  background: var(--w-surface);
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius, 14px);
  overflow: hidden;
  min-width: 0;
}
.wtl-card-head { position: relative; }
.wtl-card-head h3 { padding-right: 130px; }
.wtl-kind { display: block; font-size: 12px; font-weight: 500; color: var(--w-muted); margin: 0 0 6px; padding-right: 140px; }
.wtl-kind + h3 { padding-right: 0; }
.wtl-card-head h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin: 0 0 4px; color: var(--w-text); font-family: var(--font-display, inherit); }
.wtl-card-head p { font-size: 13px; line-height: 1.55; color: var(--w-muted); margin: 0; }
.wtl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wtl-tag { font-family: var(--w-mono); font-size: 10.5px; color: var(--w-dim); border: 1px solid var(--w-line); border-radius: var(--w-r2, 5px); padding: 2px 7px; }

.wtl-stage { position: relative; border-top: 1px solid var(--w-line); border-bottom: 1px solid var(--w-line); background: var(--w-bg); overflow: hidden; }
.wtl-live, .wtl-diagram { position: absolute; inset: 0; overflow: auto; }
.wtl-diagram[hidden], .wtl-live[hidden] { display: none; }
.wtl-badge { position: absolute; top: 18px; right: 18px; z-index: 3; font-family: var(--w-mono); font-size: 10px; letter-spacing: .01em; color: var(--w-dim); background: var(--w-surface); border: 1px solid var(--w-line); border-radius: var(--w-pill, 999px); padding: 3px 9px; pointer-events: none; }
.wtl-badge::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--w-accent); margin-right: 6px; vertical-align: 1px; }

.wtl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; flex-wrap: wrap; }
.wtl-metric { font-size: 12.5px; color: var(--w-muted); }
.wtl-metric b { color: var(--w-text); font-weight: 600; }
.wtl-actions { display: flex; align-items: center; gap: 12px; }
.wtl-seg { display: inline-flex; border: 1px solid var(--w-line2); border-radius: var(--w-r2, 8px); padding: 2px; background: var(--w-bg); }
.wtl-seg button { font: inherit; font-size: 12px; color: var(--w-muted); padding: 5px 11px; border-radius: var(--w-r2, 6px); cursor: pointer; background: none; border: 0; }
.wtl-seg button[aria-pressed="true"] { background: var(--w-surface); color: var(--w-text); box-shadow: 0 0 0 1px var(--w-line2); }
.wtl-seg button:focus-visible, .wtl-btn:focus-visible, .wtl-chip:focus-visible, .wtl-opt:focus-visible { outline: 2px solid var(--w-accent); outline-offset: 2px; }
.wtl-more { font-size: 12px; color: var(--w-ink); text-decoration: none; white-space: nowrap; }
.wtl-more:hover { text-decoration: underline; }

/* ── shared controls ─────────────────────────── */
.wtl-pad { padding: 16px; min-height: 100%; }
.wtl-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wtl-label { font-family: var(--w-mono); font-size: 10.5px; letter-spacing: .01em; text-transform: none; color: var(--w-dim); margin-bottom: 6px; display: block; }
.wtl-btn { font: inherit; font-size: 13px; font-weight: 600; color: var(--w-on); background: var(--w-accent); border: 0; border-radius: var(--w-r2, 8px); padding: 8px 14px; cursor: pointer; }
.wtl-btn:hover { filter: brightness(1.06); }
.wtl-btn[disabled] { opacity: .55; cursor: default; }
.wtl-btn.ghost { color: var(--w-text); background: transparent; border: 1px solid var(--w-line2); font-weight: 500; }
.wtl-chip { font: inherit; font-size: 12px; color: var(--w-muted); background: var(--w-surface); border: 1px solid var(--w-line); border-radius: var(--w-pill, 999px); padding: 4px 10px; cursor: pointer; }
.wtl-chip[aria-pressed="true"] { color: var(--w-text); border-color: var(--w-accent); box-shadow: inset 0 0 0 1px var(--w-accent); }
.wtl-select { font: inherit; font-size: 13px; color: var(--w-text); background: var(--w-surface); border: 1px solid var(--w-line2); border-radius: var(--w-r2, 8px); padding: 7px 10px; max-width: 100%; }
.wtl-mono { font-family: var(--w-mono); font-size: 11.5px; line-height: 1.6; }
.wtl-panel { background: var(--w-surface); border: 1px solid var(--w-line); border-radius: var(--w-r2, 10px); padding: 12px; min-width: 0; }
.wtl-range { accent-color: var(--w-accent); width: 140px; }
.wtl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── talent launcher ─────────────────────────── */
.wtl-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wtl-log li { font-size: 12px; color: var(--w-muted); display: flex; gap: 8px; align-items: baseline; opacity: 0; transform: translateY(4px); animation: wtl-in .28s forwards; }
.wtl-log li::before { content: "✓"; color: var(--w-ink); font-family: var(--w-mono); }
.wtl-log li.run::before { content: "•"; color: var(--w-warn); }
.wtl-result { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 6px 8px; border: 1px solid var(--w-line); border-radius: var(--w-r2, 7px); background: var(--w-bg); animation: wtl-in .3s both; }
.wtl-result b { font-family: var(--w-mono); color: var(--w-ink); font-weight: 600; }
@keyframes wtl-in { to { opacity: 1; transform: none; } from { opacity: 0; transform: translateY(4px); } }

/* ── doc agent ───────────────────────────────── */
.wtl-src { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.wtl-src span { font-family: var(--w-mono); font-size: 10.5px; color: var(--w-dim); border: 1px dashed var(--w-line2); border-radius: var(--w-r2, 6px); padding: 3px 8px; transition: all .25s; }
.wtl-src span.on { color: var(--w-ink); border: 1px solid var(--w-accent); }
.wtl-doc { font-size: 12.5px; line-height: 1.65; color: var(--w-muted); }
.wtl-doc h4 { font-size: 13px; color: var(--w-text); margin: 0 0 6px; font-weight: 600; }
.wtl-cursor::after { content: ""; display: inline-block; width: 6px; height: 13px; background: var(--w-accent); margin-left: 2px; vertical-align: -2px; animation: wtl-blink 1s steps(2) infinite; }
@keyframes wtl-blink { 50% { opacity: 0; } }

/* ── lifecycle ───────────────────────────────── */
.wtl-rail { display: flex; gap: 4px; flex-wrap: wrap; }
.wtl-stg { flex: 1 1 0; min-width: 78px; font: inherit; text-align: left; font-size: 11px; color: var(--w-dim); border: 1px solid var(--w-line); background: var(--w-surface); border-radius: var(--w-r2, 8px); padding: 7px 8px; cursor: pointer; transition: all .25s; }
.wtl-stg small { display: block; font-family: var(--w-mono); font-size: 9.5px; opacity: .8; }
.wtl-stg.on { color: var(--w-text); border-color: var(--w-accent); box-shadow: inset 0 0 0 1px var(--w-accent); }
.wtl-stg.done { color: var(--w-muted); }
.wtl-note { font-size: 12px; color: var(--w-muted); min-height: 36px; margin: 10px 0 0; }

/* ── bot screens ─────────────────────────────── */
.wtl-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.wtl-tab { font: inherit; font-family: var(--w-mono); font-size: 10.5px; letter-spacing: .01em; text-transform: none; color: var(--w-dim); background: var(--w-surface); border: 1px solid var(--w-line); border-radius: var(--w-r2, 6px); padding: 6px 10px; cursor: pointer; }
.wtl-tab[aria-selected="true"] { color: var(--w-ink); border-color: var(--w-accent); }
.wtl-phones { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.wtl-phone { margin: 0; width: 206px; max-width: 100%; }
.wtl-phead { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--w-line); border-bottom: 0; border-radius: var(--w-radius, 14px) var(--w-radius, 14px) 0 0; background: var(--w-surface); }
.wtl-phead b { font-size: 12.5px; display: block; line-height: 1.2; }
.wtl-phead span { font-size: 10.5px; color: var(--w-dim); }
.wtl-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--w-accent); color: var(--w-on); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.wtl-pbody { border: 1px solid var(--w-line); border-radius: 0 0 var(--w-radius, 14px) var(--w-radius, 14px); background: var(--w-bg); padding: 10px; min-height: 170px; display: flex; flex-direction: column; gap: 7px; }
.wtl-pm { max-width: 92%; font-size: 11.5px; line-height: 1.5; padding: 7px 9px; border-radius: 11px; white-space: pre-line; }
.wtl-pm time { display: block; text-align: right; font-size: 9px; color: var(--w-dim); margin-top: 3px; }
.wtl-pm.bot { align-self: flex-start; background: var(--w-surface); border: 1px solid var(--w-line); border-bottom-left-radius: 3px; }
.wtl-pm.me { align-self: flex-end; background: var(--w-accent); color: var(--w-on); border-bottom-right-radius: 3px; }
.wtl-pm.me time { color: inherit; opacity: .7; }
.wtl-kb { display: flex; flex-direction: column; gap: 4px; }
.wtl-kb span { text-align: center; font-size: 11px; color: var(--w-text); background: var(--w-surface); border: 1px solid var(--w-line2); border-radius: var(--w-r2, 7px); padding: 5px 8px; }
.wtl-phone figcaption { text-align: center; font-family: var(--w-mono); font-size: 10px; color: var(--w-dim); margin-top: 7px; }
.wtl-cap { text-align: center; font-size: 12px; color: var(--w-muted); margin: 12px auto 0; max-width: 46ch; }

/* ── talent dashboard ────────────────────────── */
.wtl-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.wtl-kpi { background: var(--w-surface); border: 1px solid var(--w-line); border-radius: var(--w-r2, 9px); padding: 10px 12px; }
.wtl-kpi b { display: block; font-family: var(--font-display, inherit); font-size: 20px; letter-spacing: -.02em; line-height: 1.1; }
.wtl-kpi span { font-size: 10.5px; color: var(--w-dim); }
.wtl-bars { display: flex; align-items: flex-end; gap: 8px; height: 92px; padding-top: 6px; }
.wtl-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.wtl-bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--w-accent); opacity: .85; }
.wtl-bar span { font-family: var(--w-mono); font-size: 9.5px; color: var(--w-dim); }
.wtl-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.wtl-table th { text-align: left; font-family: var(--w-mono); font-size: 9.5px; letter-spacing: .01em; text-transform: none; color: var(--w-dim); font-weight: 500; padding: 4px 6px 8px; border-bottom: 1px solid var(--w-line); }
.wtl-table td { padding: 8px 6px; border-bottom: 1px solid var(--w-line); color: var(--w-muted); }
.wtl-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--w-mono); color: var(--w-text); }
.wtl-table th:nth-child(n+3) { text-align: right; }
.wtl-table tr:last-child td { border-bottom: 0; }

/* ── board ───────────────────────────────────── */
.wtl-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.wtl-col { background: var(--w-surface); border: 1px solid var(--w-line); border-radius: var(--w-r2, 9px); padding: 8px; min-height: 250px; }
.wtl-col h5 { margin: 0 0 8px; font-family: var(--w-mono); font-size: 10px; letter-spacing: .01em; text-transform: none; color: var(--w-dim); font-weight: 500; display: flex; justify-content: space-between; }
.wtl-org { display: block; width: 100%; text-align: left; font: inherit; font-size: 11.5px; color: var(--w-text); background: var(--w-bg); border: 1px solid var(--w-line); border-radius: var(--w-r2, 7px); padding: 7px 8px; margin-bottom: 6px; cursor: pointer; }
.wtl-org:hover { border-color: var(--w-accent); }
.wtl-org i { display: block; font-style: normal; font-family: var(--w-mono); font-size: 10px; color: var(--w-ink); margin-top: 2px; }

/* ── digest ──────────────────────────────────── */
.wtl-item { border: 1px solid var(--w-line); background: var(--w-surface); border-radius: var(--w-r2, 9px); padding: 9px 11px; margin-bottom: 8px; animation: wtl-in .28s both; }
.wtl-item b { font-size: 12.5px; display: block; }
.wtl-item span { font-size: 11.5px; color: var(--w-muted); }
.wtl-item em { float: right; font-style: normal; font-family: var(--w-mono); font-size: 11px; color: var(--w-ink); }

/* ── iframe frame ────────────────────────────── */
.wtl-frame { position: absolute; inset: 0; overflow: hidden; }
.wtl-frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #0b0f0e; }
.wtl-frame-veil { position: absolute; inset: 0; z-index: 2; display: grid; place-items: end center; padding-bottom: 14px; background: linear-gradient(to top, rgba(0,0,0,.35), transparent 40%); cursor: pointer; border: 0; width: 100%; }
.wtl-frame-veil span { font-size: 12px; color: var(--w-text); background: var(--w-surface); border: 1px solid var(--w-line2); border-radius: var(--w-pill, 999px); padding: 6px 12px; }

/* ── how it's built: architecture view ────────── */
.wtl-flow { min-height: 100%; padding: 18px 22px 22px; background-image: radial-gradient(rgba(241,231,208,.09) 1px, transparent 1.2px); background-size: 16px 16px; }
.wtl-flow-top { display: flex; justify-content: space-between; font-family: var(--w-mono); font-size: 10px; letter-spacing: .01em; text-transform: none; color: var(--w-dim); padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--w-line); }
.wtl-flow-top span:first-child { color: var(--w-ink); }
.wtl-frail { list-style: none; margin: 0; padding: 0; position: relative; }
.wtl-frail::before { content: ""; position: absolute; left: 17px; top: 16px; bottom: 16px; width: 1px; background: linear-gradient(#e8622c, #4a544f 70%); }
.wtl-frail::after { content: ""; position: absolute; left: 14px; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: #f08a5a; box-shadow: 0 0 12px 2px rgba(232,98,44,.7); animation: wtl-travel 3.4s ease-in-out infinite; }
@keyframes wtl-travel { 0% { top: 12px; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { top: calc(100% - 20px); opacity: 0; } }
.wtl-node { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 9px; opacity: 0; transform: translateX(-8px); animation: wtl-node-in .4s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 90ms); }
@keyframes wtl-node-in { to { opacity: 1; transform: none; } }
.wtl-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #1b1f1e; border: 1px solid #e8622c; color: #f08a5a; position: relative; z-index: 1; }
.wtl-nb { background: #202523; border: 1px solid #323936; border-radius: 3px; padding: 9px 14px; min-width: 0; }
.wtl-nb b { display: block; font-family: var(--font-display, Georgia, serif); font-size: 15.5px; font-weight: 600; color: #f1e7d0; line-height: 1.2; letter-spacing: .01em; }
.wtl-nb em { display: block; font-style: normal; font-family: var(--w-mono); font-size: 10.5px; color: #a0987f; margin-top: 2px; }
.wtl-idx { font-family: var(--w-mono); font-size: 10px; color: #5a645f; letter-spacing: .1em; }
@media (prefers-reduced-motion: reduce) { .wtl-node { animation: none; opacity: 1; transform: none; } .wtl-frail::after { display: none; } }
@media (max-width: 560px) {
  .wtl-stage { height: 420px; }
  .wtl-cols { grid-template-columns: 1fr; }
  .wtl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wtl-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .wtl-log li, .wtl-msg, .wtl-item, .wtl-result { animation: none; opacity: 1; transform: none; }
  .wtl-cursor::after { animation: none; }
}

/* ── rubric + portfolio card bar ─────────────── */
.wtl-rub { display: grid; grid-template-columns: 110px 1fr 28px; gap: 10px; align-items: center; font-size: 12px; color: var(--w-muted); margin: 7px 0; }
.wtl-rub div { height: 7px; border-radius: 4px; background: var(--w-line); overflow: hidden; }
.wtl-rub i { display: block; height: 100%; background: var(--w-accent); border-radius: 4px; }
.wtl-rub em { font-style: normal; font-family: var(--w-mono); font-size: 11px; color: var(--w-text); text-align: right; }
.pcard .wtl-stage { border-top: 0; }
.pcard .wtl-diagram .pcard-diagram { min-height: 100%; border-bottom: 0; }
.pcard .wtl-diagram .pcard-diagram svg { width: 100%; height: auto; max-width: 520px; }
.wtl-pbar { border-bottom: 1px solid var(--w-line, var(--border)); }

/* ── telegram blocks ─────────────────────────── */
.wtl-pm.bot { display: flex; flex-direction: column; gap: 3px; }
.wtl-tg-h { font-weight: 600; font-size: 12px; color: var(--w-text); }
.wtl-tg-m { font-size: 11px; color: var(--w-muted); }
.wtl-tg-sec { font-family: var(--w-mono); font-size: 9.5px; letter-spacing: .01em; text-transform: none; margin-top: 5px; }
.wtl-tg-sec.urgent { color: #e5484d; } .wtl-tg-sec.closing { color: #e5793b; } .wtl-tg-sec.upcoming { color: #b98900; } .wtl-tg-sec.future { color: var(--w-dim); }
.wtl-tg-ev { border-left: 2px solid var(--w-line2); padding-left: 8px; font-size: 10.5px; color: var(--w-muted); line-height: 1.45; }
.wtl-tg-ev .n { font-weight: 600; color: var(--w-text); font-size: 11px; }
.wtl-tg-ev .cfp { color: var(--w-ink); }
.wtl-tg-ev .lnk { color: var(--w-dim); }
.wtl-kb span.danger { color: #e5484d; border-color: color-mix(in srgb, #e5484d 40%, var(--w-line2)); }

/* ── the diagram side is always an ink panel ──── */
.wtl-diagram { background: #1b1f1e; --w-text: #f1e7d0; --w-muted: #c9bfa6; --w-dim: #a0987f; --w-line: #323936; --w-line2: #5a645f; --w-accent: #e8622c; --w-ink: #f08a5a; --w-surface: #202523; color: #f1e7d0; }
.pcard .wtl-diagram .pcard-diagram { background: transparent; }
.pcard .wtl-diagram .pcard-diagram rect[fill="#0C1412"] { fill: #262c2a !important; }

/* diagram node text stays readable on the ink panel in both page themes */
html .wtl-diagram .node-text-muted, html.light .wtl-diagram .node-text-muted { fill: #c9bfa6 !important; }
html .wtl-diagram .node-text-accent, html.light .wtl-diagram .node-text-accent { fill: #f08a5a !important; }
html .wtl-diagram .node-text-dim, html.light .wtl-diagram .node-text-dim { fill: #a0987f !important; }
html .wtl-diagram .node-fill, html.light .wtl-diagram .node-fill { fill: #262c2a !important; }

/* plain-language progress track and counter */
.wtl-track { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.wtl-track li { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; line-height: 1.25; color: var(--w-dim); transition: color .3s; }
.wtl-track li::before { content: ""; height: 3px; border-radius: 2px; background: var(--w-line2); margin-bottom: 5px; transition: background .4s; }
.wtl-track li i { font-style: normal; font-family: var(--w-mono); font-size: 10px; opacity: .8; }
.wtl-track li.now { color: var(--w-text); }
.wtl-track li.now::before { background: linear-gradient(90deg, var(--w-accent) 40%, var(--w-line2) 40%); background-size: 250% 100%; animation: wtl-fill .55s linear infinite; }
.wtl-track li.done { color: var(--w-muted); }
.wtl-track li.done::before { background: var(--w-accent); }
@keyframes wtl-fill { from { background-position: 100% 0; } to { background-position: 0 0; } }
.wtl-count { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.wtl-count b { font-size: 30px; font-weight: 500; letter-spacing: -.03em; color: var(--w-text); font-variant-numeric: tabular-nums; }
.wtl-count span { font-family: var(--w-mono); font-size: 11px; color: var(--w-dim); }
.wtl-run .wtl-note { min-height: 2.6em; }
.wtl-label + .wtl-seg { margin-bottom: 0; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .wtl-track li.now::before { animation: none; background: var(--w-accent); } }

.wtl-tags[hidden]{display:none}
.wtl-src[hidden]{display:none}

/* events dashboard */
.wtl-ev { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 150px); gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--w-line); }
.wtl-ev:first-child { border-top: 0; }
.wtl-ev b { display: block; font-size: 13px; font-weight: 500; color: var(--w-text); }
.wtl-ev small { font-size: 11.5px; color: var(--w-dim); }
.wtl-tier { font-family: var(--w-mono); font-size: 10.5px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--w-line2); color: var(--w-muted); white-space: nowrap; }
.wtl-tier.urgent { color: #c62d20; border-color: #c62d20; background: rgba(198, 45, 32, .08); }
.wtl-tier.thisweek { color: #b7700a; border-color: #b7700a; background: rgba(183, 112, 10, .08); }
.wtl-dl span { display: block; font-size: 10.5px; color: var(--w-dim); margin-bottom: 4px; font-family: var(--w-mono); }
.wtl-dl div { height: 4px; border-radius: 2px; background: var(--w-line2); overflow: hidden; }
.wtl-dl i { display: block; height: 100%; background: var(--w-accent); border-radius: 2px; }
@media (max-width: 560px) { .wtl-ev { grid-template-columns: auto minmax(0, 1fr); } .wtl-dl { grid-column: 1 / -1; } }

/* premium edges: inset stage, soft radius, quiet scrollbars */
.wtl-card { border-radius: 18px; box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 22px 44px -32px rgba(30,20,10,.4); transition: box-shadow .3s, border-color .3s; }
.wtl-card:hover { border-color: var(--w-line2); box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 28px 54px -30px rgba(30,20,10,.45); }
.wtl-card-head { padding: 22px 24px 16px; }
.wtl-stage { margin: 0 20px; height: 430px; border: 1px solid var(--w-line2); border-radius: 14px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--w-line) 55%, transparent); }
.pcard .wtl-stage { border-top: 1px solid var(--w-line2); margin: 0 20px 4px; }
.wtl-foot { padding: 16px 24px 18px; }
.wtl-live, .wtl-diagram { scrollbar-width: thin; scrollbar-color: rgba(120,110,95,.45) transparent; }
.wtl-live::-webkit-scrollbar, .wtl-diagram::-webkit-scrollbar { width: 6px; height: 6px; }
.wtl-live::-webkit-scrollbar-thumb, .wtl-diagram::-webkit-scrollbar-thumb { background: rgba(120,110,95,.4); border-radius: 6px; }
.wtl-live::-webkit-scrollbar-track, .wtl-diagram::-webkit-scrollbar-track { background: transparent; }
.wtl-diagram { background-image: radial-gradient(120% 60% at 50% 0, rgba(232,98,44,.10), transparent 60%); }
.wtl-flow { padding: 20px 24px 8px; min-height: 0; }
.wtl-node { margin-bottom: 8px; }
.wtl-nb { padding: 8px 14px; }
.wtl-try { display: block; margin: 8px 24px 22px auto; font: inherit; font-size: 13px; color: #fff; background: var(--w-accent); border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; transition: filter .2s, transform .2s; }
.wtl-try:hover { filter: brightness(1.1); transform: translateY(-1px); }
@media (max-width: 560px) { .wtl-stage { margin: 0 12px; height: 440px; } .wtl-card-head { padding: 18px 16px 14px; } .wtl-foot { padding: 14px 16px 16px; } }

/* architecture view shows in full: no inner scrolling */
.is-arch .wtl-stage { height: auto; overflow: visible; }
.is-arch .wtl-diagram { position: relative; inset: auto; overflow: visible; border-radius: 13px; }
.is-arch .wtl-flow { padding-bottom: 6px; }
.wtl-card .wtl-foot { margin-top: auto; }

/* invoicing preview */
.wtl-st { font-family: var(--w-mono); font-size: 10.5px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--w-line2); color: var(--w-muted); white-space: nowrap; min-width: 62px; text-align: center; }
.wtl-st.paid { color: #12805c; border-color: #12805c; background: rgba(18, 128, 92, .08); }
.wtl-st.overdue { color: #c62d20; border-color: #c62d20; background: rgba(198, 45, 32, .08); }
.wtl-st.sent { color: #2563eb; border-color: #2563eb; background: rgba(37, 99, 235, .07); }
.wtl-mini { font: inherit; font-size: 12px; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--w-line2); background: var(--w-surface); color: var(--w-text); cursor: pointer; white-space: nowrap; transition: border-color .2s, color .2s; }
.wtl-mini:hover { border-color: var(--w-accent); color: var(--w-ink); }

/* ── how it's built: one connected column of steps (light, follows the page theme) ── */
.wtl-diagram.wtl-plain { background: var(--bg2, var(--bg, #f1ece3)); background-image: none; --w-surface: var(--surface, #fcfaf6); --w-text: var(--text, #1a1814); --w-muted: var(--muted, #5b564c); --w-dim: var(--dim-text, var(--dim, #8b8578)); --w-line: var(--border, #e3dccf); --w-line2: var(--border2, #cfc7b8); --w-accent: var(--accent, #f5500a); --w-ink: var(--accent-ink, #d8410a); color: var(--w-text); }
.wtl-steps-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 16px 20px 0; font-size: 12px; color: var(--w-muted); }
.wtl-steps-top b { font-size: 13px; font-weight: 600; color: var(--w-text); }
.wtl-steps { list-style: none; margin: 0; padding: 12px 20px 6px; display: grid; grid-template-columns: 1fr; gap: 16px; }
.wtl-step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 12px; background: var(--w-surface); border: 1px solid var(--w-line2); border-radius: 12px; padding: 10px 12px; }
.wtl-step::before { content: ""; position: absolute; inset: -1px; border: 2px solid var(--w-accent); border-radius: inherit; opacity: 0; pointer-events: none; animation: wtl-step-on calc(var(--n) * .9s) linear infinite; animation-delay: calc(var(--i) * .9s); }
@keyframes wtl-step-on { 0% { opacity: 1; } 55%, 100% { opacity: 0; } }
/* the arrow to the next step sits in the gap, under the number */
.wtl-step::after { content: "\2193"; position: absolute; left: 20px; bottom: -16px; width: 18px; text-align: center; font-size: 13px; line-height: 16px; color: var(--w-ink); }
.wtl-step:last-child::after { content: none; }
.wtl-step-lead { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wtl-step-n { font-family: var(--w-mono); font-size: 11px; font-weight: 600; color: var(--w-ink); background: color-mix(in srgb, var(--w-accent) 12%, transparent); border-radius: 6px; padding: 2px 6px; }
.wtl-step-ico { color: var(--w-ink); }
.wtl-step-text { min-width: 0; }
.wtl-step-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wtl-step b { font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--w-text); }
.wtl-step p { margin: 3px 0 0; font-size: 12px; line-height: 1.45; color: var(--w-muted); }
.wtl-step-tool { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; white-space: nowrap; color: var(--w-text); border: 1px solid var(--w-line2); border-radius: 999px; padding: 2px 8px 2px 6px; }
.wtl-step-tool::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--w-accent); }
.wtl-step-tool.has-logo { padding-left: 3px; }
.wtl-step-tool.has-logo::before { content: none; }
.wtl-step-tool img { width: 16px; height: 16px; object-fit: contain; background: #fff; border-radius: 50%; padding: 1px; }
@media (prefers-reduced-motion: reduce) { .wtl-step::before { animation: none; } }

/* Set by syncRows() in live-ui.js on the neighbours of a card that has How It's Built open:
   they keep their own height instead of stretching, which used to leave a blank gap by their demo. */
.wtl-own-h { align-self: start; }

/* a card that has not been built yet holds roughly its final height, so the page does not jump as cards build */
.wtl-card:not([data-ready]) { min-height: 640px; }
:not(.proj-grid) > .pcard[data-live]:not([data-ready]), :not(.proj-grid) > .pcard[data-frame]:not([data-ready]) { min-height: 700px; }
