:root {
  color-scheme: dark;
  --bg: #0e1013;
  --panel: #15181d;
  --line: #262b33;
  --ink: #d8dee9;
  --dim: #7c8798;
  --accent: #7fd1b9;
  --hot: #e0806a;
  --warn: #d8b45a;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 13px/1.5 var(--mono);
}
header {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
}
h1 { font-size: 15px; margin: 0; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
h2 { font-size: 12px; margin: 0; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.spacer { flex: 1; }
.sub, .hint { color: var(--dim); font-size: 12px; }
.knob { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12px; }
.knob input[type=range] { width: 110px; }
.knob input[type=number], .knob input[type=text] {
  width: 52px; background: #0b0d10; color: var(--ink); border: 1px solid var(--line);
  border-radius: 3px; padding: 3px 5px; font: inherit;
}
.knob input[type=text] { width: 28px; text-align: center; }

button {
  background: #1c2129; color: var(--ink); border: 1px solid var(--line);
  border-radius: 3px; padding: 5px 11px; font: inherit; cursor: pointer;
}
button:hover { border-color: var(--accent); color: #fff; }
button:disabled { opacity: .45; cursor: default; border-color: var(--line); }
button.primary { border-color: var(--accent); color: var(--accent); }
button.danger:hover { border-color: var(--hot); color: var(--hot); }

main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; align-items: start; }
@media (max-width: 1080px) { main { grid-template-columns: minmax(0, 1fr); } }
section { padding: 14px 16px 24px; min-width: 0; }
.inspector { border-left: 1px solid var(--line); min-height: 100vh; }
.bar { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 8px; }
.bar:first-child { margin-top: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }

/* --- pads --- */
.pads { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pad {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: 8px 9px; cursor: pointer; text-align: left; display: block; width: 100%;
  transition: border-color .08s, background .08s;
}
.pad:hover { border-color: var(--accent); }
.pad.sel { border-color: var(--accent); background: #172028; }
.pad.hit { background: #24343a; }
.pad .n { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.pad .name { color: var(--ink); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad .key {
  color: var(--accent); border: 1px solid var(--line); border-radius: 3px;
  padding: 0 4px; font-size: 10px; text-transform: uppercase;
}
.pad .nums { color: var(--dim); font-size: 11px; margin-top: 3px; display: flex; gap: 10px; justify-content: space-between; white-space: nowrap; }
.pad .nums .hotter { color: var(--warn); }
.pad .nums .clip { color: var(--hot); }
.bands { display: flex; height: 4px; margin-top: 6px; border-radius: 2px; overflow: hidden; background: #0b0d10; }
.bands i { display: block; height: 100%; }

/* --- prompt / history --- */
textarea {
  width: 100%; background: #0b0d10; color: var(--ink); border: 1px solid var(--line);
  border-radius: 3px; padding: 8px; font: inherit; resize: vertical;
}
.code { font-size: 12px; line-height: 1.45; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.history { list-style: none; margin: 10px 0 0; padding: 0; }
.history li {
  border-left: 2px solid var(--line); padding: 4px 0 4px 9px; margin-bottom: 5px;
  cursor: pointer; color: var(--dim);
}
.history li:hover { border-left-color: var(--accent); color: var(--ink); }
.history li.cur { border-left-color: var(--accent); color: var(--ink); }
.history .t { color: var(--ink); }
.history .m { font-size: 11px; }

/* --- inspector --- */
.views { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
@media (max-width: 720px) { .views { grid-template-columns: 1fr; } }
figure { margin: 0; }
figcaption { color: var(--dim); font-size: 11px; margin-bottom: 4px; }
canvas { width: 100%; height: 120px; background: #0b0d10; border: 1px solid var(--line); border-radius: 3px; display: block; }

table.measure { border-collapse: collapse; width: 100%; margin: 6px 0 2px; font-size: 12px; }
table.measure td { padding: 2px 10px 2px 0; color: var(--dim); white-space: nowrap; }
table.measure td.v { color: var(--ink); }
table.measure td.warn { color: var(--warn); }
table.measure td.bad { color: var(--hot); }

.params { display: grid; gap: 6px; }
.param { display: grid; grid-template-columns: 120px 1fr 84px; gap: 8px; align-items: center; }
.param label { color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.param output { color: var(--ink); text-align: right; font-size: 12px; }
.param input[type=range] { width: 100%; }

.diff { background: #0b0d10; border: 1px solid var(--line); border-radius: 3px; padding: 8px; overflow-x: auto; font-size: 12px; }
.diff .add { color: var(--accent); }
.diff .del { color: var(--hot); }
.diff .ctx { color: var(--dim); }
details summary { color: var(--dim); cursor: pointer; margin: 10px 0 6px; }
.warnings { color: var(--warn); font-size: 12px; margin: 6px 0; }
.err { color: var(--hot); }

/* --- bake-off comparison --- */
.compare { display: grid; gap: 12px; }
.cmp-row { border-left: 2px solid var(--line); padding-left: 10px; }
.cmp-row .q { color: var(--ink); font-size: 12px; margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; }
.cmp-row .q button { padding: 2px 8px; font-size: 11px; }
.cmp-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cmp-cells .pad .model { color: var(--accent); font-size: 11px; }
.pad .verdict { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.pad .verdict.pass { color: var(--accent); }
.pad .verdict.lint { color: var(--warn); }
.pad .verdict.bad { color: var(--hot); }
.pad .keep { margin-top: 6px; font-size: 11px; padding: 2px 8px; }
select { background: #0b0d10; color: var(--ink); border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; font: inherit; max-width: 320px; }
