:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

header h1 { margin: 0; font-size: 1.4rem; }
.subtitle { color: var(--muted); margin: 0.25rem 0 0; font-size: 0.9rem; }

main { padding: 1.5rem 2rem; max-width: 1000px; margin: 0 auto; }

section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.hidden { display: none !important; }

#user-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 2rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}
#user-bar button { width: auto; padding: 0.3rem 0.75rem; font-size: 0.8rem; }

#login-panel, #enroll-panel, #backup-codes-panel, #verify-2fa-panel {
  max-width: 440px;
  margin: 2rem auto;
}
#login-panel h2, #enroll-panel h2, #backup-codes-panel h2, #verify-2fa-panel h2 { margin-top: 0; }

.warning {
  background: #422006;
  border: 1px solid var(--warn);
  color: #fde68a;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

#enroll-panel code, #verify-2fa-panel code {
  display: inline-block;
  background: #0b1220;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  word-break: break-all;
  font-size: 0.8rem;
}
#enroll-panel code + button, #verify-2fa-panel code + button {
  width: auto;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  margin-left: 0.4rem;
}

#backup-codes-list {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.8;
}

#use-backup-code-link { color: var(--accent); font-size: 0.85rem; }

label { display: block; margin-bottom: 0.75rem; font-size: 0.85rem; color: var(--muted); }
input, textarea, button {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  width: 100%;
}
input[type="password"] { width: 220px; }
button {
  width: auto;
  cursor: pointer;
  background: var(--accent);
  color: #04202f;
  border: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
}
button:hover { opacity: 0.9; }

.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.panel-header h2 { margin: 0; }
.panel-header a { color: var(--accent); text-decoration: none; margin-left: 0.75rem; }

.article-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.article-card h3 { margin: 0 0 0.25rem; }
.article-card .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.75rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; }

.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.75rem; }
.badge-dense { background: #1e3a8a; color: #bfdbfe; }
.badge-sparse { background: #334155; color: var(--muted); }
.score-ok { color: var(--ok); }
.score-warn { color: var(--warn); }
.score-bad { color: var(--bad); }

#new-article-status, #login-status, #enroll-status, #verify-status, #extract-url-status {
  font-size: 0.85rem;
  color: var(--muted);
}
