/* ── Reset & Variables ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #060b06;
  --surface:  #0d140d;
  --surface2: #121b12;
  --border:   #1a2e1a;
  --green:    #39ff14;
  --green-dim:#1a5c0a;
  --amber:    #ffb300;
  --red:      #ff3c3c;
  --muted:    #4a7a4a;
  --text:     #c8f0c8;
  --font-mono:'VT323', monospace;
  --font-ui:  'Inter', sans-serif;
}

/* ── Theme: Dark ─────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #0d0d14;
  --surface:   #16162a;
  --surface2:  #1e1e35;
  --border:    #2a2a4a;
  --green:     #818cf8;
  --green-dim: #2a2a55;
  --amber:     #f59e0b;
  --red:       #f87171;
  --muted:     #6b7280;
  --text:      #e2e8f0;
}

/* ── Theme: Futuristic ───────────────────────────────────────── */
[data-theme="futuristic"] {
  --bg:        #000c12;
  --surface:   #001524;
  --surface2:  #001e30;
  --border:    #00384f;
  --green:     #00fff0;
  --green-dim: #003844;
  --amber:     #c77dff;
  --red:       #ff2d6e;
  --muted:     #2a7a8a;
  --text:      #a8f0ff;
}

/* ── Theme: Sunset ───────────────────────────────────────────── */
[data-theme="sunset"] {
  --bg:        #0f0a0a;
  --surface:   #1c0f0f;
  --surface2:  #231414;
  --border:    #3d1f1f;
  --green:     #ff7b54;
  --green-dim: #5c2010;
  --amber:     #ffb347;
  --red:       #ff4d6d;
  --muted:     #7a4040;
  --text:      #ffd6c0;
}

/* ── Theme: Neon Pink ────────────────────────────────────────── */
[data-theme="ocean"] {
  --bg:        #0d0010;
  --surface:   #180020;
  --surface2:  #200030;
  --border:    #3a0050;
  --green:     #ff2d9b;
  --green-dim: #5c0033;
  --amber:     #bf5fff;
  --red:       #ff5e5e;
  --muted:     #7a1a5e;
  --text:      #ffc8f0;
}

/* ── CRT off for non-retro themes ────────────────────────────── */
[data-theme="dark"] .scanlines,
[data-theme="dark"] .vignette,
[data-theme="futuristic"] .vignette,
[data-theme="sunset"] .scanlines,
[data-theme="sunset"] .vignette,
[data-theme="ocean"] .scanlines,
[data-theme="ocean"] .vignette { opacity: 0; }
[data-theme="futuristic"] .scanlines { opacity: 0; }

/* ── Dark theme: softer glows ────────────────────────────────── */
[data-theme="dark"] .sb-logo-text,
[data-theme="dark"] .page-title,
[data-theme="dark"] .stats-header { text-shadow: 0 0 12px rgba(129,140,248,0.5); }
[data-theme="dark"] .btn-scan:not(:disabled) {
  animation: none;
  box-shadow: 0 0 0 1px #818cf8;
}
[data-theme="dark"] .btn-scan:not(:disabled):hover { box-shadow: 0 0 18px rgba(129,140,248,0.5); }

/* ── Futuristic: animated neon grid background ───────────────── */
body[data-theme="futuristic"]::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,255,240,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,240,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridScroll 12s linear infinite;
}
[data-theme="futuristic"] .app-layout,
[data-theme="futuristic"] #login-screen { position: relative; z-index: 1; }

@keyframes gridScroll {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 40px, 40px 0; }
}

[data-theme="futuristic"] .sb-logo-text {
  color: var(--green);
  text-shadow: 0 0 8px var(--green), 0 0 24px rgba(0,255,240,0.4);
  animation: futuGlow 2s ease-in-out infinite;
}
[data-theme="futuristic"] .page-title,
[data-theme="futuristic"] .stats-header {
  text-shadow: 0 0 8px var(--green), 0 0 24px rgba(0,255,240,0.4);
}
@keyframes futuGlow {
  0%,100% { text-shadow: 0 0 6px var(--green), 0 0 18px rgba(0,255,240,0.3); }
  50%      { text-shadow: 0 0 14px var(--green), 0 0 40px rgba(0,255,240,0.6); }
}
[data-theme="futuristic"] .sidebar { border-right-color: var(--green); box-shadow: 2px 0 20px rgba(0,255,240,0.08); }
[data-theme="futuristic"] .task-card:hover,
[data-theme="futuristic"] .sb-item.active { box-shadow: 0 0 14px rgba(0,255,240,0.12); }
[data-theme="futuristic"] .btn-scan:not(:disabled) {
  animation: futuScanPulse 2s ease-in-out infinite;
}
@keyframes futuScanPulse {
  0%,100% { box-shadow: 0 0 8px rgba(0,255,240,0.4), 0 0 2px rgba(0,255,240,0.8); }
  50%      { box-shadow: 0 0 28px rgba(0,255,240,0.8), 0 0 60px rgba(0,255,240,0.3); }
}

/* ── Theme switcher dots ──────────────────────────────────────── */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0 4px;
}
.theme-switcher-label {
  font-size: 8px;
  font-family: 'Press Start 2P', monospace;
  color: var(--muted);
  margin-right: 4px;
}
.theme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
}
.theme-dot:hover { transform: scale(1.25); }
.theme-dot.active { border-color: var(--text); transform: scale(1.15); }
.theme-dot[data-theme="retro"]      { background: #39ff14; box-shadow: 0 0 6px #39ff14; }
.theme-dot[data-theme="dark"]       { background: #818cf8; box-shadow: 0 0 6px #818cf8; }
.theme-dot[data-theme="futuristic"] { background: #00fff0; box-shadow: 0 0 6px #00fff0; }
.theme-dot[data-theme="sunset"]     { background: #ff7b54; box-shadow: 0 0 6px #ff7b54; }
.theme-dot[data-theme="ocean"]      { background: #ff2d9b; box-shadow: 0 0 6px #ff2d9b; }
.theme-dot.active[data-theme="retro"]      { box-shadow: 0 0 10px #39ff14; }
.theme-dot.active[data-theme="dark"]       { box-shadow: 0 0 10px #818cf8; }
.theme-dot.active[data-theme="futuristic"] { box-shadow: 0 0 10px #00fff0; }
.theme-dot.active[data-theme="sunset"]     { box-shadow: 0 0 10px #ff7b54; }
.theme-dot.active[data-theme="ocean"]      { box-shadow: 0 0 10px #ff2d9b; }

/* ── Sunset theme glows ──────────────────────────────────────── */
[data-theme="sunset"] .sb-logo-text,
[data-theme="sunset"] .page-title,
[data-theme="sunset"] .stats-header { text-shadow: 0 0 12px rgba(255,123,84,0.5); }
[data-theme="sunset"] .btn-scan:not(:disabled) {
  animation: none;
  box-shadow: 0 0 0 1px #ff7b54;
}
[data-theme="sunset"] .btn-scan:not(:disabled):hover { box-shadow: 0 0 18px rgba(255,123,84,0.5); }

/* ── Neon Pink theme glows ───────────────────────────────────── */
[data-theme="ocean"] .sb-logo-text,
[data-theme="ocean"] .page-title,
[data-theme="ocean"] .stats-header { text-shadow: 0 0 12px rgba(255,45,155,0.5); }
[data-theme="ocean"] .btn-scan:not(:disabled) {
  animation: none;
  box-shadow: 0 0 0 1px #ff2d9b;
}
[data-theme="ocean"] .btn-scan:not(:disabled):hover { box-shadow: 0 0 18px rgba(255,45,155,0.5); }
[data-theme="ocean"] .sidebar { border-right-color: rgba(255,45,155,0.2); }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  overflow-x: hidden;
}

/* ── CRT Effects ─────────────────────────────────────────────── */
.scanlines {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0,0,0,0.18) 3px, rgba(0,0,0,0.18) 4px
  );
}
.vignette {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.6) 100%);
}

/* ── Utility ─────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.accent  { color: var(--amber); }
.green   { color: var(--green); }
.blink   { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── Screen wrapper ──────────────────────────────────────────── */
.screen { min-height: 100vh; }

/* ══════════════════════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════════════════════ */
#login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  gap: 32px;
}

/* Boot sequence */
.boot-sequence {
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 1px;
  text-align: left;
  max-width: 480px;
  width: 100%;
}

.boot-line {
  opacity: 0;
  animation: fadeIn 0.1s forwards;
  animation-delay: var(--d);
  margin-bottom: 4px;
}
@keyframes fadeIn { to { opacity: 1; } }

/* Login card */
.login-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-top: 3px solid var(--green);
  border-radius: 4px;
  padding: 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 0 40px rgba(57,255,20,0.08);
  opacity: 0;
  animation: fadeIn 0.3s forwards 2.2s;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.logo-icon {
  font-size: 40px;
  color: var(--green);
  text-shadow: 0 0 10px var(--green);
}

.logo-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: var(--green);
  text-shadow: 0 0 8px var(--green);
  letter-spacing: 2px;
}

.logo-sub {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-top: 4px;
}

.login-desc {
  font-size: 15px;
  color: #8fa88f;
  line-height: 1.7;
  margin-bottom: 20px;
  font-family: 'Inter', sans-serif;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.feature {
  font-size: 13px;
  color: #6a8a6a;
  padding-left: 4px;
  font-family: 'Inter', sans-serif;
}

.btn-connect {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: var(--green);
  color: var(--bg);
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: 0 0 20px rgba(57,255,20,0.3);
}

.btn-connect:hover {
  background: #fff;
  box-shadow: 0 0 30px rgba(57,255,20,0.5);
}

.btn-icon { font-size: 16px; }

.btn-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--amber);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: 0.5px;
  border: 1px dashed var(--amber);
  border-radius: 2px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s;
}
.btn-demo:hover { background: rgba(255,179,0,0.08); box-shadow: 0 0 16px rgba(255,179,0,0.2); }

.login-note {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 14px;
  letter-spacing: 0.5px;
}

.login-dumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(255,179,0,0.05);
  border: 1px solid rgba(255,179,0,0.15);
  border-radius: 4px;
}
.login-dumb-bot { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; }
.dumb-bot-body {
  width: 34px; height: 34px;
  background: var(--surface2);
  border: 1.5px solid var(--amber);
  border-radius: 6px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  box-shadow: 0 0 8px rgba(255,179,0,0.2);
  animation: botBob 2s ease-in-out infinite;
}
.dumb-bot-eyes { font-size: 9px; color: var(--amber); letter-spacing: 4px; }
.dumb-bot-mouth { font-size: 9px; color: var(--amber); }
.dumb-bot-legs { font-size: 10px; color: var(--amber); opacity: 0.5; letter-spacing: 2px; }
.login-dumb-text {
  font-size: 12px;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}
.login-dumb-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--amber);
  text-transform: uppercase;
}

/* Demo banner */
.demo-banner {
  background: rgba(255,179,0,0.1);
  border-bottom: 1px solid rgba(255,179,0,0.3);
  color: var(--amber);
  font-size: 15px;
  padding: 8px 20px;
  text-align: center;
  letter-spacing: 1px;
}
.demo-connect-link { color: var(--green); text-decoration: underline; }

/* Server notice modal */
.server-notice {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.notice-inner {
  background: var(--surface);
  border: 2px solid var(--amber);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}
.notice-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--amber);
  margin-bottom: 16px;
  letter-spacing: 1px;
}
.notice-msg { font-size: 18px; color: var(--text); margin-bottom: 12px; line-height: 1.5; }
.notice-code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px 16px;
  font-size: 15px;
  color: var(--green);
  margin: 16px 0;
  letter-spacing: 0.5px;
  word-break: break-all;
}
.notice-close {
  margin-top: 16px;
  background: var(--amber);
  color: var(--bg);
  border: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 12px 24px;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════════════ */

/* Header */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.header-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--green);
  text-shadow: 0 0 6px var(--green);
  white-space: nowrap;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  letter-spacing: 1px;
  flex: 1;
  justify-content: center;
}

.stat-val { font-size: 20px; font-weight: bold; }
.stat-sep { color: var(--border); }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-email {
  font-size: 14px;
  color: var(--muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-scan {
  background: var(--green);
  color: var(--bg);
  border: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 10px 14px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-scan:hover { background: #fff; }
.btn-scan:disabled { background: var(--muted); cursor: not-allowed; }

.btn-logout {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* Scan bar */
.scan-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.scan-label { color: var(--muted); letter-spacing: 1px; }

.limit-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 3px 8px;
  cursor: pointer;
}

.scan-hint { color: var(--muted); font-size: 14px; margin-left: auto; }

/* Tabs */
.tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}

.tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 14px 8px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab:hover { color: var(--text); background: var(--surface2); }

.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
  background: var(--surface2);
  text-shadow: 0 0 6px var(--green);
}

.tab-icon { font-size: 14px; }

.tab-badge {
  background: var(--amber);
  color: var(--bg);
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 2px;
  min-width: 18px;
  text-align: center;
}

/* Tab content */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Main content area */
.dash-main {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

/* ── States ──────────────────────────────────────────────────── */
.placeholder-state,
.empty-state,
.error-state {
  text-align: center;
  padding: 80px 20px;
}

.placeholder-icon,
.empty-icon,
.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.placeholder-title,
.empty-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.placeholder-sub,
.empty-sub {
  font-size: 18px;
  color: var(--muted);
}

.error-icon { color: var(--red); font-size: 40px; }
.error-msg { color: var(--red); font-size: 18px; margin-bottom: 16px; }
.btn-retry {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 8px 20px;
  cursor: pointer;
}

/* ── Loading bar ─────────────────────────────────────────────── */
.loading-state { padding: 60px 20px; text-align: center; }

.loading-icon {
  font-size: 52px;
  margin-bottom: 10px;
  display: block;
  animation: float 1.8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

.loading-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.5px;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.3s;
  margin-bottom: 16px;
  min-height: 22px;
}

.loading-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto 8px;
}

.loading-bar {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.loading-pct {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--green);
  min-width: 34px;
  text-align: right;
}

.loading-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  box-shadow: 0 0 8px var(--green);
  /* no CSS transition — RAF handles smoothness */
}

.loading-step {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.5px;
  font-family: 'Inter', sans-serif;
  min-height: 18px;
}

/* ── Filter bar ──────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 7px 12px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter:hover { border-color: var(--green); color: var(--text); }
.filter.active { border-color: var(--green); color: var(--green); background: rgba(57,255,20,0.06); }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot.red   { background: var(--red); box-shadow: 0 0 4px var(--red); }
.dot.amber { background: var(--amber); box-shadow: 0 0 4px var(--amber); }
.dot.green { background: var(--green); box-shadow: 0 0 4px var(--green); }

/* ── Task Cards ──────────────────────────────────────────────── */
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 2px;
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.task-card:hover { border-color: var(--green-dim); background: var(--surface2); }
.task-card.completed { opacity: 0.4; }
.task-card.completed .task-title { text-decoration: line-through; }

.task-card.priority-HIGH   { border-left-color: var(--red); }
.task-card.priority-MEDIUM { border-left-color: var(--amber); }
.task-card.priority-LOW    { border-left-color: var(--green); }

.task-priority-icon {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 4px 7px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.priority-HIGH   .task-priority-icon { background: rgba(255,60,60,0.15);  color: var(--red);   }
.priority-MEDIUM .task-priority-icon { background: rgba(255,179,0,0.15);  color: var(--amber); }
.priority-LOW    .task-priority-icon { background: rgba(57,255,20,0.1);   color: var(--green); }

.task-body { flex: 1; min-width: 0; }

.task-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
  line-height: 1.4;
  font-family: 'Inter', sans-serif;
}

.task-detail {
  font-size: 13px;
  color: #8fa88f;
  margin-bottom: 10px;
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}

.task-from { color: var(--amber); font-weight: 500; }
.task-cat  {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-family: 'Inter', sans-serif;
}
.task-deadline { color: var(--red); font-weight: 600; }

.task-done-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
  margin-top: 2px;
}

.task-done-btn:hover   { border-color: var(--green); color: var(--green); }
.task-done-btn.is-done { border-color: var(--green); color: var(--green); }

/* ── Brief Panel ─────────────────────────────────────────────── */
.brief-panel {
  background: var(--surface);
  border: 2px solid var(--border);
  border-top: 3px solid var(--amber);
  padding: 28px;
  max-width: 700px;
}

.brief-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.brief-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--amber);
  text-shadow: 0 0 6px var(--amber);
  letter-spacing: 2px;
}

.brief-time { font-size: 15px; color: var(--muted); }

.brief-body {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}
.brief-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--green);
  letter-spacing: 1px;
  margin: 18px 0 8px;
  text-shadow: 0 0 6px var(--green);
}
.brief-section-title:first-child { margin-top: 0; }
.brief-line { padding: 2px 0; }
.brief-high { color: var(--red); font-weight: 600; }
.brief-med  { color: var(--amber); }

/* ── Inbox List ──────────────────────────────────────────────── */
.inbox-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 4px;
  cursor: default;
  transition: background 0.1s;
}

.inbox-item:hover { background: var(--surface); }

/* ── Promotions section ──────────────────────────────────────── */
.promo-section { margin-top: 10px; border: 1px solid var(--border); border-radius: 3px; }
.promo-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: none;
  color: var(--muted);
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.promo-toggle:hover { background: var(--surface2); color: var(--text); }
.promo-count {
  background: var(--border);
  color: var(--muted);
  font-size: 7px;
  padding: 2px 6px;
  border-radius: 10px;
  flex: 1;
}
.promo-arrow { font-size: 8px; margin-left: auto; transition: transform 0.2s; }
.promo-list { border-top: 1px solid var(--border); }
.promo-list .inbox-item { opacity: 0.7; }
.promo-list .inbox-item:hover { opacity: 1; }

.inbox-subject-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}
.inbox-subject {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-date {
  font-size: 11px;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

.unread-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--green);
  flex-shrink: 0;
}

.inbox-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}

.inbox-snippet {
  font-size: 13px;
  color: #6a8a6a;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border: 2px solid var(--border);
  border-top: 3px solid var(--green);
  padding: 28px;
  max-width: 540px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--red); }

.modal-priority {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 5px 10px;
  display: inline-block;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.4;
  font-family: 'Inter', sans-serif;
}

.modal-detail {
  font-size: 14px;
  color: #8fa88f;
  line-height: 1.7;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
}

.modal-meta { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.modal-row { display: flex; flex-direction: column; gap: 2px; }

.modal-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 1px;
}

.modal-done-btn {
  width: 100%;
  padding: 14px;
  background: var(--green);
  color: var(--bg);
  border: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.15s;
}
.modal-done-btn:hover { background: #fff; }
.modal-done-btn.done { background: var(--muted); cursor: default; }

/* ── BETA Bar ────────────────────────────────────────────────── */
.beta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255,179,0,0.05);
  border-bottom: 1px solid rgba(255,179,0,0.2);
  flex-wrap: wrap;
  gap: 12px;
}

.beta-left { display: flex; align-items: center; gap: 10px; }

.beta-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 4px 8px;
  background: var(--amber);
  color: var(--bg);
  border-radius: 3px;
}

.beta-label { font-size: 13px; color: #8a7a4a; }

.beta-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.beta-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.beta-perm-label { font-size: 12px; color: var(--muted); }

.beta-perm { display: none; }

.beta-slider {
  width: 36px; height: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.beta-slider::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: var(--muted);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: all 0.2s;
}

.beta-perm:checked + .beta-slider {
  background: rgba(255,179,0,0.2);
  border-color: var(--amber);
}

.beta-perm:checked + .beta-slider::after {
  background: var(--amber);
  left: 18px;
}

.btn-agent {
  background: var(--amber);
  color: var(--bg);
  border: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 10px 14px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-agent:hover { background: #fff; }
.btn-agent:disabled { background: var(--muted); cursor: not-allowed; }

.btn-grant {
  background: transparent;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-grant:hover { background: rgba(255,179,0,0.1); }

/* ── AI Chat ─────────────────────────────────────────────────── */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  max-height: 800px;
}

.chat-email-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-email-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.chat-email-select {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
}
.chat-email-select:focus { border-color: var(--green); }

.chat-email-clear {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-email-clear:hover { border-color: var(--red); color: var(--red); background: rgba(255,60,60,0.08); }
.chat-email-clear.hidden { display: none; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-msg {
  display: flex;
  max-width: 80%;
}
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.bot  { align-self: flex-start; }

.chat-bubble {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}
.chat-msg.user .chat-bubble {
  background: rgba(57,255,20,0.08);
  border-color: var(--green-dim);
  color: var(--text);
}

/* Typing dots */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
}
.chat-typing span {
  width: 7px; height: 7px;
  background: var(--muted);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.5; }
  30%          { transform: translateY(-6px); opacity: 1; }
}

/* Reply box — shown when AI has a full reply ready */
.chat-reply-box {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-width: 560px;
}
.chat-reply-text {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.7;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
}
.chat-reply-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}
.btn-chat-send {
  background: rgba(57,255,20,0.1);
  border: 1px solid var(--green);
  color: var(--green);
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.btn-chat-send:hover { background: rgba(57,255,20,0.2); }
.btn-chat-send:disabled { opacity: 0.7; cursor: default; font-size: 6px; }
.chat-send-status { font-size: 12px; }

.btn-undo-send {
  background: rgba(255,60,60,0.1);
  border: 1px solid var(--red);
  color: var(--red);
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
  animation: undoPulse 0.8s ease-in-out infinite alternate;
}
.btn-undo-send:hover { background: rgba(255,60,60,0.2); }
@keyframes undoPulse {
  from { box-shadow: 0 0 0 0 rgba(255,60,60,0); }
  to   { box-shadow: 0 0 8px 2px rgba(255,60,60,0.3); }
}

/* Input bar */
.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--green); }
.chat-input::placeholder { color: var(--muted); }
.chat-send-btn {
  background: var(--green);
  border: none;
  color: var(--bg);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 6px;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.chat-send-btn:hover { opacity: 0.85; }

/* Task card reply button */
.task-actions { margin-top: 6px; }
.task-reply-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}
.task-reply-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(57,255,20,0.06);
}

/* ── Animations ──────────────────────────────────────────────── */

/* Task cards + log items slide in */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.task-card {
  animation: cardIn 0.35s ease both;
}
.task-card.completed {
  animation: none;
}
.log-item {
  animation: cardIn 0.35s ease both;
}

/* Tab content fade+slide in on switch */
@keyframes tabIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-content.active {
  animation: tabIn 0.25s ease both;
}

/* Modal scale in */
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(-12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal {
  animation: modalIn 0.2s ease both;
}

/* Scan button pulse when idle */
@keyframes scanPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(57,255,20,0.3); }
  50%       { box-shadow: 0 0 22px rgba(57,255,20,0.7), 0 0 40px rgba(57,255,20,0.2); }
}
.btn-scan:not(:disabled) {
  animation: scanPulse 2.4s ease-in-out infinite;
}

/* Header logo glow breathe */
@keyframes logoGlow {
  0%, 100% { text-shadow: 0 0 6px var(--green); }
  50%       { text-shadow: 0 0 18px var(--green), 0 0 36px rgba(57,255,20,0.35); }
}
.header-logo { animation: logoGlow 3s ease-in-out infinite; }
.logo-title   { animation: logoGlow 2.5s ease-in-out infinite; }

/* Stat value flash when updated */
@keyframes statFlash {
  0%   { color: var(--green); text-shadow: 0 0 14px var(--green); }
  100% { color: inherit; text-shadow: none; }
}
.stat-val.flash { animation: statFlash 0.7s ease forwards; }

/* Brief panel slide in */
@keyframes briefIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.brief-panel:not(.hidden) { animation: briefIn 0.3s ease both; }

/* Unread dot pulse */
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 4px var(--green); opacity: 1; }
  50%       { box-shadow: 0 0 10px var(--green); opacity: 0.6; }
}
.unread-dot { animation: dotPulse 1.8s ease-in-out infinite; }

/* BETA badge shimmer */
@keyframes badgeShimmer {
  0%, 100% { background: var(--amber); }
  50%       { background: #ffd044; box-shadow: 0 0 12px rgba(255,179,0,0.5); }
}
.beta-badge { animation: badgeShimmer 2.5s ease-in-out infinite; }

/* ── Cute agent robot ────────────────────────────────────────── */
.agent-bot-wrap {
  position: relative;
  width: 80px;
  height: 100px;
  margin: 0 auto 20px;
  animation: botBob 1.2s ease-in-out infinite;
}

@keyframes botBob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.agent-bot-body {
  width: 60px;
  height: 60px;
  background: var(--surface2);
  border: 2px solid var(--green);
  border-radius: 10px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 0 16px rgba(57,255,20,0.25);
  position: relative;
  z-index: 2;
}

.agent-bot-eyes {
  font-size: 16px;
  color: var(--green);
  letter-spacing: 8px;
  animation: eyeBlink 3s ease-in-out infinite;
  text-shadow: 0 0 6px var(--green);
}

@keyframes eyeBlink {
  0%, 90%, 100% { opacity: 1; }
  95%            { opacity: 0; }
}

.agent-bot-mouth {
  font-size: 14px;
  color: var(--green);
  animation: mouthWiggle 1.2s ease-in-out infinite;
}

@keyframes mouthWiggle {
  0%, 100% { transform: scaleX(1); }
  50%       { transform: scaleX(1.3); }
}

.agent-bot-arm {
  position: absolute;
  top: 16px;
  font-size: 20px;
  color: var(--green);
  opacity: 0.7;
}
.agent-bot-arm.left-arm  { left: -14px; transform-origin: bottom right; animation: waveLeft  0.6s ease-in-out infinite alternate; }
.agent-bot-arm.right-arm { right: -14px; transform-origin: bottom left;  animation: waveRight 0.6s ease-in-out infinite alternate; }

@keyframes waveLeft  { from { transform: rotate(-20deg); } to { transform: rotate(10deg); } }
@keyframes waveRight { from { transform: rotate(20deg);  } to { transform: rotate(-10deg); } }

.agent-bot-legs {
  font-size: 18px;
  color: var(--green);
  letter-spacing: 4px;
  opacity: 0.5;
  margin-top: 2px;
}

.agent-mail-float {
  position: absolute;
  top: -20px;
  right: -8px;
  font-size: 20px;
  animation: mailOrbit 2s ease-in-out infinite;
}

@keyframes mailOrbit {
  0%, 100% { transform: translate(0, 0) rotate(-10deg); }
  50%       { transform: translate(6px, -10px) rotate(10deg); }
}

/* ── Done toast ──────────────────────────────────────────────── */
.done-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--green);
  color: var(--green);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(57,255,20,0.2);
  white-space: nowrap;
  z-index: 9000;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s;
  opacity: 0;
  pointer-events: none;
}
.done-toast.toast-in  { transform: translateX(-50%) translateY(0); opacity: 1; }
.done-toast.toast-out { transform: translateX(-50%) translateY(80px); opacity: 0; }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR LAYOUT
══════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* When demo banner is visible, shrink layout */
#demo-banner:not(.hidden) + * .app-layout,
.demo-banner:not(.hidden) ~ .app-layout {
  height: calc(100vh - 37px);
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.main-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-width: 0;
}

/* Sidebar logo */
.sb-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-logo-icon { font-size: 18px; }
.sb-logo-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--green);
  text-shadow: 0 0 8px var(--green);
  animation: logoGlow 2.5s ease-in-out infinite;
  line-height: 1.5;
}

/* Scan area */
.sb-scan {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sb-scan .limit-select { width: 100%; font-size: 13px; }
.sb-scan .btn-scan     { width: 100%; padding: 9px; font-size: 7px; }
.sb-scan .scan-hint    { font-size: 10px; color: var(--muted); margin: 0; }

/* Nav */
.sb-nav { padding: 6px 0; flex: 1; }

.sb-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.sb-item:hover  { color: var(--text); background: var(--surface2); border-left-color: var(--green-dim); }
.sb-item.active { color: var(--green); background: var(--surface2); border-left-color: var(--green); text-shadow: 0 0 4px var(--green); }
.sb-icon  { font-size: 13px; }
.sb-label { flex: 1; }

/* BETA section */
.sb-beta { border-top: 1px solid var(--border); }

.sb-beta-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.sb-beta-toggle:hover { background: var(--surface2); }
.sb-beta-label { flex: 1; font-size: 10px; color: var(--muted); text-align: left; }
.sb-beta-arrow { font-size: 9px; color: var(--amber); transition: transform 0.2s; }

.sb-beta-body {
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255,179,0,0.03);
}
.sb-beta-body.hidden { display: none; }
.sb-beta-desc { font-size: 10px; color: var(--muted); font-family: 'Inter', sans-serif; }
.sb-beta-body .beta-toggle-wrap { gap: 6px; }
.sb-beta-body .beta-perm-label  { font-size: 10px; flex: 1; }
.sb-beta-body .btn-agent  { width: 100%; font-size: 7px; padding: 9px; margin-top: 4px; }
.sb-beta-body .btn-grant  { width: 100%; text-align: center; font-size: 6px; padding: 8px; }

/* Footer */
.sb-footer {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sb-user-email {
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}
.sb-footer-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 9px;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  margin-bottom: 6px;
}
.sb-footer-link {
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s;
}
.sb-footer-link:hover     { color: var(--text); }
.sb-logout-link:hover     { color: var(--red); }

/* Pages */
.page-panel         { display: none; }
.page-panel.active  { display: block; animation: tabIn 0.2s ease both; }

.page-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--green);
  margin-bottom: 20px;
  letter-spacing: 1px;
  text-shadow: 0 0 6px var(--green);
}

/* ══════════════════════════════════════════════════════════════
   STATS PAGE
══════════════════════════════════════════════════════════════ */
.stats-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--green);
  margin-bottom: 20px;
  text-shadow: 0 0 6px var(--green);
}

.stats-rank {
  background: var(--surface);
  border: 2px solid var(--amber);
  padding: 18px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 0 20px rgba(255,179,0,0.1);
}
.stats-rank-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 15px;
  color: var(--amber);
  text-shadow: 0 0 10px var(--amber);
  margin-bottom: 6px;
}
.stats-rank-sub { font-size: 13px; color: var(--muted); font-family: 'Inter', sans-serif; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 12px;
  text-align: center;
  animation: cardIn 0.35s ease both;
}
.stat-card-num {
  font-family: 'Press Start 2P', monospace;
  font-size: 20px;
  color: var(--green);
  text-shadow: 0 0 8px var(--green);
  margin-bottom: 6px;
  display: block;
}
.stat-card-label {
  font-size: 10px;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.3px;
}

.stats-chart-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.stats-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  margin-bottom: 6px;
  padding: 0 4px;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar {
  width: 100%;
  background: var(--green-dim);
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  transition: height 0.6s ease;
}
.chart-bar.today { background: var(--green); box-shadow: 0 0 8px var(--green); }
.chart-day { font-size: 9px; color: var(--muted); font-family: 'Inter', sans-serif; }

/* ══════════════════════════════════════════════════════════════
   GAMES PAGE
══════════════════════════════════════════════════════════════ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px 16px;
  text-align: center;
  transition: all 0.15s;
  animation: cardIn 0.35s ease both;
}
.game-card:hover { border-color: var(--green-dim); background: var(--surface2); transform: translateY(-2px); }

.game-card-icon  { font-size: 38px; margin-bottom: 10px; display: block; }
.game-card-name  {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--green);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.game-card-desc  {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
}
.btn-play-game {
  background: var(--green);
  color: var(--bg);
  border: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 9px 18px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}
.btn-play-game:hover { background: #fff; }

.game-viewport-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.btn-back-game {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-back-game:hover { border-color: var(--green); color: var(--green); }
.game-viewport-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--amber);
}
.game-canvas-wrap { display: flex; justify-content: center; overflow: hidden; }
#game-canvas {
  background: #000;
  border: 2px solid var(--border);
  max-width: 100%;
  display: block;
}

/* ── Game Pad ────────────────────────────────────────────────── */
.game-pad {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 8px;
  user-select: none;
  -webkit-user-select: none;
}
@media (pointer: coarse) {
  .game-pad { display: flex; }
}
.pb-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.pb {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.07);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--green);
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: background 0.08s;
}
.pb:active, .pb.pressed {
  background: rgba(255,255,255,0.2);
  border-color: var(--green);
}
.pb-wide {
  width: 160px;
  height: 58px;
}
.pb-tall {
  width: 80px;
  height: 80px;
  font-size: 20px;
}
.pb-shoot {
  background: rgba(255, 60, 60, 0.15);
  border-color: #ff4444;
  color: #ff4444;
  width: 72px;
  height: 72px;
}
.pb-shoot:active, .pb-shoot.pressed {
  background: rgba(255, 60, 60, 0.4);
}
/* D-pad for Snake */
.pb-dpad {
  display: grid;
  grid-template-columns: 52px 52px 52px;
  grid-template-rows: 52px 52px 52px;
  gap: 4px;
}
.dpad-up    { grid-column: 2; grid-row: 1; }
.dpad-lft   { grid-column: 1; grid-row: 2; }
.dpad-mid   { grid-column: 2; grid-row: 2; background: rgba(255,255,255,0.03); border-color: transparent; pointer-events: none; }
.dpad-rgt   { grid-column: 3; grid-row: 2; }
.dpad-dn    { grid-column: 2; grid-row: 3; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 700px) {
  .sidebar { width: 180px; }
  .sb-logo-text { font-size: 6px; }
  .main-wrap { padding: 14px; }
  .task-card { flex-wrap: wrap; }
  .task-done-btn { width: 100%; text-align: center; }
  #game-canvas { width: 100% !important; height: auto !important; }
  .game-canvas-wrap { width: 100%; }
  #page-games { padding: 8px; }
  .game-viewport-header { margin-bottom: 6px; }
}
