/* SPLICE site — vector recreations of the app (pure HTML/CSS + a JS transcript
 * player, no screenshots). Measurements and colors transcribed from
 * pkg/usr/share/splice/style.css: 42px headerbar, 26px tabs w/ 2px orange seam,
 * 3px result-row seam, 310px sidebar, 14px checks, 10px/800 sidebar title.
 * Fidelity rules: terminal lines never soft-wrap (white-space: pre), output
 * PRINTS (no fades), and the mockup font is pinned so it doesn't reflow per OS. */

/* ---------------------------------------------------------------- window */
.mk-window {
  background: var(--bg);
  border: 1px solid var(--edge);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  min-width: 680px;
  font-family: "DejaVu Sans Mono", "JetBrains Mono", "Liberation Mono", monospace;
}
.mk-fragment { min-width: 620px; border-radius: 8px 8px 3px 3px; }

/* headerbar */
.mk-header {
  display: flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 8px;
  background: linear-gradient(to bottom, var(--header-glint-top), var(--panel));
  border-bottom: 1px solid var(--line);
  box-shadow: var(--top-glint);
}
.mk-header .wordmark { font-size: 13px; }
.mk-header .spacer { flex: 1; }
.mk-hbtn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 24px; padding: 2px 10px;
  background: linear-gradient(to bottom, #20242b, var(--raise));
  color: var(--fg); border: 1px solid var(--edge); border-radius: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  box-shadow: var(--top-glint); white-space: nowrap;
}
.mk-hbtn.sm { min-height: 20px; padding: 0 7px; font-size: 9px; font-weight: 800; }
.mk-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 24px; padding: 2px 12px;
  background: linear-gradient(to bottom, var(--grad-top), var(--grad-bot));
  color: var(--bg); border: 1px solid var(--accent-deep); border-radius: 3px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 4px rgba(255, 106, 0, 0.25);
  white-space: nowrap;
}
.mk-chip {
  display: inline-flex; align-items: center;
  background: var(--bg); color: var(--dim);
  border: 1px solid var(--edge); border-radius: 10px;
  padding: 2px 10px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); white-space: nowrap;
}
.mk-winbtns { display: inline-flex; gap: 4px; margin-left: 4px; color: var(--dim); }
.mk-winbtns span {
  width: 22px; height: 22px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 3px; font-size: 11px;
}

/* tab strip */
.mk-tabs {
  display: flex; align-items: stretch;
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding-left: 2px;
}
.mk-tab {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 26px; padding: 4px 12px;
  color: var(--dim); font-size: 11px; letter-spacing: 0.08em;
  border-bottom: 2px solid transparent;
}
.mk-tab .x { color: var(--dim); font-size: 10px; }
.mk-tab.on {
  color: var(--fg);
  border-bottom-color: var(--accent);
  background: linear-gradient(to bottom, rgba(255, 106, 0, 0.05), var(--bg) 55%);
}

/* terminal body — lines PRINT, they never soft-wrap or fade */
.mk-term {
  background: var(--bg);
  padding: 10px 12px 12px 14px;
  font-size: 13px; line-height: 1.5;
  overflow-x: auto; scrollbar-width: thin;
}
.mk-term::-webkit-scrollbar { height: 6px; }
.mk-term::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 4px; }
.mk-term .tline { white-space: pre; word-break: normal; min-height: 1.5em; }
.t-banner { color: var(--accent); }
.t-user { color: var(--t-green); font-weight: 700; }
.t-path { color: var(--t-blue); font-weight: 700; }
.t-dim  { color: var(--dim); }
.t-ok   { color: var(--t-green); }
.t-warn { color: var(--t-yellow); }
.t-err  { color: var(--t-red); }
.t-bolt { color: var(--accent); font-weight: 800; text-shadow: var(--bolt-glow); }
.t-fix  { color: var(--accent); font-weight: 700; }

/* the intercepted command word: boxed the instant the trap fires */
.t-badword {
  outline: 1px solid var(--err);
  outline-offset: 1px;
  background: rgba(248, 81, 73, 0.12);
  border-radius: 2px;
}

/* --------------------------------------------- JS transcript player bits */
.d-hid { visibility: hidden; }            /* lines keep their slot; they print into it */
.tline.d-hid { visibility: hidden; }
.mk-guard.d-hid { visibility: hidden; }
span.d-hid { visibility: hidden; }

.d-type { white-space: pre; }
.d-type.typing::after {
  content: ""; display: inline-block; width: 0.55em; height: 1.1em;
  vertical-align: text-bottom; background: var(--accent); margin-left: 1px;
}

.caret {
  display: inline-block; width: 0.55em; height: 1.15em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: mkblink 1.06s steps(1) infinite;
}
@keyframes mkblink { 50% { opacity: 0; } }

/* key flash when the demo "presses" a strip/guard key */
kbd.press {
  background: linear-gradient(to bottom, var(--grad-top), var(--grad-bot));
  color: var(--bg); border-color: var(--accent-deep);
}

/* ------------------------------------------------------- v1.3 rescue strip
 * GTK revealer bar above the prompt: panel bg, 3px safety-orange seam,
 * zero-token badge. Mirrors the app's result-row values. */
.mk-strip {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 10px;
  background: linear-gradient(to right, rgba(255, 106, 0, 0.07), rgba(255, 106, 0, 0) 30%), var(--panel);
  border-top: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  font-size: 12px; white-space: nowrap; overflow-x: auto; scrollbar-width: thin;
  max-height: 44px;
  transition: max-height 140ms ease, padding 140ms ease, border-width 140ms ease, opacity 140ms ease;
}
.mk-strip:not(.open) {
  max-height: 0; padding-top: 0; padding-bottom: 0;
  border-top-width: 0; opacity: 0; overflow: hidden;
}
.mk-strip .s-fix { color: var(--fg); }
.mk-strip .s-fix b { color: var(--accent); font-weight: 800; }
.mk-strip .s-why { color: var(--dim); font-weight: 400; }
.mk-strip .s-keys { color: var(--dim); font-size: 11px; margin-left: auto; }
.mk-strip .s-keys kbd { font-size: 10px; padding: 0 5px; }
.mk-strip .s-tok {
  flex: none;
  color: var(--ok); border: 1px solid rgba(63, 185, 80, 0.5); border-radius: 10px;
  background: rgba(63, 185, 80, 0.08);
  padding: 0 8px; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; line-height: 1.8;
}

/* ------------------------------------------------------------ v1.3 guard
 * The red veto card: same geometry as the result row, error-red seam. */
.mk-guard {
  margin: 4px 0;
  background: linear-gradient(to right, rgba(248, 81, 73, 0.08), rgba(248, 81, 73, 0) 40%), var(--panel);
  border: 1px solid rgba(248, 81, 73, 0.35);
  border-left: 3px solid var(--err);
  border-radius: 3px;
  padding: 7px 10px 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  font-size: 12.5px;
  max-width: 640px;
}
.mk-guard .g-head {
  display: flex; align-items: center; gap: 8px;
  color: var(--err); font-weight: 800; letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.mk-guard .g-bolt { text-shadow: 0 0 7px rgba(248, 81, 73, 0.55); }
.mk-guard .g-sp { flex: 1; }
.mk-guard .g-tok {
  color: var(--ok); border: 1px solid rgba(63, 185, 80, 0.5); border-radius: 10px;
  background: rgba(63, 185, 80, 0.08);
  padding: 0 8px; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; line-height: 1.8;
}
.mk-guard .g-line { color: var(--dim); padding: 1px 0; white-space: pre-wrap; }
.mk-guard .g-line b { color: var(--err); font-weight: 800; }
.mk-guard .g-line code {
  color: var(--fg); background: var(--raise);
  border: 1px solid var(--edge); border-radius: 3px; padding: 0 4px; font-size: 11px;
}
.mk-guard .g-keys { margin-top: 5px; color: var(--fg); font-size: 11.5px; }
.mk-guard .g-keys .g-note { color: var(--dim); }

/* ---------------------------------------------------------------- AI bar */
.mk-aibar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px;
  background: linear-gradient(to bottom, var(--aibar-glint-top), var(--panel));
  border-bottom: 2px solid var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 3px 10px rgba(0, 0, 0, 0.35);
}
.mk-entry {
  flex: 1; display: flex; align-items: center; gap: 1px;
  min-width: 0;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--edge); border-radius: 3px;
  padding: 5px 8px; font-size: 12px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  white-space: nowrap; overflow: hidden;
}
.mk-entry.focused {
  border-color: var(--accent);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(255, 106, 0, 0.3),
              0 0 10px rgba(255, 106, 0, 0.15);
}
.mk-entry .caret { height: 1.1em; }
.mk-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 10px; min-height: 22px;
  background: var(--raise); color: var(--dim);
  border: 1px solid var(--edge); border-radius: 3px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
}
.mk-toggle.on {
  background: linear-gradient(to bottom, var(--grad-top), var(--grad-bot));
  color: var(--bg); border-color: var(--accent-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.mk-resultwrap { padding: 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
.mk-result {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(to right, rgba(255, 106, 0, 0.07), rgba(255, 106, 0, 0) 30%), var(--bg);
  border: 1px solid var(--edge); border-left: 3px solid var(--accent);
  border-radius: 3px; padding: 6px 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  overflow-x: auto; scrollbar-width: thin;
}
.mk-result .rp {
  color: var(--accent); font-weight: 800;
  text-shadow: 0 0 6px rgba(255, 106, 0, 0.4);
}
.mk-result .cmd { flex: 1; color: var(--fg); font-size: 12px; white-space: nowrap; }
.mk-result .btns { display: inline-flex; gap: 6px; }
.mk-status {
  padding: 4px 10px 8px; background: var(--panel);
  color: var(--dim); font-size: 10px; letter-spacing: 0.08em;
}
.mk-status .ok { color: var(--ok); }

/* --------------------------------------------------------------- sidebar */
.mk-body { display: flex; align-items: stretch; }
.mk-body .mk-term { flex: 1; min-width: 0; }
.mk-sidebar {
  width: 310px; flex: none;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.02);
  display: flex; flex-direction: column;
}
.mk-sidehead {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  background: linear-gradient(to bottom, var(--header-glint-top), var(--panel));
  border-bottom: 1px solid var(--line);
}
.mk-sidehead .title {
  flex: 1; color: var(--dim);
  font-size: 10px; font-weight: 800; letter-spacing: 0.18em;
}
.mk-ctxlist { flex: 1; }
.mk-ctxrow {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: background-color 100ms ease, border-color 100ms ease;
}
.mk-ctxrow:hover {
  background: rgba(255, 255, 255, 0.03);
  border-left-color: rgba(255, 106, 0, 0.4);
}
.mk-check {
  flex: none; width: 14px; height: 14px; margin-top: 2px;
  background: var(--bg);
  border: 1px solid var(--check-border); border-radius: 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  position: relative;
}
.mk-check.on {
  background: linear-gradient(to bottom, var(--grad-top), var(--grad-bot));
  border-color: var(--accent-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.mk-check.on::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid var(--bg); border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}
.mk-ctxrow .meta { flex: 1; min-width: 0; }
.mk-ctxrow .name { color: var(--fg); font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-ctxrow.off .name { color: var(--dim); }
.mk-ctxrow .sub { color: var(--dim); font-size: 10px; letter-spacing: 0.04em; display: flex; gap: 6px; align-items: center; }
.mk-pin {
  flex: none;
  background: rgba(255, 106, 0, 0.14); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 2px;
  padding: 0 4px; font-size: 9px; font-weight: 800; letter-spacing: 0.08em;
  line-height: 1.5;
}
.mk-sidefoot {
  padding: 6px 8px;
  background: linear-gradient(to bottom, var(--panel), #14171b);
  border-top: 1px solid var(--line);
  color: var(--dim); font-size: 10px; letter-spacing: 0.08em;
}
.mk-sidefoot .lit { color: var(--accent); font-weight: 800; }

/* keyboard-shortcut annotation under fragments */
.mk-keyhint {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-size: 10.5px; letter-spacing: 0.06em; color: var(--dim);
  flex-wrap: wrap;
}

/* pipeline flow (typo-rescue stages) */
.pipe { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.pipe .stage {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto; gap: 12px;
  align-items: baseline; padding: 9px 12px;
  background: var(--panel); border-top: 1px solid var(--line);
  font-size: 12px;
}
.pipe .stage:first-child { border-top: none; }
.pipe .stage .st { color: var(--fg); font-weight: 800; font-size: 10px; letter-spacing: 0.14em; }
.pipe .stage .what { color: var(--dim); }
.pipe .stage .lat { color: var(--dim); font-size: 10px; white-space: nowrap; }
.pipe .stage .cost { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; white-space: nowrap; }
.pipe .stage .cost.zero { color: var(--ok); }
.pipe .stage.paid { background: linear-gradient(to right, rgba(255, 106, 0, 0.06), var(--panel) 45%); }
.pipe .stage.paid .cost { color: var(--accent); }

/* responsive mockups: scroll strips keep pixel metrics intact */
@media (max-width: 900px) {
  .mk-sidebar { width: 280px; }
  .pipe .stage { grid-template-columns: 74px minmax(0, 1fr) auto; }
  .pipe .stage .lat { display: none; }
}

/* ----------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .mk-strip { transition: none; }
}
