:root {
  --bg: #111318;
  --card: #1b1e26;
  --border: #2a2e38;
  --text: #e8e9ec;
  --muted: #9198a6;
  --accent: #5b8def;
  --good: #3ecf8e;
  --bad: #e0575b;
  --warn: #e0a53e;
}

* { box-sizing: border-box; }

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

header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

header h1 { margin: 0 0 6px; font-size: 18px; }

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.header-meta .logout {
  color: var(--accent);
  margin-left: auto;
  text-decoration: none;
}

main {
  padding: 12px 16px 48px;
  max-width: 720px;
  margin: 0 auto;
}

section {
  margin-bottom: 28px;
}

section h2 {
  font-size: 16px;
  margin: 0 0 4px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 10px;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

/* Thin-data rows (e.g. best-time-to-post on a day with too few real posts
   to trust the pick the same as a day with 5-6) -- a real number, not
   hidden, but must not look as solid as every other row at a glance. */
tr.thin-data td {
  opacity: 0.6;
  border-left: 2px solid var(--warn);
}

.thin-badge {
  background: var(--warn);
  color: #2b1a04;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table th, table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.video-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.video-title { font-weight: 600; }
.video-meta { color: var(--muted); font-size: 12px; margin-bottom: 8px; }

.velocity-table td { text-align: center; }
.velocity-table td.low-confidence { color: var(--muted); font-style: italic; }

.gate-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.gate-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.gate-card.unlocked { border-color: var(--good); }

.gate-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
}

.gate-card.unlocked .badge {
  background: var(--good);
  color: #06231a;
}

.gate-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
}

.gate-card.unlocked .bar-fill { background: var(--good); }

/* Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card h1 { font-size: 18px; margin: 0 0 4px; text-align: center; }

.login-card input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
}

.login-card button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

.login-card .error { color: var(--bad); font-size: 13px; margin: 0; }
