:root {
  --auth-text: #e5edf8;
  --auth-muted: #9fb0c3;
  --auth-panel: rgba(12,16,24,.82);
  --auth-line: rgba(255,255,255,.12);
  --auth-input: rgba(255,255,255,.06);
  --auth-accent: #1f7ae0;

  /* Live panel */
  --lp-bg: rgba(10,14,22,.88);
  --lp-section: rgba(255,255,255,.04);
  --lp-line: rgba(255,255,255,.10);
  --lp-text: #dce8f5;
  --lp-muted: #7a94b0;
  --lp-cyan: #29c5e6;
  --lp-green: #2ac37e;
  --lp-yellow: #f0a500;
  --lp-red: #e05252;
  --lp-w: 270px;
}
* { box-sizing: border-box; }
body.auth-body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--auth-text);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.7)), url('/static/img/auth-bg.png') center/cover no-repeat fixed;
}
.auth-wrap { width: 100%; max-width: 420px; padding: 24px; }
.auth-brand { text-align: center; margin-bottom: 16px; }
.auth-brand h1 { margin: 0; font-size: 2.1rem; font-weight: 700; }
.auth-brand p { margin: 8px 0 0; color: var(--auth-muted); }
.auth-card {
  background: var(--auth-panel);
  border: 1px solid var(--auth-line);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 48px rgba(0,0,0,.38);
  padding: 22px;
}
.auth-card h2 { margin: 0 0 8px; text-align: center; font-size: 1.1rem; }
.auth-sub { text-align: center; color: var(--auth-muted); margin-bottom: 16px; font-size: .92rem; }
.auth-input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid var(--auth-line);
  background: var(--auth-input);
  color: var(--auth-text);
}
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
}
.auth-row-end { justify-content: flex-end; }
.auth-check { color: var(--auth-muted); font-size: .92rem; display: flex; gap: 8px; align-items: center; }
.auth-btn {
  width: auto;
  min-width: 110px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  background: var(--auth-accent);
  color: white;
}
.auth-divider { text-align: center; color: var(--auth-muted); margin: 14px 0; }
.auth-oauth-grid { display: grid; gap: 10px; }
.auth-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}
.auth-apple { background: #111; color: white; }
.auth-google { background: #fff; color: #111; }
.auth-github { background: #24292f; color: white; }
.auth-links { display: grid; gap: 8px; margin-top: 16px; }
.auth-links a { color: #8fc2ff; text-decoration: none; }

/* ── Live data sidebar ─────────────────────────────────────── */
.lp-panel {
  position: fixed;
  top: 0; right: 0;
  width: var(--lp-w);
  height: 100vh;
  background: var(--lp-bg);
  border-left: 1px solid var(--lp-line);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 200;
  overflow: hidden;
}
.lp-panel.is-hidden {
  transform: translateX(100%);
}
.lp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--lp-line);
  flex-shrink: 0;
}
.lp-header-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--lp-text);
}
.lp-hide-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid var(--lp-line);
  border-radius: 6px;
  color: var(--lp-text);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  cursor: pointer;
  transition: background .15s;
}
.lp-hide-btn:hover { background: rgba(255,255,255,.18); }

.lp-body {
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.lp-body::-webkit-scrollbar { width: 4px; }
.lp-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* Sections */
.lp-section {
  border-bottom: 1px solid var(--lp-line);
  padding: 12px 14px;
}
.lp-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.lp-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--lp-text);
  letter-spacing: .02em;
}
.lp-source {
  font-size: 10px;
  color: var(--lp-muted);
  text-decoration: none;
  border: 1px solid var(--lp-line);
  border-radius: 4px;
  padding: 2px 6px;
  transition: color .15s, border-color .15s;
}
.lp-source:hover { color: var(--lp-cyan); border-color: var(--lp-cyan); }

/* Site link buttons */
.lp-site-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--lp-section);
  border: 1px solid var(--lp-line);
  text-decoration: none;
  margin-bottom: 8px;
  transition: background .15s, border-color .15s;
}
.lp-site-link:last-child { margin-bottom: 0; }
.lp-site-link:hover { background: rgba(41,197,230,.08); border-color: var(--lp-cyan); }
.lp-site-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.lp-site-info {}
.lp-site-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--lp-text);
  margin-bottom: 1px;
}
.lp-site-desc {
  font-size: 11px;
  color: var(--lp-muted);
}

/* KV grid for data rows */
.lp-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.lp-kv-cell {}
.lp-kv-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--lp-muted);
  margin-bottom: 2px;
}
.lp-kv-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--lp-text);
  letter-spacing: -.01em;
}
.lp-kv-val.is-green  { color: var(--lp-green); }
.lp-kv-val.is-cyan   { color: var(--lp-cyan); }
.lp-kv-val.is-yellow { color: var(--lp-yellow); }
.lp-kv-val.is-red    { color: var(--lp-red); }

.lp-timestamp {
  font-size: 10px;
  color: var(--lp-muted);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--lp-line);
}

/* Toggle row (layer switches) */
.lp-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  gap: 8px;
}
.lp-toggle-row:last-child { border-bottom: none; }
.lp-toggle-label {
  font-size: 11px;
  color: var(--lp-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.lp-toggle-label i {
  font-style: normal;
  font-size: 10px;
  color: rgba(255,255,255,.3);
  cursor: help;
}
/* Custom toggle switch */
.lp-switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.lp-switch input { opacity: 0; width: 0; height: 0; }
.lp-switch-track {
  position: absolute; inset: 0;
  border-radius: 20px;
  background: rgba(255,255,255,.15);
  cursor: pointer;
  transition: background .2s;
}
.lp-switch-track::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.lp-switch input:checked + .lp-switch-track { background: var(--lp-cyan); }
.lp-switch input:checked + .lp-switch-track::before { transform: translateX(16px); }

/* Show-data button (visible when panel is hidden) */
.lp-show-btn {
  position: fixed;
  top: 16px; right: 16px;
  background: rgba(10,14,22,.88);
  border: 1px solid var(--lp-line);
  border-radius: 24px;
  color: var(--lp-text);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .22s, transform .22s;
}
.lp-show-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 600px) {
  .lp-panel { width: 100%; border-left: none; }
}
