/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --bg:           #0c0e14;
  --surface:      #13161f;
  --surface-2:    #1a1e2b;
  --surface-3:    #222738;
  --border:       #272d3f;
  --border-light: #2e3549;

  --text:         #e8edf8;
  --text-muted:   #7a85a8;
  --text-dim:     #4a5370;

  --accent:       #f0a500;
  --accent-glow:  rgba(240,165,0,0.2);
  --accent-dim:   rgba(240,165,0,0.09);

  --series-jan:   #3b7dd8;
  --series-may:   #22c97a;
  --series-oct:   #e06c75;

  --status-notdone:   #4a5370;
  --status-inprog:    #3b7dd8;
  --status-done:      #22c97a;
  --status-reviewed:  #a06bf5;

  --gold:   #f0a500;
  --silver: #9eaabf;
  --bronze: #cd7c44;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;

  --font-display: 'Syne', sans-serif;
  --font-body:    'Outfit', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  background-image: radial-gradient(ellipse 80% 40% at 50% -10%, rgba(240,165,0,0.07) 0%, transparent 70%);
}

/* ── Auth Overlay ────────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,9,14,0.93);
  backdrop-filter: blur(8px);
  padding: 1rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.65), 0 0 0 1px rgba(240,165,0,0.08);
  animation: fadeUp 0.3s ease both;
}

.auth-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
  margin-bottom: 0.4rem;
}

.auth-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.auth-tabs {
  display: flex; gap: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 3px; margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1; background: none; border: none;
  color: var(--text-muted); font-family: var(--font-body);
  font-size: 0.875rem; font-weight: 500;
  padding: 0.45rem; border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.auth-tab.active { background: var(--surface-3); color: var(--text); }

.auth-msg {
  font-size: 0.82rem; font-family: var(--font-mono);
  padding: 0.6rem 0.8rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; line-height: 1.4;
}
.auth-msg--error   { background: rgba(224,108,117,0.12); border: 1px solid rgba(224,108,117,0.3); color: #e8848a; }
.auth-msg--success { background: rgba(34,201,122,0.1);   border: 1px solid rgba(34,201,122,0.3);  color: #5edea5; }

.auth-form { display: flex; flex-direction: column; gap: 0.85rem; }

.auth-field { display: flex; flex-direction: column; gap: 0.4rem; }
.auth-field label {
  font-size: 0.72rem; font-family: var(--font-mono);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}
.auth-field input {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem; font-family: var(--font-body); font-size: 0.9rem;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.auth-submit {
  background: var(--accent); color: #0c0e14; border: none;
  border-radius: var(--radius-sm); padding: 0.65rem;
  font-family: var(--font-display); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; width: 100%; margin-top: 0.25rem;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.auth-submit:hover  { background: #ffb520; box-shadow: 0 0 20px var(--accent-glow); }
.auth-submit:active { transform: scale(0.99); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Leaderboard Modal ───────────────────────────────────────────────────── */
.lb-overlay {
  position: fixed; inset: 0; z-index: 998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,9,14,0.88);
  backdrop-filter: blur(8px);
  padding: 1rem;
}

.lb-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%; max-width: 480px;
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: fadeUp 0.25s ease both;
}

.lb-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.3rem;
}

.lb-title {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
}

.lb-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1rem; cursor: pointer; padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm); transition: color 0.15s, background 0.15s;
}
.lb-close:hover { color: var(--text); background: var(--surface-2); }

.lb-subtitle {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-dim); margin-bottom: 1.2rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.lb-loading { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.82rem; text-align: center; padding: 2rem 0; }

.lb-list { display: flex; flex-direction: column; gap: 0.5rem; }

.lb-row {
  display: flex; align-items: center; gap: 0.85rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.65rem 1rem;
  transition: border-color 0.15s;
}
.lb-row:hover { border-color: var(--border-light); }
.lb-row.lb-me { border-color: var(--accent); background: var(--accent-dim); }

.lb-rank {
  font-family: var(--font-display); font-size: 0.9rem; font-weight: 700;
  width: 28px; text-align: center; flex-shrink: 0;
}
.lb-rank.rank-1 { color: var(--gold); }
.lb-rank.rank-2 { color: var(--silver); }
.lb-rank.rank-3 { color: var(--bronze); }
.lb-rank.rank-other { color: var(--text-dim); }

.lb-name {
  flex: 1; font-family: var(--font-body); font-size: 0.9rem;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-name .you-tag {
  font-family: var(--font-mono); font-size: 0.65rem; color: var(--accent);
  background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: 999px; padding: 0.1rem 0.4rem; margin-left: 0.4rem;
  vertical-align: middle;
}

.lb-score {
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--status-done); font-weight: 500; flex-shrink: 0;
}
.lb-score-label {
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-dim); margin-left: 0.2rem;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(12,14,20,0.9);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 100;
}

.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}

.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  color: var(--text); white-space: nowrap; flex-shrink: 0;
}
.logo-mark { color: var(--accent); font-size: 1.2rem; }

.tagline {
  font-size: 0.75rem; color: var(--text-dim);
  font-family: var(--font-mono); letter-spacing: 0.02em;
  border-left: 1px solid var(--border-light); padding-left: 1rem;
  white-space: nowrap;
}

.header-actions {
  display: flex; align-items: center; gap: 0.75rem;
  margin-left: auto; flex-shrink: 0;
}

/* Paper counter */
.paper-counter {
  display: flex; align-items: center; gap: 0.35rem;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: 999px; padding: 0.28rem 0.75rem;
  cursor: default;
}
.paper-counter-icon { font-size: 0.8rem; line-height: 1; }
.paper-counter-val  { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; color: var(--accent); }
.paper-counter-label { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim); }

/* Leaderboard button */
.lb-btn {
  display: flex; align-items: center; gap: 0.35rem;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: 999px; padding: 0.28rem 0.85rem;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted);
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.lb-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Beta testers */
.beta-testers { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.beta-label { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.beta-avatars { display: flex; align-items: center; }

.beta-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--av-color) 15%, transparent);
  border: 2px solid var(--av-color); color: var(--av-color);
  font-family: var(--font-display); font-size: 0.68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; margin-left: -5px; position: relative; z-index: 1;
  transition: transform 0.15s, box-shadow 0.15s;
}
.beta-avatar:first-child { margin-left: 0; }
.beta-avatar:hover {
  transform: translateY(-3px) scale(1.15); z-index: 10;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--av-color) 40%, transparent);
}

/* User pill */
.user-pill {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: 999px; padding: 0.25rem 0.5rem 0.25rem 0.35rem; flex-shrink: 0;
}
.user-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-dim); border: 1px solid var(--accent);
  color: var(--accent); font-family: var(--font-display); font-size: 0.68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-email {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.logout-btn {
  background: none; border: none; color: var(--text-dim);
  font-family: var(--font-mono); font-size: 0.68rem; cursor: pointer;
  padding: 0.18rem 0.4rem; border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s; white-space: nowrap;
}
.logout-btn:hover { color: #e8848a; background: rgba(224,108,117,0.08); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px; margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}

/* ── Controls card ───────────────────────────────────────────────────────── */
.controls-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.1rem 1.5rem;
}

.controls { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

label {
  font-size: 0.7rem; font-family: var(--font-mono);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.09em;
}

select {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 0.55rem 2.2rem 0.55rem 0.8rem;
  font-family: var(--font-body); font-size: 0.9rem;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none; cursor: pointer; min-width: 160px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a85a8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center;
}

select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ── Year picker dropdown ────────────────────────────────────────────────── */
.year-picker { position: relative; }

.year-picker-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem; font-family: var(--font-body); font-size: 0.9rem;
  cursor: pointer; min-width: 180px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.year-picker-btn:focus,
.year-picker-btn.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.year-picker-btn svg { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s; }
.year-picker-btn.open svg { transform: rotate(180deg); }

#year-picker-label { color: var(--text); font-size: 0.88rem; }
#year-picker-label.placeholder { color: var(--text-muted); }

.year-picker-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  min-width: 200px; max-height: 300px; overflow-y: auto;
  display: none; flex-direction: column;
}
.year-picker-panel.open { display: flex; }

.year-picker-actions {
  display: flex; gap: 0.4rem; padding: 0.6rem 0.75rem 0.4rem;
  border-bottom: 1px solid var(--border);
}
.year-picker-actions button {
  background: var(--surface-2); border: 1px solid var(--border-light);
  color: var(--text-muted); border-radius: var(--radius-sm);
  padding: 0.22rem 0.6rem; font-family: var(--font-mono); font-size: 0.7rem;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.year-picker-actions button:hover { border-color: var(--accent); color: var(--accent); }

.year-checklist { padding: 0.4rem 0; }

.year-check-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.38rem 0.75rem; cursor: pointer;
  transition: background 0.1s;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted);
  user-select: none;
}
.year-check-item:hover { background: var(--surface-2); color: var(--text); }
.year-check-item.checked { color: var(--accent); }

.year-checkbox {
  width: 15px; height: 15px; border-radius: 3px; flex-shrink: 0;
  border: 1.5px solid var(--border-light); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; color: var(--accent); transition: border-color 0.15s, background 0.15s;
}
.year-check-item.checked .year-checkbox {
  border-color: var(--accent); background: var(--accent-dim);
}

/* ── Paper picker ────────────────────────────────────────────────────────── */
.paper-picker-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem 1.5rem 1.2rem;
}

.picker-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.85rem; gap: 1rem;
}

.picker-label {
  font-size: 0.7rem; font-family: var(--font-mono);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.09em;
}

.picker-actions { display: flex; gap: 0.4rem; }
.picker-actions button {
  background: var(--surface-2); border: 1px solid var(--border-light);
  color: var(--text-muted); border-radius: var(--radius-sm);
  padding: 0.25rem 0.7rem; font-family: var(--font-mono); font-size: 0.7rem;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.picker-actions button:hover { border-color: var(--accent); color: var(--accent); }

.chip-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 0.38rem 0.8rem;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted);
  cursor: pointer; user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.chip-check { opacity: 0; transform: scale(0.5); transition: opacity 0.15s, transform 0.15s; font-size: 0.7rem; }
.chip.active .chip-check { opacity: 1; transform: scale(1); }

/* ── Summary ─────────────────────────────────────────────────────────────── */
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.32rem 0.9rem;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted);
}
.badge strong { color: var(--text); }

.badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.badge[data-status="Not Done"]::before        { background: var(--status-notdone); }
.badge[data-status="In Progress"]::before     { background: var(--status-inprog); }
.badge[data-status="Done"]::before            { background: var(--status-done); }
.badge[data-status="Done + Reviewed"]::before { background: var(--status-reviewed); }

.summary-progress { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; flex-shrink: 0; }
.summary-progress-track {
  width: 150px; height: 7px; background: var(--surface-3);
  border-radius: 999px; overflow: hidden; border: 1px solid var(--border);
}
.summary-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--status-inprog), var(--status-done));
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1); width: 0%;
}
.summary-progress-label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

/* ── Tracker ─────────────────────────────────────────────────────────────── */
.tracker { display: grid; gap: 1rem; }

/* ── Year card ───────────────────────────────────────────────────────────── */
.year-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  animation: fadeUp 0.3s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.year-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); gap: 1rem;
  background: var(--surface-2);
}

.year-title {
  font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text);
}
.year-title span { color: var(--accent); }

.year-progress-wrap { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

.year-progress-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

.year-progress-bar { width: 100px; height: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.year-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--status-inprog), var(--status-done));
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1); width: 0%;
}

.year-body { display: grid; grid-template-columns: repeat(3, 1fr); }

/* ── Series ──────────────────────────────────────────────────────────────── */
.series { border-right: 1px solid var(--border); }
.series:last-child { border-right: none; }

.series-header {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, var(--surface-3), var(--surface-2));
}

.series-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Coloured per-series */
.series[data-series="January"]          .series-dot { background: var(--series-jan); box-shadow: 0 0 8px var(--series-jan); }
.series[data-series="May/June"]         .series-dot { background: var(--series-may); box-shadow: 0 0 8px var(--series-may); }
.series[data-series="October/November"] .series-dot { background: var(--series-oct); box-shadow: 0 0 8px var(--series-oct); }

.series-name { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.01em; }
.series[data-series="January"]          .series-name { color: #8ec5f8; }
.series[data-series="May/June"]         .series-name { color: #5edea5; }
.series[data-series="October/November"] .series-name { color: #f09098; }

.series-table-wrap { padding: 0.5rem 1.1rem 0.8rem; }
.series table { width: 100%; border-collapse: collapse; }
.series td { padding: 0.35rem 0; border-bottom: 1px solid var(--surface-3); vertical-align: middle; }
.series tr:last-child td { border-bottom: none; }

.paper-name {
  font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--text); font-weight: 500; padding-right: 0.5rem; white-space: nowrap;
}
.status-cell { text-align: right; }

/* ── Status dropdowns ────────────────────────────────────────────────────── */
select.status {
  min-width: 0; width: 100%; max-width: 172px;
  font-size: 0.8rem; font-family: var(--font-mono);
  padding: 0.32rem 1.8rem 0.32rem 0.65rem;
  border-radius: var(--radius-sm); background-color: var(--surface-2);
  border: 1px solid var(--border-light); color: var(--text-muted);
  background-position: right 0.5rem center; font-weight: 500;
}
select.status:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); color: var(--text); }

select.status[data-status="Not Done"]        { border-left: 3px solid var(--status-notdone); }
select.status[data-status="In Progress"]     { border-left: 3px solid var(--status-inprog);  color: #8ec5f8; }
select.status[data-status="Done"]            { border-left: 3px solid var(--status-done);     color: #5edea5; }
select.status[data-status="Done + Reviewed"] { border-left: 3px solid var(--status-reviewed); color: #c4a0f8; }

/* ── Sync toast ──────────────────────────────────────────────────────────── */
.sync-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 0.5rem 1rem;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.5rem;
  z-index: 200; opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.sync-toast.visible { opacity: 1; transform: translateY(0); }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1s infinite; }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }
@keyframes spin  { to { transform: rotate(360deg); } }

/* ── Auth loader ─────────────────────────────────────────────────────────── */
#auth-loader { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.loader-spinner { width: 30px; height: 30px; border: 3px solid var(--border-light); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-dim); font-family: var(--font-mono); font-size: 0.85rem;
  background: var(--surface); border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .year-body { grid-template-columns: 1fr 1fr; }
  .series:nth-child(2) { border-right: none; }
  .series:nth-child(3) { border-top: 1px solid var(--border); grid-column: 1/-1; }
  .lb-btn-label { display: none; }
  .user-email { display: none; }
  .beta-label { display: none; }
}

@media (max-width: 640px) {
  .controls { flex-direction: column; align-items: stretch; }
  select, .year-picker-btn { width: 100%; }
  .year-body { grid-template-columns: 1fr; }
  .series { border-right: none; border-bottom: 1px solid var(--border); }
  .series:last-child { border-bottom: none; }
  .year-progress-bar { width: 60px; }
  .tagline { display: none; }
  .summary-progress { margin-left: 0; width: 100%; }
  .summary-progress-track { flex: 1; }
  .paper-counter { display: none; }
}
