:root {
  --bg: #0f1216;
  --panel: #171c23;
  --line: #2a323d;
  --text: #e7ecf3;
  --muted: #9aa7b8;
  --accent: #4a9eff;
  --ok: #3ddc97;
  --warn: #ffb454;
  --err: #ff6b6b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}
header strong { font-size: 15px; }
header .meta { color: var(--muted); font-size: 12px; }
main { display: grid; grid-template-columns: 1fr 480px; gap: 18px; padding: 18px; max-width: 1500px; }
@media (max-width: 1100px) { main { grid-template-columns: 1fr; } }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
input, select, textarea, button {
  font: inherit;
  color: var(--text);
  background: #0c1014;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  width: 100%;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { background: var(--accent); border-color: var(--accent); color: #04121f; font-weight: 600; cursor: pointer; width: auto; padding: 9px 16px; }
button.ghost { background: transparent; color: var(--text); border-color: var(--line); font-weight: 400; }
button:disabled { opacity: .5; cursor: not-allowed; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.field.req label::after { content: " *"; color: var(--err); }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.row { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: #1f5c47; }
.pill.warn { color: var(--warn); border-color: #5c4a1f; }
.pill.err { color: var(--err); border-color: #5c1f1f; }
.results { border: 1px solid var(--line); border-radius: 8px; max-height: 260px; overflow: auto; margin-top: 8px; }
.results div { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.results div:hover { background: #10161d; }
.results div:last-child { border-bottom: 0; }
.chosen { background: #10161d; border: 1px solid var(--accent); border-radius: 8px; padding: 10px; margin-top: 8px; }
#log { background: #0a0d11; border: 1px solid var(--line); border-radius: 8px; padding: 10px; height: 340px; overflow: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
#log .e { color: var(--err); }
#log .w { color: var(--warn); }
#log .s { color: var(--ok); }
.piece-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.muted { color: var(--muted); }
.err { color: var(--err); }
.ok { color: var(--ok); }
a { color: var(--accent); }
img.shot { width: 100%; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.login { max-width: 360px; margin: 10vh auto; }
.login .field { margin-bottom: 12px; }
.login button { width: 100%; }
code { background: #0a0d11; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
