:root {
  --bg: #0f1218;
  --panel: #171b24;
  --panel2: #1d2230;
  --line: #2a3142;
  --ink: #e6e9ef;
  --muted: #8b93a7;
  --accent: #f0b90b;
  --blue: #6c7cff;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --radius: 10px;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f4f6fa; --panel: #ffffff; --panel2: #f0f2f7; --line: #dfe3ec; --ink: #1b2130; --muted: #5d667a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel2); border-radius: 8px; padding: 6px 12px; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600; }
button.danger { border-color: var(--red); color: var(--red); background: transparent; }
button.link { border: 0; background: none; color: var(--muted); padding: 4px 6px; }
button.small { padding: 3px 8px; font-size: 12px; }
input, select, textarea { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; min-width: 0; }
textarea { width: 100%; min-height: 110px; resize: vertical; font-family: Consolas, monospace; font-size: 13px; }
input[type=checkbox] { width: 16px; height: 16px; }
a { color: var(--blue); }
code, .mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1em; }
.ok { color: var(--green); }
.warn { color: var(--orange); }
.bad { color: var(--red); }
.hidden { display: none !important; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .2px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav button { border: 0; background: none; color: var(--muted); padding: 6px 10px; }
nav button.on { color: var(--ink); background: var(--panel2); }
.top-right { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.pill.bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.pill.warn { color: var(--orange); border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); }
.pill.live { color: #111; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.banner { margin: 10px 16px 0; padding: 10px 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--orange) 16%, var(--panel)); border: 1px solid color-mix(in srgb, var(--orange) 45%, var(--line)); }
main { padding: 14px 16px 40px; max-width: 1400px; margin: 0 auto; }
section > h2 { margin: 6px 0 12px; font-size: 18px; }
h3 { margin: 0 0 8px; font-size: 15px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card + .card, .block { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.space { flex: 1; }
.big { font-size: 20px; font-weight: 650; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.kv > :nth-child(odd) { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel2); }
.long { color: var(--green); font-weight: 600; }
.short { color: var(--red); font-weight: 600; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.msg { white-space: pre-wrap; word-break: break-word; max-height: 7.5em; overflow: hidden; color: var(--muted); font-size: 12.5px; }
.form { display: grid; grid-template-columns: minmax(150px, 260px) 1fr; gap: 8px 14px; align-items: center; }
.form .help { grid-column: 2; color: var(--muted); font-size: 12px; margin-top: -4px; }
.form input[type=number] { width: 120px; }
.steps { margin: 6px 0 0 18px; padding: 0; }
.steps li { margin: 4px 0; }
.pub { width: 100%; min-height: 86px; }
.notes { max-height: 340px; overflow: auto; }
.note { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.note time { color: var(--muted); font-size: 12px; margin-right: 6px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 10px; }
.login-card h1 { font-size: 18px; margin: 0; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal-box { width: min(860px, 100%); max-height: 88vh; overflow: auto; position: relative; }
.modal-close { position: absolute; right: 8px; top: 6px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; z-index: 30; max-width: min(92vw, 640px); }
.pc-only { font-size: 12px; color: var(--muted); }
@media (max-width: 700px) {
  .top { gap: 8px; padding: 8px 10px; }
  main { padding: 10px; }
  .form { grid-template-columns: 1fr; }
  .form .help { grid-column: 1; }
  th:nth-child(n+7), td:nth-child(n+7) { display: none; }
}
