*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #0d1117;
  --bg2:     #161b22;
  --bg3:     #21262d;
  --border:  #30363d;
  --accent:  #58a6ff;
  --green:   #3fb950;
  --red:     #f85149;
  --orange:  #e3a435;
  --text:    #e6edf3;
  --text2:   #8b949e;
  --radius:  8px;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system,'Segoe UI',system-ui,sans-serif; font-size: 14px; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.layout {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.logo { font-weight: 700; font-size: 15px; }
#cookie-dot-wrap { display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-red   { background: var(--red); }
.dot-green { background: var(--green); }
.dot-label { font-size: 12px; color: var(--text2); }

/* ── URL section ─────────────────────────────────────────────────────────── */
.url-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.url-row { display: flex; gap: 8px; align-items: center; }
.url-row input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.url-row input:focus { border-color: var(--accent); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent);  color: #000; }
.btn-danger  { background: var(--red);     color: #fff; }
.btn-orange  { background: var(--orange);  color: #000; }
.btn-green   { background: var(--green);   color: #000; }
.btn-ghost   { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs  { padding: 3px 8px;  font-size: 11px; }
.hidden  { display: none !important; }

/* ── Stats bar ───────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.stat-box {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg2);
  text-align: center;
}
.stat-val { font-size: 22px; font-weight: 700; line-height: 1; }
.stat-lbl { font-size: 11px; color: var(--text2); margin-top: 3px; text-transform: uppercase; letter-spacing: .5px; }
.stat-box.success .stat-val { color: var(--green); }
.stat-box.error   .stat-val { color: var(--red); }
.stat-box.pending .stat-val { color: var(--orange); font-size: 13px; padding-top: 4px; }

/* ── Main content (2 panels) ─────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  overflow: hidden;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
.results-panel { border-right: none; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.badge-count {
  background: var(--bg3);
  color: var(--text2);
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 11px;
}

/* ── Console ─────────────────────────────────────────────────────────────── */
.console {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: 'Cascadia Code','Fira Code','Consolas',monospace;
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--bg);
}

.log-line { display: flex; gap: 8px; align-items: baseline; }
.log-ts   { color: var(--text2); font-size: 11px; flex-shrink: 0; }
.log-msg  { word-break: break-word; }

.log-line.info    .log-msg { color: var(--text2); }
.log-line.ok      .log-msg { color: var(--green); }
.log-line.err     .log-msg { color: var(--red); }
.log-line.warn    .log-msg { color: var(--orange); }
.log-line.step    .log-msg { color: var(--accent); }
.log-line.done    .log-msg { color: var(--green); font-weight: 600; }
.log-line.paused  .log-msg { color: var(--orange); font-weight: 600; }

/* ── Results table ───────────────────────────────────────────────────────── */
.table-wrap { flex: 1; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { padding: 8px 12px; color: var(--text2); font-weight: 600; border-bottom: 1px solid var(--border); text-align: left; position: sticky; top: 0; background: var(--bg2); }
td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }
td:nth-child(2) { color: var(--orange); white-space: nowrap; }
td:nth-child(1) { color: var(--text2); font-size: 11.5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td:nth-child(3) { font-size: 12px; }

/* ── Settings panel ──────────────────────────────────────────────────────── */
#settings-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; }
#settings-panel {
  position: fixed; top: 0; right: 0; width: 380px; height: 100%;
  background: var(--bg2); border-left: 1px solid var(--border);
  z-index: 101; padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.settings-header { display: flex; justify-content: space-between; align-items: center; }
.settings-header h3 { font-size: 15px; }
.settings-header button { background: none; border: none; color: var(--text2); font-size: 18px; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--text2); line-height: 1.5; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-red   { background: rgba(248,81,73,.12); color: var(--red);   border: 1px solid rgba(248,81,73,.3); }
.badge-green { background: rgba(63,185,80,.12); color: var(--green); border: 1px solid rgba(63,185,80,.3); }
textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); padding: 10px 12px;
  font-size: 11.5px; font-family: 'Fira Code',monospace; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }
.settings-actions { display: flex; gap: 10px; }
