:root {
  --bg: #0a0b0d;
  --bg2: #0e1014;
  --panel: #12141a;
  --panel2: #171a21;
  --line: #23272f;
  --line2: #2e333d;
  --text: #e7e9ef;
  --muted: #878d9e;
  --accent: #7cf7c4;
  --accent-dim: #1f4d3d;
  --good: #58e08a;
  --warn: #ffcf5c;
  --bad: #ff6b6b;
  --info: #7cc4f7;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 400px at 12% -10%, rgba(124, 247, 196, 0.07), transparent 60%),
    radial-gradient(700px 350px at 95% 0%, rgba(124, 196, 247, 0.05), transparent 55%),
    var(--bg);
}

.mono { font-family: var(--mono); font-size: 12.5px; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- topbar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: baseline; gap: 12px; }

.mark {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
}

.tag { font-size: 12.5px; color: var(--muted); letter-spacing: 0.4px; }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(135, 141, 158, 0.12);
}
.status.ok .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(88, 224, 138, 0.15); }
.status.bad .dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15); }

/* ------------------------------------------------------------------ tabs */
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  padding: 12px 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }

main { padding: 22px 24px 60px; max-width: 1220px; margin: 0 auto; }
.panel { display: none; }
.panel.on { display: block; }

/* ------------------------------------------------------------------ bar */
.bar { display: flex; gap: 10px; }

input[type=text], textarea, select {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 12px 13px;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input[type=text]:focus, textarea:focus, select:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(124, 247, 196, 0.09);
}
textarea { min-height: 300px; resize: vertical; line-height: 1.5; }

.go {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #04120d;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.3px;
  padding: 0 22px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .15s, opacity .15s;
}
.go:hover { filter: brightness(1.08); }
.go:disabled { opacity: .5; cursor: default; }

.ghost {
  appearance: none;
  background: var(--panel);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 14px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.ghost:hover:not(:disabled) { border-color: var(--accent-dim); color: var(--accent); }
.ghost:disabled { opacity: .45; cursor: default; }

/* ----------------------------------------------------------------- opts */
.opts {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 14px 2px 24px;
  font-size: 12.5px;
  color: var(--muted);
}
.chk { display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.chk input { accent-color: var(--accent); }
.sel { display: flex; align-items: center; gap: 8px; }
.sel select { width: auto; padding: 7px 9px; font-size: 12px; }
.hint { color: #5e6474; flex: 1 1 260px; min-width: 200px; }

/* --------------------------------------------------------------- result */
.result.empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 26px;
}
.placeholder { color: var(--muted); margin: 0; font-size: 13.5px; }

.result:not(.empty) { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.verdict-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  flex-wrap: wrap;
}

.verdict-main { display: flex; flex-direction: column; gap: 4px; min-width: 180px; }
.verdict-label {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.verdict-sub { font-size: 12.5px; color: var(--muted); font-family: var(--mono); word-break: break-all; }

.score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 2px solid var(--line2);
  font-family: var(--mono);
  flex: 0 0 auto;
}
.score b { font-size: 21px; line-height: 1; }
.score span { font-size: 9.5px; color: var(--muted); letter-spacing: 1px; }

.spacer { flex: 1 1 40px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 14px;
}
.metric { background: var(--panel); padding: 12px 14px; }
.metric .k { font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); }
.metric .v { font-family: var(--mono); font-size: 15px; margin-top: 3px; word-break: break-all; }

.blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 780px) { .blocks { grid-template-columns: 1fr; } }

.block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.block h3 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.block ul { margin: 0; padding-left: 17px; font-size: 13px; }
.block li { margin-bottom: 5px; }
.block li.none { list-style: none; margin-left: -17px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  color: var(--muted);
  white-space: nowrap;
}
.chip.on { border-color: var(--accent-dim); color: var(--accent); background: rgba(124, 247, 196, .06); }
.chip.v-play { color: var(--good); border-color: rgba(88,224,138,.35); }
.chip.v-menu { color: var(--info); border-color: rgba(124,196,247,.35); }
.chip.v-black, .chip.v-blank { color: var(--warn); border-color: rgba(255,207,92,.35); }
.chip.v-ad { color: #ff9f5c; border-color: rgba(255,159,92,.35); }
.chip.v-dead, .chip.v-blocked, .chip.v-empty, .chip.v-error { color: var(--bad); border-color: rgba(255,107,107,.35); }

details.raw { margin-top: 14px; }
details.raw summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  padding: 6px 0;
}
details.raw pre {
  background: #07080a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  overflow: auto;
  max-height: 420px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #b9c0d0;
  margin: 0;
}

/* -------------------------------------------------------------- preview */
.preview {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg2);
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.preview-head .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame { position: relative; width: 100%; aspect-ratio: 16 / 10; background: #000; }
.frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.frame-host { width: 100%; height: 100%; }
.frame-host iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------------------------------------------------------------- batch */
.batch-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 860px) { .batch-grid { grid-template-columns: 1fr; } }

.lbl {
  display: block;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 600;
}
.side { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; }
.fine { font-size: 12px; color: #5e6474; margin: 0; }
.side .sel select { padding: 9px; }

.tablewrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  max-height: 70vh;
  background: var(--panel);
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel2);
  z-index: 1;
  font-weight: 600;
}
td { padding: 9px 12px; border-bottom: 1px solid #1a1d24; font-family: var(--mono); }
tbody tr:hover td { background: #151820; }
td.link { font-family: var(--mono); color: #b9c0d0; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.link a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--line2); }

.batch-host {
  position: fixed;
  left: 0; top: 0;
  width: 960px; height: 640px;
  opacity: 0.015;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.batch-host iframe { width: 960px; height: 640px; border: 0; }

/* ---------------------------------------------------------------- about */
.about { max-width: 760px; }
.about h2 { font-size: 15px; letter-spacing: .3px; margin: 26px 0 8px; }
.about h2:first-child { margin-top: 0; }
.about p, .about li { font-size: 13.5px; color: #b3b9c7; }
.about ul { padding-left: 18px; }
.about li { margin-bottom: 7px; }
.about b { color: var(--text); }
