:root {
  --bg: #0d1117;
  --panel: #161b22;
  --line: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #3fb950;
  --accent-2: #58a6ff;
  --warn: #d29922;
  --danger: #f85149;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(63, 185, 80, .12), transparent 50%),
    var(--bg);
  color: var(--text);
}

.topbar, .card, input, select, textarea, button {
  border: 1px solid var(--line);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: rgba(22, 27, 34, .92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
}

h1, h2 { margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }

.top-actions, .section-head, .row-actions, .inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
}

.settings, .logs { grid-column: 1 / -1; }

.card {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.section-head { justify-content: space-between; margin-bottom: 12px; }

.grid-3 .span-2 { grid-column: span 2; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

label, .hint { color: var(--muted); font-size: 13px; }
label { display: flex; flex-direction: column; gap: 6px; }
.hint { margin: 12px 0 0; }

input, select, textarea, button {
  background: #0d1117;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

textarea { width: 100%; resize: vertical; }

button {
  cursor: pointer;
  background: #21262d;
}
button.primary { background: var(--accent); color: #04160a; font-weight: 700; border-color: transparent; }
button.ghost { background: transparent; }
button.danger { color: var(--danger); }
button.stop-votes { border-color: var(--danger); font-weight: 600; }
button.stop-votes:not([hidden]) { margin-left: 0.35rem; }
.proxy-all-tag { color: var(--accent); font-size: 0.85em; font-weight: 600; }
.hint { margin: 0 0 0.75rem; font-size: 0.9rem; opacity: 0.85; }
button:disabled { opacity: .55; cursor: wait; }

.check { flex-direction: row; align-items: center; color: var(--text); }
.pill {
  background: #21262d;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}

.inline-form, .bulk-form { margin-bottom: 12px; }
.inline-form { flex-wrap: wrap; }
.inline-form input, .inline-form select { flex: 1; min-width: 120px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d1117;
}
.item b { display: block; }
.item small { color: var(--muted); word-break: break-all; }
.status { font-size: 12px; font-weight: 700; }
.status.success { color: var(--accent); }
.status.later, .status.captcha, .status.unknown { color: var(--warn); }
.status.error, .status.blocked { color: var(--danger); }

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow: auto;
  font-size: 13px;
}
.log-list li { padding: 6px 0; border-bottom: 1px solid #21262d; color: var(--muted); }
.log-list .success { color: var(--accent); }
.log-list .error { color: var(--danger); }
.log-list .warn { color: var(--warn); }

.preview { margin-bottom: 12px; }
.preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
  pointer-events: none;
  user-select: none;
}
.preview .hint { margin: 0 0 8px; }
.hidden { display: none; }

@media (max-width: 980px) {
  .layout, .grid-3 { grid-template-columns: 1fr; }
  .settings, .logs { grid-column: auto; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
