html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* ---- Zebra puzzle theme ---- */
.zp {
  --card: #181b24;
  --border: #272b38;
  --muted: #9aa1b1;
  --accent: #7c9cff;
  --hot: #2a3b1f;
  --hot-border: #6fbf3a;
  --ok: #6fbf3a;
  --err: #ff6b6b;
  max-width: 880px;
  margin: 0 auto;
  color: #e6e8ee;
}
.zp .hero h1 { font-size: 2.2rem; margin: 0 0 .25rem; letter-spacing: -.02em; }
.zp .subtitle { color: var(--muted); max-width: 62ch; }
.zp code { color: #cdd3e0; }
.zp .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  margin: 1.1rem 0;
}
.zp .card h2 { font-size: 1.12rem; margin: 0 0 .6rem; }
.zp .err-card { border-color: #5a2a2a; background: #241616; }
.zp .muted { color: var(--muted); font-size: .9rem; }
.zp .clues { columns: 2; column-gap: 2rem; padding-left: 1.3rem; margin: 0; }
.zp .clues li { margin: .15rem 0; break-inside: avoid; }
.zp pre.sql {
  background: #0c0e14; border: 1px solid var(--border); border-radius: 8px;
  padding: 1rem; overflow: auto; max-height: 460px; margin: 0;
}
.zp pre.sql code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; white-space: pre; color: #cdd3e0;
}
.zp .status .ok { color: var(--ok); font-weight: 600; }
.zp .table-wrap { overflow-x: auto; }
.zp table.grid { border-collapse: collapse; width: 100%; font-size: .92rem; }
.zp table.grid th, .zp table.grid td {
  border: 1px solid var(--border); padding: .5rem .7rem; text-align: center;
}
.zp table.grid thead th { background: #20242f; }
.zp .rolehead { background: #20242f; text-align: left; white-space: nowrap; font-weight: 600; }
.zp td.hot { background: var(--hot); border-color: var(--hot-border); font-weight: 700; }
.zp tr.hot td { background: var(--hot); font-weight: 700; }
.zp .answers { margin: 1rem 0 0; font-size: 1.05rem; }
.zp .answers strong { color: var(--accent); }
.zp table.counts td:nth-child(2) { text-align: left; }
.zp table.counts .num { text-align: right; }
.zp table.counts .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.zp details summary { cursor: pointer; }
.zp pre.sql.detail { margin-top: .5rem; max-height: 320px; }
.zp .legend {
  background: #0c0e14; border: 1px solid var(--border); border-radius: 8px;
  padding: .75rem 1rem; margin-bottom: 1rem;
}
.zp .legend > .muted { margin: 0 0 .5rem; }
.zp .legend-row { display: flex; gap: .75rem; padding: .2rem 0; flex-wrap: wrap; font-size: .88rem; }
.zp .legend-cat { min-width: 9rem; color: var(--accent); font-weight: 600; }
.zp .legend-cols { color: #cdd3e0; }
.zp .legend code, .zp pre.sql code, .zp p code {
  background: #1c2130; border-radius: 4px; padding: .05rem .3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem;
}

/* ---- Constraint Lab ---- */
.zp .card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.zp button.mini {
  background: #2a3142; color: #e6e8ee; border: 1px solid var(--border);
  border-radius: 6px; padding: .3rem .7rem; font-size: .82rem; cursor: pointer; margin-left: .4rem;
}
.zp button.mini:hover { filter: brightness(1.15); }
.zp .clue-list { list-style: none; margin: 0; padding: 0; }
.zp .clue-list li { padding: .12rem 0; }
.zp .clue-list label { display: flex; align-items: baseline; gap: .5rem; cursor: pointer; }
.zp .clue-list label.fixed { cursor: default; color: var(--muted); }
.zp .clue-list input { margin-top: .15rem; }
.zp .cnum { color: var(--muted); min-width: 1.6rem; }
.zp .tag {
  margin-left: .4rem; font-size: .7rem; background: #2a3142; color: var(--muted);
  border-radius: 4px; padding: .05rem .35rem;
}
.zp .result { text-align: center; }
.zp .bignum {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums; font-size: 2.4rem; font-weight: 700; color: var(--accent);
  margin: .3rem 0;
}
.zp .badge { min-height: 1.3rem; font-weight: 600; }
.zp .badge.ok { color: var(--ok); }
.zp .result .table-wrap { margin-top: 1rem; }
.zp .builder { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.zp .builder select {
  background: #0c0e14; color: #e6e8ee; border: 1px solid var(--border);
  border-radius: 6px; padding: .3rem .5rem; font-size: .85rem;
}
.zp .crit-list { list-style: none; margin: .75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.zp .crit-list li {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #0c0e14; border: 1px solid var(--border); border-radius: 6px; padding: .2rem .5rem;
}
.zp .crit-list button.rm {
  background: none; border: none; color: var(--err); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0;
}
.zp .badge.err { color: var(--err); }
.zp .sample { margin-bottom: 1.1rem; }
.zp .sample h3 { font-size: .9rem; color: var(--muted); margin: 0 0 .35rem; }
.zp .io { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.zp .io h3 { font-size: .95rem; margin: 0 0 .35rem; }
.zp .io .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; word-break: break-all; }
@media (max-width: 720px) { .zp .io { grid-template-columns: 1fr; } }

/* ---- Stack 001 ---- */
.zp .controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.zp .controls .spd { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); margin-left: .5rem; }
.zp .controls .stepcount {
  margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600;
}
.zp .controls select {
  background: #0c0e14; color: #e6e8ee; border: 1px solid var(--border);
  border-radius: 6px; padding: .25rem .4rem; font-size: .8rem; margin-left: .3rem;
}
.zp a.cta {
  display: inline-block; margin-top: .3rem; background: #2a3142; color: var(--accent);
  border: 1px solid var(--border); border-radius: 6px; padding: .4rem .8rem;
  text-decoration: none; font-weight: 600; font-size: .9rem;
}
.zp a.cta:hover { filter: brightness(1.2); }
.zp .seekrow { margin-top: .6rem; }
.zp .seekrow input[type=range] { width: 100%; accent-color: var(--accent); }
.zp .controls input[type=range] { accent-color: var(--accent); }
.zp .stack-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.2rem; }
@media (max-width: 820px) { .zp .stack-layout { grid-template-columns: 1fr; } }
.zp .panel h3 { font-size: .95rem; margin: 0 0 .4rem; }
.zp table.board-grid { border-collapse: collapse; width: 100%; font-size: .9rem; }
.zp table.board-grid th, .zp table.board-grid td {
  border: 1px solid var(--border); padding: .35rem .4rem; text-align: center;
}
.zp table.board-grid thead th, .zp table.board-grid .rolehead { background: #20242f; }
.zp .bcell .cand {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem; color: var(--muted); letter-spacing: .08em;
}
.zp .bcell.fixed {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem; font-weight: 700; color: var(--accent); background: #161d2c;
}
.zp .bcell.fixed.hot { background: var(--hot); border-color: var(--hot-border); color: #d6f5b8; }
/* board cells now hold property names (words), not single digits — size to fit */
/* fixed table layout: column widths stay constant so the grid never reshapes as
   cells change during fast playback */
.zp.ux table.board-grid { table-layout: fixed; width: 100%; min-width: 46rem; }
.zp.ux table.board-grid th.rolehead { width: 9rem; }
.zp.ux .board-grid td.bcell {
  font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.zp.ux .board-grid td.bcell.fixed, .zp.ux .board-grid td.bcell.tent { font-size: .78rem; }
/* tentative cell — a guess sitting on the stack, not yet committed on this search path */
.zp .bcell.tent {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem; font-weight: 700; font-style: italic; color: var(--accent);
  background: rgba(109, 124, 255, .10); border: 1px dashed var(--accent);
}
.zp.ux:not(.rm) .bcell.tent { animation: uxtent .95s ease-in-out infinite alternate; }
@keyframes uxtent { from { background: rgba(109, 124, 255, .05); } to { background: rgba(109, 124, 255, .18); } }
.zp .ux-boardlegend {
  color: var(--muted); font-size: .74rem; margin: .55rem 0 0;
  display: flex; gap: .55rem; align-items: center; flex-wrap: wrap;
}
.zp .ux-boardlegend .bk {
  display: inline-block; min-width: 1.25rem; text-align: center; border-radius: 4px;
  padding: .02rem .3rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700;
}
.zp .ux-boardlegend .bk.fixed { background: #161d2c; color: var(--accent); border: 1px solid var(--border); }
.zp .ux-boardlegend .bk.tent { color: var(--accent); border: 1px dashed var(--accent); background: rgba(109, 124, 255, .10); font-style: italic; }
.zp .target { margin-top: .7rem; font-size: .9rem; }
.zp .target code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1rem;
  letter-spacing: .12em; background: none; padding: 0;
}
.zp .target .tg-open { color: #4a5163; }
.zp .target .tg-ok   { color: var(--ok); font-weight: 700; }
.zp .target .tg-bad  { color: var(--err); font-weight: 700; }
.zp ol.stk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.zp ol.stk .frame {
  display: flex; align-items: center; gap: .5rem; background: #0c0e14;
  border: 1px solid var(--border); border-radius: 6px; padding: .25rem .5rem; font-size: .82rem;
}
.zp ol.stk .frame.top { border-color: var(--accent); background: #141b2b; }
.zp ol.stk .fnum { color: var(--muted); min-width: 3.4rem; }
.zp ol.stk .fpick {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #cdd3e0; flex: 1;
}
.zp ol.stk .ftag { color: var(--muted); font-size: .72rem; }
.zp .bits { font-size: .82rem; }
.zp .bits .brow { padding: .12rem 0; }
.zp .bits .brow.chosen code { background: #141b2b; }
.zp .bits .bidx { color: var(--muted); display: inline-block; min-width: 1.4rem; }
.zp .bits code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem;
  background: none; padding: 0;
}
.zp .bits .bit1 { color: var(--accent); font-weight: 700; }
.zp .bits .bit0 { color: #3c4356; }
.zp ol.log {
  list-style: none; margin: 0; padding: .5rem; max-height: 340px; overflow: auto;
  background: #0c0e14; border: 1px solid var(--border); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem;
}
.zp ol.log .logline { padding: .15rem .3rem; border-radius: 4px; color: #cdd3e0; }
.zp ol.log .logline.cur { background: #1c2436; }
.zp ol.log .ltag {
  display: inline-block; min-width: 4.2rem; font-weight: 700; font-size: .7rem; margin-right: .5rem;
}
.zp ol.log .t-seed .ltag, .zp ol.log .t-push .ltag { color: var(--accent); }
.zp ol.log .t-prop .ltag, .zp ol.log .t-solution .ltag { color: var(--ok); }
.zp ol.log .t-contra .ltag, .zp ol.log .t-deadend .ltag { color: var(--err); }
.zp ol.log .t-backtrack .ltag { color: #e0a23a; }
.zp ol.log .t-pop .ltag { color: #cdd3e0; }
.zp ol.log .t-solution { color: var(--ok); font-weight: 600; }

/* ---- Stack 002 (depth view) ---- */
.zp .depthwrap { margin-bottom: .4rem; }
.zp .depthmeter { display: flex; align-items: center; gap: .5rem; }
.zp .depthnum { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.zp .depthbar { flex: 1; height: 10px; background: #0c0e14; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-left: .5rem; }
.zp .depthfill { height: 100%; width: 0; background: linear-gradient(90deg, #3a5bd9, var(--accent)); transition: width .25s ease; }
.zp ol.tower { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.zp ol.tower .level {
  background: #0c0e14; border: 1px solid var(--border); border-radius: 8px; padding: .45rem .6rem;
  animation: lvin .25s ease;
}
.zp ol.tower .level.cur { border-color: var(--accent); background: #141b2b; }
@keyframes lvin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.zp .lvtop { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.zp .lvd { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; min-width: 4rem; }
.zp .lvclue { font-size: .88rem; color: #e6e8ee; }
.zp .lvchips { margin-top: .35rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.zp .chip {
  display: inline-flex; align-items: center; gap: .3rem; background: #1c2130; border: 1px solid var(--border);
  border-radius: 6px; padding: .12rem .45rem; font-size: .8rem; color: #cdd3e0;
}
.zp .chip code { background: #2a3142; padding: .02rem .28rem; font-size: .74rem; }
.zp .ruledout { margin-top: 1rem; }
.zp .ruledout summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.zp ul.droplist { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.zp ul.droplist .drop {
  display: flex; flex-direction: column; gap: .2rem; background: #150e12; border: 1px solid #3a2326;
  border-radius: 6px; padding: .35rem .5rem; font-size: .8rem;
}
.zp ul.droplist .drop.deep { background: #161410; border-color: #3a3320; }
.zp ul.droplist .dchips { display: flex; flex-wrap: wrap; gap: .3rem; }
.zp ul.droplist .dreason { color: var(--muted); }

/* ---- Stack 003 (op machine) ---- */
.zp .opwrap { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.zp .opnum {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.8rem; font-weight: 700; color: var(--accent);
}
.zp .ssize { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #cdd3e0; font-weight: 600; }
.zp ol.opstack {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .22rem;
  max-height: 460px; overflow: auto;
}
.zp ol.opstack .oframe {
  display: flex; align-items: center; gap: .5rem; background: #0c0e14;
  border: 1px solid var(--border); border-radius: 6px; padding: .25rem .5rem; font-size: .82rem;
}
.zp ol.opstack .oframe.top { border-color: var(--accent); background: #141b2b; }
.zp ol.opstack .ofd { color: var(--muted); font-size: .72rem; min-width: 1.8rem; }
.zp ol.opstack .ofc { color: var(--muted); min-width: 3.4rem; }
.zp ol.opstack .ofl {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #cdd3e0; flex: 1;
}
.zp ol.opstack .oftag {
  font-size: .68rem; background: #2a3142; color: var(--accent); border-radius: 4px; padding: .03rem .35rem;
}
.zp ol.log .t-push .ltag { color: var(--accent); }
.zp ol.log .t-pop .ltag { color: var(--ok); }
.zp ol.log .t-drop .ltag { color: var(--err); }
.zp ol.log .t-seed .ltag { color: var(--muted); }
.zp p#phase strong.cc-ok { color: var(--ok); }
.zp p#phase strong.cc-bad { color: var(--err); }
.zp .opbits {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92rem; letter-spacing: .06em; min-height: 1.1rem;
}
.zp ol.log .opvals-inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #8fa9ff; margin-left: .6rem; letter-spacing: .08em; font-size: .76rem;
}
.zp ol.log .opidx {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #7f8aa3; font-weight: 600; font-size: .76rem;
}
.zp ol.log .opdepth {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #8a93a6; margin-left: .5rem; font-size: .76rem;
}
.zp ol.log .logsep { color: #3c4356; margin: 0 .55rem; }

/* ---- Stack UI/UX (/stack-uiux) — M0 shell ---- */
.zp.ux .ux-accent { color: var(--accent); }
.zp .ux-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; }
@media (max-width: 720px) { .zp .ux-kpis { grid-template-columns: repeat(3, 1fr); } }
.zp .ux-kpi {
  background: #0c0e14; border: 1px solid var(--border); border-radius: 10px;
  padding: .7rem .8rem; display: flex; flex-direction: column; gap: .15rem; text-align: center;
}
.zp .ux-kpi-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 700; color: var(--accent);
}
.zp .ux-kpi-val.ux-ok { color: var(--ok); }
.zp .ux-kpi-lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.zp .ux-depthrow { display: flex; align-items: center; gap: .5rem; }
.zp .ux-depthnum { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.zp .ux-opreadout {
  margin-left: .6rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #8a93a6; font-size: .85rem;
}
.zp .ux-narr { font-size: 1.02rem; margin: .6rem 0 .2rem; min-height: 1.4rem; }
.zp .ux-tag {
  display: inline-block; font-size: .7rem; font-weight: 700; padding: .05rem .4rem; border-radius: 5px;
  margin-right: .4rem; background: #2a3142; color: var(--muted);
}
.zp .ux-tag.t-push { color: var(--accent); }
.zp .ux-tag.t-pop, .zp .ux-tag.t-solution { color: var(--ok); }
.zp .ux-tag.t-drop { color: var(--err); }
.zp .ux-soon { background: #0c0e14; }
.zp ul.ux-todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; }
.zp ul.ux-todo li { color: #cdd3e0; }
.zp .ux-ms {
  display: inline-block; min-width: 2rem; margin-right: .5rem; font-size: .7rem; font-weight: 700;
  color: var(--accent); background: #141b2b; border: 1px solid var(--border); border-radius: 5px;
  padding: .03rem .3rem; text-align: center;
}

/* M1 — apply the zebra-stack-uiux design tokens to /stack-uiux */
.zp.ux { --ux-accent2: #46e0d0; --ux-grad: linear-gradient(90deg, var(--accent), var(--ux-accent2)); }
.zp.ux .ux-accent {
  background: var(--ux-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.zp.ux .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012)), var(--card);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
}
.zp.ux .ux-kpi {
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
}
.zp.ux .ux-kpi-val {
  background: var(--ux-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.zp.ux .ux-kpi-val.ux-ok { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--ok); }
.zp.ux .ux-depthnum { background: var(--ux-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.zp.ux .depthfill {
  background: var(--ux-grad); box-shadow: 0 0 18px rgba(70, 224, 208, .35);
}
.zp.ux .controls .mini { transition: filter .15s ease, transform .15s ease; }
.zp.ux .controls .mini:hover { transform: translateY(-1px); }
.zp.ux .ux-narr .ux-tag.t-push { box-shadow: inset 0 0 0 1px rgba(109, 124, 255, .3); }

/* M2 — stack tower */
.zp.ux ol.ux-tower { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.zp.ux .ux-frame {
  display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012));
  border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.zp.ux .ux-frame.top { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(109, 124, 255, .35), 0 0 26px rgba(109, 124, 255, .22); }
.zp.ux .ux-frame.top.t-pop { border-color: var(--ok); box-shadow: 0 0 0 1px rgba(95, 208, 138, .4), 0 0 26px rgba(95, 208, 138, .22); }
.zp.ux .ux-frame.top.t-drop { border-color: var(--err); box-shadow: 0 0 0 1px rgba(255, 107, 107, .4), 0 0 26px rgba(255, 107, 107, .22); }
.zp.ux:not(.rm) .ux-frame.top { animation: uxin .18s var(--ux-spring, cubic-bezier(.22, 1, .36, 1)); }
@keyframes uxin { from { opacity: 0; transform: translateY(-7px) scale(.98); } to { opacity: 1; transform: none; } }
.zp.ux .ux-fd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; color: var(--muted); min-width: 2.1rem; }
.zp.ux .ux-fl { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #cdd3e0; flex: 1; }
.zp.ux .ux-ftag { font-size: .66rem; font-weight: 700; color: var(--accent); background: #141b2b; border-radius: 999px; padding: .04rem .4rem; }
.zp.ux .ux-more { color: var(--muted); font-size: .78rem; text-align: center; padding: .2rem; }

/* clues-satisfied readout under the board */
.zp.ux .ux-cluestat { display: flex; align-items: center; gap: .55rem; margin: .5rem 0 0; font-size: .82rem; color: var(--muted); }
.zp.ux .ux-cluestat strong { color: var(--ok); font-size: .95rem; }
.zp.ux .ux-cluebar { flex: 1; max-width: 240px; height: 8px; border-radius: 999px; background: #0c0e14; border: 1px solid var(--border); overflow: hidden; }
.zp.ux .ux-cluefill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--ok)); transition: width .15s ease; }
.zp.ux.rm .ux-cluefill { transition: none; }

/* stack as houses-board strings — top frame first */
.zp.ux ol.ux-stackstr { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; max-height: 420px; overflow: auto; }
.zp.ux .ux-sline {
  display: flex; align-items: center; gap: .7rem; padding: .32rem .55rem; border-radius: 8px;
  background: rgba(255, 255, 255, .02); border: 1px solid var(--border);
}
.zp.ux .ux-sline.top { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(109, 124, 255, .3), 0 0 18px rgba(109, 124, 255, .16); }
.zp.ux .ux-sline.top.t-pop { border-color: var(--ok); box-shadow: 0 0 0 1px rgba(95, 208, 138, .35); }
.zp.ux .ux-sline.top.t-drop { border-color: var(--err); box-shadow: 0 0 0 1px rgba(255, 107, 107, .35); }
.zp.ux .ux-sd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; color: var(--muted); min-width: 2.4rem; }
.zp.ux .ux-sv { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; letter-spacing: .12em; color: #cdd3e0; flex: 1; white-space: nowrap; }
.zp.ux .ux-sline.top .ux-sv { color: var(--accent); font-weight: 700; }

/* M3 — density ribbon + playhead */
.zp.ux .ux-ribbonwrap { position: relative; margin: 1rem 0 .3rem; cursor: pointer; line-height: 0; }
.zp.ux .ux-ribbonwrap canvas { width: 100%; border-radius: 6px; border: 1px solid var(--border); display: block; }
.zp.ux .ux-playhead {
  position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; left: 0;
  box-shadow: 0 0 8px rgba(255, 255, 255, .8); pointer-events: none; transition: left .12s linear;
}
.zp.ux.rm .ux-playhead { transition: none; }

/* M4 — virtualized + filterable log */
.zp.ux .ux-logtools { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.zp.ux .ux-filters .mini.on { background: var(--accent); color: #0b0d12; font-weight: 700; }
.zp.ux .ux-search {
  background: #0c0e14; color: #e6e8ee; border: 1px solid var(--border); border-radius: 6px;
  padding: .3rem .5rem; font-size: .82rem; width: 9rem;
}
.zp.ux .ux-vlog {
  position: relative; height: 360px; overflow: auto; margin-top: .6rem;
  background: #0c0e14; border: 1px solid var(--border); border-radius: 8px;
}
.zp.ux .ux-vlog:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.zp.ux .ux-vspace { position: absolute; top: 0; left: 0; width: 1px; }
.zp.ux .ux-vrows { position: absolute; top: 0; left: 0; right: 0; }
.zp.ux .ux-vrow {
  height: 22px; line-height: 22px; padding: 0 .6rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem; color: #cdd3e0; cursor: pointer;
}
.zp.ux .ux-vrow:hover { background: #141a26; }
.zp.ux .ux-vrow.cur { background: #1c2436; }
.zp.ux .ux-vrow .ltag { min-width: 3.4rem; display: inline-block; font-weight: 700; }
.zp.ux .ux-vrow.t-push .ltag { color: var(--accent); }
.zp.ux .ux-vrow.t-pop .ltag, .zp.ux .ux-vrow.t-solution .ltag { color: var(--ok); }
.zp.ux .ux-vrow.t-drop .ltag { color: var(--err); }
.zp.ux .ux-li-idx { color: #7f8aa3; }
.zp.ux .ux-li-d { color: #8a93a6; margin-left: .4rem; }
.zp.ux .ux-li-v { color: #8fa9ff; margin-left: .4rem; letter-spacing: .06em; }
.zp.ux .ux-vrow .logsep { color: #3c4356; margin: 0 .45rem; }
.zp .opbits .opvals {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent); letter-spacing: .1em; font-weight: 700;
}