:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #121620;
  --surface-2: #181d29;
  --surface-3: #202736;
  --border: #293244;
  --text: #edf2f7;
  --muted: #93a0b4;
  --accent: #8b5cf6;
  --accent-2: #20c7b7;
  --danger: #fb7185;
  --warning: #fbbf24;
  --success: #34d399;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, .12), transparent 34rem),
    radial-gradient(circle at top right, rgba(32, 199, 183, .08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: #a78bfa; text-decoration: none; }
a:hover { color: #c4b5fd; }
code {
  background: #090b10;
  border: 1px solid #242c3a;
  border-radius: 6px;
  color: #b7f7ef;
  padding: 2px 6px;
  overflow-wrap: anywhere;
}

.shell { width: min(940px, calc(100% - 32px)); margin: 38px auto 70px; }
.shell.wide { width: min(1500px, calc(100% - 28px)); }
.header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.eyebrow { color: var(--accent-2); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 5px 0 8px; font-size: clamp(25px, 4vw, 34px); letter-spacing: -.025em; }
h2 { margin: 0; font-size: 17px; }
p { color: var(--muted); line-height: 1.55; }
.subtle { color: var(--muted); font-size: 13px; }

.card {
  background: linear-gradient(180deg, rgba(24,29,41,.96), rgba(18,22,32,.96));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.step { padding: 20px; margin-bottom: 14px; }
.step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.step p { margin: 7px 0 15px; font-size: 14px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }

button, .button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  min-height: 38px;
  padding: 9px 14px;
  transition: transform .12s ease, border-color .12s ease, filter .12s ease;
}
button:hover, .button:hover { filter: brightness(1.08); color: white; transform: translateY(-1px); }
button:disabled { cursor: not-allowed; filter: grayscale(.7); opacity: .55; transform: none; }
button.secondary, .button.secondary { background: var(--surface-3); border-color: #3a455a; color: #dce4ef; }
button.ghost, .button.ghost { background: transparent; border-color: #343d50; color: #bcc7d8; }
button.danger { background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.45); color: #fda4af; }

.badge { border-radius: 999px; font-size: 11px; font-weight: 800; padding: 4px 9px; white-space: nowrap; }
.badge.done { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.25); color: var(--success); }
.badge.todo { background: rgba(148,163,184,.08); border: 1px solid rgba(148,163,184,.16); color: #8b98aa; }
.status { min-height: 18px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.ok { color: var(--success) !important; }
.err { color: var(--danger) !important; }
.warn { color: var(--warning) !important; }

.viewer-wrap { display: none; margin-top: 14px; overflow: hidden; }
.viewer-wrap.open { display: block; }
.viewer-bar { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 11px; background: #0d1017; border: 1px solid var(--border); border-bottom: 0; border-radius: 10px 10px 0 0; }
.viewer-frame { width: 100%; height: min(68vh, 700px); border: 1px solid var(--border); border-radius: 0 0 10px 10px; background: #050608; }
.notice { background: rgba(251,191,36,.07); border: 1px solid rgba(251,191,36,.2); border-radius: 9px; color: #d7c27c; font-size: 12px; margin-top: 12px; padding: 10px 12px; }

.toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 12px; margin-bottom: 12px; backdrop-filter: blur(15px); background: rgba(11,13,18,.88); border: 1px solid var(--border); border-radius: 12px; }
.table-card { overflow: auto; max-height: calc(100vh - 235px); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
th, td { border-bottom: 1px solid #242c39; padding: 8px; text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 3; background: #161b26; color: #b8c3d3; border-bottom: 1px solid #394459; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; }
tbody tr:hover { background: rgba(139,92,246,.05); }
.excluded { opacity: .38; }

input[type="text"], input[type="number"], select {
  width: 100%; min-height: 34px; background: #0d1118; border: 1px solid #30394a; border-radius: 6px; color: var(--text); font: inherit; padding: 6px 8px; outline: none;
}
input:focus, select:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.12); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.score-high { color: var(--success); font-weight: 800; }
.score-mid { color: var(--warning); font-weight: 800; }
.score-low { color: var(--danger); font-weight: 800; }
.url-cell { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6f7d91; font-size: 10px; }

@media (max-width: 720px) {
  .shell { width: min(100% - 20px, 940px); margin-top: 20px; }
  .header { display: block; }
  .step { padding: 16px; }
  .viewer-frame { height: 58vh; }
}
