/* ═══════════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════════ */
:root {
  /* Colors — Blue */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  /* Colors — Zinc */
  --zinc-50: #fafafa;
  --zinc-100: #f4f4f5;
  --zinc-200: #e4e4e7;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --zinc-700: #3f3f46;
  --zinc-800: #27272a;
  --zinc-900: #18181b;

  /* Colors — Semantic */
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-50: #fef2f2;
  --red-200: #fecaca;
  --green-500: #22c55e;
  --green-600: #16a34a;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --sp-1: 4px;
  --sp-1h: 6px;
  --sp-2: 8px;
  --sp-2h: 10px;
  --sp-3: 12px;
  --sp-3h: 14px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 10px;
  --r-2xl: 12px;
  --r-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);

  /* Borders */
  --border: 1px solid var(--zinc-200);
  --border-light: 1px solid var(--zinc-100);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
}

/* ═══════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--zinc-100);
  font-family: var(--font-sans);
  color: var(--zinc-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { display: flex; justify-content: center; }
svg { display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--zinc-300); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════════
   SHELL
   ═══════════════════════════════════════════════════════════════════ */
.shell {
  width: 1440px;
  min-height: 100vh;
  background: var(--zinc-50);
  display: grid;
  grid-template-columns: 248px 1fr;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--sp-5) var(--sp-4);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2h);
  padding: var(--sp-2) var(--sp-2) var(--sp-5);
  border-bottom: var(--border-light);
  margin-bottom: var(--sp-4);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--r-lg);
  background: var(--blue-600);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.brand-logo-lg {
  width: 48px;
  height: 48px;
  font-size: 20px;
  border-radius: var(--r-2xl);
}

.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--zinc-500); margin-top: 1px; }

.nav-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--zinc-400);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: var(--sp-3h) var(--sp-2) var(--sp-1h);
}

.nav a {
  display: flex;
  align-items: center;
  gap: var(--sp-2h);
  padding: var(--sp-2) var(--sp-2h);
  border-radius: var(--r-lg);
  color: var(--zinc-700);
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background var(--duration-fast);
}
.nav a:hover { background: var(--zinc-100); }
.nav a.active { background: var(--blue-50); color: var(--blue-700); }
.nav a svg { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }

.badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--zinc-200);
  color: var(--zinc-600);
  padding: 1px 6px;
  border-radius: var(--r-md);
  font-weight: 500;
}
.nav a.active .badge { background: var(--blue-100); color: var(--blue-700); }

.sidebar-foot {
  margin-top: auto;
  border-top: var(--border-light);
  padding-top: var(--sp-3);
  position: relative;
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--sp-2h);
  padding: var(--sp-2);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.user-card:hover { background: var(--zinc-100); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, var(--blue-600));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}

.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

.user-name { font-size: 13px; font-weight: 600; }
.user-mail { font-size: 11px; color: var(--zinc-500); }

.user-dropdown {
  position: absolute;
  bottom: 100%;
  left: var(--sp-2);
  right: var(--sp-2);
  background: #fff;
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-1);
  display: none;
  margin-bottom: var(--sp-1);
}
.user-dropdown.dropdown-open { display: block; animation: slideUp var(--duration-fast) var(--ease-out); }

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-2) var(--sp-2h);
  border: none;
  background: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 13px;
  color: var(--zinc-700);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.user-dropdown-item:hover { background: var(--zinc-100); }

/* ═══════════════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════════════ */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 60px;
  background: #fff;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-8);
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 5;
}

.search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--zinc-100);
  border: var(--border);
  border-radius: var(--r-lg);
  padding: 7px var(--sp-3);
}
.search svg { color: var(--zinc-500); flex-shrink: 0; }
.search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 13px;
  font-family: inherit;
  color: var(--zinc-900);
}
.search kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: #fff;
  border: var(--border);
  padding: 1px 5px;
  border-radius: var(--r-sm);
  color: var(--zinc-500);
}

.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-lg);
  border: var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: background var(--duration-fast);
}
.icon-btn:hover { background: var(--zinc-100); }
.icon-btn svg { width: 16px; height: 16px; color: var(--zinc-600); }

.dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--red-500);
  border-radius: 50%;
  border: 1.5px solid #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-lg);
  border: var(--border);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--zinc-900);
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
  white-space: nowrap;
}
.btn:hover { background: var(--zinc-100); }
.btn svg { flex-shrink: 0; }

.btn-primary { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:disabled { background: var(--blue-200); border-color: var(--blue-200); cursor: not-allowed; }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--zinc-100); }

.btn-danger { color: var(--red-700); border-color: var(--red-200); background: #fff; }
.btn-danger:hover { background: var(--red-50); }

.btn-sm { height: 30px; padding: 0 var(--sp-2h); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════ */
.input {
  flex: 1;
  height: 38px;
  padding: 0 var(--sp-3);
  border: var(--border);
  border-radius: var(--r-lg);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.input.input-error-border { border-color: var(--red-500); box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

.input-error {
  font-size: 12px;
  color: var(--red-600);
  margin-top: var(--sp-1);
  display: none;
}
.input-error.visible { display: block; }

/* ═══════════════════════════════════════════════════════════════════
   PAGE LAYOUT
   ═══════════════════════════════════════════════════════════════════ */
.page {
  padding: var(--sp-6) var(--sp-8) var(--sp-12);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--zinc-500);
}
.crumbs a { color: var(--zinc-500); text-decoration: none; transition: color var(--duration-fast); }
.crumbs a:hover { color: var(--zinc-900); }
.crumbs .sep { color: var(--zinc-300); }
.crumbs .current { color: var(--zinc-900); font-weight: 500; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-6);
}
.page-title { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.page-sub { font-size: 14px; color: var(--zinc-600); margin-top: var(--sp-1); max-width: 620px; line-height: 1.5; }
.head-actions { display: flex; gap: var(--sp-2); align-items: center; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════════════════════════ */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }

.stat {
  background: #fff;
  border: var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-3h) var(--sp-4);
  animation: slideUp var(--duration-slow) var(--ease-out);
}
.stat-label { font-size: 12px; color: var(--zinc-500); font-weight: 500; }
.stat-val { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: var(--sp-1); }
.stat-delta { font-size: 11px; color: var(--green-600); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════
   GRID
   ═══════════════════════════════════════════════════════════════════ */
.grid { display: grid; grid-template-columns: 1fr 420px; gap: var(--sp-5); align-items: start; }
.right-col { display: flex; flex-direction: column; gap: var(--sp-5); }

/* ═══════════════════════════════════════════════════════════════════
   CARD
   ═══════════════════════════════════════════════════════════════════ */
.card {
  background: #fff;
  border: var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
  animation: slideUp var(--duration-slow) var(--ease-out);
}
.card-head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-meta { font-size: 12px; color: var(--zinc-500); margin-top: 2px; }
.card-body { padding: var(--sp-5); }

/* ═══════════════════════════════════════════════════════════════════
   ADD ROW
   ═══════════════════════════════════════════════════════════════════ */
.add-row { display: flex; gap: var(--sp-2); }

.hint {
  font-size: 12px;
  color: var(--zinc-500);
  margin-top: var(--sp-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.hint svg { flex-shrink: 0; color: var(--zinc-500); }
.hint kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--zinc-100);
  border: var(--border);
  padding: 1px 5px;
  border-radius: var(--r-sm);
}

/* ═══════════════════════════════════════════════════════════════════
   OPTIONS LIST
   ═══════════════════════════════════════════════════════════════════ */
.opt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--zinc-100);
  border: var(--border);
  color: var(--zinc-700);
  font-size: 12px;
  font-weight: 500;
  padding: 3px var(--sp-2);
  border-radius: var(--r-full);
}
.count-pill .num { color: var(--blue-600); font-weight: 700; }

.opt-list { display: flex; flex-direction: column; gap: var(--sp-2); max-height: 480px; overflow-y: auto; padding-right: 2px; }

.opt {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2h) var(--sp-3);
  border: var(--border);
  border-radius: var(--r-xl);
  background: #fff;
  transition: all var(--duration-fast);
  animation: fadeIn var(--duration-normal) var(--ease-out);
  animation-fill-mode: both;
}
.opt:hover { background: var(--zinc-50); border-color: var(--zinc-300); }

.opt .num-tag {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--zinc-100);
  color: var(--zinc-600);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.opt .text {
  flex: 1;
  font-size: 14px;
  color: var(--zinc-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.opt .row-actions {
  display: flex;
  gap: var(--sp-1);
  opacity: 0;
  transition: opacity var(--duration-fast);
  flex-shrink: 0;
}
.opt:hover .row-actions { opacity: 1; }

.opt .ico {
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--zinc-500);
  transition: background var(--duration-fast), color var(--duration-fast);
}
.opt .ico:hover { background: var(--zinc-100); color: var(--zinc-900); }
.opt .ico.del:hover { background: var(--red-50); color: var(--red-600); }

/* Winner state */
.opt.winner {
  background: var(--blue-50);
  border-color: var(--blue-200);
  box-shadow: 0 0 0 4px rgba(37,99,235,.08);
  animation: winnerGlow 2s ease-in-out infinite alternate;
}
.opt.winner .num-tag { background: var(--blue-600); color: #fff; }
.opt.winner .text { font-weight: 600; color: var(--blue-700); }
.opt.winner .row-actions { opacity: 1; }

.selected-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--blue-100);
  border: 1px solid var(--blue-200);
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 600;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.selected-badge svg { stroke-width: 3; }

/* Editing state */
.opt.editing { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
.opt.editing .text-input {
  flex: 1;
  height: 30px;
  border: var(--border);
  border-radius: var(--r-md);
  padding: 0 var(--sp-2);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  min-width: 0;
}
.opt.editing .text-input:focus { border-color: var(--blue-600); }
.opt.editing .text-input.input-error-border { border-color: var(--red-500); }

/* Empty state */
.opt-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-5);
  color: var(--zinc-400);
}
.opt-empty-icon { margin-bottom: var(--sp-3); opacity: .5; }
.opt-empty-text { font-size: 14px; color: var(--zinc-500); }

.empty-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--zinc-200);
}
.muted { font-size: 12px; color: var(--zinc-500); }

/* ═══════════════════════════════════════════════════════════════════
   RESULT PANEL
   ═══════════════════════════════════════════════════════════════════ */
.result-card {
  background: #fff;
  border: var(--border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: slideUp var(--duration-slow) var(--ease-out);
}
.result-head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.result-body { padding: var(--sp-6) var(--sp-5) var(--sp-5); text-align: center; }
.result-label {
  font-size: 12px;
  color: var(--zinc-500);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
}
.result-name {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--zinc-900);
  margin-top: var(--sp-2);
  line-height: 1.15;
  word-break: break-word;
}

.result-meta {
  font-size: 12px;
  color: var(--zinc-500);
  margin-top: var(--sp-2h);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--zinc-100);
  border-radius: var(--r-full);
  padding: var(--sp-1) var(--sp-2h);
}

.pick-cta { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: 18px; }

.pick-btn {
  width: 100%;
  height: 44px;
  border-radius: var(--r-xl);
  background: var(--blue-600);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: inherit;
  transition: background var(--duration-fast);
}
.pick-btn:hover { background: var(--blue-700); }
.pick-btn:disabled { background: var(--blue-200); cursor: not-allowed; }

.pick-secondary { display: flex; gap: var(--sp-2); }
.pick-secondary .btn { flex: 1; justify-content: center; }

/* Live indicator */
.live-pill { background: var(--zinc-100); }
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-600);
  display: inline-block;
  animation: livePulse 2s ease-in-out infinite;
}

/* Result placeholder */
.result-placeholder { padding: var(--sp-5) 0; }
.result-placeholder-icon { color: var(--zinc-300); margin-bottom: var(--sp-3); }
.result-placeholder-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--zinc-600);
  margin-bottom: var(--sp-1);
}
.result-placeholder-sub { font-size: 13px; color: var(--zinc-500); line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════ */
.footer {
  margin-top: auto;
  border-top: var(--border);
  background: #fff;
  padding: var(--sp-3h) var(--sp-8);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--zinc-500);
}
.footer a {
  color: var(--zinc-600);
  text-decoration: none;
  margin-left: var(--sp-4);
  transition: color var(--duration-fast);
}
.footer a:hover { color: var(--zinc-900); }

/* ═══════════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: #fff;
  border: var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-2h) var(--sp-4);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  color: var(--zinc-900);
  pointer-events: all;
  transform: translateX(0);
  opacity: 1;
  transition: transform var(--duration-normal) var(--ease-out), opacity var(--duration-fast);
}
.toast-enter { transform: translateX(100%); opacity: 0; }
.toast-visible { transform: translateX(0); opacity: 1; }
.toast-exit { transform: translateX(100%); opacity: 0; }

.toast-success { border-left: 3px solid var(--green-600); }
.toast-error { border-left: 3px solid var(--red-500); }
.toast-info { border-left: 3px solid var(--blue-600); }

.toast-msg { flex: 1; }
.toast-close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--zinc-400);
  cursor: pointer;
  padding: 0 0 0 var(--sp-2);
  line-height: 1;
}
.toast-close:hover { color: var(--zinc-900); }

/* ═══════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.4);
  display: grid;
  place-items: center;
  animation: fadeIn var(--duration-normal) var(--ease-out);
}
.modal-overlay.modal-closing { animation: fadeOut var(--duration-normal) var(--ease-out); }

.modal-card {
  background: #fff;
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
  width: 420px;
  max-width: 90vw;
  animation: scaleIn var(--duration-normal) var(--ease-out);
}
.modal-closing .modal-card { animation: scaleOut var(--duration-normal) var(--ease-out); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  border-radius: var(--r-md);
  font-size: 20px;
  color: var(--zinc-500);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--duration-fast);
}
.modal-close-btn:hover { background: var(--zinc-100); }

.modal-body {
  padding: 0 var(--sp-5);
  font-size: 14px;
  color: var(--zinc-600);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-5);
}

/* ═══════════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  width: 1440px;
  background: var(--zinc-100);
  display: grid;
  place-items: center;
  animation: fadeIn var(--duration-slow) var(--ease-out);
}

.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-8);
  width: 100%;
  max-width: 400px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.login-sub {
  font-size: 14px;
  color: var(--zinc-500);
}

.login-card {
  width: 100%;
  background: #fff;
  border: var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-8);
  animation: slideUp var(--duration-slow) var(--ease-out);
}

.login-card-title { font-size: 18px; font-weight: 600; margin-bottom: var(--sp-1); }
.login-card-sub { font-size: 14px; color: var(--zinc-500); margin-bottom: var(--sp-6); }

.login-users { margin-bottom: var(--sp-6); }

.login-user-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: var(--border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.login-user-card:hover { background: var(--zinc-50); border-color: var(--zinc-300); }
.login-user-card.user-card-selected {
  background: var(--blue-50);
  border-color: var(--blue-200);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.login-user-info { flex: 1; }
.login-user-name { font-size: 14px; font-weight: 600; }
.login-user-email { font-size: 12px; color: var(--zinc-500); margin-top: 1px; }

.login-user-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: var(--border);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all var(--duration-fast);
}
.user-card-selected .login-user-check {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
}

.login-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.login-field { display: flex; flex-direction: column; gap: var(--sp-1h); }
.login-label { font-size: 13px; font-weight: 500; color: var(--zinc-700); }

.login-name-display {
  height: 38px;
  padding: 0 var(--sp-3);
  border: var(--border);
  border-radius: var(--r-lg);
  font-size: 14px;
  display: flex;
  align-items: center;
  color: var(--zinc-400);
  background: var(--zinc-50);
}
.login-name-display.filled { color: var(--zinc-900); background: #fff; }

.login-submit { width: 100%; justify-content: center; height: 40px; font-size: 14px; }

.login-footer-text { font-size: 12px; color: var(--zinc-400); }

.login-redirect { width: 1440px; min-height: 100vh; }

/* ═══════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes scaleOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.95); }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

@keyframes winnerGlow {
  from { box-shadow: 0 0 0 4px rgba(37,99,235,.06); }
  to { box-shadow: 0 0 0 4px rgba(37,99,235,.14); }
}

@keyframes resultPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.result-pulse { animation: resultPulse 300ms var(--ease-out); }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.pick-spin svg { animation: spin 400ms ease-out; }

/* Option row stagger */
.opt:nth-child(1) { animation-delay: 0ms; }
.opt:nth-child(2) { animation-delay: 50ms; }
.opt:nth-child(3) { animation-delay: 100ms; }
.opt:nth-child(4) { animation-delay: 150ms; }
.opt:nth-child(5) { animation-delay: 200ms; }
.opt:nth-child(6) { animation-delay: 250ms; }
.opt:nth-child(7) { animation-delay: 300ms; }
.opt:nth-child(8) { animation-delay: 350ms; }
.opt:nth-child(9) { animation-delay: 400ms; }
.opt:nth-child(10) { animation-delay: 450ms; }
