:root {
  --bg: #0d1117; --panel: #161b22; --panel2: #1c2330; --border: #2b3440;
  --text: #e6edf3; --muted: #8b949e; --accent: #6ea8fe; --accent2: #58d6a0;
  --low: #2ea043; --medium: #d29922; --high: #f85149;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); }
header { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--panel); }
.brand { font-size: 18px; font-weight: 600; }
.tag { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.key { display: flex; align-items: center; gap: 8px; }
.key label { color: var(--muted); font-size: 12px; }
.key input { background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 6px 8px; width: 220px; }

main { display: grid; grid-template-columns: 240px 1fr 1.2fr; height: calc(100vh - 57px); }
.col { border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.col.detail { border-right: none; overflow-y: auto; }
.col-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border); }
.col-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 0; }
.addr { font-size: 12px; color: var(--accent); }

.list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.list li { padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.list li:hover { background: var(--panel); }
.list li.active { background: var(--panel2); }
.list .li-top { display: flex; justify-content: space-between; gap: 8px; }
.list .li-from { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .li-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .li-prev { color: var(--muted); font-size: 12px; }

.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #07101f; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }

.detail-body { padding: 16px; }
.muted { color: var(--muted); }
.panel { padding: 16px; border-top: 1px solid var(--border); }
.panel h3 { margin: 0 0 10px; font-size: 14px; }
.panel input, .panel textarea { width: 100%; margin-bottom: 8px; background: var(--bg);
  border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px; font: inherit; }
.row { display: flex; gap: 8px; }
.samples { margin-top: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip { background: transparent; border: 1px solid var(--border); color: var(--accent);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.badge.low { background: rgba(46,160,67,.18); color: var(--low); }
.badge.medium { background: rgba(210,153,34,.18); color: var(--medium); }
.badge.high { background: rgba(248,81,73,.2); color: var(--high); }
.badge.otp { background: rgba(110,168,254,.18); color: var(--accent); }

.score-bar { height: 8px; border-radius: 4px; background: var(--panel2); overflow: hidden; margin: 8px 0; }
.score-fill { height: 100%; }
.flag { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 6px; background: var(--panel); }
.flag .flag-code { font-family: ui-monospace, monospace; font-size: 12px; color: var(--high); }
.flag .flag-detail { font-size: 13px; color: var(--text); }
.kv { margin: 4px 0; } .kv b { color: var(--muted); font-weight: 500; }
.body-box { background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px; margin-top: 10px; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow-y: auto; }
.reco { border-left: 3px solid var(--accent); padding: 8px 12px; margin: 10px 0; background: var(--panel); border-radius: 0 6px 6px 0; }
