/* Wand Execution Debugger — scoped styles (ported from the design mockup). All
   classes/vars are wd-prefixed so they never collide with Tailwind or app.css. */
.wd-root {
  --wd-ground: #12100f;
  --wd-panel: #1b1815;
  --wd-panel-2: #211d19;
  --wd-hair: #2e2a25;
  --wd-ink: #e8e2d6;
  --wd-muted: #9a9284;
  --wd-faint: #655e54;
  --wd-cyan: #5fd0d8;
  --wd-gold: #e8b24a;
  --wd-draw: #7d8794;
  --wd-multi: #e0a33a;
  --wd-trig: #a982e0;
  --wd-recur: #e06fa8;
  --wd-through: #6fbf73;
  --wd-fire: #5fd0d8;
  --wd-idle: #7a7266;
  --wd-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --wd-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--wd-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--wd-ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wd-root * { box-sizing: border-box; }

/* ---- deck ribbon ---- */
.wd-deck-ribbon { display: flex; gap: 5px; flex-wrap: wrap; align-items: stretch; }
.wd-card {
  position: relative; min-width: 62px; flex: 1 1 62px; border: 1px solid var(--wd-hair);
  border-radius: 5px; background: var(--wd-panel); padding: 6px 7px 7px; display: flex;
  flex-direction: column; gap: 2px; transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.wd-card .wd-cty { width: 100%; height: 3px; border-radius: 2px; margin-bottom: 3px; }
.wd-card .wd-cid { font-size: 9px; color: var(--wd-faint); letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; }
.wd-card .wd-cnm { font-family: var(--wd-sans); font-size: 11px; font-weight: 600; line-height: 1.15; }
.wd-card.drawn { opacity: .42; }
.wd-card.pc {
  border-color: var(--wd-cyan); background: #15211f; transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--wd-cyan), 0 6px 18px -8px rgba(0, 170, 255, .4);
}
.wd-card.pc .wd-cnm { color: var(--wd-cyan); }
.wd-card .wd-slotn {
  position: absolute; top: -7px; right: -6px; font-size: 9px; color: var(--wd-faint);
  background: var(--wd-ground); border: 1px solid var(--wd-hair); border-radius: 3px; padding: 0 3px;
}

/* ---- transport ---- */
.wd-transport {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; background: var(--wd-panel);
  border: 1px solid var(--wd-hair); border-radius: 8px; padding: 9px 11px;
}
.wd-tp {
  font-family: var(--wd-sans); font-size: 12px; font-weight: 600; color: var(--wd-ink);
  background: var(--wd-panel-2); border: 1px solid var(--wd-hair); border-radius: 6px; padding: 6px 11px;
  cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: border-color .1s, background .1s, color .1s;
}
.wd-tp:hover { border-color: #4a443b; background: #2a251f; }
.wd-tp:focus-visible { outline: 2px solid var(--wd-cyan); outline-offset: 1px; }
.wd-tp:disabled { opacity: .35; cursor: not-allowed; }
.wd-tp .wd-k { font-family: var(--wd-mono); font-size: 9px; color: var(--wd-faint); border: 1px solid var(--wd-hair); border-radius: 3px; padding: 0 3px; }
.wd-tp.primary { color: var(--wd-cyan); border-color: #2c4a4c; }
.wd-sep { width: 1px; align-self: stretch; background: var(--wd-hair); margin: 0 2px; }
.wd-stepread { margin-left: auto; display: flex; gap: 12px; align-items: baseline; font-variant-numeric: tabular-nums; }
.wd-stepread .wd-n { font-size: 16px; color: var(--wd-ink); }
.wd-stepread .wd-n b { color: var(--wd-cyan); }
.wd-edge-pill {
  font-family: var(--wd-sans); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid currentColor;
}
.wd-cast-sel {
  font-family: var(--wd-mono); font-size: 12px; color: var(--wd-ink); background: var(--wd-panel-2);
  border: 1px solid var(--wd-hair); border-radius: 6px; padding: 5px 8px;
}

/* ---- grid + panes ---- */
.wd-grid { display: grid; grid-template-columns: 1fr 1.15fr 1.15fr; gap: 12px; }
@media (max-width: 900px) { .wd-grid { grid-template-columns: 1fr; } }
.wd-pane { background: var(--wd-panel); border: 1px solid var(--wd-hair); border-radius: 8px; padding: 12px; min-height: 120px; }
.wd-pane > h2 {
  font-family: var(--wd-sans); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--wd-muted); margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; font-weight: 600;
}
.wd-pane > h2 .wd-h-note { color: var(--wd-faint); letter-spacing: .02em; text-transform: none; font-size: 10px; }

/* piles */
.wd-regs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.wd-reg { background: var(--wd-panel-2); border: 1px solid var(--wd-hair); border-radius: 5px; padding: 6px 8px; }
.wd-reg .wd-rl { font-size: 9.5px; color: var(--wd-muted); letter-spacing: .05em; text-transform: uppercase; }
.wd-reg .wd-rv { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--wd-ink); }
.wd-reg .wd-rv.hot { color: var(--wd-gold); }
.wd-pilesec { margin-top: 9px; }
.wd-pilesec .wd-pl {
  font-size: 9.5px; color: var(--wd-muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 5px;
  display: flex; justify-content: space-between;
}
.wd-chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 20px; }
.wd-chip { font-size: 10.5px; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--wd-hair); background: var(--wd-panel-2); color: var(--wd-muted); }
.wd-chip.live { color: var(--wd-ink); border-color: #40483f; background: #1b211a; }
.wd-chip.fire { color: var(--wd-ground); background: var(--wd-cyan); border-color: var(--wd-cyan); font-weight: 600; }
.wd-empty { color: var(--wd-faint); font-style: italic; font-family: var(--wd-sans); font-size: 11px; }

/* call stack */
.wd-stack { display: flex; flex-direction: column; gap: 0; }
.wd-frame { position: relative; padding: 7px 9px 7px 26px; border-radius: 6px; border: 1px solid transparent; }
.wd-frame::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--wd-hair); }
.wd-frame::after {
  content: ""; position: absolute; left: 7px; top: 13px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--wd-ground); border: 2px solid var(--wd-edge, var(--wd-idle));
}
.wd-frame.cur { background: #15211f; border-color: #243c3b; }
.wd-frame.cur::after { background: var(--wd-edge); box-shadow: 0 0 0 3px rgba(95, 208, 216, .13); }
.wd-frame .wd-fnm { font-family: var(--wd-sans); font-weight: 600; font-size: 12.5px; }
.wd-frame.cur .wd-fnm { color: var(--wd-cyan); }
.wd-frame .wd-ftag { font-size: 10px; color: var(--wd-muted); }
.wd-frame .wd-ftag em { font-style: normal; color: var(--wd-edge); text-transform: uppercase; letter-spacing: .06em; font-size: 9px; }
.wd-note {
  margin-top: 11px; padding: 9px 10px; background: var(--wd-panel-2); border: 1px solid var(--wd-hair);
  border-left: 2px solid var(--wd-edge, var(--wd-cyan)); border-radius: 5px; font-family: var(--wd-sans);
  font-size: 12px; color: #cfc8ba; line-height: 1.5;
}

/* config c */
.wd-cgrp { margin-bottom: 10px; }
.wd-cgrp .wd-gl {
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--wd-faint);
  border-bottom: 1px solid var(--wd-hair); padding-bottom: 3px; margin-bottom: 5px;
}
.wd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 4px; border-radius: 4px; }
.wd-row .wd-fk { color: var(--wd-muted); font-size: 11.5px; }
.wd-row .wd-fv { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--wd-ink); text-align: right; }
.wd-row .wd-fv .wd-was { color: var(--wd-faint); font-size: 10px; margin-right: 5px; }
.wd-row.chg { background: #241d10; box-shadow: inset 2px 0 0 var(--wd-gold); }
.wd-row.chg .wd-fk { color: var(--wd-gold); }
.wd-row.chg .wd-fv { color: var(--wd-gold); }
.wd-row .wd-fv .wd-arr { color: var(--wd-gold); }
.wd-earr { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.wd-earr .wd-ee { font-size: 10.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid #40483f; background: #1b211a; color: #bfe0c2; }
.wd-earr .wd-ee.ge { border-color: #4a3350; background: #221826; color: #dcc4e6; }
.wd-earr .wd-ee.tg { border-color: #4a3d1a; background: #221c10; color: #e6d3a0; }
.wd-earr.chg .wd-ee { box-shadow: 0 0 0 1px var(--wd-gold); }

/* timeline */
.wd-tl-wrap { background: var(--wd-panel); border: 1px solid var(--wd-hair); border-radius: 8px; padding: 11px 12px; }
.wd-tl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wd-tl-head .wd-lbl { font-family: var(--wd-sans); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--wd-muted); }
.wd-legend { display: flex; gap: 11px; flex-wrap: wrap; font-family: var(--wd-sans); font-size: 10px; color: var(--wd-muted); }
.wd-legend span { display: inline-flex; align-items: center; gap: 4px; }
.wd-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
/* Flame graph: x = step index, row = call depth, span = one card frame. */
.wd-flame { position: relative; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; cursor: crosshair; }
.wd-flame-inner { position: relative; }
.wd-span {
  position: absolute; box-sizing: border-box; border-radius: 3px; cursor: pointer;
  background: color-mix(in srgb, var(--tc, var(--wd-idle)) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc, var(--wd-idle)) 65%, transparent);
  display: flex; align-items: center; gap: 4px; padding: 0 4px; overflow: hidden;
  font-family: var(--wd-sans); font-size: 10px; white-space: nowrap; color: var(--wd-ink);
  transition: background .1s, border-color .1s;
}
.wd-span:hover { background: color-mix(in srgb, var(--tc, var(--wd-idle)) 40%, transparent); }
.wd-span.cur {
  background: color-mix(in srgb, var(--tc, var(--wd-idle)) 45%, transparent);
  border-color: var(--tc, var(--wd-idle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tc, var(--wd-idle)) 50%, transparent);
}
.wd-span .wd-ico { flex: 0 0 auto; }
.wd-fdot {
  position: absolute; width: 5px; height: 5px; border-radius: 50%; cursor: pointer;
  background: var(--wd-fire); box-shadow: 0 0 4px var(--wd-fire);
}
.wd-fdot.reload { background: var(--wd-idle); box-shadow: none; }
.wd-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; pointer-events: none;
  background: var(--wd-cyan); opacity: .85; box-shadow: 0 0 6px var(--wd-cyan);
}
.wd-ico { width: 14px; height: 14px; image-rendering: pixelated; vertical-align: -2px; display: inline-block; }
.wd-ico.big { width: 17px; height: 17px; margin-right: 4px; }
.wd-chip .wd-ico, .wd-fnm .wd-ico { margin-right: 3px; }
.wd-foot { color: var(--wd-faint); font-family: var(--wd-sans); font-size: 10.5px; text-align: center; margin-top: 2px; }
.wd-foot kbd { font-family: var(--wd-mono); font-size: 10px; background: var(--wd-panel-2); border: 1px solid var(--wd-hair); border-radius: 3px; padding: 0 4px; color: var(--wd-muted); }
