
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}

[data-theme="light"]{
  --bg:#ffffff;--off:#f7f7f5;--off2:#efefec;--line:#e5e5e0;--line2:#d0d0c8;
  --muted:#9a9a90;--text:#1a1a18;--text2:#4a4a44;
  --green:#16a34a;--red:#dc2626;--amber:#d97706;
  --dbg:#fef2f2;--dsbg:#f0fdf4;
  --bpb:#fef3c7;--bpc:#92400e;--bab:#dcfce7;--bac:#166534;
  --bbb:#fee2e2;--bbc:#991b1b;
  --sab:#dbeafe;--sac:#1e40af;--sdb:#fee2e2;--sdc:#991b1b;
  --shadow:0 1px 3px rgba(0,0,0,.08);
}
[data-theme="dark"]{
  --bg:#111110;--off:#1a1a18;--off2:#222220;--line:#2a2a27;--line2:#3a3a36;
  --muted:#5a5a54;--text:#e8e8e0;--text2:#a0a098;
  --green:#22c55e;--red:#ef4444;--amber:#f59e0b;
  --dbg:#2a1515;--dsbg:#0f2a1a;
  --bpb:#2a2010;--bpc:#d97706;--bab:#0f2a1a;--bac:#22c55e;
  --bbb:#2a1010;--bbc:#ef4444;
  --sab:#0f1e3a;--sac:#60a5fa;--sdb:#2a1010;--sdc:#fca5a5;
  --shadow:0 1px 4px rgba(0,0,0,.3);
}

html,body{height:100%;font-family:'DM Sans',sans-serif;background:var(--bg);color:var(--text);font-size:14px;line-height:1.5;transition:background .2s,color .2s;-webkit-tap-highlight-color:transparent;overscroll-behavior:none;}
button{font-family:'DM Sans',sans-serif;cursor:pointer;border:none;background:none;min-height:44px;} /* 44px min touch target */
input,textarea,select{font-family:'DM Sans',sans-serif;font-size:16px;} /* 16px prevents iOS auto-zoom */
img,video{display:block;max-width:100%;}


/* ═══ LAYOUT & SHELL ════════════════════════════════════════════════════════════ */


/* ── LAYOUT ────────────────────────────────────────────────────────────────── */
#shell{display:flex;height:100vh;overflow:hidden;}


/* ── TOPBAR ────────────────────────────────────────────────────────────────── */
#main{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0;}
#topbar{
  height:58px;
  border-bottom:1px solid color-mix(in srgb, var(--line) 78%, transparent);
  display:flex;align-items:center;
  padding:0 28px;gap:12px;
  flex-shrink:0;
  background:color-mix(in srgb, var(--bg) 92%, var(--off));
}
.topbar-brand{display:flex;align-items:center;min-width:0;}
#tb-hamburger{display:none;font-size:18px;cursor:pointer;color:var(--text2);padding:6px;border-radius:6px;transition:all .1s;line-height:1;}
#tb-hamburger:hover{color:var(--text);background:var(--off);}
#tb-back{
  display:none;font-size:18px;cursor:pointer;color:var(--text2);
  padding:6px;border-radius:6px;transition:all .1s;line-height:1;
  flex-shrink:0;
}
#tb-back:hover{color:var(--text);background:var(--off);}
#tb-back svg{display:block;}
#tb-title{
  font-family:'DM Sans',sans-serif;font-size:13px;font-weight:600;
  color:var(--text2);letter-spacing:0;text-transform:none;
  flex:1;
}
#tb-right{margin-left:auto;display:flex;gap:8px;align-items:center;}
.content{flex:1;overflow-y:auto;padding:28px clamp(28px,4vw,56px) 72px;-webkit-overflow-scrolling:touch;}

/* NAV OVERLAY */
#nav-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:49;backdrop-filter:blur(2px);}


/* ── SIDEBAR ───────────────────────────────────────────────────────────────── */
#nav{
  width:248px;min-width:248px;
  border-right:1px solid color-mix(in srgb, var(--line) 72%, transparent);
  display:flex;flex-direction:column;
  background:color-mix(in srgb, var(--bg) 92%, var(--off));
  overflow-y:auto;
  transition:transform .28s cubic-bezier(.4,0,.2,1);z-index:50;
}
.nav-logo{
  padding:18px 18px 14px;
  border-bottom:1px solid color-mix(in srgb, var(--line) 70%, transparent);
  display:flex;align-items:center;justify-content:space-between;
  min-height:60px;
}
.brand-logo{max-width:140px;max-height:38px;width:auto;height:auto;object-fit:contain;display:none;}
.brand-text{font-family:'DM Mono',monospace;font-size:13px;font-weight:500;letter-spacing:.06em;color:var(--text);}
.brand-text span{color:var(--muted);}
.topbar-logo{max-width:120px;max-height:28px;width:auto;height:auto;object-fit:contain;display:none;}
.topbar-brand-text{display:none;font-family:'DM Mono',monospace;font-size:12px;font-weight:500;letter-spacing:.06em;color:var(--text);white-space:nowrap;}
.logo-prev{max-width:180px;max-height:70px;object-fit:contain;margin-top:10px;border:1px solid var(--line);border-radius:4px;background:var(--off);padding:8px;}
.nav-close{display:none;font-size:18px;color:var(--muted);cursor:pointer;padding:2px 6px;line-height:1;transition:color .1s;}
.nav-close:hover{color:var(--text);}

.nav-sec{padding:10px 14px 4px;}
.nav-lbl{
  padding:0 8px 6px;
  font-family:'DM Mono',monospace;font-size:10px;
  color:var(--muted);letter-spacing:.12em;text-transform:uppercase;
}
.nav-item{
  display:flex;align-items:center;gap:10px;
  padding:9px 10px;font-size:13px;color:var(--text2);
  cursor:pointer;border-radius:9px;
  transition:background .14s, color .14s, transform .14s;
  user-select:none;margin-bottom:1px;
  position:relative;
}
.nav-item svg{flex-shrink:0;opacity:.6;transition:opacity .12s;}
.nav-item:hover{color:var(--text);background:color-mix(in srgb, var(--off2) 52%, transparent);}
.nav-item:hover svg{opacity:1;}
.nav-item.on{
  color:var(--text);background:var(--off2);font-weight:600;
  box-shadow:inset 2px 0 0 var(--accent,#e8623a);
}
.nav-item.on svg{opacity:1;}
.collapsible-nav-sec {
  margin: 6px 10px 0;
  padding: 3px 0 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.collapsible-nav-sec .collapsible-nav-lbl {
  margin: 0 4px 4px;
  padding: 6px 6px;
  border-radius: 8px;
  background: transparent;
}
.collapsible-nav-body {
  margin: 0 4px 0 8px;
  padding-left: 8px;
  border-left: 1px solid color-mix(in srgb, var(--line2) 55%, transparent);
}
.collapsible-nav-body .nav-item {
  padding: 8px 9px;
  min-height: 38px;
  font-size: 12.5px;
  border-radius: 8px;
}
.collapsible-nav-body .nav-item svg {
  width: 14px;
  height: 14px;
}
.nav-badge{
  margin-left:auto;
  background:var(--red);color:#fff;
  font-family:'DM Mono',monospace;font-size:9px;
  padding:1px 5px;border-radius:10px;
  font-weight:500;
}


/* ── ADMIN SIDEBAR SECTION ─────────────────────────────────────────────────── */
.admin-nav-sec {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 6px;
  position: relative;
}
.admin-nav-sec::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--red) 0%, transparent 100%);
  opacity: .45;
  border-radius: 0 1px 1px 0;
}
.admin-nav-lbl {
  padding: 4px 10px 6px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--red);
  letter-spacing: .12em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
  opacity: .8;
}
.admin-nav-lbl svg { stroke: var(--red); flex-shrink: 0; }
.nav-adm-group { margin-bottom: 4px; }
.nav-adm-grouplbl {
  padding: 6px 10px 3px;
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .7;
}


/* ── ADMIN PANEL COLLAPSE ──────────────────────────────────────────────────── */
#admin-panel-body {
  overflow: hidden;
  transition: max-height .22s cubic-bezier(.4,0,.2,1), opacity .18s ease;
  max-height: 1200px; /* large enough to show all items including Monetization */
  opacity: 1;
}
#admin-panel-body.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
#admin-panel-chevron.collapsed {
  transform: rotate(180deg);
}

.nav-foot{
  margin-top:auto;
  padding:14px 18px calc(14px + 37px);
  border-top:1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background:color-mix(in srgb, var(--bg) 86%, var(--off));
}
/* Normal user display */
.nav-user{font-size:12px;color:var(--text2);margin-bottom:10px;}
.nav-user-id {
  font-family: 'DM Mono', monospace; font-size: 9px;
  color: var(--muted); letter-spacing: .05em;
  background: var(--off2); border: 1px solid var(--line2);
  border-radius: 3px; padding: 1px 4px; flex-shrink: 0;
  opacity: .7;
}
.nav-user strong{display:block;font-size:13px;color:var(--text);font-weight:500;}
.nav-user span{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);}
/* EA sidebar card */
.nav-user-ea{margin-bottom:10px;padding:10px 12px;border-radius:8px;border:1px solid rgba(255,215,0,.45);background:linear-gradient(135deg,rgba(184,134,11,.1),rgba(255,215,0,.05));position:relative;overflow:hidden;}
[data-theme="light"] .nav-user-ea{border-color:rgba(180,130,0,.5);background:linear-gradient(135deg,rgba(200,150,0,.1),rgba(255,215,0,.08));}
.nav-user-ea::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(255,215,0,.6),transparent);animation:eaShimmer 3s linear infinite;}
.nav-user-ea-name{font-size:13px;font-weight:500;color:var(--text);display:flex;align-items:center;gap:6px;margin-bottom:4px;}
.nav-user-ea-star{font-size:11px;color:#d4a800;flex-shrink:0;animation:eaPulse 2.5s ease-in-out infinite;}
@keyframes eaPulse{0%,100%{opacity:.7;transform:scale(1);}50%{opacity:1;transform:scale(1.15);}}
.nav-user-ea-role{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);display:flex;align-items:center;gap:5px;}
.nav-user-ea-badge{font-family:'DM Mono',monospace;font-size:9px;letter-spacing:.06em;font-weight:500;color:#3a2800;background:linear-gradient(90deg,#b8860b 0%,#ffd700 50%,#b8860b 100%);background-size:200% auto;animation:eaShimmer 3s linear infinite;padding:1px 6px;border-radius:2px;border:1px solid #c9a600;}
.tog-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.1em;}
.tog-track{width:36px;height:20px;border-radius:10px;background:var(--off2);border:1px solid var(--line2);position:relative;cursor:pointer;flex-shrink:0;transition:background .2s;}
[data-theme="dark"] .tog-track{background:var(--line2);}
.tog-thumb{width:14px;height:14px;border-radius:50%;background:var(--text);position:absolute;top:2px;left:2px;transition:transform .2s;}
[data-theme="dark"] .tog-thumb{transform:translateX(16px);}


/* ── MOBILE BOTTOM NAV ─────────────────────────────────────────────────────── */
#bottom-nav {
  display: none; /* shown only when .app-visible AND on mobile */
  position: fixed;
  bottom: calc(46px + env(safe-area-inset-bottom, 0px));
  left: 0; right: 0;
  z-index: 520;
  border-top: 1px solid var(--line2);
  flex-direction: row;
  align-items: stretch;
  padding: 5px 8px 6px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  margin-bottom: 0;
}
/* Hide bottom nav on impressum page */
#bottom-nav.app-visible.hidden { display: none; }
/* legal-widget is always visible — no class needed to show it */
#legal-widget.app-visible { display: flex; }
#legal-widget.app-visible.hidden { display: none; }
#legal-widget.auth-visible { display: flex; }
#legal-widget.auth-visible.hidden { display: none; }
.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-height: 56px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
}
/* Hide text labels — icons only (overridden on mobile) */
.bn-item span:not(.bn-icon) { display: none; }
.bn-item.on,
#bn-more[aria-expanded="true"] { color: var(--text); background: var(--off); }
.bn-item.on::after {
  content: '';
  position: absolute;
  bottom: 5px; left: calc(50% - 10px); right: auto; top: auto;
  width: 20px; height: 2px;
  background: var(--accent,#e8623a);
  border-radius: 999px;
  animation: tileIn .2s ease;
}
.bn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  transition: transform .15s;
}
.bn-icon svg { width: clamp(18px, 3.5vw, 24px); height: clamp(18px, 3.5vw, 24px); stroke: currentColor; }
.bn-item:active .bn-icon { transform: scale(.88); }
.bn-signout { color: var(--red) !important; opacity: .75; }
.bn-signout:active { opacity: 1; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Mobile more sheet */
#mobile-more-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 800;
  align-items: flex-end;
}
#mobile-more-sheet.on { display: flex; }
.mobile-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.58);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.mobile-more-panel {
  position: relative;
  width: 100%;
  max-height: min(74vh, 620px);
  overflow-y: auto;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line2);
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--off2) 52%, transparent), transparent 190px),
    var(--bg);
  box-shadow: 0 -20px 48px rgba(0,0,0,.34);
  animation: slideUp .22s cubic-bezier(.4,0,.2,1);
}
.mobile-more-handle {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: var(--line2);
  margin: 0 auto 14px;
}
.mobile-more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.mobile-more-kicker {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.mobile-more-title {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.mobile-more-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  color: var(--text2);
  background: var(--off);
  cursor: pointer;
}
.mobile-more-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.mobile-more-label {
  grid-column: 1 / -1;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.mobile-more-item {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--off) 82%, transparent);
  color: var(--text2);
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}
.mobile-more-item.on,
.mobile-more-item:active {
  color: var(--text);
  border-color: var(--line2);
  background: var(--off2);
}
.mobile-more-item span {
  float: right;
  margin-top: 1px;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: #c4b8ff;
}
.mobile-more-danger {
  color: var(--red) !important;
}

/* Notification toggle row in settings */
.notif-toggle-row { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.notif-toggle-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
#notif-tog-track[data-notif="1"] { background: var(--text); }
#notif-tog-track[data-notif="1"] .tog-thumb { transform: translateX(15px); }

/* Responsive dashboard — supplement to main mobile block */
@media(max-width: 700px) {
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dst-n           { font-size: 20px; }
  .dash-stat-tile  { padding: 14px 14px 12px; }
}
@media(max-width: 768px) {
  #bottom-nav.app-visible { display: flex; }
}
@media(max-width: 380px) {
  .dash-tiles          { grid-template-columns: repeat(3, 1fr); }
  .dash-tile           { padding: 14px 12px; min-height: 96px; }
  .dash-hero-wordmark  { font-size: 18px; }
  .dash-hero-logo      { max-width: 160px; max-height: 64px; }
  .dst-n               { font-size: 18px; }
}


/* ── LEGAL NOTICE FOOTER LINK ──────────────────────────────────────────────── */
#legal-widget {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 501;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 6px 16px env(safe-area-inset-bottom, 0px);
  padding-left: calc(248px + 16px); /* offset sidebar so content centers in main area */
  min-height: 37px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  cursor: default;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.lw-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 4px;
  cursor: pointer; text-decoration: none;
  transition: background .12s;
}
.lw-link:hover { background: var(--off); }
.lw-link:hover .lw-text { color: var(--text); }
#legal-widget .lw-icon {
  font-size: 11px;
  color: var(--muted);
}
#legal-widget .lw-text {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .12s;
  white-space: nowrap;
}
#legal-widget .lw-amp {
  font-size: 10px;
  color: var(--line2);
}
#legal-widget .lw-divider {
  width: 1px; height: 12px;
  background: var(--line2);
  margin: 0 4px;
  flex-shrink: 0;
}
#legal-widget .lw-credit-sep {
  color: var(--line2);
  font-size: 10px;
  margin: 0 8px;
}
#legal-widget .lw-credit {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--muted);
  opacity: .55;
  white-space: nowrap;
}
/* Push auth page up so footer doesn't cover it */
#auth { padding-bottom: calc(37px + 20px); }
@media(max-width: 768px) {
  #auth { padding-bottom: calc(37px + env(safe-area-inset-bottom, 0px) + 20px); }
  #legal-widget {
    padding-left: 16px; /* no sidebar on mobile */
    min-height: 44px;
    gap: 0;
  }
  #legal-widget .lw-credit-sep,
  #legal-widget .lw-credit { display: none; } /* hide credit on small screens — no room */
}
@supports(padding: max(0px)) {
  #legal-widget { padding-bottom: max(0px, env(safe-area-inset-bottom, 0px)); }
  .nav-foot { padding-bottom: max(calc(14px + 37px), calc(env(safe-area-inset-bottom) + 37px + 8px)); }
}
/* Hide on impressum page itself */
#legal-widget.hidden { display: none; }
/* Hide legal widget while cookie banner is visible */
body:has(#cookie-banner.on) #legal-widget { display: none; }



/* ═══ BASE COMPONENTS ═══════════════════════════════════════════════════════════ */


/* ── BUTTONS ───────────────────────────────────────────────────────────────── */
.btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;font-size:13px;font-weight:500;border-radius:4px;transition:all .1s;cursor:pointer;border:1px solid transparent;white-space:nowrap;}
.btn-dk{background:var(--text);color:var(--bg);border-color:var(--text);}
.btn-dk:hover{opacity:.8;}
.btn-gh{background:transparent;color:var(--text2);border-color:var(--line2);}
.btn-gh:hover{background:var(--off);color:var(--text);}
.btn-sm{padding:5px 10px;font-size:12px;}
.btn-del{color:var(--red);border-color:var(--red);background:var(--dbg);}
.btn-del:hover{background:var(--red);color:var(--bg);}
.btn-ok{color:var(--green);border-color:var(--green);background:var(--dsbg);}
.btn-ok:hover{background:var(--green);color:var(--bg);}
.btn:disabled{opacity:.45;cursor:not-allowed;}


/* ── FORMS ─────────────────────────────────────────────────────────────────── */
.field{margin-bottom:14px;}
.lbl{display:block;font-family:'DM Mono',monospace;font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin-bottom:5px;}
.inp{width:100%;padding:9px 12px;font-size:16px;border:1px solid var(--line2);border-radius:4px;background:var(--off);color:var(--text);outline:none;transition:border .1s;-webkit-appearance:none;}
.inp:focus{border-color:var(--text);}
.inp-ta{resize:vertical;min-height:80px;}
select.inp{appearance:none;}
.upz{border:1px dashed var(--line2);border-radius:4px;padding:18px;text-align:center;cursor:pointer;transition:all .15s;color:var(--muted);font-size:13px;background:var(--off);}
.upz:hover{border-color:var(--text);color:var(--text);}
.upz.has{border-style:solid;border-color:var(--text);color:var(--text);}
.upz input[type=file]{display:none;}
.upz-bar{height:3px;background:var(--line);border-radius:2px;margin-top:10px;overflow:hidden;display:none;}
.upz-bar.on{display:block;}
.upz-bar-f{height:100%;background:var(--green);transition:width .2s;}


/* ── CARD ──────────────────────────────────────────────────────────────────── */
.card{border:1px solid var(--line);border-radius:6px;background:var(--bg);overflow:hidden;}
.chead{padding:12px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;}
.ctitle{font-size:13px;font-weight:500;}
.cbody{padding:16px;}


/* ── TABLE ─────────────────────────────────────────────────────────────────── */
.tbl-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
table{width:100%;border-collapse:collapse;font-size:13px;min-width:500px;}
th{text-align:left;padding:8px 12px;font-family:'DM Mono',monospace;font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);border-bottom:1px solid var(--line);background:var(--off);font-weight:400;}
td{padding:10px 12px;border-bottom:1px solid var(--line);color:var(--text2);vertical-align:middle;}
tr:last-child td{border-bottom:none;}
tr:hover td{background:var(--off);}


/* ── BADGES ────────────────────────────────────────────────────────────────── */
.badge{display:inline-block;padding:2px 7px;border-radius:2px;font-family:'DM Mono',monospace;font-size:10px;letter-spacing:.05em;}
.b-pend{background:var(--bpb);color:var(--bpc);}
.b-act {background:var(--bab);color:var(--bac);}
.b-ban {background:var(--bbb);color:var(--bbc);}
.b-adm {background:var(--off2);color:var(--text);border:1px solid var(--line2);}
/* Dev blue badge */
.b-dev {
  background: linear-gradient(90deg,#1a3a6e 0%,#2563eb 50%,#1a3a6e 100%);
  background-size: 200% auto;
  animation: devShimmer 3s linear infinite;
  color: #bfdbfe; font-weight: 500; border: 1px solid #3b82f6; letter-spacing: .04em;
}
@keyframes devShimmer{0%{background-position:200% center;}100%{background-position:-200% center;}}
/* Early Access gold badge */
.b-ea{
  background:linear-gradient(90deg,#b8860b 0%,#ffd700 50%,#b8860b 100%);
  background-size:200% auto;
  animation:eaShimmer 3s linear infinite;
  color:#3a2800;font-weight:500;border:1px solid #c9a600;letter-spacing:.04em;
}
@keyframes eaShimmer{0%{background-position:200% center;}100%{background-position:-200% center;}}
/* Early Access name frame */
.ea-name{
  display:inline-flex;align-items:center;gap:5px;
  padding:2px 8px 2px 6px;border-radius:4px;
  border:1px solid rgba(255,215,0,.4);
  background:linear-gradient(135deg,rgba(184,134,11,.12),rgba(255,215,0,.06));
}
[data-theme="light"] .ea-name{border-color:rgba(180,130,0,.45);background:linear-gradient(135deg,rgba(200,150,0,.1),rgba(255,215,0,.1));}
.ea-name::before{content:'★';font-size:10px;color:#d4a800;flex-shrink:0;line-height:1;}
.ea-name-text{font-weight:500;color:var(--text);}
/* Admin name frame — red highlight analogous to EA gold */
.adm-name{
  display:inline-flex;align-items:center;gap:5px;
  padding:2px 8px 2px 6px;border-radius:4px;
  border:1px solid rgba(239,68,68,.45);
  background:linear-gradient(135deg,rgba(239,68,68,.12),rgba(239,68,68,.05));
}
[data-theme="light"] .adm-name{border-color:rgba(220,38,38,.5);background:linear-gradient(135deg,rgba(220,38,38,.1),rgba(239,68,68,.07));}
.adm-name::before{content:'⬡';font-size:10px;color:var(--red);flex-shrink:0;line-height:1;}
.adm-name-text{font-weight:500;color:var(--text);}
/* Admin sidebar card — red frame analogous to EA gold card */
.nav-user-adm{margin-bottom:10px;padding:10px 12px;border-radius:8px;border:1px solid rgba(239,68,68,.4);background:linear-gradient(135deg,rgba(239,68,68,.1),rgba(239,68,68,.04));position:relative;overflow:hidden;animation:admCardPulse 3.5s ease-in-out infinite;}
[data-theme="light"] .nav-user-adm{border-color:rgba(220,38,38,.45);background:linear-gradient(135deg,rgba(220,38,38,.08),rgba(239,68,68,.04));}
.nav-user-adm::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(239,68,68,.8),transparent);background-size:200% auto;animation:admSweep 2.8s linear infinite;}
.nav-user-adm-name{font-size:13px;font-weight:500;color:var(--text);display:flex;align-items:center;gap:6px;margin-bottom:4px;}
.nav-user-adm-icon{font-size:11px;color:var(--red);flex-shrink:0;animation:admIconPulse 2.5s ease-in-out infinite;}
.nav-user-adm-role{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);display:flex;align-items:center;gap:5px;}
.nav-user-adm-badge{font-family:'DM Mono',monospace;font-size:9px;letter-spacing:.06em;font-weight:500;color:#fff;background:var(--red);padding:1px 6px;border-radius:2px;border:1px solid rgba(239,68,68,.6);}
.nav-user-badges-row{display:flex;gap:5px;align-items:center;margin-top:5px;flex-wrap:nowrap;}
@keyframes admCardPulse{0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,0);}50%{box-shadow:0 0 8px 1px rgba(239,68,68,.18);}}
@keyframes admSweep{0%{background-position:200% center;}100%{background-position:-200% center;}}
@keyframes admIconPulse{0%,100%{opacity:.7;transform:scale(1);}50%{opacity:1;transform:scale(1.2);}}
/* Admin EA combined sidebar card */
.nav-user-adm-ea{margin-bottom:10px;padding:10px 12px;border-radius:8px;border:1px solid rgba(239,68,68,.4);background:linear-gradient(135deg,rgba(239,68,68,.1),rgba(184,134,11,.06));position:relative;overflow:hidden;animation:admCardPulse 3.5s ease-in-out infinite;}
[data-theme="light"] .nav-user-adm-ea{border-color:rgba(220,38,38,.45);background:linear-gradient(135deg,rgba(220,38,38,.08),rgba(200,150,0,.06));}
.nav-user-adm-ea::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(239,68,68,.8),rgba(255,215,0,.5),transparent);background-size:200% auto;animation:admSweep 2.8s linear infinite;}
/* Dev sidebar user card */
.nav-user-dev{margin-bottom:10px;padding:10px 12px;border-radius:8px;border:1px solid rgba(59,130,246,.4);background:linear-gradient(135deg,rgba(37,99,235,.1),rgba(37,99,235,.04));position:relative;overflow:hidden;animation:devCardPulse 3.5s ease-in-out infinite;}
[data-theme="light"] .nav-user-dev{border-color:rgba(37,99,235,.45);background:linear-gradient(135deg,rgba(37,99,235,.08),rgba(59,130,246,.04));}
.nav-user-dev::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(59,130,246,.8),transparent);background-size:200% auto;animation:devSweep 2.8s linear infinite;}
@keyframes devSweep{0%{background-position:200% 0;}100%{background-position:-200% 0;}}
@keyframes devCardPulse{0%,100%{box-shadow:0 0 0 0 rgba(59,130,246,0);}50%{box-shadow:0 0 0 3px rgba(59,130,246,.06);}}
.nav-user-dev-name{font-size:13px;font-weight:500;color:var(--text);display:flex;align-items:center;gap:6px;margin-bottom:4px;}
.nav-user-dev-icon{font-size:11px;color:#3b82f6;flex-shrink:0;animation:devIconPulse 2.5s ease-in-out infinite;}
@keyframes devIconPulse{0%,100%{opacity:1;}50%{opacity:.5;}}
.nav-user-dev-role{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);display:flex;align-items:center;gap:5px;}
.nav-user-dev-badge{font-family:'DM Mono',monospace;font-size:9px;letter-spacing:.06em;font-weight:500;color:#bfdbfe;background:linear-gradient(90deg,#1a3a6e 0%,#2563eb 50%,#1a3a6e 100%);background-size:200% auto;animation:devShimmer 3s linear infinite;padding:1px 6px;border-radius:2px;border:1px solid #3b82f6;}


/* ── SPINNER ───────────────────────────────────────────────────────────────── */
.spin-s{width:13px;height:13px;border-radius:50%;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;animation:spin .7s linear infinite;display:inline-block;vertical-align:middle;}


/* ── MODAL ─────────────────────────────────────────────────────────────────── */
.modal-bg{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;align-items:flex-end;justify-content:center;z-index:300;}
.modal-bg.on{display:flex;}
.modal{background:var(--bg);border:1px solid var(--line);border-radius:10px 10px 0 0;padding:24px 24px 32px;width:100%;max-width:500px;max-height:92vh;overflow-y:auto;position:relative;animation:slideUp .2s ease;}
@keyframes slideUp{from{transform:translateY(100%);}to{transform:none;}}
.modal-title{font-size:15px;font-weight:500;margin-bottom:18px;}
.modal-x{position:absolute;top:14px;right:14px;font-size:20px;color:var(--muted);cursor:pointer;width:28px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:4px;}
.modal-x:hover{color:var(--text);background:var(--off);}


/* ── TOAST ─────────────────────────────────────────────────────────────────── */
#toasts{position:fixed;bottom:20px;right:16px;z-index:999;display:flex;flex-direction:column;gap:7px;pointer-events:none;}
.toast{padding:10px 15px;background:var(--text);color:var(--bg);border-radius:6px;font-size:12px;font-family:'DM Mono',monospace;animation:fadeUp .2s ease;box-shadow:var(--shadow);max-width:280px;}
.toast.ok {background:var(--green);}
.toast.err{background:var(--red);color:#fff;}


/* ── BACK BUTTON ───────────────────────────────────────────────────────────── */
.back{
  display:inline-flex;align-items:center;gap:6px;
  font-family:'DM Mono',monospace;font-size:11px;color:var(--muted);
  cursor:pointer;margin-bottom:18px;text-transform:uppercase;letter-spacing:.08em;
  transition:color .1s, gap .15s;padding:6px 0;
}
.back:hover{color:var(--text);gap:10px;}

.back{
  display:inline-flex;align-items:center;gap:7px;
  font-family:'DM Mono',monospace;font-size:11px;color:var(--muted);
  cursor:pointer;margin-bottom:20px;text-transform:uppercase;letter-spacing:.08em;
  transition:color .15s;padding:6px 0;min-height:36px;
}
.back::before{content:'←';transition:transform .15s;}
.back:hover{color:var(--text);}
.back:hover::before{transform:translateX(-3px);}

/* ══════════════════════════════════════════════════════════════════════════════
   BASE TOUCH / MOBILE IMPROVEMENTS (applied globally, overridden on desktop)
══════════════════════════════════════════════════════════════════════════════ */

/* Prevent iOS auto-zoom on input focus — must stay 16px on mobile */
.inp { font-size: 16px; }
select.inp { font-size: 16px; }

/* Minimum tap targets (Apple HIG: 44px, Google: 48px — we use 48px) */
.btn          { min-height: 48px; }
.btn-sm       { min-height: 40px; }
.nav-item     { min-height: 48px; }
.fchip        { min-height: 36px; line-height: 1.6; }
.back         { min-height: 44px; }
.dash-stat-pill { min-height: 44px; }
.user-filter-btn { min-height: 44px; }
.cm-toggle    { width: 48px; height: 28px; }
.cm-toggle-thumb { width: 20px; height: 20px; }
.cm-toggle input:checked ~ .cm-toggle-thumb { transform: translateX(20px); }

/* Remove iOS tap flash */
* { -webkit-tap-highlight-color: transparent; }

/* Smooth momentum scrolling everywhere */
.content, .co-list, .modal, .pe-sb, .tbl-wrap,
.admin-list-body, .cm-box { -webkit-overflow-scrolling: touch; }


/* ── GRID HELPERS ──────────────────────────────────────────────────────────── */
.g2{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.g2-sm{gap:8px;}
.mu{color:var(--muted);}
.mono{font-family:'DM Mono',monospace;}
.sm{font-size:12px;}
.stats-row{display:flex;gap:1px;background:var(--line);border:1px solid var(--line);border-radius:6px;overflow:hidden;margin-bottom:24px;flex-wrap:wrap;}
.sbox{flex:1;min-width:80px;background:var(--bg);padding:14px 16px;}
.sn{font-family:'DM Mono',monospace;font-size:26px;font-weight:500;}
.sl{font-family:'DM Mono',monospace;font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin-top:2px;}
.img-prev{max-height:100px;border-radius:3px;object-fit:cover;margin-top:8px;}
.vid-prev{max-height:100px;border-radius:3px;margin-top:8px;}


/* ── PAGE TRANSITIONS ──────────────────────────────────────────────────────── */
.page{display:none;}
.page.on{display:block;animation:pageIn .2s ease;}
@keyframes pageIn{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:none;}}


/* ── PAGES ─────────────────────────────────────────────────────────────────── */
.page{display:none;}
.page.on{display:block;animation:pageIn .22s ease;}
@keyframes pageIn{from{opacity:0;transform:translateY(5px);}to{opacity:1;transform:none;}}


/* ── PAGE HEADER (matches Overview style) ──────────────────────────────────── */
.page-header {
  margin-bottom: 18px;
  opacity: 0; animation: statIn .3s ease forwards;
}
.page-header-title {
  font-size: 18px; font-weight: 650; color: var(--text);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 4px;
}
.page-header-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: color-mix(in srgb, var(--off2) 74%, transparent); border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.page-header-icon svg { width: 18px; height: 18px; }
.page-header-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: var(--muted);
  letter-spacing: 0; margin-left: 44px;
}
.page-header-bar {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; flex-wrap: wrap;
}



/* ═══ AUTH, STATUS & COOKIE CONSENT ═════════════════════════════════════════════ */


/* ── STATUS SCREENS ────────────────────────────────────────────────────────── */
.ss{position:fixed;inset:0;z-index:500;background:var(--bg);display:none;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:32px;}
.ss.on{display:flex;}
.ss-content{animation:fadeUp .4s ease;}
.ss-ring{width:100px;height:100px;border-radius:50%;border:2px solid var(--line2);position:relative;margin:0 auto 24px;display:flex;align-items:center;justify-content:center;}
.ss-ring.spin-amber{border-top-color:var(--amber);animation:spin 1.4s linear infinite;}
.ss-ring.spin-red  {border-top-color:var(--red);border-right-color:var(--red);animation:spin 2s linear infinite;}
.ss-dot{width:10px;height:10px;border-radius:50%;background:var(--amber);animation:pulse 1.4s ease-in-out infinite;}
.ss-x{font-size:34px;color:var(--red);animation:flicker 3s ease-in-out infinite;}
.ss-badge{display:inline-block;padding:3px 12px;border-radius:2px;font-family:'DM Mono',monospace;font-size:10px;letter-spacing:.12em;margin-bottom:18px;}
.ss-badge.amber{background:var(--bpb);color:var(--bpc);}
.ss-badge.red  {background:var(--bbb);color:var(--bbc);}
.ss h2{font-size:18px;font-weight:500;margin-bottom:8px;}
.ss p{font-size:13px;color:var(--muted);max-width:300px;line-height:1.7;margin-bottom:22px;}

/* LOGIN SUCCESS */
.ss-check-wrap{width:100px;height:100px;margin:0 auto 24px;}
.ss-check-svg{width:100px;height:100px;}
.ss-check-circle{stroke:var(--green);stroke-dasharray:226;stroke-dashoffset:226;transform-origin:center;transform:rotate(-90deg);}
.ss-check-tick  {stroke:var(--green);stroke-dasharray:60;stroke-dashoffset:60;}
#ss-ok.on .ss-check-circle{animation:drawCircle .55s cubic-bezier(.4,0,.2,1) .05s forwards;}
#ss-ok.on .ss-check-tick  {animation:drawTick   .3s  cubic-bezier(.4,0,.2,1) .55s forwards;}
@keyframes drawCircle{to{stroke-dashoffset:0;}}
@keyframes drawTick  {to{stroke-dashoffset:0;}}
.ss-ok-lbl{font-family:'DM Mono',monospace;font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--green);margin-bottom:8px;opacity:0;}
.ss-ok-usr{font-family:'DM Mono',monospace;font-size:14px;color:var(--text2);opacity:0;}
#ss-ok.on .ss-ok-lbl{animation:fadeUp .3s ease .80s forwards;}
#ss-ok.on .ss-ok-usr{animation:fadeUp .3s ease .95s forwards;}


/* ── EARLY ACCESS LOGIN SCREEN ─────────────────────────────────────────────── */
#ss-ea {
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
/* gold shimmer sweep across the whole bg */
#ss-ea::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    transparent 0%,
    rgba(255,215,0,.06) 40%,
    rgba(255,215,0,.12) 50%,
    rgba(255,215,0,.06) 60%,
    transparent 100%);
  background-size: 300% 300%;
  animation: eaBgSweep 2s ease forwards;
}
@keyframes eaBgSweep {
  0%   { background-position: 200% 200%; opacity: 0; }
  30%  { opacity: 1; }
  100% { background-position: -50% -50%; opacity: 0; }
}
.ss-ea-star-ring {
  width: 100px; height: 100px;
  margin: 0 auto 22px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
/* rotating gold ring */
.ss-ea-ring-svg { width: 100px; height: 100px; position: absolute; top: 0; left: 0; }
.ss-ea-ring-circle {
  stroke: url(#ea-grad);
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  transform-origin: center;
  transform: rotate(-90deg);
}
#ss-ea.on .ss-ea-ring-circle {
  animation: drawCircle .6s cubic-bezier(.4,0,.2,1) .1s forwards;
}
/* center star */
.ss-ea-star {
  font-size: 36px;
  line-height: 1;
  position: relative;
  z-index: 1;
  opacity: 0;
}
#ss-ea.on .ss-ea-star {
  animation: eaStarPop .4s cubic-bezier(.34,1.56,.64,1) .6s forwards;
}
@keyframes eaStarPop {
  0%  { opacity:0; transform:scale(0) rotate(-30deg); }
  100%{ opacity:1; transform:scale(1) rotate(0deg); }
}
/* burst rays */
.ss-ea-rays {
  position: absolute;
  inset: -10px;
  opacity: 0;
}
#ss-ea.on .ss-ea-rays {
  animation: eaRaysIn .5s ease .65s forwards;
}
@keyframes eaRaysIn {
  0%  { opacity:0; transform:rotate(0deg) scale(.7); }
  60% { opacity:.6; }
  100%{ opacity:.25; transform:rotate(22deg) scale(1.1); }
}
.ss-ea-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #b8860b, #ffd700, #b8860b);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: eaShimmer 2s linear infinite;
  margin-bottom: 8px; opacity: 0;
}
#ss-ea.on .ss-ea-lbl { animation: fadeUp .3s ease .9s forwards, eaShimmer 2s linear 1s infinite; }
.ss-ea-sub {
  font-family: 'DM Mono', monospace;
  font-size: 13px; color: var(--text2); opacity: 0;
}
#ss-ea.on .ss-ea-sub { animation: fadeUp .3s ease 1.05s forwards; }
.ss-ea-badge-row {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 12px; opacity: 0;
}
#ss-ea.on .ss-ea-badge-row { animation: fadeUp .3s ease 1.15s forwards; }
.ss-ea-badge {
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .06em;
  font-weight: 500; color: #3a2800;
  background: linear-gradient(90deg, #b8860b 0%, #ffd700 50%, #b8860b 100%);
  background-size: 200% auto;
  animation: eaShimmer 2s linear infinite;
  padding: 3px 10px; border-radius: 3px; border: 1px solid #c9a600;
}


/* ── ADMIN LOGIN SCREEN ────────────────────────────────────────────────────── */
#ss-adm {
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
/* scanline overlay */
#ss-adm::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(239,68,68,.025) 2px,
    rgba(239,68,68,.025) 4px
  );
  pointer-events: none;
  opacity: 0;
  animation: scanFade 1.8s ease forwards;
}
@keyframes scanFade { 0%{opacity:0;} 20%{opacity:1;} 80%{opacity:1;} 100%{opacity:0;} }
/* red pulse vignette */
#ss-adm::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(239,68,68,.08) 100%);
  pointer-events: none;
  opacity: 0;
  animation: admVignette 1.8s ease forwards;
}
@keyframes admVignette { 0%{opacity:0;} 30%{opacity:1;} 80%{opacity:1;} 100%{opacity:0;} }
.ss-adm-ring-wrap {
  width: 100px; height: 100px;
  margin: 0 auto 22px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.ss-adm-ring-svg { width: 100px; height: 100px; position: absolute; top: 0; left: 0; }
.ss-adm-ring-circle {
  stroke: var(--red);
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  transform-origin: center;
  transform: rotate(-90deg);
}
#ss-adm.on .ss-adm-ring-circle {
  animation: drawCircle .5s cubic-bezier(.4,0,.2,1) .1s forwards;
}
.ss-adm-icon {
  font-size: 32px; position: relative; z-index: 1; opacity: 0;
  filter: grayscale(1);
}
#ss-adm.on .ss-adm-icon {
  animation: admIconIn .4s cubic-bezier(.34,1.4,.64,1) .55s forwards;
}
@keyframes admIconIn {
  0%  { opacity:0; transform:scale(.4); filter:grayscale(1); }
  100%{ opacity:1; transform:scale(1);  filter:grayscale(0); }
}
.ss-adm-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red); margin-bottom: 6px; opacity: 0;
}
#ss-adm.on .ss-adm-lbl { animation: fadeUp .3s ease .85s forwards; }
.ss-adm-typerow {
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--text2);
  display: flex; align-items: center; gap: 6px;
  justify-content: center; opacity: 0;
  margin-bottom: 4px;
}
#ss-adm.on .ss-adm-typerow { animation: fadeUp .3s ease .95s forwards; }
/* blinking cursor */
.ss-adm-cursor {
  display: inline-block; width: 8px; height: 14px;
  background: var(--red); vertical-align: middle;
  animation: admBlink .7s step-end infinite;
}
@keyframes admBlink { 0%,100%{opacity:1;} 50%{opacity:0;} }
.ss-adm-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing:.1em;
  color: var(--muted); text-transform: uppercase; opacity: 0;
}
#ss-adm.on .ss-adm-sub { animation: fadeUp .3s ease 1.1s forwards; }

@keyframes spin    {to{transform:rotate(360deg);}}
@keyframes pulse   {0%,100%{opacity:.35;transform:scale(.8);}50%{opacity:1;transform:scale(1.2);}}
@keyframes flicker {0%,100%{opacity:1;}48%{opacity:1;}52%{opacity:.2;}56%{opacity:1;}82%{opacity:1;}86%{opacity:.4;}90%{opacity:1;}}
@keyframes fadeUp  {from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}
@keyframes slideIn {from{transform:translateX(100%);}to{transform:none;}}
@keyframes tOut    {to{transform:translateY(8px);opacity:0;}}


/* ── DEV LOGIN SCREEN ──────────────────────────────────────────────────────── */
#ss-dev {
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
/* blue scanline overlay */
#ss-dev::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(37,99,235,.025) 2px,
    rgba(37,99,235,.025) 4px
  );
  pointer-events: none;
  opacity: 0;
  animation: scanFade 1.8s ease forwards;
}
/* blue pulse vignette */
#ss-dev::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(37,99,235,.08) 100%);
  pointer-events: none;
  opacity: 0;
  animation: devVignette 1.8s ease forwards;
}
@keyframes devVignette { 0%{opacity:0;} 30%{opacity:1;} 80%{opacity:1;} 100%{opacity:0;} }
.ss-dev-ring-wrap {
  width: 100px; height: 100px;
  margin: 0 auto 22px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.ss-dev-ring-svg { width: 100px; height: 100px; position: absolute; top: 0; left: 0; }
.ss-dev-ring-circle {
  stroke: #3b82f6;
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  transform-origin: center;
  transform: rotate(-90deg);
}
#ss-dev.on .ss-dev-ring-circle {
  animation: drawCircle .5s cubic-bezier(.4,0,.2,1) .1s forwards;
}
.ss-dev-icon {
  font-size: 32px; position: relative; z-index: 1; opacity: 0;
  filter: grayscale(1);
}
#ss-dev.on .ss-dev-icon {
  animation: devIconIn .4s cubic-bezier(.34,1.4,.64,1) .55s forwards;
}
@keyframes devIconIn {
  0%  { opacity:0; transform:scale(.4); filter:grayscale(1); }
  100%{ opacity:1; transform:scale(1);  filter:grayscale(0); }
}
.ss-dev-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase;
  color: #3b82f6; margin-bottom: 6px; opacity: 0;
}
#ss-dev.on .ss-dev-lbl { animation: fadeUp .3s ease .85s forwards; }
.ss-dev-typerow {
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--text2);
  display: flex; align-items: center; gap: 6px;
  justify-content: center; opacity: 0;
  margin-bottom: 4px;
}
#ss-dev.on .ss-dev-typerow { animation: fadeUp .3s ease .95s forwards; }
/* blinking cursor — blue */
.ss-dev-cursor {
  display: inline-block; width: 8px; height: 14px;
  background: #3b82f6; vertical-align: middle;
  animation: admBlink .7s step-end infinite;
}
.ss-dev-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing:.1em;
  color: var(--muted); text-transform: uppercase; opacity: 0;
}
#ss-dev.on .ss-dev-sub { animation: fadeUp .3s ease 1.1s forwards; }

/* ── AUTH ──────────────────────────────────────────────────────────────────── */
#auth{
  position:fixed;inset:0;z-index:500;
  background:var(--bg);
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  padding:48px 20px calc(37px + 20px); /* bottom = footer height + breathing room */
  overflow-y:auto;
}
.auth-box{
  width:100%;max-width:400px;
  animation:fadeUp .35s ease;
  display:flex;flex-direction:column;align-items:center;
}
/* Logo — centered above card, full width */
.auth-logo-wrap{
  text-align:center;margin-bottom:24px;width:100%;
}
.auth-logo-wrap .brand-logo{
  display:none;
  max-width:320px;max-height:130px;
  width:auto;height:auto;object-fit:contain;
  margin:0 auto 10px;
}
.auth-logo-wrap .brand-text{
  font-family:'DM Mono',monospace;
  font-size:24px;font-weight:500;letter-spacing:.05em;color:var(--text);
  display:block;line-height:1.1;
}
.auth-logo-wrap small{
  display:block;font-size:10px;color:var(--muted);
  letter-spacing:.14em;margin-top:5px;text-transform:uppercase;font-weight:400;
}
/* Form card */
.auth-card{
  width:100%;
  border:1px solid var(--line);border-radius:10px;
  background:var(--bg);overflow:hidden;
}
.auth-card-head{
  display:flex;align-items:center;justify-content:flex-end;
  padding:9px 12px;border-bottom:1px solid var(--line);
  background:var(--off);gap:8px;
}
.auth-top{display:none;} /* replaced by auth-logo-wrap + auth-card-head */
.auth-brand-corner{display:none;}
.auth-logo{display:none;}
.auth-actions{display:flex;gap:8px;align-items:center;}
.auth-discord{font-size:20px;text-decoration:none;color:var(--text2);transition:color .1s;}
.auth-discord:hover{color:var(--text);}
#auth-tbtn{
  padding:4px 9px;border-radius:4px;
  border:1px solid var(--line2);background:var(--bg);
  font-family:'DM Mono',monospace;font-size:11px;color:var(--muted);cursor:pointer;
  transition:all .1s;
}
#auth-tbtn:hover{color:var(--text);border-color:var(--text);}

/* Tabs — underline style inside card */
.auth-tabs{
  display:flex;
  background:var(--off);
  border-bottom:1px solid var(--line);
  padding:10px 12px 0;
  gap:0;
  margin-bottom:0;
}
.auth-tab{
  flex:1;padding:9px 8px 10px;text-align:center;
  font-size:12px;font-family:'DM Mono',monospace;
  text-transform:uppercase;letter-spacing:.1em;
  color:var(--muted);cursor:pointer;
  border-bottom:2px solid transparent;
  margin-bottom:-1px;
  transition:color .18s, border-color .18s;
  font-weight:400;
}
.auth-tab.on{
  color:var(--text);border-bottom-color:var(--text);font-weight:500;
}
/* Panel container with overflow hidden for slide animation */
.auth-panels{padding:20px;overflow:hidden;}
/* Slide animations */
@keyframes authSlideInRight{from{opacity:0;transform:translateX(22px);}to{opacity:1;transform:none;}}
@keyframes authSlideInLeft {from{opacity:0;transform:translateX(-22px);}to{opacity:1;transform:none;}}
.auth-panel-enter-right{animation:authSlideInRight .22s cubic-bezier(.4,0,.2,1) forwards;}
.auth-panel-enter-left {animation:authSlideInLeft  .22s cubic-bezier(.4,0,.2,1) forwards;}

/* inputs with icon support */
.auth-field{margin-bottom:14px;}
.auth-field-lbl{
  display:block;font-family:'DM Mono',monospace;
  font-size:10px;text-transform:uppercase;letter-spacing:.1em;
  color:var(--muted);margin-bottom:5px;
}
.auth-input-wrap{position:relative;}
.auth-input-wrap .inp{padding-right:40px;}
.pw-toggle{
  position:absolute;right:0;top:0;bottom:0;
  width:40px;display:flex;align-items:center;justify-content:center;
  cursor:pointer;color:var(--muted);background:none;border:none;
  border-radius:0 4px 4px 0;transition:color .1s;
  font-size:15px;
}
.pw-toggle:hover{color:var(--text);}

.auth-err{
  display:none;margin-bottom:12px;
  padding:10px 12px;
  background:var(--dbg);border:1px solid var(--red);
  border-radius:4px;font-size:12px;color:var(--red);
  font-family:'DM Mono',monospace;
  animation:fadeUp .2s ease;
}
.auth-err.on{display:flex;gap:8px;align-items:flex-start;}
.auth-err-icon{flex-shrink:0;font-size:13px;}

.auth-submit{
  width:100%;display:flex;align-items:center;justify-content:center;
  gap:8px;padding:11px 16px;
  font-size:13px;font-weight:500;
  border-radius:5px;cursor:pointer;border:none;
  background:var(--text);color:var(--bg);
  transition:opacity .15s, transform .1s;
  margin-top:4px;
}
.auth-submit:hover{opacity:.85;}
.auth-submit:active{transform:scale(.98);}
.auth-submit:disabled{opacity:.45;cursor:not-allowed;}

/* ── Discord OAuth button (login + register) ─────────────────────────── */
.auth-discord-oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: #5865f2;
  color: #fff;
  box-shadow: 0 2px 12px #5865f233;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  letter-spacing: .01em;
}
.auth-discord-oauth-btn:hover  { opacity: .88; box-shadow: 0 4px 18px #5865f255; }
.auth-discord-oauth-btn:active { transform: scale(.98); }
.auth-discord-oauth-btn:disabled { opacity: .45; cursor: not-allowed; }

.auth-divider{
  display:flex;align-items:center;gap:10px;
  margin:16px 0;color:var(--muted);
  font-family:'DM Mono',monospace;font-size:10px;text-transform:uppercase;letter-spacing:.08em;
}
.auth-divider::before,.auth-divider::after{
  content:'';flex:1;height:1px;background:var(--line);
}

.auth-note{
  margin-top:14px;padding:10px 12px;
  background:var(--off);border-radius:4px;
  font-size:12px;color:var(--text2);
  font-family:'DM Mono',monospace;line-height:1.5;border:1px solid var(--line);
}



/* Register success panel */
#reg-success{
  animation:fadeUp .3s ease;
  text-align:center;
  padding:4px 0 8px;
}
.reg-success-icon{
  width:52px;height:52px;border-radius:50%;
  background:var(--dsbg);border:1px solid var(--green);
  color:var(--green);font-size:22px;
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 14px;
}
.reg-success-title{
  font-size:16px;font-weight:500;color:var(--text);
  margin-bottom:8px;
}
.reg-success-msg{
  font-size:12px;color:var(--text2);line-height:1.65;
  margin-bottom:18px;
  font-family:'DM Mono',monospace;
}
.reg-discord-cta{
  display:flex;align-items:center;justify-content:center;gap:9px;
  width:100%;padding:11px 16px;
  background:#5865f2;color:#fff;
  border-radius:6px;text-decoration:none;
  font-size:13px;font-weight:500;
  transition:opacity .15s,transform .1s;
  margin-bottom:12px;
}
.reg-discord-cta:hover{opacity:.88;}
.reg-discord-cta:active{transform:scale(.98);}
.reg-success-skip{
  font-family:'DM Mono',monospace;
  font-size:11px;color:var(--muted);
}
.auth-footer{margin-top:20px;text-align:center;font-family:'DM Mono',monospace;font-size:11px;color:var(--muted);}
.auth-footer a{color:var(--muted);text-decoration:underline;cursor:pointer;}
.auth-footer a:hover{color:var(--text2);}

/* password strength bar */
.pw-strength{height:2px;border-radius:2px;margin-top:6px;background:var(--line);overflow:hidden;}
.pw-strength-bar{height:100%;border-radius:2px;transition:width .3s,background .3s;width:0%;}

@media(max-width:768px){
  #auth{padding:48px 20px calc(37px + 20px);}
}


/* ── TERMS OF SERVICE BANNER (bottom bar, like cookie banner) ────────────── */
#tos-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 99998;
  background: var(--off); border-top: 1px solid var(--line2);
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom,0px)) 20px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.22);
  display: none;
  animation: cookieSlideUp .3s cubic-bezier(.4,0,.2,1);
}
#tos-banner.on { display: block; }
.tos-inner {
  max-width: 920px; margin: 0 auto;
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.tos-bar-icon { font-size: 20px; flex-shrink: 0; margin-top: 3px; color: var(--text2); }
.tos-bar-text { flex: 1; min-width: 220px; }
.tos-bar-title {
  font-family: 'DM Mono', monospace; font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text); font-weight: 500; margin-bottom: 5px;
}
.tos-bar-desc { font-size: 12px; color: var(--text2); line-height: 1.6; }
.tos-bar-desc a { color: var(--text2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.tos-bar-desc a:hover { color: var(--text); }
.tos-bar-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.tos-bar-btn {
  padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line2); cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all .12s; min-height: 36px;
}
.tos-bar-btn-accept { background: var(--text); color: var(--bg); border-color: var(--text); }
.tos-bar-btn-accept:hover { opacity: .82; }
.tos-bar-btn-decline { background: transparent; color: var(--text2); border-color: var(--line2); }
.tos-bar-btn-decline:hover { background: var(--off2); color: var(--text); }
/* CTA button — replaces the old accept/decline pair */
.tos-bar-cta {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 7px; flex-shrink: 0;
  background: var(--text); color: var(--bg);
  border: none; cursor: pointer;
  font-size: 13px; font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  transition: opacity .12s; white-space: nowrap;
}
.tos-bar-cta:hover { opacity: .82; }
@media (max-width: 600px) {
  .tos-bar-cta { width: 100%; justify-content: center; }
}

/* ── TOS FULL-TEXT MODAL ─────────────────────────────────────────────────── */
#tos-modal {
  display: none; position: fixed; inset: 0; z-index: 100000;
  align-items: center; justify-content: center; padding: 20px;
}
#tos-modal.on { display: flex; }
.tos-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.tos-modal-box {
  position: relative; width: 100%; max-width: 560px;
  background: var(--off); border: 1px solid var(--line2); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; max-height: 88vh;
  animation: tosModalIn .25s cubic-bezier(.4,0,.2,1);
}
@keyframes tosModalIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.tos-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.tos-modal-title {
  font-family: 'DM Mono', monospace; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text); font-weight: 500;
}
.tos-modal-close {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 4px 8px; border-radius: 4px;
  transition: all .1s; min-height: unset; line-height: 1;
}
.tos-modal-close:hover { color: var(--text); background: var(--off2); }
.tos-modal-scroll {
  flex: 1; overflow-y: auto; padding: 18px 20px;
  font-size: 13px; color: var(--text2); line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}
.tos-modal-scroll:focus { outline: none; }
.tos-modal-scroll p { margin-bottom: 8px; }
.tos-modal-footer {
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--line); flex-shrink: 0;
}
/* shared tos text styles */
.tos-h {
  font-family: 'DM Mono', monospace; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text); margin: 14px 0 8px;
}
.tos-list { padding-left: 18px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 5px; }
.tos-list li strong { color: var(--text); }
.tos-hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ── TOS DECLINE INFO PANEL ─────────────────────────────────────────────────── */
#tos-decline-info {
  display: none; position: fixed; inset: 0; z-index: 100002;
  align-items: center; justify-content: center; padding: 20px;
}
#tos-decline-info.on { display: flex; }
.tos-decline-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.tos-decline-panel {
  position: relative; width: 100%; max-width: 540px;
  background: var(--off); border: 1px solid var(--amber);
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; max-height: 88vh;
  animation: tosModalIn .25s cubic-bezier(.4,0,.2,1);
}
.tos-decline-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.tos-decline-head svg { color: var(--amber); flex-shrink: 0; }
.tos-decline-head-title {
  font-family: 'DM Mono', monospace; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text); font-weight: 500;
}
.tos-decline-body {
  flex: 1; overflow-y: auto; padding: 18px 20px;
  font-size: 13px; color: var(--text2); line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}
.tos-decline-block { display: flex; flex-direction: column; gap: 8px; }
.tos-decline-lang {
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2px;
}
.tos-decline-block p strong { color: var(--text); }
.tos-decline-mail {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 7px; margin: 2px 0;
  background: var(--off2); border: 1px solid var(--line2);
  color: var(--text); font-size: 13px; font-weight: 500;
  text-decoration: none; transition: all .12s; word-break: break-all;
}
.tos-decline-mail:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.tos-decline-mail svg { flex-shrink: 0; }
.tos-decline-hint {
  font-size: 11px; color: var(--muted); line-height: 1.55;
  padding: 8px 10px; border-left: 2px solid var(--line2); margin-top: 2px;
}
.tos-decline-footer {
  padding: 14px 20px; border-top: 1px solid var(--line); flex-shrink: 0;
  display: flex; justify-content: flex-end;
}


/* ── COOKIE BANNER ─────────────────────────────────────────────────────────── */
#cookie-banner{
  position:fixed;bottom:0;left:0;right:0;z-index:99999;
  background:var(--off);border-top:1px solid var(--line2);
  padding:16px 20px calc(16px + env(safe-area-inset-bottom,0px)) 20px;
  box-shadow:0 -4px 24px rgba(0,0,0,.22);
  display:none;
  animation:cookieSlideUp .3s cubic-bezier(.4,0,.2,1);
}
#cookie-banner.on{display:block;}
@keyframes cookieSlideUp{from{transform:translateY(100%);opacity:0;}to{transform:none;opacity:1;}}
.cb-inner{max-width:920px;margin:0 auto;display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap;}
.cb-icon{font-size:22px;flex-shrink:0;margin-top:2px;}
.cb-text{flex:1;min-width:220px;}
.cb-title{font-family:'DM Mono',monospace;font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--text);font-weight:500;margin-bottom:5px;}
.cb-desc{font-size:12px;color:var(--text2);line-height:1.6;}
.cb-desc a{color:var(--text2);text-decoration:underline;text-underline-offset:2px;cursor:pointer;}
.cb-desc a:hover{color:var(--text);}
.cb-actions{display:flex;gap:8px;align-items:center;flex-shrink:0;flex-wrap:wrap;}
.cb-btn{
  min-height:44px;padding:10px 16px;font-size:13px;font-weight:500;
  border-radius:4px;cursor:pointer;border:1px solid transparent;
  font-family:'DM Sans',sans-serif;transition:all .12s;
  white-space:normal;word-break:break-word;
  text-align:center;line-height:1.35;
}
.cb-btn-accept{background:var(--text);color:var(--bg);border-color:var(--text);}
.cb-btn-accept:hover{opacity:.82;}
.cb-btn-decline{background:transparent;color:var(--text2);border-color:var(--line2);}
.cb-btn-decline:hover{background:var(--off2);color:var(--text);}
.cb-btn-settings{background:transparent;color:var(--muted);border-color:transparent;font-size:12px;min-height:36px;padding:8px 10px;}
.cb-btn-settings:hover{color:var(--text2);background:var(--off2);}


/* ── MOBILE: banner buttons stack full-width ───────────────────────────────── */
@media(max-width:600px){
  .cb-inner{gap:12px;}
  .cb-text{min-width:0;}
  .cb-actions{width:100%;display:flex;flex-direction:column;gap:8px;}
  .cb-actions .cb-btn{width:100%;flex:none;}
  .cb-actions .cb-btn-settings{order:-1;}
}


/* ── MOBILE: modal footer buttons stack full-width ─────────────────────────── */
@media(max-width:540px){
  .cm-footer{flex-direction:column;}
  .cm-footer .cb-btn{width:100%;flex:none;}
}


/* ── COOKIE PREFERENCE MODAL ───────────────────────────────────────────────── */
#cookie-modal{
  position:fixed;inset:0;z-index:100000;
  background:rgba(0,0,0,.55);backdrop-filter:blur(4px);
  display:none;align-items:flex-end;justify-content:center;
}
#cookie-modal.on{display:flex;}
@media(min-width:600px){#cookie-modal{align-items:center;}}
.cm-box{
  background:var(--off);border:1px solid var(--line2);
  width:100%;max-width:520px;
  border-radius:16px 16px 0 0;
  padding:0 0 calc(16px + env(safe-area-inset-bottom,0px)) 0;
  max-height:92vh;overflow-y:auto;
  animation:cookieSlideUp .28s cubic-bezier(.4,0,.2,1);
  -webkit-overflow-scrolling:touch;
}
@media(min-width:600px){
  .cm-box{border-radius:12px;max-height:85vh;animation:cmFadeIn .22s ease;}
  @keyframes cmFadeIn{from{opacity:0;transform:scale(.97) translateY(8px);}to{opacity:1;transform:none;}}
}
.cm-drag{width:36px;height:4px;border-radius:2px;background:var(--line2);margin:12px auto 0;}
@media(min-width:600px){.cm-drag{display:none;}}
.cm-head{padding:18px 20px 14px;border-bottom:1px solid var(--line);}
.cm-head-title{font-family:'DM Mono',monospace;font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:var(--text);font-weight:500;margin-bottom:4px;display:flex;align-items:center;gap:8px;}
.cm-head-desc{font-size:12px;color:var(--text2);line-height:1.6;}
.cm-head-desc a{color:var(--text2);text-decoration:underline;text-underline-offset:2px;cursor:pointer;}
.cm-categories{padding:0 20px;}
.cm-cat{border-bottom:1px solid var(--line);padding:14px 0;}
.cm-cat:last-child{border-bottom:none;}
.cm-cat-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px;}
.cm-cat-name{font-family:'DM Mono',monospace;font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--text);font-weight:500;}
.cm-cat-desc{font-size:12px;color:var(--muted);line-height:1.55;}
.cm-cat-badge{font-family:'DM Mono',monospace;font-size:9px;letter-spacing:.08em;text-transform:uppercase;padding:2px 7px;border-radius:3px;flex-shrink:0;}
.cm-cat-badge.required{background:var(--off2);color:var(--muted);border:1px solid var(--line2);}
/* Toggle switch */
.cm-toggle{position:relative;width:42px;height:24px;flex-shrink:0;}
.cm-toggle input{opacity:0;width:0;height:0;position:absolute;}
.cm-toggle-track{
  position:absolute;inset:0;border-radius:12px;
  background:var(--line2);border:1px solid var(--line2);
  transition:background .18s,border-color .18s;cursor:pointer;
}
.cm-toggle input:checked + .cm-toggle-track{background:var(--text);border-color:var(--text);}
.cm-toggle input:disabled + .cm-toggle-track{opacity:.45;cursor:not-allowed;}
.cm-toggle-thumb{
  position:absolute;top:3px;left:3px;width:16px;height:16px;
  border-radius:50%;background:#fff;
  transition:transform .18s cubic-bezier(.4,0,.2,1);
  pointer-events:none;
}
[data-theme="light"] .cm-toggle-thumb{background:var(--off);}
.cm-toggle input:checked ~ .cm-toggle-thumb{transform:translateX(18px);}
.cm-toggle input:disabled ~ .cm-toggle-thumb{opacity:.6;}
.cm-footer{
  padding:14px 20px 0;
  display:flex;gap:8px;flex-wrap:wrap;
  border-top:1px solid var(--line);margin-top:4px;
}
.cm-footer .cb-btn{flex:1;min-width:0;}



/* ═══ CONTENT COMPONENTS ════════════════════════════════════════════════════════ */


/* ── SELECTION GRIDS (callouts / learn / setups — no thumbnails) ───────────── */
.sel-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;}
.sel-tile{
  border:1px solid var(--line);border-radius:8px;
  padding:16px 18px;cursor:pointer;
  background:var(--bg);
  transition:border-color .15s, background .15s, transform .15s;
  display:flex;flex-direction:column;gap:6px;
  opacity:0;
  animation:tileIn .3s ease forwards;
}
.sel-tile:hover{border-color:var(--text);background:var(--off);transform:translateY(-1px);}
.sel-tile:active{transform:translateY(0);}
@keyframes tileIn{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:none;}}
.sel-tile-icon{font-size:20px;line-height:1;margin-bottom:2px;}
.sel-tile-name{font-size:14px;font-weight:500;color:var(--text);}
.sel-tile-meta{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);}
.sel-tile-chips{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;}
.sel-tile-arrow{margin-top:auto;font-size:12px;color:var(--muted);align-self:flex-end;opacity:0;transition:opacity .15s,transform .15s;}
.sel-tile:hover .sel-tile-arrow{opacity:1;transform:translateX(2px);}
/* Staggered entrance */
.sel-tile:nth-child(1){animation-delay:.04s;}
.sel-tile:nth-child(2){animation-delay:.08s;}
.sel-tile:nth-child(3){animation-delay:.12s;}
.sel-tile:nth-child(4){animation-delay:.16s;}
.sel-tile:nth-child(5){animation-delay:.20s;}
.sel-tile:nth-child(6){animation-delay:.24s;}
.sel-tile:nth-child(n+7){animation-delay:.26s;}


/* ── MAP GRID (kept for guides) ────────────────────────────────────────────── */
.map-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px;}
.map-tile{border:1px solid var(--line);border-radius:8px;overflow:hidden;cursor:pointer;transition:border-color .15s,transform .15s;background:var(--bg);}
.map-tile:hover,.map-tile:active{border-color:var(--text);transform:translateY(-1px);}
.mthumb{height:80px;background:var(--off2);overflow:hidden;display:flex;align-items:center;justify-content:center;}
.mthumb img{width:100%;height:100%;object-fit:cover;}
.mthumb-empty{font-family:'DM Mono',monospace;font-size:11px;color:var(--muted);}
.mtbody{padding:11px 13px;}
.mtname{font-size:13px;font-weight:500;}
.mtmeta{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);margin-top:2px;}
.fchips{display:flex;gap:4px;margin-top:7px;flex-wrap:wrap;}
.fchip{padding:2px 8px;background:var(--off);border:1px solid var(--line);border-radius:2px;font-family:'DM Mono',monospace;font-size:10px;color:var(--text2);cursor:pointer;transition:all .1s;min-height:22px;display:inline-flex;align-items:center;}
.fchip:hover,.fchip.on{background:var(--text);color:var(--bg);border-color:var(--text);}


/* ── SETUP LIST (text-only, no thumbnails) ─────────────────────────────────── */
.setup-list{display:flex;flex-direction:column;gap:6px;}
.setup-row{
  border:1px solid var(--line);border-radius:8px;
  padding:14px 16px;cursor:pointer;
  background:var(--bg);
  display:flex;align-items:center;gap:14px;
  transition:border-color .15s,background .15s;
  opacity:0;animation:tileIn .3s ease forwards;
}
.setup-row:hover{border-color:var(--text);background:var(--off);}
.setup-row-icon{
  width:40px;height:40px;border-radius:6px;
  background:var(--off2);border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
  font-size:18px;flex-shrink:0;
}
.setup-row-body{flex:1;min-width:0;}
.setup-row-title{font-size:13px;font-weight:500;color:var(--text);}
.setup-row-meta{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);margin-top:2px;}
.setup-row-right{display:flex;align-items:center;gap:8px;flex-shrink:0;}
.setup-row-media{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);}


/* ── FLASHCARD ─────────────────────────────────────────────────────────────── */
.fcs{max-width:680px;margin:0 auto;}
.fcmeta{font-family:'DM Mono',monospace;font-size:11px;color:var(--muted);margin-bottom:14px;display:flex;align-items:center;justify-content:space-between;}
.fccard{border:1px solid var(--line);border-radius:10px;overflow:hidden;margin-bottom:16px;background:var(--bg);animation:tileIn .25s ease;box-shadow:var(--shadow);}
.fcimg{background:var(--off2);min-height:288px;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;}
.fcimg img{width:100%;object-fit:contain;max-height:384px;}
.fcimg-ph{font-family:'DM Mono',monospace;font-size:12px;color:var(--muted);text-align:center;padding:16px;}
.fcprog{height:3px;background:var(--line);position:absolute;top:0;left:0;right:0;}
.fcprog-f{height:100%;background:var(--text);transition:width .4s cubic-bezier(.4,0,.2,1);}
.fcfoot{padding:18px 20px;}
.fcq{font-size:13px;color:var(--text2);margin-bottom:12px;line-height:1.5;}
.fcrow{display:flex;gap:8px;}
.fcrow input{flex:1;min-width:0;}
.fcres{margin-top:11px;padding:10px 12px;border-radius:6px;font-family:'DM Mono',monospace;font-size:13px;display:none;animation:tileIn .2s ease;}
.fcres.ok      {background:var(--dsbg);color:var(--green);border:1px solid var(--green);}
.fcres.ok-fuzzy{background:var(--dsbg);color:var(--green);border:1px solid var(--green);}
.fcres.close   {background:rgba(234,179,8,.08);color:#ca8a04;border:1px solid rgba(234,179,8,.4);}
.fcres.err     {background:var(--dbg); color:var(--red);  border:1px solid var(--red);}
.fcres-note {
  display: inline-block; margin-left: 8px;
  font-size: 10px; letter-spacing: .04em;
  color: #ca8a04; opacity: .85;
  font-style: italic;
}
.fcnav{display:flex;align-items:center;justify-content:space-between;margin-top:14px;flex-wrap:wrap;gap:8px;}
.fccnt{font-family:'DM Mono',monospace;font-size:11px;color:var(--muted);}
.fcscore{padding:40px 28px;text-align:center;border:1px solid var(--line);border-radius:10px;font-family:'DM Mono',monospace;background:var(--bg);animation:tileIn .35s ease;box-shadow:var(--shadow);}
.fcscore .big{font-size:56px;font-weight:300;line-height:1;margin-bottom:6px;}
.fcscore .big-label{font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin-bottom:24px;}


/* ── SESSION LIVE TIMER ────────────────────────────────────────────────────── */
.fc-timer-bar{
  display:flex;align-items:center;justify-content:space-between;
  padding:6px 0 10px;
  font-family:'DM Mono',monospace;font-size:12px;color:var(--muted);
}
.fc-timer{
  display:inline-flex;align-items:center;gap:5px;
  background:var(--off);border:1px solid var(--line2);
  border-radius:5px;padding:3px 10px;
  font-family:'DM Mono',monospace;font-size:13px;font-weight:500;
  color:var(--text);letter-spacing:.06em;
  transition:color .2s;
}
.fc-timer.running{color:var(--green);}
.fc-timer-icon{font-size:11px;}


/* ── LEADERBOARD ───────────────────────────────────────────────────────────── */
.lb-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px; }
.lb-tab {
  padding:8px 14px; border-radius:5px;
  border:1px solid var(--line2); background:var(--off);
  font-family:'DM Mono',monospace; font-size:11px; letter-spacing:.08em;
  color:var(--muted); cursor:pointer; transition:all .12s; min-height:36px;
}
.lb-tab.on  { background:var(--text); color:var(--bg); border-color:var(--text); }
.lb-tab:not(.on):hover { background:var(--off2); color:var(--text); }

.lb-panel {}
.lb-section { margin-bottom:22px; }
.lb-section-head {
  font-family:'DM Mono',monospace; font-size:10px; letter-spacing:.14em;
  text-transform:uppercase; color:var(--muted);
  padding:6px 0; margin-bottom:8px;
  border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:8px;
}
.lb-map-name { flex:1; font-size:11px; letter-spacing:.1em; }

/* Desktop table */
.lb-table { width:100%; border-collapse:collapse; }
.lb-table th {
  font-family:'DM Mono',monospace; font-size:9px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--muted);
  padding:6px 8px; text-align:left; border-bottom:1px solid var(--line);
}
.lb-table td {
  padding:9px 8px; border-bottom:1px solid var(--line);
  font-size:13px; vertical-align:middle;
}
.lb-table tr:last-child td { border-bottom:none; }
.lb-table tr:hover td { background:var(--off); }
.lb-rank {
  font-family:'DM Mono',monospace; font-size:14px; font-weight:500;
  width:30px; text-align:center; color:var(--muted);
}
.lb-rank-1 { color:#ffd700; }
.lb-rank-2 { color:#c0c0c0; }
.lb-rank-3 { color:#cd7f32; }
.lb-username { font-weight:500; color:var(--text); display:flex; align-items:center; gap:6px; }
.lb-time { font-family:'DM Mono',monospace; font-size:12px; color:var(--green); font-weight:500; }
.lb-pct  { font-family:'DM Mono',monospace; font-size:12px; font-weight:500; }
.lb-meta { font-family:'DM Mono',monospace; font-size:11px; color:var(--muted); }
.lb-empty { text-align:center; padding:28px 16px; font-family:'DM Mono',monospace; font-size:12px; color:var(--muted); }
.lb-self td { background:var(--off) !important; }
[data-theme="dark"] .lb-self td { background:rgba(255,255,255,.04) !important; }

/* Mobile card layout */
.lb-card-list { display:none; flex-direction:column; gap:8px; }
.lb-card {
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border:1px solid var(--line);
  border-radius:10px; background:var(--bg);
  opacity:0;
  animation:lbCardIn .32s cubic-bezier(.4,0,.2,1) forwards;
}
.lb-card.lb-card-self {
  border-color:var(--text);
  background:var(--off);
}
@keyframes lbCardIn {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:none; }
}
.lb-card-rank {
  font-family:'DM Mono',monospace; font-size:22px; font-weight:500;
  min-width:36px; text-align:center; flex-shrink:0; color:var(--muted);
  line-height:1;
}
.lb-card-rank.r1 { color:#ffd700; }
.lb-card-rank.r2 { color:#c0c0c0; }
.lb-card-rank.r3 { color:#cd7f32; }
.lb-card-body { flex:1; min-width:0; }
.lb-card-name {
  font-size:14px; font-weight:500; color:var(--text);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  margin-bottom:4px; display:flex; align-items:center; gap:6px; flex-wrap:wrap;
}
.lb-card-meta-row {
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
}
.lb-card-stat {
  font-family:'DM Mono',monospace; font-size:11px;
  color:var(--muted); display:flex; align-items:center; gap:3px;
}
.lb-card-stat strong { font-weight:500; }
.lb-card-right {
  flex-shrink:0; text-align:right;
}
.lb-card-pct {
  font-family:'DM Mono',monospace; font-size:18px; font-weight:500; line-height:1;
}
.lb-card-bar {
  width:48px; height:3px; background:var(--line2); border-radius:2px;
  overflow:hidden; margin-top:4px; margin-left:auto;
}
.lb-card-bar-fill {
  height:100%; border-radius:2px;
  transition:width .6s cubic-bezier(.4,0,.2,1);
}
.lb-card-time {
  font-family:'DM Mono',monospace; font-size:16px; font-weight:500;
  color:var(--green); line-height:1;
}
.lb-card-self-tag {
  font-family:'DM Mono',monospace; font-size:9px; color:var(--muted);
  background:var(--off2); padding:1px 5px; border-radius:3px;
  border:1px solid var(--line2);
}

/* Staggered card entrance delays */
.lb-card:nth-child(1)  { animation-delay:.03s; }
.lb-card:nth-child(2)  { animation-delay:.07s; }
.lb-card:nth-child(3)  { animation-delay:.11s; }
.lb-card:nth-child(4)  { animation-delay:.15s; }
.lb-card:nth-child(5)  { animation-delay:.19s; }
.lb-card:nth-child(6)  { animation-delay:.22s; }
.lb-card:nth-child(7)  { animation-delay:.25s; }
.lb-card:nth-child(n+8) { animation-delay:.27s; }

/* Loading shimmer for leaderboard */
.lb-skeleton {
  display:flex; flex-direction:column; gap:8px;
}
.lb-skel-card {
  height:68px; border-radius:10px;
  background:linear-gradient(90deg, var(--off) 25%, var(--off2) 50%, var(--off) 75%);
  background-size:200% 100%;
  animation:lbShimmer 1.4s ease-in-out infinite;
}
.lb-skel-card:nth-child(2) { animation-delay:.1s; opacity:.8; }
.lb-skel-card:nth-child(3) { animation-delay:.2s; opacity:.6; }
.lb-skel-card:nth-child(4) { animation-delay:.3s; opacity:.4; }
@keyframes lbShimmer {
  0%   { background-position:200% 0; }
  100% { background-position:-200% 0; }
}

/* Section entry animation */
.lb-section {
  margin-bottom:22px;
  opacity:0; animation:lbSectionIn .3s ease forwards;
}
.lb-section:nth-child(1) { animation-delay:.0s; }
.lb-section:nth-child(2) { animation-delay:.08s; }
.lb-section:nth-child(3) { animation-delay:.14s; }
.lb-section:nth-child(n+4) { animation-delay:.18s; }
@keyframes lbSectionIn {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:none; }
}


/* ── BLUEPRINT ─────────────────────────────────────────────────────────────── */
.bp-wrap{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--off2);min-height:280px;display:flex;align-items:center;justify-content:center;}
.bp-wrap img{width:100%;object-fit:contain;max-height:440px;cursor:zoom-in;}
.bp-empty{font-family:'DM Mono',monospace;font-size:11px;color:var(--muted);text-align:center;padding:16px;}
.bp-zoom{position:fixed;inset:0;z-index:400;background:rgba(0,0,0,.9);display:none;align-items:center;justify-content:center;padding:24px;cursor:zoom-out;}
.bp-zoom.on{display:flex;}
.bp-zoom img{max-width:96vw;max-height:92vh;object-fit:contain;}
.bp-zoom-hint{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);font-family:'DM Mono',monospace;font-size:10px;color:rgba(255,255,255,.5);letter-spacing:.08em;text-transform:uppercase;}


/* ── SIDE BADGES ───────────────────────────────────────────────────────────── */
.sc{display:inline-block;padding:2px 8px;border-radius:3px;font-family:'DM Mono',monospace;font-size:10px;letter-spacing:.04em;}
.sc-atk{background:var(--sab);color:var(--sac);}
.sc-def{background:var(--sdb);color:var(--sdc);}
.sdet-media{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--off2);min-height:200px;display:flex;align-items:center;justify-content:center;}
.sdet-media video,.sdet-media img{width:100%;max-height:440px;object-fit:contain;}


/* ── CALLOUT MAP TILE override (text-only) ─────────────────────────────────── */
.co-map-tile{/* uses sel-tile styles */}



/* ═══ ADMIN COMPONENTS ══════════════════════════════════════════════════════════ */


/* ── ADMIN TABS ────────────────────────────────────────────────────────────── */
/* Admin pages get an inner tab bar for sub-sections */
.admin-tabs {
  display: flex;
  gap: 2px;
  background: var(--off2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.admin-tab {
  flex: 1;
  min-width: 80px;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 12px; font-weight: 500;
  text-align: center; cursor: pointer;
  color: var(--muted);
  transition: background .12s, color .12s;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
  border: none; background: none;
}
.admin-tab:hover { color: var(--text); background: var(--off); }
.admin-tab.on {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .admin-tab.on { background: var(--off2); }

/* Admin panel: show/hide sub-panels */
.admin-panel { display: none; }
.admin-panel.on { display: block; animation: pageIn .18s ease; }

/* Section label with separator */
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin-bottom: 12px; margin-top: 4px;
  display: flex; align-items: center; gap: 10px;
}
.section-label::after { content:''; flex:1; height:1px; background:var(--line); }


/* ── ADMIN CLEANER LAYOUT ──────────────────────────────────────────────────── */
/* Unified admin page wrapper */
.admin-page-wrap { display: flex; flex-direction: column; gap: 20px; }
/* Two-col form+list on admin pages */
.admin-split {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}
@media(max-width:900px){ .admin-split { grid-template-columns: 1fr; } }

/* Form panels within admin */
.admin-form-card { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.admin-form-head { padding: 12px 16px; background: var(--off); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--text); }
.admin-form-body { padding: 16px; }

/* List panel */
.admin-list-card { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.admin-list-head { padding: 12px 16px; background: var(--off); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.admin-list-title { font-size: 13px; font-weight: 500; color: var(--text); }
.admin-list-body { padding: 12px 16px; max-height: 480px; overflow-y: auto; }
.admin-list-body.no-pad { padding: 0; }
.admin-list-empty { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--muted); text-align: center; padding: 24px; }


/* ── ADMIN ROWS ────────────────────────────────────────────────────────────── */
.mrow{display:flex;align-items:center;gap:11px;padding:9px 0;border-bottom:1px solid var(--line);}
.mrow:last-child{border-bottom:none;}
.mrthumb{width:56px;height:36px;border-radius:3px;background:var(--off2);overflow:hidden;flex-shrink:0;}
.mrthumb img{width:100%;height:100%;object-fit:cover;}
.mrinfo{flex:1;min-width:0;}
.mrname{font-size:13px;font-weight:500;}
.mrmeta{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);}
.fcac{border:1px solid var(--line);border-radius:4px;padding:10px 12px;margin-bottom:7px;display:flex;align-items:center;gap:11px;background:var(--bg);}
.fcac-th{width:44px;height:34px;border-radius:3px;background:var(--off2);overflow:hidden;flex-shrink:0;}
.fcac-th img{width:100%;height:100%;object-fit:cover;}
.fcac-info{flex:1;min-width:0;}
.fcac-name{font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.fcac-meta{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);margin-top:1px;}

/* Mobile user cards (replaces table on small screens) */
.user-card{border:1px solid var(--line);border-radius:6px;padding:12px 14px;margin-bottom:8px;background:var(--bg);}
.user-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;}
.user-card-name{font-size:13px;font-weight:500;color:var(--text);}
.user-card-meta{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);margin-bottom:8px;}
.user-card-badges{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:10px;}
.user-card-actions{display:flex;gap:6px;flex-wrap:wrap;}
.user-card-actions .btn-sm{flex:1;min-width:0;justify-content:center;font-size:11px;padding:6px 4px;}


/* ── PAGE EDITOR ───────────────────────────────────────────────────────────── */
.pe-layout{display:grid;grid-template-columns:200px 1fr;gap:14px;height:calc(100vh - 150px);}
.pe-sb{border:1px solid var(--line);border-radius:6px;overflow-y:auto;background:var(--bg);}
.pi{padding:10px 13px;border-bottom:1px solid var(--line);cursor:pointer;transition:all .1s;}
.pi:last-child{border-bottom:none;}
.pi:hover,.pi.on{background:var(--off);}
.pi-title{font-size:13px;font-weight:500;}
.pi-meta{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);margin-top:2px;}
.ed-wrap{border:1px solid var(--line);border-radius:6px;overflow:hidden;display:flex;flex-direction:column;background:var(--bg);}
.ed-tb{padding:7px 10px;border-bottom:1px solid var(--line);display:flex;gap:4px;flex-wrap:wrap;background:var(--off);}
.ed-btn{padding:4px 8px;font-size:11px;border-radius:3px;border:1px solid var(--line2);background:var(--bg);color:var(--text2);cursor:pointer;}
.ed-btn:hover{background:var(--off2);color:var(--text);}
.ed-area{flex:1;padding:14px;outline:none;font-size:14px;line-height:1.7;color:var(--text);overflow-y:auto;background:var(--bg);min-height:200px;}
.ed-area h2{font-size:18px;font-weight:500;margin:14px 0 7px;}
.ed-area h3{font-size:15px;font-weight:500;margin:10px 0 5px;}
.ed-area p{margin-bottom:10px;color:var(--text2);}
.ed-area ul{padding-left:20px;color:var(--text2);}


/* ── SETTINGS TILES (like Overview tiles) ──────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.settings-tile {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); overflow: hidden;
  box-shadow: var(--shadow);
  opacity: 0; animation: statIn .3s ease forwards;
}
.settings-tile:nth-child(1){animation-delay:.05s;}
.settings-tile:nth-child(2){animation-delay:.10s;}
.settings-tile:nth-child(3){animation-delay:.15s;}
.settings-tile:nth-child(4){animation-delay:.20s;}
.settings-tile:nth-child(5){animation-delay:.25s;}
.settings-tile:nth-child(6){animation-delay:.30s;}
.settings-tile:nth-child(7){animation-delay:.35s;}
.settings-tile-head {
  padding: 12px 16px;
  background: var(--off);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.settings-tile-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--off2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.settings-tile-icon svg { width: 14px; height: 14px; }
.settings-tile-title { font-size: 13px; font-weight: 500; color: var(--text); }
.settings-tile-body { padding: 16px; }
@media(max-width:768px){ .settings-grid{grid-template-columns:1fr;} }


/* ── SITE ACCESS ROWS ──────────────────────────────────────────────────────── */
.sa-row{display:flex;align-items:center;justify-content:space-between;padding:11px 14px;border-bottom:1px solid var(--line);gap:12px;}
.sa-row-info{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text);}


/* ── USER FILTER BAR ───────────────────────────────────────────────────────── */
.user-filter-bar {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: var(--off2); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px;
  margin-bottom: 16px;
}
.user-filter-btn {
  padding: 7px 14px; border-radius: 5px;
  font-size: 12px; font-weight: 500;
  cursor: pointer; color: var(--muted);
  transition: background .12s, color .12s;
  white-space: nowrap; border: none; background: none;
  display: flex; align-items: center; gap: 6px;
  font-family: 'DM Sans', sans-serif;
}
.user-filter-btn:hover { color: var(--text); background: var(--off); }
.user-filter-btn.on {
  background: var(--bg); color: var(--text);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .user-filter-btn.on { background: var(--off2); }
.ufc {
  font-family: 'DM Mono', monospace; font-size: 10px;
  background: var(--off2); color: var(--muted);
  padding: 1px 5px; border-radius: 10px; min-width: 18px; text-align: center;
  transition: background .12s, color .12s;
}
.user-filter-btn.on .ufc { background: var(--line); color: var(--text2); }
.ufc.pending-has { background: var(--red) !important; color: #fff !important; }

/* ── User pagination ─────────────────────────────────────────────────────────── */
.user-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 14px 16px 12px;
  border-top: 1px solid var(--line);
}
.user-pg-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 14px; border-radius: 6px; cursor: pointer;
  font-family: 'DM Mono', monospace; font-size: 11px;
  letter-spacing: .06em; font-weight: 500;
  background: var(--adm-surface); border: 1px solid var(--adm-border);
  color: var(--adm-text2); transition: all .12s; min-height: 32px;
}
.user-pg-btn:hover:not(:disabled) { background: var(--off2); color: var(--text); }
.user-pg-btn.disabled, .user-pg-btn:disabled { opacity: .35; cursor: not-allowed; }
.user-pg-info {
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--muted); letter-spacing: .04em; min-width: 90px; text-align: center;
}

/* ── ToS log in user modal ───────────────────────────────────────────────────── */
.tos-log-table { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.tos-log-entry {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 10px; border-radius: 5px;
  background: var(--off); border: 1px solid var(--line);
  font-size: 11px;
}
.tos-log-action { font-weight: 600; font-size: 11px; white-space: nowrap; }
.tos-log-accept   { color: #16a34a; }
.tos-log-withdraw { color: var(--muted); }
.tos-log-date {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--muted); flex: 1; min-width: 130px;
}
.tos-log-ip {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--muted); opacity: .7;
}
.adm-user-modal-loading {
  font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace;
  padding: 6px 0; letter-spacing: .04em;
}
/* Internal ID chip shown next to username in table */
.adm-uid-chip {
  font-family: 'DM Mono', monospace; font-size: 9px;
  color: var(--muted); letter-spacing: .06em;
  background: var(--off2); border: 1px solid var(--line2);
  border-radius: 3px; padding: 1px 5px; flex-shrink: 0;
}
/* Custom ID badge */
.adm-badge-customid {
  background: rgba(99,102,241,.15); color: #818cf8;
  border: 1px solid rgba(99,102,241,.3);
}


/* ── DISCORD LOGIN PANEL ───────────────────────────────────────────────────── */
#auth-discord-panel {
  display: none; /* shown when discord_url set */
  width: 100%;
  margin-top: 16px;
  border: 1px solid #4752c4;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #404eed18, #5865f218);
  animation: fadeUp .3s ease;
}
[data-theme="light"] #auth-discord-panel {
  background: linear-gradient(135deg, #404eed10, #5865f210);
}
.auth-discord-panel-inner {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth-discord-panel-icon {
  width: 42px; height: 42px;
  background: #5865f2;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-discord-panel-icon svg { width: 22px; height: 22px; fill: #fff; }
.auth-discord-panel-text { flex: 1; min-width: 0; }
.auth-discord-panel-title {
  font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px;
}
.auth-discord-panel-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--muted); line-height: 1.4;
}
.auth-discord-panel-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 5px;
  background: #5865f2; color: #fff;
  font-size: 12px; font-weight: 500;
  text-decoration: none;
  transition: opacity .12s, transform .1s;
  white-space: nowrap; flex-shrink: 0;
}
.auth-discord-panel-btn:hover { opacity: .88; }
.auth-discord-panel-btn:active { transform: scale(.97); }
@media(max-width:400px){
  .auth-discord-panel-inner { flex-direction: column; text-align: center; }
}


/* ── DISCORD ICON ──────────────────────────────────────────────────────────── */
.discord-btn{
  display:inline-flex;align-items:center;gap:7px;
  padding:7px 14px;border-radius:4px;text-decoration:none;
  background:#5865f2;color:#fff;font-size:13px;font-weight:500;
  transition:opacity .1s;
}
.discord-btn:hover{opacity:.85;}
.discord-btn svg{width:18px;height:18px;fill:#fff;}



/* ═══ PROFILE ═══════════════════════════════════════════════════════════════════ */


/* ── PROFILE ROLE CARD ─────────────────────────────────────────────────────── */
.prof-role-card{
  border-radius:10px;padding:16px 18px;position:relative;overflow:hidden;
  display:flex;align-items:center;gap:14px;
  margin-bottom:18px;
}
/* User — neutral */
.prof-role-card.role-user{
  border:1px solid var(--line2);
  background:var(--off);
}
/* Early Access — gold */
.prof-role-card.role-ea{
  border:1px solid rgba(255,215,0,.45);
  background:linear-gradient(135deg,rgba(184,134,11,.13),rgba(255,215,0,.06));
  animation:admCardPulse 3.5s ease-in-out infinite;
}
[data-theme="light"] .prof-role-card.role-ea{border-color:rgba(180,130,0,.5);background:linear-gradient(135deg,rgba(200,150,0,.1),rgba(255,215,0,.09));}
.prof-role-card.role-ea::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(255,215,0,.7),transparent);background-size:200% auto;animation:eaShimmer 3s linear infinite;}
/* Admin — red */
.prof-role-card.role-admin{
  border:1px solid rgba(239,68,68,.4);
  background:linear-gradient(135deg,rgba(239,68,68,.12),rgba(239,68,68,.04));
  animation:admCardPulse 3.5s ease-in-out infinite;
}
[data-theme="light"] .prof-role-card.role-admin{border-color:rgba(220,38,38,.45);background:linear-gradient(135deg,rgba(220,38,38,.09),rgba(239,68,68,.04));}
.prof-role-card.role-admin::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(239,68,68,.8),transparent);background-size:200% auto;animation:admSweep 2.8s linear infinite;}
/* Admin+EA — red/gold */
.prof-role-card.role-admin-ea{
  border:1px solid rgba(239,68,68,.4);
  background:linear-gradient(135deg,rgba(239,68,68,.12),rgba(184,134,11,.07));
  animation:admCardPulse 3.5s ease-in-out infinite;
}
[data-theme="light"] .prof-role-card.role-admin-ea{border-color:rgba(220,38,38,.45);background:linear-gradient(135deg,rgba(220,38,38,.08),rgba(200,150,0,.07));}
.prof-role-card.role-admin-ea::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(239,68,68,.8),rgba(255,215,0,.6),transparent);background-size:200% auto;animation:admSweep 2.8s linear infinite;}

.prof-role-icon{
  width:40px;height:40px;border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  font-size:20px;flex-shrink:0;
}
.prof-role-card.role-user    .prof-role-icon{background:var(--off2);}
.prof-role-card.role-ea      .prof-role-icon{background:rgba(255,215,0,.12);border:1px solid rgba(255,215,0,.3);}
.prof-role-card.role-admin   .prof-role-icon{background:rgba(239,68,68,.12);border:1px solid rgba(239,68,68,.3);}
.prof-role-card.role-admin-ea .prof-role-icon{background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.3);}

.prof-role-info{flex:1;min-width:0;}
.prof-role-label{font-family:'DM Mono',monospace;font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-bottom:3px;}
.prof-role-name{font-size:15px;font-weight:500;color:var(--text);margin-bottom:6px;}
.prof-role-badges{display:flex;gap:6px;flex-wrap:wrap;}


/* ── PROFILE PAGE ──────────────────────────────────────────────────────────── */
/* keep profile-avatar for dash-profile-banner reuse */
.profile-avatar {
  width:60px;height:60px;border-radius:50%;
  background:var(--off2);border:2px solid var(--line2);
  display:flex;align-items:center;justify-content:center;
  font-size:24px;font-weight:300;color:var(--text2);flex-shrink:0;
  font-family:'DM Mono',monospace;
}


/* ── PROFILE: USER BANNER (always on top) ──────────────────────────────────── */
.prof-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--off);
  margin-bottom: 14px;
  opacity: 0;
  animation: statIn .35s ease .05s forwards;
}
.prof-banner-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--off2); border: 2px solid var(--line2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 20px; font-weight: 300; color: var(--text2);
  flex-shrink: 0;
}
.prof-banner-info { flex: 1; min-width: 0; }
.prof-banner-name {
  font-size: 16px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.prof-banner-meta {
  font-family: 'DM Mono', monospace;
  font-size: 11px; color: var(--muted);
  margin-top: 2px;
}


/* ── PROFILE STACKED LAYOUT ────────────────────────────────────────────────── */
.prof-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Tiles match dash-tile style */
.prof-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
  position: relative;
  opacity: 0;
  animation: statIn .35s ease calc(var(--ti, 0) * 70ms + .15s) forwards;
}
/* Left accent bar on hover — same as dash-tile */
.prof-tile::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 2px;
  background: var(--text);
  transform: scaleY(0);
  transition: transform .18s ease;
  transform-origin: bottom;
}
.prof-tile:hover::before { transform: scaleY(1); }

/* Tile header */
.prof-tile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 14px;
}
.prof-tile-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--off2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.prof-tile:hover .prof-tile-icon { background: var(--line); }
.prof-tile-icon svg { width: 20px; height: 20px; stroke: var(--text2); }
.prof-tile-title {
  font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.2;
}

/* Tile body */
.prof-tile-body {
  padding: 0 18px 18px;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* Divider */
.prof-divider { height: 1px; background: var(--line); margin: 14px 0; }

/* Section label */
.prof-section-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.prof-section-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Hint text */
.prof-hint {
  font-size: 12px; color: var(--muted);
  font-family: 'DM Mono', monospace;
  line-height: 1.6;
  margin-bottom: 12px;
}
/* ToS status row in profile tile */
.tos-prof-status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  border: 1px solid; margin-bottom: 8px;
}
.tos-prof-status--ok {
  background: rgba(34,197,94,.10); color: var(--green);
  border-color: rgba(34,197,94,.28);
}
.tos-prof-status--no {
  background: rgba(245,158,11,.10); color: var(--amber);
  border-color: rgba(245,158,11,.28);
}
[data-theme="light"] .tos-prof-status--ok { color: #166534; border-color: rgba(22,163,74,.3); background: rgba(22,163,74,.08); }
[data-theme="light"] .tos-prof-status--no { color: #92400e; border-color: rgba(217,119,6,.3);  background: rgba(217,119,6,.08); }

/* Empty state */
.prof-empty {
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--muted);
  padding: 10px 0; text-align: center;
}

/* stat row inside learning tile */
.prof-stats-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px;
}
@media(max-width: 700px) { .prof-stats-row { grid-template-columns: repeat(3, 1fr); } }
@media(max-width: 420px) { .prof-stats-row { grid-template-columns: repeat(2, 1fr); } }
.prof-stat { background: var(--bg); padding: 18px 10px; text-align: center; }
.prof-stat-n {
  font-family: 'DM Mono', monospace;
  font-size: 28px; font-weight: 500; color: var(--text); line-height: 1;
}
.prof-stat-l {
  font-family: 'DM Mono', monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-top: 6px;
}

/* Per-map rows */
.prof-map-list { display: flex; flex-direction: column; }
.map-stat-row { display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--line);animation:tileIn .25s ease forwards; }
.map-stat-row:last-child { border-bottom: none; }
.map-stat-name { flex:1;font-size:13px;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.map-stat-bar-wrap { width:90px;height:5px;background:var(--line);border-radius:3px;overflow:hidden;flex-shrink:0; }
.map-stat-bar-fill { height:100%;border-radius:3px;transition:width .6s cubic-bezier(.4,0,.2,1); }
.map-stat-pct { font-family:'DM Mono',monospace;font-size:12px;width:36px;text-align:right;flex-shrink:0;font-weight:500; }
.map-stat-meta { font-family:'DM Mono',monospace;font-size:11px;color:var(--muted);white-space:nowrap;display:block; }

/* Sparkline */
.session-chart { display:flex;align-items:flex-end;gap:3px;height:44px;margin:8px 0 4px; }
.session-bar { flex:1;border-radius:2px 2px 0 0;min-width:4px;cursor:default;position:relative; }
.session-bar::after { content:attr(data-tip);position:absolute;bottom:110%;left:50%;transform:translateX(-50%);background:var(--text);color:var(--bg);font-family:'DM Mono',monospace;font-size:10px;padding:3px 7px;border-radius:4px;white-space:nowrap;z-index:10;display:none; }
.session-bar:hover::after { display:block; }
.prof-chart-labels { display:flex;justify-content:space-between;font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);margin-top:2px; }

/* Score screen */
.score-details{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:16px 0;}
.score-detail{background:var(--off);border-radius:6px;padding:10px;text-align:center;}
.score-detail-n{font-family:'DM Mono',monospace;font-size:18px;font-weight:500;}
.score-detail-l{font-family:'DM Mono',monospace;font-size:9px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin-top:2px;}

/* prof-stats-row breakpoints handled in the block above */

.co-layout{display:grid;grid-template-columns:1fr 290px;gap:14px;}
.co-list{display:flex;flex-direction:column;gap:4px;max-height:500px;overflow-y:auto;}
.ci{
  padding:10px 12px;border:1px solid var(--line);border-radius:6px;
  display:flex;align-items:center;gap:10px;background:var(--bg);
  cursor:default;transition:background .1s;
}
.ci:hover{background:var(--off);}
.cidot{width:8px;height:8px;border-radius:50%;flex-shrink:0;}
.ciname{font-size:13px;font-weight:500;flex:1;}
.cidesc{font-size:11px;color:var(--muted);margin-top:1px;}
.cifl{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);flex-shrink:0;padding:1px 6px;background:var(--off2);border-radius:2px;}



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


/* ── OS-LIKE WINDOW CHROME ─────────────────────────────────────────────────── */
/* Topbar gets a slight elevation and app-name breadcrumb */
#topbar {
  background: color-mix(in srgb, var(--bg) 92%, var(--off));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  box-shadow: none;
}
/* Page content area feels like a "window body" */
.content {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--off2) 28%, transparent), transparent 360px),
    color-mix(in srgb, var(--off) 72%, var(--bg));
}
[data-theme="dark"] .content {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.035), transparent 360px),
    var(--bg);
}
.content > .page {
  max-width: 1180px;
  margin: 0 auto;
}
#page-team-planner,
#page-coaching {
  max-width: none;
}

/* Cards get window-like elevation */
.card {
  box-shadow: none;
  border-radius: 8px;
}
.chead {
  background: var(--off);
  border-radius: 8px 8px 0 0;
}

/* Window title style for page headers */
.page-title {
  font-size: 18px; font-weight: 500; color: var(--text);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.page-title-icon {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--off2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.page-title-icon svg { width: 16px; height: 16px; }


/* ── DASH HERO (logo + greeting) ───────────────────────────────────────────── */
.dash-hero {
  text-align: center;
  padding: 28px 0 22px;
  opacity: 0;
  animation: statIn .4s ease .05s forwards;
}
.dash-hero-logo {
  max-width: 280px;
  max-height: 110px;
  width: auto; height: auto;
  object-fit: contain;
  display: none; /* shown by applyLogos */
  margin: 0 auto 16px;
}
.dash-hero-wordmark {
  font-family: 'DM Mono', monospace;
  font-size: 28px; font-weight: 500; letter-spacing: .04em;
  color: var(--text); line-height: 1;
  margin-bottom: 6px;
}
.dash-hero-sub {
  font-family: 'DM Mono', monospace;
  font-size: 11px; color: var(--muted);
  letter-spacing: .12em; text-transform: uppercase;
}
.dash-hero-greeting {
  font-family: 'DM Mono', monospace;
  font-size: 11px; color: var(--muted);
  letter-spacing: .08em;
  white-space: nowrap;
}
/* Greeting + badge row */
.dash-hero-greeting-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: nowrap;
}
/* Hero role badge — EA gold */
.dash-hero-badge-ea {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 20px;
  border: 1px solid rgba(255,215,0,.5);
  background: linear-gradient(90deg, rgba(184,134,11,.15), rgba(255,215,0,.08), rgba(184,134,11,.15));
  background-size: 200% auto;
  font-family: 'DM Mono', monospace;
  font-size: 10px; font-weight: 500; letter-spacing: .08em;
  color: #c9960a;
  white-space: nowrap;
  animation: heroBadgeIn .45s cubic-bezier(.34,1.56,.64,1) both, eaShimmer 3s linear infinite;
  position: relative; overflow: hidden;
}
[data-theme="light"] .dash-hero-badge-ea { color: #9a6f00; border-color: rgba(180,130,0,.5); }
.dash-hero-badge-ea::before { content: '★'; font-size: 10px; line-height: 1; }
.dash-hero-badge-ea::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,215,0,.18) 50%, transparent 100%);
  background-size: 200% auto;
  animation: eaShimmer 2.4s linear infinite;
  border-radius: inherit;
}
/* Hero role badge — Admin red */
.dash-hero-badge-adm {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 20px;
  border: 1px solid rgba(239,68,68,.5);
  background: linear-gradient(90deg, rgba(239,68,68,.14), rgba(239,68,68,.06), rgba(239,68,68,.14));
  background-size: 200% auto;
  font-family: 'DM Mono', monospace;
  font-size: 10px; font-weight: 500; letter-spacing: .08em;
  color: var(--red);
  white-space: nowrap;
  animation: heroBadgeIn .45s cubic-bezier(.34,1.56,.64,1) both, admSweepBadge 3s linear infinite, admBadgePulse 3.5s ease-in-out infinite;
  position: relative; overflow: hidden;
}
.dash-hero-badge-adm::before { content: '⬡'; font-size: 10px; line-height: 1; animation: admIconPulse 2.5s ease-in-out infinite; }
.dash-hero-badge-adm::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(239,68,68,.15) 50%, transparent 100%);
  background-size: 200% auto;
  animation: admSweep 2.4s linear infinite;
  border-radius: inherit;
}
@keyframes heroBadgeIn {
  0%   { opacity:0; transform: scale(.6) translateY(4px); }
  100% { opacity:1; transform: scale(1) translateY(0); }
}
@keyframes admSweepBadge { 0%{background-position:200% center;} 100%{background-position:-200% center;} }
@keyframes admBadgePulse { 0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,0);} 50%{box-shadow:0 0 6px 1px rgba(239,68,68,.2);} }
/* Dev hero badge — blue, mirrors admin badge */
.dash-hero-badge-dev {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 20px;
  border: 1px solid rgba(59,130,246,.5);
  background: linear-gradient(90deg, rgba(37,99,235,.14), rgba(37,99,235,.06), rgba(37,99,235,.14));
  background-size: 200% auto;
  font-family: 'DM Mono', monospace;
  font-size: 10px; font-weight: 500; letter-spacing: .08em;
  color: #60a5fa;
  white-space: nowrap;
  animation: heroBadgeIn .45s cubic-bezier(.34,1.56,.64,1) both, devSweepBadge 3s linear infinite, devBadgePulse 3.5s ease-in-out infinite;
  position: relative; overflow: hidden;
}
.dash-hero-badge-dev::before { content: '◈'; font-size: 10px; line-height: 1; animation: devIconPulse 2.5s ease-in-out infinite; }
.dash-hero-badge-dev::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(59,130,246,.15) 50%, transparent 100%);
  background-size: 200% auto;
  animation: devSweep 2.4s linear infinite;
  border-radius: inherit;
}
@keyframes devSweepBadge { 0%{background-position:200% center;} 100%{background-position:-200% center;} }
@keyframes devBadgePulse { 0%,100%{box-shadow:0 0 0 0 rgba(59,130,246,0);} 50%{box-shadow:0 0 6px 1px rgba(59,130,246,.2);} }

/* Stat pills row */
.dash-pills {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.dash-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--off);
  font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted);
  cursor: default;
}
.dash-pill-n {
  font-weight: 500; color: var(--text); font-size: 12px;
}
.dash-pill[onclick] {
  transition: border-color .15s, background .15s, transform .15s;
}
.dash-pill[onclick]:hover {
  border-color: var(--text); background: var(--off2); transform: translateY(-1px);
}
.dash-pill[onclick]:active { transform: translateY(0); }


/* ── DASH STAT TILES ───────────────────────────────────────────────────────── */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.dash-stat-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
  opacity: 0;
  animation: statIn .35s ease calc(var(--dsi, 0) * 60ms + .1s) forwards;
}
.dash-stat-tile:hover {
  border-color: var(--text); background: var(--off);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
[data-theme="dark"] .dash-stat-tile:hover { box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.dash-stat-tile:active { transform: translateY(0); box-shadow: none; }
.dash-stat-tile::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 2px;
  background: var(--text); transform: scaleY(0);
  transition: transform .18s ease; transform-origin: bottom;
}
.dash-stat-tile:hover::before { transform: scaleY(1); }
.dst-icon {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--off2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px; flex-shrink: 0;
  transition: background .15s;
}
.dash-stat-tile:hover .dst-icon { background: var(--line); }
.dst-icon svg { stroke: var(--text2); }
.dst-n {
  font-family: 'DM Mono', monospace;
  font-size: 26px; font-weight: 500; line-height: 1;
  color: var(--text);
}
.dst-l {
  font-family: 'DM Mono', monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted);
}
@media(max-width: 700px) {
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dst-n { font-size: 22px; }
  .dash-stat-tile { padding: 13px 13px 11px; }
}
@media(max-width: 380px) {
  .dst-n { font-size: 18px; }
}


/* ── STAT PILLS ────────────────────────────────────────────────────────────── */
.dash-stat-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  justify-content: center;
}
.dash-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line2);
  border-radius: 20px;
  background: var(--off);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text2);
  transition: border-color .15s, background .15s, color .15s;
  min-height: 34px;
}
.dash-stat-pill:hover { border-color: var(--text); color: var(--text); background: var(--off2); }
.dsp-n { font-family: 'DM Mono', monospace; font-weight: 500; color: var(--text); font-size: 13px; }
.dsp-l { font-size: 12px; color: var(--text2); }


/* ── DASH NAV TILES ────────────────────────────────────────────────────────── */
.dash-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px;
  margin-bottom: 16px;
}
.dash-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
  opacity: 0;
  animation: statIn .35s ease calc(var(--ti) * 70ms + .15s) forwards;
  position: relative;
  overflow: hidden;
  min-height: 80px;
}
.dash-tile:hover {
  border-color: var(--text);
  background: var(--off);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
[data-theme="dark"] .dash-tile:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.dash-tile:active { transform: translateY(0); box-shadow: none; }
/* Accent line on left edge on hover */
.dash-tile::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 2px;
  background: var(--text);
  transform: scaleY(0);
  transition: transform .18s ease;
  transform-origin: bottom;
}
.dash-tile:hover::before { transform: scaleY(1); }
.dash-tile-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--off2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.dash-tile:hover .dash-tile-icon { background: var(--line); }
.dash-tile-icon svg { width: 20px; height: 20px; stroke: var(--text2); }
.dash-tile-label {
  font-size: 14px; font-weight: 500; color: var(--text);
  line-height: 1.2;
}
.dash-tile-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em;
}
.dash-tile-arrow {
  position: absolute; bottom: 14px; right: 16px;
  font-size: 14px; color: var(--line2);
  transition: color .15s, transform .15s;
}
.dash-tile:hover .dash-tile-arrow { color: var(--text); transform: translateX(3px); }


/* ── DISCORD HERO ──────────────────────────────────────────────────────────── */
.dash-discord-hero {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--off);
  margin-bottom: 10px;
  overflow: hidden;
  position: relative;
  opacity: 0;
  animation: statIn .4s ease .6s forwards;
}
[data-theme="dark"] .dash-discord-hero {
  background: linear-gradient(135deg, #1a1c2e 0%, #1a1a18 100%);
  border-color: #2d3060;
}
.dash-discord-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.dash-discord-icon { width: 32px; height: 32px; color: #5865f2; flex-shrink: 0; }
.dash-discord-text { flex: 1; min-width: 0; }
.dash-discord-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.dash-discord-sub { font-size: 11px; color: var(--muted); }


/* ── BUY ME A COFFEE ───────────────────────────────────────────────────────── */
.bmac-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--bg);
  text-decoration: none;
  color: var(--text2);
  transition: border-color .15s, background .15s;
  opacity: 0;
  animation: statIn .4s ease .65s forwards;
}
.bmac-bar:hover { border-color: #f7c948; background: var(--off); }
.bmac-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #f7c948;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  transition: transform .2s;
}
.bmac-bar:hover .bmac-icon { transform: scale(1.1) rotate(-8deg); }
.bmac-text { flex: 1; min-width: 0; }
.bmac-title { font-size: 13px; font-weight: 500; color: var(--text); }
.bmac-sub   { font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace; margin-top: 1px; }
.bmac-cta { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; transition: color .15s; }
.bmac-bar:hover .bmac-cta { color: #c9a200; }

/* ── Dashboard credit ───────────────────────────────────────────────────────── */
.dash-credit {
  display: flex; justify-content: center;
  margin-top: 32px; padding: 20px 0 10px;
  border-top: 1px solid var(--line);
}
.dash-credit-inner {
  display: flex; align-items: center; gap: 14px;
}
.dash-credit-heart {
  font-size: 22px; color: #ef4444; flex-shrink: 0;
  animation: dash-credit-pulse 2.4s ease-in-out infinite;
}
@keyframes dash-credit-pulse {
  0%, 100% { transform: scale(1);    opacity: .8; }
  50%       { transform: scale(1.22); opacity: 1; }
}
.dash-credit-text {
  display: flex; flex-direction: column; gap: 1px;
}
.dash-credit-line {
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}
.dash-credit-names {
  font-family: 'DM Mono', monospace;
  font-size: 15px; font-weight: 500;
  letter-spacing: .06em; color: var(--text2);
  line-height: 1;
}
.dash-credit-amp {
  color: var(--muted); font-size: 12px; margin: 0 3px;
}


/* ── DASH PROFILE BANNER ───────────────────────────────────────────────────── */
.dash-profile-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--off);
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
  opacity: 0;
  animation: statIn .4s ease .42s forwards;
  position: relative;
  overflow: hidden;
}
.dash-profile-banner::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--text2);
  border-radius: 3px 0 0 3px;
  transform: scaleY(0);
  transition: transform .2s cubic-bezier(.4,0,.2,1);
}
.dash-profile-banner:hover { border-color: var(--line2); background: var(--off2); box-shadow: var(--shadow); }
.dash-profile-banner:hover::before { transform: scaleY(1); }
.dash-profile-banner:active { transform: translateY(0); box-shadow: none; }
.dash-profile-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--off2);
  border: 1px solid var(--line2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 16px; font-weight: 500;
  color: var(--text2);
  flex-shrink: 0;
  transition: background .15s;
}
.dash-profile-banner:hover .dash-profile-avatar { background: var(--line); }
.dash-profile-info { flex: 1; min-width: 0; }
.dash-profile-name { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.dash-profile-sub  { font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace; }


/* ── DASH STATS (animated) ─────────────────────────────────────────────────── */
/* keep for backward compat but hidden — pills used instead */
.dash-stats { display: none; }
.dash-stat  { display: none; }
.dash-section-label { display: none; }
/* old action buttons hidden */
.dash-actions { display: none; }
.dash-action-btn { display: none; }

/* statIn keyframe used by dashboard hero, tiles, discord, bmac */
@keyframes statIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}



/* ═══ NOTIFICATION BAR ══════════════════════════════════════════════════════════ */



/* ── NOTIFICATION BAR (global, fixed top) ──────────────────────────────────── */
:root { --notif-h: 0px; }
body.has-notif { --notif-h: 36px; }

#notif-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  background: var(--text);
  color: var(--bg);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: .04em;
  padding: 0 44px 0 16px;
  text-align: center;
  line-height: 1.5;
  /* animation handled via JS class toggle */
  height: 0;
  overflow: hidden;
  transition: height .35s cubic-bezier(.4,0,.2,1), opacity .35s ease;
  opacity: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
#notif-bar.visible {
  height: 36px;
  opacity: 1;
}
#notif-bar.dismissing {
  height: 0;
  opacity: 0;
}
#notif-close {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 14px; opacity: .55; padding: 4px 6px; line-height: 1;
  transition: opacity .1s;
}
#notif-close:hover { opacity: 1; }

/* Push all top-fixed elements down by bar height */
#auth       { padding-top: calc(96px + var(--notif-h)); transition: padding-top .35s cubic-bezier(.4,0,.2,1); }
#shell      { padding-top: var(--notif-h); transition: padding-top .35s cubic-bezier(.4,0,.2,1); }
#nav        { top: var(--notif-h) !important; transition: top .35s cubic-bezier(.4,0,.2,1); }
#nav-overlay{ top: var(--notif-h); transition: top .35s cubic-bezier(.4,0,.2,1); }
.ss         { padding-top: calc(32px + var(--notif-h)); transition: padding-top .35s cubic-bezier(.4,0,.2,1); }
.public-page{ padding-top: calc(24px + var(--notif-h)); transition: padding-top .35s cubic-bezier(.4,0,.2,1); }

@media(max-width:768px){
  body.has-notif { --notif-h: 32px; }
  #notif-bar { font-size: 11px; padding: 0 36px 0 12px; }
  #notif-bar.visible { height: 32px; }
  #auth { padding-top: calc(80px + var(--notif-h)); }
}

/* Shell layout: column so notif bar offset works */
#shell { flex-direction: column; }
#shell-inner { display: flex; flex: 1; overflow: hidden; min-height: 0; }



/* ═══ IMPRESSUM / LEGAL ═════════════════════════════════════════════════════════ */


/* ── IMPRESSUM ─────────────────────────────────────────────────────────────── */
.imp-content-wrap { max-width: 720px; margin: 0 auto; }
.imp-content { font-size: 13px; color: var(--text2); line-height: 1.85; }
.imp-content h1 { font-size: 19px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.imp-content h2 { font-size: 14px; font-weight: 500; color: var(--text); margin: 20px 0 6px; text-transform: uppercase; letter-spacing: .06em; font-family: 'DM Mono', monospace; font-size: 11px; }
.imp-content h3 { font-size: 13px; font-weight: 500; color: var(--text); margin: 12px 0 4px; }
.imp-content p  { margin-bottom: 10px; }
.imp-content a  { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.imp-content ul { padding-left: 18px; margin-bottom: 10px; }
.imp-content li { margin-bottom: 4px; }
.imp-content hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.imp-content .imp-field { margin-bottom: 16px; padding: 12px 14px; background: var(--off); border-radius: 6px; border: 1px solid var(--line); }
.imp-content .imp-field-lbl { font-family: 'DM Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 5px; }
.imp-content .imp-tos-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 20px 0 4px;
  padding: 14px 16px;
  background: var(--off); border: 1px solid var(--line2); border-radius: 8px;
  flex-wrap: wrap;
}
.imp-content .imp-tos-cta-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.imp-content .imp-tos-cta-text strong { color: var(--text); font-size: 13px; font-weight: 500; }
.imp-content .imp-tos-cta-text span  { color: var(--muted); font-size: 12px; line-height: 1.4; }
.imp-content .imp-tos-btn {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 8px 16px; border-radius: 6px;
  border: 1px solid var(--line2); background: var(--off2);
  color: var(--text); font-size: 13px; font-weight: 500;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
  transition: all .12s; min-height: 36px; white-space: nowrap;
}
.imp-content .imp-tos-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.imp-content .imp-tos-btn svg { flex-shrink: 0; }
.public-page { position: fixed; inset: 0; z-index: 250; background: var(--bg); display: none; overflow-y: auto; padding: 28px 20px 60px; }
.public-page.on { display: block; animation: pageIn .22s ease; }
.public-inner { width: 100%; max-width: 720px; margin: 0 auto; }
.public-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.public-title { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }



/* ═══ RESPONSIVE ════════════════════════════════════════════════════════════════ */


/* ── DESKTOP (≥769px) ──────────────────────────────────────────────────────── */
@media(min-width: 769px) {
  .modal-bg  { align-items: center; }
  .modal     { border-radius: 10px; animation: fadeUp .2s ease; }
  /* Restore compact font size on desktop inputs */
  .inp       { font-size: 13px; }
  select.inp { font-size: 13px; }
  /* Desktop tap targets can be slightly smaller */
  .btn       { min-height: 36px; }
  .btn-sm    { min-height: 30px; }
  .fchip     { min-height: 24px; }
  .dash-stat-pill { min-height: 34px; }
  .user-filter-btn { min-height: 36px; }
  .cm-toggle { width: 42px; height: 24px; }
  .cm-toggle-thumb { width: 16px; height: 16px; }
  .cm-toggle input:checked ~ .cm-toggle-thumb { transform: translateX(18px); }

  /* Hide scrollbars on desktop (keep scroll functionality) */
  #nav::-webkit-scrollbar,
  .content::-webkit-scrollbar,
  .co-list::-webkit-scrollbar,
  .modal::-webkit-scrollbar,
  .pe-sb::-webkit-scrollbar,
  .tbl-wrap::-webkit-scrollbar,
  .admin-list-body::-webkit-scrollbar,
  .cm-box::-webkit-scrollbar { display: none; }
  #nav,
  .content,
  .co-list,
  .modal,
  .pe-sb,
  .tbl-wrap,
  .admin-list-body,
  .cm-box { scrollbar-width: none; -ms-overflow-style: none; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE (≤768px)
══════════════════════════════════════════════════════════════════════════════ */
@media(max-width: 768px) {

  


/* ── MOBILE (≤768px) ───────────────────────────────────────────────────────── */
@media(max-width: 768px) {

  /* Sidebar: slide-in drawer */
  #nav {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
    width: 272px; min-width: 0;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
  }
  #nav.open       { transform: none; }
  #nav-overlay.on { display: block; }
  #tb-hamburger   { display: flex; }
  .nav-close      { display: block; }

  

  /* Topbar */
  #topbar { padding: 0 16px; gap: 10px; height: 56px; }
  #topbar-brand-text { font-size: 11px; }

  

  /* Content area */
  /* Bottom padding = bottom-nav + legal footer + breathing room */
  .content { padding: 20px 16px calc(68px + 52px + env(safe-area-inset-bottom, 0px)); }

  

  /* Grids → single column */
  .g2     { grid-template-columns: 1fr; }
  .g2-sm  { grid-template-columns: 1fr; }

  

  /* Bottom nav */
  #bottom-nav.app-visible { display: flex; }
  #bottom-nav { bottom: calc(46px + env(safe-area-inset-bottom, 0px)); }
  .bn-item { min-height: 58px; padding: 5px 2px 7px; }
  .bn-item span:not(.bn-icon) {
    display: block;
    max-width: 100%;
    font-size: 10px;
    line-height: 1.1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .bn-icon { width: 28px; height: 26px; }
  .bn-icon svg { width: 22px; height: 22px; }

  

  /* Dashboard */
  .dash-hero          { padding: 24px 0 18px; }
  .dash-hero-wordmark { font-size: 24px; }
  .dash-hero-logo     { max-width: 220px; max-height: 88px; }
  .dash-hero-greeting { font-size: 12px; }

  /* Stat pills: slightly bigger touch targets */
  .dash-stat-pills  { gap: 8px; margin-bottom: 16px; }
  .dash-stat-pill   { padding: 10px 16px; min-height: 44px; font-size: 14px; }
  .dsp-n            { font-size: 15px; }
  .dsp-l            { font-size: 13px; }

  /* Nav tiles: 2-column grid, comfortable height */
  .dash-tiles     { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .dash-tile      { padding: 20px 16px 16px; min-height: 110px; }
  .dash-tile-label { font-size: 14px; }
  .dash-tile-sub  { font-size: 11px; }
  .dash-tile-icon { width: 44px; height: 44px; border-radius: 10px; }
  .dash-tile-icon svg { width: 22px; height: 22px; }
  .dash-tile-arrow { font-size: 16px; bottom: 14px; right: 14px; }

  /* Profile banner */
  .dash-profile-banner  { padding: 16px 18px; }
  .dash-profile-avatar  { width: 46px; height: 46px; font-size: 18px; }
  .dash-profile-name    { font-size: 14px; }

  /* Discord + bmac */
  .dash-discord-inner { padding: 14px 16px; gap: 12px; }
  .dash-discord-icon  { width: 28px; height: 28px; }
  .dash-discord-title { font-size: 14px; }
  .dash-discord-sub   { font-size: 12px; }
  .discord-btn        { padding: 10px 14px; font-size: 13px; min-height: 44px; }
  .bmac-bar           { padding: 14px 16px; }
  .bmac-icon          { width: 34px; height: 34px; font-size: 17px; }
  .bmac-title         { font-size: 14px; }

  

  /* Page headers */
  .page-header        { margin-bottom: 18px; }
  .page-header-title  { font-size: 18px; gap: 10px; }
  .page-header-icon   { width: 40px; height: 40px; border-radius: 10px; }
  .page-header-icon svg { width: 20px; height: 20px; }
  .page-header-sub    { font-size: 12px; margin-left: 50px; }
  .page-header-bar    { gap: 8px; margin-top: 12px; }
  .page-header-bar .inp { font-size: 16px; }

  

  /* Selection grids (callouts / learn / guides) */
  .sel-grid           { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sel-tile           { padding: 16px 14px; }
  .sel-tile-name      { font-size: 14px; }
  .sel-tile-icon      { font-size: 22px; }
  .sel-tile-meta      { font-size: 11px; }

  

  /* Callout layout */
  .co-layout { grid-template-columns: 1fr; gap: 12px; }
  .co-list   { max-height: 260px; }

  /* Blueprint */
  .bp-wrap        { min-height: 200px; }
  .bp-wrap img    { max-height: 280px; }

  /* Floor chips: horizontal scroll */
  .fchips         { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .fchip          { flex-shrink: 0; min-height: 40px; padding: 0 12px; font-size: 12px; }

  

  /* Setup list */
  .setup-list       { gap: 8px; }
  .setup-row        { padding: 14px 16px; gap: 12px; }
  .setup-row-icon   { width: 44px; height: 44px; font-size: 20px; }
  .setup-row-title  { font-size: 14px; }
  .setup-row-meta   { font-size: 11px; }

  /* Setup detail media */
  .sdet-media             { min-height: 200px; }
  .sdet-media video,
  .sdet-media img         { max-height: 320px; }

  

  /* Flashcard */
  .fcimg          { min-height: 240px; }
  .fcimg img      { max-height: 320px; }
  .fcfoot         { padding: 16px 18px; }
  .fcrow          { flex-direction: column; gap: 10px; }
  .fcrow input    { width: 100%; font-size: 16px; }
  .fcrow .btn     { width: 100%; justify-content: center; }
  .fcmeta         { font-size: 12px; }
  .fcscore .big   { font-size: 48px; }
  .score-details  { gap: 10px; }
  .score-detail-n { font-size: 20px; }

  

  /* Back button */
  .back { padding: 12px 0; margin-bottom: 14px; font-size: 12px; }

  

  /* Cards */
  .card  { border-radius: 10px; }
  .cbody { padding: 16px; }

  

  /* Modals: full-width bottom sheet */
  .modal-bg { align-items: flex-end; }
  .modal    {
    border-radius: 18px 18px 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    max-height: 92vh;
  }
  .modal-title { font-size: 16px; margin-bottom: 20px; }

  

  /* Toasts */
  #toasts { right: 16px; left: 16px; bottom: calc(68px + 52px + env(safe-area-inset-bottom, 0px)); }
  .toast  { max-width: 100%; text-align: center; font-size: 13px; padding: 12px 16px; }

  

  /* Auth */
  #auth           { padding: 72px 20px calc(37px + 20px); }
  .auth-submit    { min-height: 52px; font-size: 15px; }
  .auth-card      { padding: 24px 20px; }

  

  /* Profile */
  .prof-banner        { padding: 16px 18px; gap: 13px; }
  .prof-banner-avatar { width: 44px; height: 44px; font-size: 17px; }
  .prof-banner-name   { font-size: 15px; }
  .prof-stat-n        { font-size: 22px; }
  .prof-tile-body     { padding: 0 14px 14px; padding-top: 14px; }
  .prof-tile-head     { padding: 14px 14px 12px; }
  .prof-tile-icon     { width: 36px; height: 36px; }
  .prof-tile-icon svg { width: 18px; height: 18px; }

  

  /* Impressum */
  .public-page    { padding: 20px 16px 80px; }
  /* In-app impressum: no bottom nav shown, so less padding needed */
  #page-impressum { padding-bottom: 24px; }

  

  /* Admin: User filter bar */
  .user-filter-bar  { gap: 3px; padding: 4px; }
  .user-filter-btn  { padding: 9px 12px; font-size: 13px; min-height: 44px; flex: 1; justify-content: center; }
  .ufc              { font-size: 11px; }

  

  /* Admin: split layout */
  .admin-split      { grid-template-columns: 1fr; gap: 12px; }
  .admin-list-body  { max-height: 380px; }
  .admin-form-body  { padding: 18px 16px; }
  .admin-form-head  { padding: 14px 16px; font-size: 14px; }
  .admin-list-head  { padding: 14px 16px; }
  .admin-list-title { font-size: 14px; }

  

  /* Admin: table → horizontal scroll */
  .tbl-wrap { margin: 0 -16px; border-radius: 0; }
  table     { min-width: 520px; font-size: 13px; }
  th        { padding: 10px 14px; font-size: 11px; }
  td        { padding: 12px 14px; }
  td .btn-sm { padding: 8px 10px; font-size: 12px; min-height: 38px; }
  .tbl-actions { display: flex; gap: 5px; flex-wrap: wrap; }

  

  /* Admin: map/card rows */
  .mrthumb  { width: 52px; height: 34px; }
  .mrname   { font-size: 13px; }
  .mrmeta   { font-size: 11px; }
  .fcac     { padding: 10px 12px; gap: 10px; }
  .fcac-th  { width: 46px; height: 36px; }
  .fcac-name { font-size: 13px; }
  .fcac-meta { font-size: 11px; }

  

  /* Admin: user cards (mobile) */
  .user-card          { padding: 14px 16px; border-radius: 8px; margin-bottom: 10px; }
  .user-card-name     { font-size: 14px; }
  .user-card-meta     { font-size: 11px; }
  .user-card-actions .btn-sm { flex: 1; min-width: 0; justify-content: center;
                               font-size: 13px; padding: 10px 8px; min-height: 44px; }

  

  /* Settings */
  .settings-grid      { grid-template-columns: 1fr; }
  .settings-tile-head { padding: 14px 16px; }
  .settings-tile-body { padding: 18px 16px; }
  .settings-tile-title { font-size: 14px; }
  .upz                { padding: 24px 16px; font-size: 14px; min-height: 80px; }

  

  /* Page editor */
  .pe-layout        { grid-template-columns: 1fr; height: auto; gap: 10px; }
  .pe-layout .pe-sb { display: none; }

  

  /* Map grid */
  .map-grid   { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

  /* Leaderboard: switch to card layout */
  .lb-table, .lb-table thead, .lb-table tbody, .lb-table tr { display:none !important; }
  .card:has(.lb-table) { display:none !important; }
  .lb-card-list { display:flex !important; }
  .mthumb     { height: 88px; }
  .mtbody     { padding: 10px 12px; }
  .mtname     { font-size: 13px; }
  .mtmeta     { font-size: 11px; }

  

  /* Old stats row */
  .stats-row  { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   SMALL PHONES (≤400px)
══════════════════════════════════════════════════════════════════════════════ */
@media(max-width: 400px) {
  /* Single column selection grid on very small screens */
  .sel-grid           { grid-template-columns: 1fr; }
  .dash-hero-wordmark { font-size: 20px; }
  .dash-hero-logo     { max-width: 170px; max-height: 68px; }
  .dash-tile          { padding: 16px 14px; min-height: 100px; }
  .dash-tile-label    { font-size: 13px; }

  /* Buttons: full size for thumb use */
  .btn                { font-size: 14px; }
  .btn-sm             { font-size: 13px; min-height: 44px; }
  .content            { padding: 14px 14px calc(68px + 52px + env(safe-area-inset-bottom, 0px)); }
  .fcscore .big       { font-size: 42px; }

  /* Auth */
  #auth               { padding: 60px 16px calc(37px + 20px); }
  .auth-submit        { font-size: 15px; }

  /* Tables: allow tighter on tiny phones */
  table               { font-size: 12px; min-width: 480px; }
  th, td              { padding: 10px 10px; }
}

}


/* ── SAFE AREA (notch / home bar) ──────────────────────────────────────────── */
@supports(padding: max(0px)) {
  /* On mobile, content bottom already accounts for nav + footer; add home-bar here */
  @media(max-width: 768px) {
    .content {
      padding-bottom: max(calc(68px + 52px + 16px), calc(68px + 52px + env(safe-area-inset-bottom) + 8px));
    }
    #bottom-nav {
      bottom: calc(46px + env(safe-area-inset-bottom, 0px));
      padding-bottom: 0;
    }
  }
  .nav-foot {
    padding-bottom: max(calc(14px + 37px), calc(env(safe-area-inset-bottom) + 37px + 8px));
  }
  .modal {
    padding-bottom: max(32px, calc(env(safe-area-inset-bottom) + 20px));
  }
}


/* ── OPERATORS ──────────────────────────────────────────────────────────────── */

/* Side toggle — Attack / Defense */
.ops-side-toggle {
  display: flex;
  gap: 0;
  background: var(--off2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  width: fit-content;
  margin-bottom: 20px;
  position: relative;
}
.ops-side-btn {
  position: relative;
  padding: 8px 22px;
  border-radius: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 500; cursor: pointer; border: none;
  background: transparent; color: var(--muted);
  transition: color .2s; z-index: 1;
  display: flex; align-items: center; gap: 7px; min-height: 38px;
}
.ops-side-btn.on { color: var(--text); }
.ops-side-btn.atk.on { color: #60a5fa; }
.ops-side-btn.def.on { color: #f87171; }
/* Sliding pill indicator */
.ops-side-pill {
  position: absolute;
  top: 3px; bottom: 3px;
  border-radius: 5px;
  background: var(--off);
  border: 1px solid var(--line2);
  transition: left .22s cubic-bezier(.4,0,.2,1), width .22s cubic-bezier(.4,0,.2,1);
  pointer-events: none; z-index: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.ops-side-btn .ops-side-icon {
  font-size: 14px; line-height: 1; flex-shrink: 0;
}

/* Operator grid */
.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
@media(min-width: 600px) {
  .ops-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
}
@media(min-width: 900px) {
  .ops-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
}

/* Individual operator card — R6 style */
.op-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #0a0a0a;
  aspect-ratio: 1/1;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  opacity: 0;
  animation: opCardIn .28s cubic-bezier(.4,0,.2,1) forwards;
}
.op-card:hover {
  border-color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
[data-theme="dark"] .op-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.op-card:active { transform: translateY(0); box-shadow: none; }

/* Staggered entrance */
.op-card:nth-child(1)  { animation-delay:.02s }
.op-card:nth-child(2)  { animation-delay:.04s }
.op-card:nth-child(3)  { animation-delay:.06s }
.op-card:nth-child(4)  { animation-delay:.08s }
.op-card:nth-child(5)  { animation-delay:.10s }
.op-card:nth-child(6)  { animation-delay:.12s }
.op-card:nth-child(7)  { animation-delay:.14s }
.op-card:nth-child(8)  { animation-delay:.16s }
.op-card:nth-child(9)  { animation-delay:.18s }
.op-card:nth-child(10) { animation-delay:.20s }
.op-card:nth-child(11) { animation-delay:.21s }
.op-card:nth-child(12) { animation-delay:.22s }
.op-card:nth-child(n+13) { animation-delay:.23s }
@keyframes opCardIn {
  from { opacity:0; transform:scale(.94) translateY(8px); }
  to   { opacity:1; transform:none; }
}

.op-card-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
}
/* Placeholder when no image */
.op-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #0a0a0a;
  font-size: 32px; color: rgba(255,255,255,.2);
}
/* Name overlay at bottom */
.op-card-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px 6px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: .10em; text-transform: uppercase;
  font-weight: 500; color: #fff;
  text-align: center; line-height: 1.2;
}
/* Side color accent — left border flashes on hover */
.op-card::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 2px;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}
.op-card:hover::before { opacity: 1; }
.ops-side-atk .op-card::before { background: #60a5fa; }
.ops-side-def .op-card::before { background: #f87171; }

/* Speed / armor badges on card corner */
.op-card-badges {
  position: absolute; top: 5px; right: 5px;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-end;
  z-index: 2;
}
.op-badge {
  font-family: 'DM Mono', monospace;
  font-size: 8px; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 4px; border-radius: 2px; line-height: 1.5;
  background: rgba(0,0,0,.55); color: rgba(255,255,255,.9);
  backdrop-filter: blur(2px);
}

/* Empty state */
.ops-empty {
  text-align: center; padding: 48px 16px;
  font-family: 'DM Mono', monospace; font-size: 12px; color: var(--muted);
}

/* ── OPERATOR DETAIL VIEW ───────────────────────────────────────────────────── */
.op-detail-header {
  display: flex; gap: 20px; align-items: flex-start;
  margin-bottom: 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.op-detail-portrait {
  width: 110px; height: 110px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--line2);
  background: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
}
.op-detail-portrait img {
  width: 100%; height: 100%; object-fit: contain; padding: 6px;
}
.op-detail-portrait-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}
.op-detail-info { flex: 1; min-width: 0; }
.op-detail-name {
  font-family: 'DM Mono', monospace;
  font-size: 22px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text);
  margin-bottom: 8px;
}
.op-detail-side {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 3px;
}
.op-detail-side.atk { background: rgba(96,165,250,.15); color: #60a5fa; border: 1px solid rgba(96,165,250,.35); }
.op-detail-side.def { background: rgba(248,113,113,.15); color: #f87171; border: 1px solid rgba(248,113,113,.35); }

/* ── Meta status badge ──────────────────────────────────────────────────────── */
.op-meta-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; margin-bottom: 16px;
  border-radius: 7px; font-size: 13px; font-weight: 500;
  letter-spacing: .01em; border: 1px solid transparent;
  width: 100%; box-sizing: border-box;
}
.op-meta-overpicked-strong  { background: rgba(239,68,68,.10);  color: #ef4444; border-color: rgba(239,68,68,.25);  }
.op-meta-overpicked-weak    { background: rgba(234,179,8,.10);  color: #ca8a04; border-color: rgba(234,179,8,.25);  }
.op-meta-underpicked-strong { background: rgba(34,197,94,.10);  color: #16a34a; border-color: rgba(34,197,94,.25);  }
.op-meta-underpicked-weak   { background: rgba(148,163,184,.10);color: var(--text2); border-color: rgba(148,163,184,.2); }

/* ── Stat tiles row ─────────────────────────────────────────────────────────── */
.op-stats-row {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px;
}
.op-stat-tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 16px; border-radius: 8px;
  background: var(--off); border: 1px solid var(--line);
  min-width: 90px; flex: 1; max-width: 130px;
}
.op-stat-tile-wide {
  max-width: none; flex: 2;
}
.op-stat-label {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.op-stat-dots {
  display: flex; gap: 5px; align-items: center;
}
.op-stat-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line2); border: 1px solid var(--line2);
  flex-shrink: 0;
}
.op-stat-dots.spd .op-stat-dot.on { background: #60a5fa; border-color: #60a5fa; }
.op-stat-dots.arm .op-stat-dot.on { background: #f87171; border-color: #f87171; }
.op-stat-val {
  font-family: 'DM Mono', monospace; font-size: 20px; font-weight: 600;
  color: var(--text); line-height: 1;
}
.op-stat-role-val {
  font-size: 14px; font-weight: 500; color: var(--text);
  line-height: 1.3;
}

/* ── Notes section ──────────────────────────────────────────────────────────── */
.op-notes-section {
  border-top: 1px solid var(--line); padding-top: 16px;
}
.op-notes-heading {
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.op-meta-content {
  font-size: 13px; color: var(--text2); line-height: 1.85;
}
.op-meta-content h2 {
  font-size: 11px; font-weight: 500; color: var(--text);
  margin: 22px 0 8px; font-family: 'DM Mono', monospace;
  text-transform: uppercase; letter-spacing: .06em;
}
.op-meta-content h3 { font-size: 13px; font-weight: 500; color: var(--text); margin: 14px 0 5px; }
.op-meta-content p  { margin-bottom: 10px; }
.op-meta-content ul { padding-left: 18px; margin-bottom: 10px; }
.op-meta-content li { margin-bottom: 4px; }
.op-meta-content a  { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Admin operator card (management list) */
.aop-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  transition: background .1s;
}
.aop-row:last-child { border-bottom: none; }
.aop-row.aop-drag-over {
  background: rgba(99,179,237,0.08);
  border-radius: 4px;
  outline: 1px dashed rgba(99,179,237,0.4);
}
.aop-thumb {
  width: 44px; height: 44px; border-radius: 4px;
  background: #0a0a0a; overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.aop-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.aop-thumb-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.aop-info { flex: 1; min-width: 0; }
.aop-name { font-size: 13px; font-weight: 500; color: var(--text); }
.aop-meta { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); margin-top: 2px; }
.aop-side {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: .08em;
  text-transform: uppercase; padding: 1px 6px; border-radius: 2px;
  display: inline-block; margin-top: 2px;
}
.aop-side.atk { background: rgba(96,165,250,.15); color: #60a5fa; }
.aop-side.def { background: rgba(248,113,113,.15); color: #f87171; }

/* Search bar for operator grid */
.ops-search-wrap {
  position: relative; margin-bottom: 14px;
}
.ops-search-wrap .inp {
  padding-left: 34px;
}
.ops-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}



/* ═══════════════════════════════════════════════════════════════════════════
   macOS ADMIN UX — additive layer, both themes
   Principles: System Preferences tile grid, SF sidebar accent, clean tokens
═══════════════════════════════════════════════════════════════════════════ */

/* ── Theme tokens ─────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --adm-bg:        #111110;
  --adm-surface:   #1c1c1e;
  --adm-surface2:  #2c2c2e;
  --adm-surface3:  #3a3a3c;
  --adm-border:    rgba(255,255,255,.09);
  --adm-border2:   rgba(255,255,255,.05);
  --adm-text:      rgba(255,255,255,.88);
  --adm-text2:     rgba(255,255,255,.55);
  --adm-label:     rgba(255,255,255,.38);
  --adm-hover:     rgba(255,255,255,.05);
  --adm-active:    rgba(255,255,255,.10);
  --adm-red:       #ff453a;
  --adm-red-bg:    rgba(255,69,58,.10);
  --adm-red-brd:   rgba(255,69,58,.25);
  --adm-green:     #30d158;
  --adm-green-bg:  rgba(48,209,88,.10);
  --adm-amber:     #ffd60a;
  --adm-amber-bg:  rgba(255,214,10,.10);
  --adm-blue:      #0a84ff;
  --adm-blue-bg:   rgba(10,132,255,.10);
  --adm-shadow:    0 2px 20px rgba(0,0,0,.40);
  --adm-shadow-sm: 0 1px 6px rgba(0,0,0,.30);
}
[data-theme="light"] {
  --adm-bg:        #f2f2f7;
  --adm-surface:   #ffffff;
  --adm-surface2:  #f9f9fb;
  --adm-surface3:  #efeff4;
  --adm-border:    rgba(0,0,0,.09);
  --adm-border2:   rgba(0,0,0,.05);
  --adm-text:      #1c1c1e;
  --adm-text2:     rgba(0,0,0,.55);
  --adm-label:     rgba(0,0,0,.38);
  --adm-hover:     rgba(0,0,0,.04);
  --adm-active:    rgba(0,0,0,.07);
  --adm-red:       #ff3b30;
  --adm-red-bg:    rgba(255,59,48,.08);
  --adm-red-brd:   rgba(255,59,48,.22);
  --adm-green:     #34c759;
  --adm-green-bg:  rgba(52,199,89,.09);
  --adm-amber:     #ff9f0a;
  --adm-amber-bg:  rgba(255,159,10,.10);
  --adm-blue:      #0071e3;
  --adm-blue-bg:   rgba(0,113,227,.08);
  --adm-shadow:    0 2px 16px rgba(0,0,0,.08);
  --adm-shadow-sm: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Admin pages get a distinct background tint ───────────────────────── */
#page-a-users,
#page-a-settings,
#page-a-lockouts,
#page-a-operators,
#page-a-maps,
#page-a-cards,
#page-a-setups,
#page-a-guides { background: transparent; }

/* ── macOS Page Header ────────────────────────────────────────────────── */
.adm-page-hd {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--adm-border);
}
.adm-page-hd-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--adm-shadow-sm);
}
.adm-page-hd-icon svg { width: 18px; height: 18px; stroke: var(--adm-text2); }
.adm-page-hd-body { flex: 1; min-width: 0; }
.adm-page-hd-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--adm-text);
  letter-spacing: -.02em;
  line-height: 1.2;
}
.adm-page-hd-sub {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--adm-label);
  letter-spacing: .04em;
  margin-top: 3px;
}
.adm-page-hd-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ── macOS Tile Grid ──────────────────────────────────────────────────── */
/* Tiles sit in a responsive grid; each tile is a self-contained card */
.adm-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.adm-tile-grid-2col {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .adm-tile-grid-2col { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .adm-tile-grid { grid-template-columns: 1fr; }
}

/* ── macOS Tile Card ──────────────────────────────────────────────────── */
/* ── Admin user detail modal ────────────────────────────────────────────────── */
.adm-name-clickable { cursor: pointer; }
.adm-name-clickable:hover { opacity: .78; }

.adm-user-modal-overlay {
  position: fixed; inset: 0; z-index: 99500;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: admModalFadeIn .15s ease;
}
@keyframes admModalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.adm-user-modal-box {
  width: 100%; max-width: 420px;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,.35);
  overflow: hidden;
  animation: admModalSlideIn .18s cubic-bezier(.4,0,.2,1);
}
@keyframes admModalSlideIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.adm-user-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--adm-border);
  background: var(--adm-bg);
}
.adm-user-modal-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.adm-user-modal-username {
  font-size: 15px; font-weight: 700; color: var(--adm-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.adm-user-modal-id {
  font-family: 'DM Mono', monospace; font-size: 11px; color: var(--adm-label);
  flex-shrink: 0;
}
.adm-user-modal-close {
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  color: var(--adm-label); font-size: 14px; border-radius: 6px;
  transition: all .1s; flex-shrink: 0; line-height: 1;
}
.adm-user-modal-close:hover { background: var(--adm-border); color: var(--adm-text); }

.adm-user-modal-body { padding: 14px 18px 18px; }

.adm-user-modal-section {
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--adm-label); margin-bottom: 8px;
}
.adm-user-modal-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--adm-border);
  font-size: 13px;
}
.adm-user-modal-row:last-child { border-bottom: none; }
.adm-user-modal-label { color: var(--adm-text2); font-size: 12px; flex-shrink: 0; }
.adm-user-modal-mono {
  font-family: 'DM Mono', monospace; font-size: 11px; color: var(--adm-text);
  text-align: right; word-break: break-all;
}
.adm-user-modal-yes { color: var(--adm-green, #22c55e); font-size: 12px; font-weight: 600; }
.adm-user-modal-no  { color: var(--adm-label); font-size: 12px; }

.adm-tile {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--adm-shadow);
  display: flex;
  flex-direction: column;
}
/* Tile header bar */
.adm-tile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px 11px;
  background: var(--adm-surface2);
  border-bottom: 1px solid var(--adm-border);
  flex-shrink: 0;
}
.adm-tile-head-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--adm-hover);
  border: 1px solid var(--adm-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.adm-tile-head-icon svg { width: 13px; height: 13px; stroke: var(--adm-text2); }
/* danger variant */
.adm-tile-head-icon.red {
  background: var(--adm-red-bg);
  border-color: var(--adm-red-brd);
}
.adm-tile-head-icon.red svg { stroke: var(--adm-red); }
.adm-tile-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--adm-text);
  letter-spacing: -.01em;
  flex: 1;
}
.adm-tile-title.red { color: var(--adm-red); }
.adm-tile-head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}
.adm-tile-body {
  padding: 16px;
  flex: 1;
}
.adm-tile-body-np { padding: 0; overflow: hidden; }/* no padding for tables */
/* Mobile: user card list sits inside the tile without extra padding */
#user-card-list { padding: 10px 12px; }
@media (max-width: 768px) {
  #user-card-list { padding: 8px 10px; }
}

/* Tile body section divider */
.adm-tile-sep {
  height: 1px;
  background: var(--adm-border);
  margin: 12px -16px;
}

/* ── macOS Buttons ────────────────────────────────────────────────────── */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  transition: all .14s;
  min-height: 30px;
  line-height: 1.2;
}
.adm-btn svg { flex-shrink: 0; }
.adm-btn-primary {
  background: var(--adm-red);
  color: #fff;
  border-color: var(--adm-red);
}
.adm-btn-primary:hover { filter: brightness(1.12); }
.adm-btn-ghost {
  background: var(--adm-hover);
  color: var(--adm-text);
  border-color: var(--adm-border);
}
.adm-btn-ghost:hover { background: var(--adm-active); }
.adm-btn-danger {
  background: var(--adm-red-bg);
  color: var(--adm-red);
  border-color: var(--adm-red-brd);
}
.adm-btn-danger:hover { background: var(--adm-red); color: #fff; }
.adm-btn-ok {
  background: var(--adm-green-bg);
  color: var(--adm-green);
  border-color: rgba(48,209,88,.28);
}
[data-theme="light"] .adm-btn-ok { border-color: rgba(52,199,89,.3); }
.adm-btn-ok:hover { background: var(--adm-green); color: #fff; }
.adm-btn-sm {
  padding: 4px 11px;
  font-size: 12px;
  min-height: 26px;
  border-radius: 7px;
}
.adm-btn:disabled { opacity: .38; cursor: not-allowed; }
.adm-btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── macOS Form fields ────────────────────────────────────────────────── */
.adm-field { margin-bottom: 14px; }
.adm-label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 500;
  color: var(--adm-label);
  margin-bottom: 5px;
}
.adm-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  background: var(--adm-surface3);
  color: var(--adm-text);
  outline: none;
  font-family: 'DM Sans', sans-serif;
  transition: border-color .14s, box-shadow .14s;
  -webkit-appearance: none;
}
[data-theme="light"] .adm-input { background: #f5f5f7; }
.adm-input:focus {
  border-color: var(--adm-red);
  box-shadow: 0 0 0 3px var(--adm-red-bg);
}
select.adm-input { appearance: none; }
textarea.adm-input { resize: vertical; min-height: 88px; line-height: 1.5; }
.adm-hint {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--adm-label);
  margin-top: 4px;
  line-height: 1.5;
}

/* ── macOS Upload Zone ────────────────────────────────────────────────── */
.adm-upzone {
  border: 1.5px dashed var(--adm-border);
  border-radius: 9px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: var(--adm-label);
  font-size: 13px;
  background: var(--adm-surface3);
  transition: border-color .15s, background .15s, color .15s;
}
[data-theme="light"] .adm-upzone { background: #f5f5f7; }
.adm-upzone:hover { border-color: var(--adm-red); color: var(--adm-text); background: var(--adm-red-bg); }
.adm-upzone.has { border-style: solid; border-color: var(--adm-red); }
.adm-upzone input[type=file] { display: none; }

/* ── macOS Filter Segment ─────────────────────────────────────────────── */
.adm-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--adm-surface2);
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: 3px;
}
.adm-seg-btn {
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  color: var(--adm-text2);
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  transition: all .14s;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  min-height: 28px;
}
.adm-seg-btn.on {
  background: var(--adm-surface);
  color: var(--adm-text);
  box-shadow: 0 1px 5px rgba(0,0,0,.14);
}
[data-theme="light"] .adm-seg-btn.on { box-shadow: 0 1px 3px rgba(0,0,0,.10); }
.adm-seg-count {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  background: var(--adm-hover);
  border: 1px solid var(--adm-border);
  padding: 0 5px;
  border-radius: 5px;
  min-width: 18px;
  text-align: center;
  color: var(--adm-label);
}
.adm-seg-btn.on .adm-seg-count { background: var(--adm-surface2); }

/* ── macOS Badges ─────────────────────────────────────────────────────── */
.adm-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  white-space: nowrap;
}
.adm-badge-active  { background: var(--adm-green-bg);  color: var(--adm-green);  border: 1px solid rgba(48,209,88,.22); }
.adm-badge-pending { background: var(--adm-amber-bg);  color: var(--adm-amber);  border: 1px solid rgba(255,214,10,.22); }
.adm-badge-banned  { background: var(--adm-red-bg);    color: var(--adm-red);    border: 1px solid var(--adm-red-brd); }
.adm-badge-admin   { background: var(--adm-red-bg);    color: var(--adm-red);    border: 1px solid var(--adm-red-brd); }
.adm-badge-dev     { background: rgba(37,99,235,.15);  color: #60a5fa;           border: 1px solid rgba(59,130,246,.4); }
.adm-badge-user    { background: var(--adm-hover);     color: var(--adm-text2);  border: 1px solid var(--adm-border); }
.adm-badge-lock    { background: var(--adm-red-bg);    color: var(--adm-red);    border: 1px solid var(--adm-red-brd); }
.adm-badge-warn    { background: var(--adm-amber-bg);  color: var(--adm-amber);  border: 1px solid rgba(255,214,10,.22); }
.adm-badge-ok      { background: var(--adm-green-bg);  color: var(--adm-green);  border: 1px solid rgba(48,209,88,.22); }
.adm-badge-ea {
  background: linear-gradient(90deg,rgba(184,134,11,.2),rgba(255,215,0,.15),rgba(184,134,11,.2));
  color: #c9960a;
  border: 1px solid rgba(255,215,0,.35);
}
/* ToS accepted / not accepted badges */
.adm-badge-tos-ok {
  background: rgba(34,197,94,.12);
  color: var(--green);
  border: 1px solid rgba(34,197,94,.28);
  font-family: 'DM Mono', monospace;
  font-weight: 600;
}
.adm-badge-tos-no {
  background: rgba(245,158,11,.10);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,.28);
  font-family: 'DM Mono', monospace;
  font-weight: 600;
}
[data-theme="light"] .adm-badge-tos-ok { color: #166534; border-color: rgba(22,163,74,.3); }
[data-theme="light"] .adm-badge-tos-no { color: #92400e; border-color: rgba(217,119,6,.3); }
[data-theme="light"] .adm-badge-active  { color: #1d7a2e; border-color: rgba(52,199,89,.3); }
[data-theme="light"] .adm-badge-pending { color: #8a5c00; border-color: rgba(255,159,10,.3); }
[data-theme="light"] .adm-badge-banned  { color: #b02a22; }
[data-theme="light"] .adm-badge-admin   { color: #b02a22; }
[data-theme="light"] .adm-badge-dev     { color: #1d4ed8; border-color: rgba(37,99,235,.35); }
[data-theme="light"] .adm-badge-lock    { color: #b02a22; }
[data-theme="light"] .adm-badge-ok      { color: #1d7a2e; border-color: rgba(52,199,89,.3); }
[data-theme="light"] .adm-badge-warn    { color: #8a5c00; }

/* ── macOS Table ──────────────────────────────────────────────────────── */
.adm-tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.adm-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 520px;
}
.adm-tbl th {
  text-align: left;
  padding: 9px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--adm-label);
  border-bottom: 1px solid var(--adm-border);
  background: var(--adm-surface2);
  font-weight: 500;
  white-space: nowrap;
}
.adm-tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--adm-border2);
  color: var(--adm-text);
  vertical-align: middle;
}
.adm-tbl tr:last-child td { border-bottom: none; }
.adm-tbl tbody tr:hover td { background: var(--adm-hover); }
/* mono cell */
.adm-tbl .adm-cell-mono {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--adm-text2);
}

/* ── macOS List Row ───────────────────────────────────────────────────── */
.adm-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--adm-border2);
  transition: background .12s;
}
.adm-list-row:last-child { border-bottom: none; }
.adm-list-row:hover { background: var(--adm-hover); }
.adm-list-thumb {
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1px solid var(--adm-border);
  background: var(--adm-surface3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.adm-list-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.adm-list-thumb-dark { background: #0a0a0a; }
.adm-list-info { flex: 1; min-width: 0; }
.adm-list-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--adm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-list-meta {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--adm-label);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-list-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}

/* ── Access / Toggle Rows ─────────────────────────────────────────────── */
.adm-access-list {
  border: 1px solid var(--adm-border);
  border-radius: 9px;
  overflow: hidden;
}
.adm-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--adm-border2);
  transition: background .1s;
}
.adm-access-row:last-child { border-bottom: none; }
.adm-access-row:hover { background: var(--adm-hover); }
.adm-access-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--adm-text);
}
.adm-access-row-label svg { width: 14px; height: 14px; stroke: var(--adm-text2); flex-shrink: 0; opacity: .7; }

/* ── Danger Box ───────────────────────────────────────────────────────── */
.adm-danger-box {
  background: var(--adm-red-bg);
  border: 1px solid var(--adm-red-brd);
  border-radius: 9px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.adm-danger-box p {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--adm-text2);
  line-height: 1.65;
}
.adm-danger-box p strong { color: var(--adm-red); font-weight: 500; display: block; margin-bottom: 3px; font-size: 12px; }

/* ── Notif toggle row ─────────────────────────────────────────────────── */
.adm-notif-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.adm-notif-label { font-size: 13px; color: var(--adm-text); flex: 1; }

/* ── Stats Summary Row ────────────────────────────────────────────────── */
.adm-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1px;
  background: var(--adm-border);
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.adm-stat-box {
  background: var(--adm-surface);
  padding: 14px 12px;
}
.adm-stat-n {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--adm-text);
  line-height: 1;
}
.adm-stat-l {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--adm-label);
  margin-top: 4px;
}

/* ── Admin sidebar — keep red accent ──────────────────────────────────── */
/* Override the previous CSS's blue-accent override with red */
#admin-panel-body .nav-item:hover {
  background: rgba(255,69,58,.08) !important;
  color: var(--adm-red) !important;
}
[data-theme="light"] #admin-panel-body .nav-item:hover {
  background: rgba(255,59,48,.07) !important;
  color: var(--adm-red) !important;
}
#admin-panel-body .nav-item.on {
  background: rgba(255,69,58,.12) !important;
  color: var(--adm-red) !important;
}
[data-theme="light"] #admin-panel-body .nav-item.on {
  background: rgba(255,59,48,.10) !important;
  color: var(--adm-red) !important;
}
#admin-panel-body .nav-item.on svg,
#admin-panel-body .nav-item:hover svg {
  opacity: 1 !important;
  stroke: var(--adm-red) !important;
}
/* Admin sidebar label stays red */
.admin-nav-lbl { color: var(--red) !important; opacity: .85 !important; }
.admin-nav-sec::before {
  background: linear-gradient(180deg, var(--red) 0%, transparent 100%) !important;
  opacity: .5 !important;
}
/* Dev-mode: nav label + sidebar accent in blue */
#admin-nav.dev-mode .admin-nav-lbl {
  color: #3b82f6 !important;
  opacity: .85 !important;
}
#admin-nav.dev-mode .admin-nav-lbl svg {
  stroke: #3b82f6 !important;
}
#admin-nav.dev-mode #admin-panel-chevron {
  stroke: #3b82f6 !important;
  opacity: .7 !important;
}
#admin-nav.dev-mode .admin-nav-sec::before {
  background: linear-gradient(180deg, #3b82f6 0%, transparent 100%) !important;
  opacity: .45 !important;
}
/* Dev-mode: nav item hover + active — blue instead of red */
#admin-nav.dev-mode #admin-panel-body .nav-item:hover {
  background: rgba(59,130,246,.1) !important;
  color: #60a5fa !important;
}
[data-theme="light"] #admin-nav.dev-mode #admin-panel-body .nav-item:hover {
  background: rgba(37,99,235,.08) !important;
  color: #2563eb !important;
}
#admin-nav.dev-mode #admin-panel-body .nav-item.on {
  background: rgba(59,130,246,.14) !important;
  color: #60a5fa !important;
}
[data-theme="light"] #admin-nav.dev-mode #admin-panel-body .nav-item.on {
  background: rgba(37,99,235,.11) !important;
  color: #2563eb !important;
}
#admin-nav.dev-mode #admin-panel-body .nav-item.on svg,
#admin-nav.dev-mode #admin-panel-body .nav-item:hover svg {
  opacity: 1 !important;
  stroke: #60a5fa !important;
}
[data-theme="light"] #admin-nav.dev-mode #admin-panel-body .nav-item.on svg,
[data-theme="light"] #admin-nav.dev-mode #admin-panel-body .nav-item:hover svg {
  stroke: #2563eb !important;
}
/* Dev+EA combined card — mirrors adm-ea but in blue+gold */
.nav-user-dev-ea {
  margin-bottom: 10px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(59,130,246,.4);
  background: linear-gradient(135deg, rgba(37,99,235,.1), rgba(184,134,11,.06));
  position: relative; overflow: hidden;
  animation: devCardPulse 3.5s ease-in-out infinite;
}
[data-theme="light"] .nav-user-dev-ea {
  border-color: rgba(37,99,235,.45);
  background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(200,150,0,.06));
}
.nav-user-dev-ea::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,.8), rgba(255,215,0,.5), transparent);
  background-size: 200% auto;
  animation: devSweep 2.8s linear infinite;
}
.nav-user-dev-badges-row {
  display: flex; align-items: center; gap: 5px; margin-top: 5px;
}
/* Admin sidebar card stays red */
.nav-user-adm {
  border-color: rgba(239,68,68,.38) !important;
  background: linear-gradient(135deg,rgba(239,68,68,.09),rgba(239,68,68,.04)) !important;
}
[data-theme="light"] .nav-user-adm {
  border-color: rgba(220,38,38,.35) !important;
  background: linear-gradient(135deg,rgba(220,38,38,.07),rgba(239,68,68,.03)) !important;
}
.nav-user-adm-icon { color: var(--red) !important; }
.nav-user-adm-badge { background: var(--red) !important; }
.nav-user-adm::before { background: linear-gradient(90deg,transparent,rgba(239,68,68,.7),transparent) !important; }

/* ── Admin-list-card / admin-form-card with new adm-tile look ─────────── */
/* Redirect old classes to new token system */
.admin-form-card,
.admin-list-card {
  background: var(--adm-surface) !important;
  border: 1px solid var(--adm-border) !important;
  border-radius: 13px !important;
  box-shadow: var(--adm-shadow) !important;
  overflow: hidden;
}
.admin-form-head,
.admin-list-head {
  background: var(--adm-surface2) !important;
  border-bottom: 1px solid var(--adm-border) !important;
  padding: 12px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--adm-text) !important;
  letter-spacing: -.01em !important;
}
.admin-form-body { padding: 16px !important; }
.admin-list-body { max-height: 560px; overflow-y: auto; }
.admin-list-empty {
  padding: 36px 16px !important;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 11px !important;
  color: var(--adm-label) !important;
  text-transform: uppercase;
  letter-spacing: .08em !important;
}
.admin-list-title {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--adm-text) !important;
  letter-spacing: -.01em !important;
}

/* Settings tiles use new tokens */
.settings-tile {
  background: var(--adm-surface) !important;
  border: 1px solid var(--adm-border) !important;
  border-radius: 13px !important;
  box-shadow: var(--adm-shadow) !important;
  overflow: hidden;
}
.settings-tile-head {
  background: var(--adm-surface2) !important;
  border-bottom: 1px solid var(--adm-border) !important;
  padding: 12px 16px !important;
}
.settings-tile-icon {
  background: var(--adm-hover) !important;
  border: 1px solid var(--adm-border) !important;
  border-radius: 7px !important;
}
.settings-tile-title {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--adm-text) !important;
  letter-spacing: -.01em !important;
}
.settings-tile-body { padding: 16px !important; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

/* Sa-row cleanup */
.sa-row {
  border-bottom: 1px solid var(--adm-border2) !important;
  padding: 10px 0 !important;
}
.sa-row:last-child { border-bottom: none !important; }
.sa-row-info { color: var(--adm-text) !important; font-size: 13px !important; }

/* Table header inside admin pages */
#page-a-users th,
#page-a-lockouts th {
  background: var(--adm-surface2) !important;
  color: var(--adm-label) !important;
  border-bottom: 1px solid var(--adm-border) !important;
  font-family: 'DM Mono', monospace !important;
  font-size: 10px !important;
  letter-spacing: .09em !important;
}
#page-a-users td,
#page-a-lockouts td {
  border-bottom: 1px solid var(--adm-border2) !important;
  color: var(--adm-text) !important;
}
#page-a-users tr:hover td,
#page-a-lockouts tr:hover td {
  background: var(--adm-hover) !important;
}

/* ── Filter bar (user management) new segment style ───────────────────── */
.user-filter-bar {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  background: var(--adm-surface2) !important;
  border: 1px solid var(--adm-border) !important;
  border-radius: 10px !important;
  padding: 3px !important;
  margin-bottom: 14px !important;
  flex-wrap: wrap;
}
.user-filter-btn {
  padding: 5px 13px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  border: none !important;
  background: transparent !important;
  color: var(--adm-text2) !important;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif !important;
  transition: all .14s;
  display: flex; align-items: center; gap: 5px;
  min-height: 28px !important;
}
.user-filter-btn:hover { background: var(--adm-hover) !important; color: var(--adm-text) !important; }
.user-filter-btn.on {
  background: var(--adm-surface) !important;
  color: var(--adm-text) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.13) !important;
}
.ufc {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  background: var(--adm-hover);
  border: 1px solid var(--adm-border);
  padding: 0 5px;
  border-radius: 5px;
  min-width: 18px;
  text-align: center;
  color: var(--adm-label);
}
.user-filter-btn.on .ufc { background: var(--adm-surface2); }

/* ── Page header in admin pages (existing .page-header override) ──────── */
#page-a-users .page-header,
#page-a-settings .page-header,
#page-a-lockouts .page-header {
  opacity: 1 !important;
  animation: none !important;
  margin-bottom: 16px !important;
}
#page-a-users .page-header-title,
#page-a-settings .page-header-title,
#page-a-lockouts .page-header-title {
  font-size: 17px !important;
  font-weight: 600 !important;
  color: var(--adm-text) !important;
  letter-spacing: -.02em !important;
}
#page-a-users .page-header-icon,
#page-a-settings .page-header-icon,
#page-a-lockouts .page-header-icon {
  background: var(--adm-surface) !important;
  border: 1px solid var(--adm-border) !important;
  border-radius: 9px !important;
  box-shadow: var(--adm-shadow-sm) !important;
}
#page-a-users .page-header-sub,
#page-a-settings .page-header-sub,
#page-a-lockouts .page-header-sub {
  color: var(--adm-label) !important;
  font-size: 11px !important;
  letter-spacing: .04em !important;
}

/* ── Page editor tile ────────────────────────────────────────────────── */
#page-a-guides .pe-layout {
  border: 1px solid var(--adm-border);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--adm-shadow);
}
#page-a-guides .pe-sb {
  background: var(--adm-surface2) !important;
  border-right: 1px solid var(--adm-border) !important;
}

/* ── Admin-split two-col layout ──────────────────────────────────────── */
.admin-split {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .admin-split { grid-template-columns: 1fr; } }

/* ── Responsive tweaks for small screens ─────────────────────────────── */
@media (max-width: 768px) {
  .adm-page-hd { margin-bottom: 16px; padding-bottom: 14px; }
  .adm-tile-grid { gap: 10px; }
  .adm-tile-head { padding: 11px 14px 9px; }
  .adm-tile-body { padding: 14px; }
  .adm-tile-sep { margin: 10px -14px; }
  .adm-list-row { padding: 10px 14px; }
  .user-filter-btn { min-height: 38px !important; padding: 7px 12px !important; font-size: 13px !important; flex: 1; justify-content: center; }
  .settings-grid { grid-template-columns: 1fr; }
  .adm-btn { min-height: 38px; }
  .adm-btn-sm { min-height: 32px; }
}


/* ── Discord pill buttons (profile) ─────────────────────────────────── */
.dc-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  line-height: 1;
}
.dc-pill:active { transform: scale(.98); }

.dc-pill--link {
  background: #5865f2;
  color: #fff;
  box-shadow: 0 2px 10px #5865f240;
}
.dc-pill--link:hover { opacity: .88; box-shadow: 0 4px 16px #5865f255; }

.dc-pill--unlink {
  background: #2b2d31;
  color: #b5bac1;
  box-shadow: none;
}
.dc-pill--unlink:hover { background: #3b3d45; color: #fff; }

/* ═══ SCRIM FINDER ══════════════════════════════════════════════════════════ */

/* Ensure settings-tile animations fire correctly inside scrim admin page */
#page-a-scrims .settings-tile {
  opacity: 0;
  animation: statIn .3s ease forwards;
}
#page-a-scrims .settings-tile:nth-child(1) { animation-delay: .05s; }
#page-a-scrims .settings-tile:nth-child(2) { animation-delay: .10s; }
#page-a-scrims .settings-tile:nth-child(3) { animation-delay: .15s; }
#page-a-scrims .adm-tile {
  opacity: 0;
  animation: statIn .3s ease forwards;
}
#page-a-scrims .adm-tile:nth-child(2) { animation-delay: .12s; }
#page-a-scrims .adm-tile:nth-child(3) { animation-delay: .20s; }

/* Tabs */
.scrim-tabs{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:16px;border-bottom:1px solid var(--line);padding-bottom:12px;}
.scrim-tab{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:500;color:var(--text2);background:none;border:1px solid var(--line2);cursor:pointer;transition:all .12s;min-height:38px;}
.scrim-tab.on{background:var(--off2);color:var(--text);border-color:var(--line2);}
.scrim-tab:hover{background:var(--off);color:var(--text);}

/* Panels */
.scrim-panel{display:none;}
.scrim-panel.on{display:block;}

/* Filter bar */
.scrim-filter-bar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px;align-items:center;}
.scrim-filter-sel{flex:1;min-width:140px;max-width:220px;font-size:15px;}
@media(max-width:480px){.scrim-filter-sel{max-width:100%;width:100%;flex:unset;}}

/* Listing cards */
.scrim-card{background:var(--off);border:1px solid var(--line2);border-radius:10px;padding:14px 16px;margin-bottom:10px;transition:border-color .12s;}
.scrim-card:hover{border-color:var(--muted);}
.scrim-card-own{border-color:var(--amber);background:var(--bpb);}
.scrim-card-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px;}
.scrim-card-team{font-weight:600;font-size:14px;}
.scrim-card-meta{display:flex;gap:10px;flex-wrap:wrap;font-size:12px;color:var(--text2);font-family:'DM Mono',monospace;}

/* Accept result panel */
.scrim-accept-result{background:var(--off);border:1px solid var(--green);border-radius:10px;padding:20px;margin-bottom:16px;}

/* Empty states */
.scrim-empty{text-align:center;padding:32px 16px;color:var(--muted);font-family:'DM Mono',monospace;font-size:12px;letter-spacing:.06em;}

/* List body */
.scrim-list-body{min-height:120px;}

/* Mobile: card-style roster */
@media(max-width:767px){
  .scrim-filter-bar{flex-direction:column;}
  .scrim-filter-sel,.scrim-filter-bar .btn{width:100%;max-width:100%;}
  .scrim-card-meta{flex-direction:column;gap:4px;}
}

/* Roster rows */
.scrim-roster-row{display:flex;align-items:center;justify-content:space-between;padding:9px 4px;border-bottom:1px solid var(--line);gap:8px;}
.scrim-roster-row:last-child{border-bottom:none;}
.scrim-roster-info{flex:1;min-width:0;}
.scrim-roster-name{font-size:13px;font-weight:500;display:flex;align-items:center;gap:5px;flex-wrap:wrap;}
.scrim-roster-sub{font-size:11px;color:var(--muted);font-family:'DM Mono',monospace;margin-top:1px;}
.scrim-roster-actions{display:flex;gap:4px;flex-shrink:0;}
.scrim-uplay-edit-inp{width:160px;}
@media(max-width:480px){.scrim-uplay-edit-inp{width:110px;}}

/* Scrim admin control row — same layout as sa-row but separate class
   to avoid triggering savePageAccess() on toggle change */
.scrim-ctrl-row{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;gap:12px;border:1px solid var(--line);border-radius:6px;}


/* ══════════════════════════════════════════════════════════════════════════════
   LEARN CALLOUTS — FLUID DESKTOP LAYOUT
   Scales dynamically with screen width AND height on any resolution.
   body.lrn-active toggled by JS. Mobile (≤768px) 100% untouched.

   Overhead breakdown (height):
     topbar 52px + content-padding-top 16px + .back 44px + back-margin 14px
     + fc-timer-bar 36px + fcfoot 110px + card-border 2px + breathing 20px
     = ~294px reserved → image gets calc(100vh - 294px)

   Width: content area = 100vw - 232px sidebar - 40px padding
══════════════════════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {

  /* ── Content: reduce padding during session for maximum usable space ───── */
  body.lrn-active .content {
    padding: 16px 20px 12px;
  }

  /* ── Shell: fluid width — fills content area up to a generous cap ──────── */
  #lrn-ses .fcs,
  #lrn-done .fcs {
    width: 100%;
    /* 96% of the content pane width (= 100vw minus sidebar minus content padding) */
    max-width: calc((100vw - 232px) * 0.96);
  }

  #lrn-ses .fccard {
    width: 100%;
  }

  /* ── Image container: fills the remaining vertical space precisely ─────── */
  #lrn-ses .fcimg {
    /* Total overhead: topbar(52) + pad-top(16) + .back(58) + timer-bar(36)
       + fcfoot(110) + card-radius/border(4) + breathing(18) = 294px        */
    height: calc(100vh - 420px);
    max-height: 58vh;    /* never taller than 72% of viewport                */
    align-items: center;
    overflow: hidden;
  }

  /* ── Image: fills container fully, aspect ratio preserved ─────────────── */
  #lrn-ses .fcimg img,
  #lrn-ses .fcimg .fcimg-map,
  #lrn-ses .fccard .fcimg img,
  #lrn-ses .fccard .fcimg .fcimg-map {
    width: 100%;
    height: 100%;
    max-height: none !important;
    object-fit: contain;
    object-position: center;
  }

  /* ── Controls: full width, no artificial narrowing ─────────────────────── */
  #lrn-ses .fcfoot { padding: 14px 20px 16px; }
  #lrn-ses .fcrow  { max-width: none; }
  #lrn-ses .fcnav  { max-width: none; }
  #lrn-ses .fcq    { max-width: none; }
}

/* ── Extra room on wide screens (≥1400px) ──────────────────────────────────── */
@media (min-width: 1400px) {
  #lrn-ses .fcs,
  #lrn-done .fcs {
    max-width: calc((100vw - 232px) * 0.92);
  }
}

/* ── Cap on ultrawide to avoid absurdly stretched cards (≥2200px) ────────── */
@media (min-width: 2200px) {
  #lrn-ses .fcs,
  #lrn-done .fcs {
    max-width: 1800px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PREMIUM SYSTEM
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Admin panel max-height — ensure Monetization group is visible ────────── */

/* ── Premium shimmer badge ────────────────────────────────────────────────── */
@keyframes premShimmer { 0%{background-position:0%} 100%{background-position:200%} }
.badge-prem {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-family: 'DM Mono', monospace; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
  background: linear-gradient(90deg, #1a1060, #4f39f6, #1a1060);
  background-size: 200%; animation: premShimmer 3s linear infinite;
  color: #c4b8ff; border: 1px solid #6d5ef6;
}

/* ── Dashboard Pro banner ─────────────────────────────────────────────────── */
.prem-dash-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 16px 20px; border-radius: 12px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(109,94,246,.18), rgba(79,57,246,.08));
  border: 1px solid rgba(109,94,246,.4);
}
.prem-dash-banner-left { display: flex; align-items: center; gap: 12px; }
.prem-dash-banner-icon { font-size: 22px; color: #c4b8ff; }
.prem-dash-banner-title { font-size: 14px; font-weight: 600; color: #e8e2ff; }
.prem-dash-banner-sub { font-size: 12px; color: rgba(196,184,255,.7); margin-top: 2px; }
.prem-dash-banner-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.prem-dash-btn {
  padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .12s; font-family: 'DM Sans', sans-serif;
  border: 1px solid rgba(109,94,246,.6); background: rgba(109,94,246,.3); color: #e8e2ff;
}
.prem-dash-btn:hover { background: rgba(109,94,246,.45); border-color: rgba(109,94,246,.8); }

/* ── Premium upsell block ─────────────────────────────────────────────────── */
.prem-upsell-block {
  background: var(--off); border: 1px solid var(--line2); border-radius: 12px;
  padding: 20px; margin-bottom: 8px;
}
.prem-upsell-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.prem-upsell-badge {
  font-size: 11px; font-family: 'DM Mono', monospace; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
  background: linear-gradient(90deg,#1a1060,#4f39f6,#1a1060); background-size:200%;
  animation: premShimmer 3s linear infinite; color: #c4b8ff; border: 1px solid #6d5ef6;
}
.prem-upsell-title { font-size: 15px; font-weight: 600; color: var(--text); }
.prem-upsell-features { margin-bottom: 14px; }
.prem-upsell-feat { font-size: 13px; color: var(--text2); padding: 4px 0; }
.prem-upsell-contact { font-size: 12px; color: var(--muted); margin-top: 12px; font-style: italic; }

/* ── Price cards ──────────────────────────────────────────────────────────── */
.prem-price-cards { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.prem-price-card {
  flex: 1; min-width: 120px; padding: 12px 14px; border-radius: 9px;
  background: var(--off2); border: 1px solid var(--line2);
}
.prem-price-card-yr { border-color: rgba(109,94,246,.4); background: rgba(109,94,246,.06); }
.prem-price-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-family: 'DM Mono', monospace; }
.prem-price-amount { font-size: 20px; font-weight: 700; color: var(--text); }
.prem-price-per { font-size: 12px; color: var(--muted); font-weight: 400; }
.prem-price-save {
  font-size: 10px; color: #c4b8ff; font-family: 'DM Mono', monospace;
  margin-top: 4px; letter-spacing: .04em;
}

/* ── Premium gate ─────────────────────────────────────────────────────────── */
.prem-gate-inner { text-align: center; padding: 40px 24px; max-width: 520px; margin: 0 auto; }
.prem-gate-icon { font-size: 40px; color: #c4b8ff; margin-bottom: 12px; }
.prem-gate-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.prem-gate-sub { font-size: 14px; color: var(--text2); margin-bottom: 16px; }

/* ── Coaching KPI tiles ───────────────────────────────────────────────────── */
.coach-kpi-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.coach-kpi {
  flex: 1; min-width: 90px; padding: 12px 14px; border-radius: 9px;
  background: var(--off); border: 1px solid var(--line2); text-align: center;
}
.coach-kpi-val { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.coach-kpi-lbl { font-size: 10px; color: var(--muted); font-family: 'DM Mono', monospace; margin-top: 3px; letter-spacing: .05em; text-transform: uppercase; }

@media (max-width: 600px) {
  .prem-dash-banner { flex-direction: column; align-items: flex-start; }
  .coach-kpi { min-width: 70px; padding: 10px; }
  .coach-kpi-val { font-size: 16px; }
}

/* ── Stripe Buy buttons ───────────────────────────────────────────────────── */
.prem-buy-row {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px;
}
.prem-buy-btn {
  flex: 1; min-width: 140px; padding: 14px 16px; border-radius: 10px;
  border: 1px solid rgba(109,94,246,.4); background: rgba(109,94,246,.12);
  color: var(--text); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 2px;
  transition: all .15s; font-family: 'DM Sans', sans-serif;
}
.prem-buy-btn:hover:not(:disabled) {
  background: rgba(109,94,246,.22); border-color: rgba(109,94,246,.7);
  transform: translateY(-1px); box-shadow: 0 4px 16px rgba(109,94,246,.2);
}
.prem-buy-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.prem-buy-yr { border-color: rgba(109,94,246,.6); background: rgba(109,94,246,.18); }
.prem-buy-plan { font-size: 12px; color: #c4b8ff; font-family: 'DM Mono', monospace; }
.prem-buy-price { font-size: 20px; font-weight: 700; color: #e8e2ff; line-height: 1.2; }
.prem-buy-save { font-size: 11px; color: #a89ef5; font-family: 'DM Mono', monospace; }
.prem-buy-cta { font-size: 12px; color: #c4b8ff; margin-top: 6px; font-weight: 500; }

@media (max-width: 480px) {
  .prem-buy-btn { min-width: 100%; }
}

/* ── Premium Grant Modal — duration options ─────────────────────────────── */
.prem-dur-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line2); background: var(--off);
  font-size: 13px; color: var(--text2); transition: all .12s;
  user-select: none;
}
.prem-dur-opt:has(input:checked) {
  border-color: rgba(109,94,246,.6); background: rgba(109,94,246,.12); color: #e8e2ff;
}
.prem-dur-opt input[type="radio"] { display: none; }
.prem-dur-opt:hover { border-color: var(--line); color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════════════
   COACHING DASHBOARD — PRO DESIGN SYSTEM
   Dark tactical aesthetic · Indigo-accent · Glassmorphism
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Shell & header ─────────────────────────────────────────────────────────── */
.co-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 40px;
}
.co-header {
  padding: 28px 0 24px;
  border-bottom: 1px solid rgba(109,94,246,.2);
  margin-bottom: 24px;
  position: relative;
}
.co-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 0%, rgba(109,94,246,.12), transparent);
  pointer-events: none;
}
.co-header-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(109,94,246,.5);
  background: rgba(109,94,246,.15);
  color: #c4b8ff;
  margin-bottom: 10px;
  animation: premShimmer 3s linear infinite;
  background: linear-gradient(90deg,rgba(26,16,96,.8),rgba(79,57,246,.4),rgba(26,16,96,.8));
  background-size: 200%;
}
.co-header-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: #e8e8f4;
  line-height: 1.15;
  margin-bottom: 6px;
}
.co-header-sub {
  font-size: 13px;
  color: #6a6a8a;
  font-family: 'DM Mono', monospace;
  letter-spacing: .02em;
}

/* ── KPI row ────────────────────────────────────────────────────────────────── */
@keyframes coKpiIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.co-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.co-kpi {
  position: relative;
  padding: 16px 16px 14px;
  border-radius: 12px;
  background: rgba(16,14,30,.7);
  border: 1px solid rgba(109,94,246,.2);
  overflow: hidden;
  animation: coKpiIn .4s ease both;
  transition: border-color .2s, transform .15s;
}
.co-kpi::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% -10%, var(--kpi-glow, rgba(109,94,246,.2)), transparent);
  pointer-events: none;
}
.co-kpi:hover {
  border-color: rgba(109,94,246,.45);
  transform: translateY(-1px);
}
.co-kpi-icon {
  font-size: 13px;
  color: rgba(109,94,246,.7);
  margin-bottom: 6px;
  position: relative;
}
.co-kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: #e8e8f4;
  line-height: 1.2;
  letter-spacing: -.02em;
  position: relative;
  margin-bottom: 3px;
}
.co-kpi-lbl {
  font-size: 10px;
  color: #4a4a6a;
  font-family: 'DM Mono', monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  position: relative;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.co-card {
  background: rgba(16,14,30,.6);
  border: 1px solid rgba(109,94,246,.15);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(4px);
}
.co-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(109,94,246,.1);
  background: rgba(109,94,246,.04);
}
.co-card-icon {
  font-size: 14px;
  color: rgba(109,94,246,.7);
}
.co-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #c8c8e0;
  letter-spacing: -.01em;
}
.co-card-sub {
  font-size: 11px;
  color: #4a4a6a;
  font-family: 'DM Mono', monospace;
}
.co-card-body {
  padding: 16px 18px;
}

/* ── Heatmap cells ──────────────────────────────────────────────────────────── */
.co-heat-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  transition: transform .1s;
}
.co-heat-cell:hover { transform: scale(1.4); }

/* ── Trend badges ───────────────────────────────────────────────────────────── */
.co-trend-up   { color: #4ade80; font-size: 12px; font-weight: 700; font-family: 'DM Mono', monospace; }
.co-trend-down { color: #f87171; font-size: 12px; font-weight: 700; font-family: 'DM Mono', monospace; }
.co-trend-flat { color: #4a4a6a; font-size: 12px; }

/* ── Training plan rows ─────────────────────────────────────────────────────── */
.co-plan-row {
  padding: 18px 18px;
}
.co-mastery-badge {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid;
}

/* ── Map tiles ──────────────────────────────────────────────────────────────── */
.co-map-tile {
  padding: 12px 13px;
  background: rgba(109,94,246,.04);
  border: 1px solid rgba(109,94,246,.12);
  border-radius: 9px;
  border-left-width: 3px;
  transition: border-color .15s, background .15s;
}
.co-map-tile:hover {
  background: rgba(109,94,246,.09);
  border-color: rgba(109,94,246,.3);
}

/* ── Session rows ───────────────────────────────────────────────────────────── */
.co-sess-row {
  display: grid;
  grid-template-columns: 130px 1fr 60px 48px 60px auto;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  transition: background .1s;
}
.co-sess-row:hover { background: rgba(109,94,246,.05); }
.co-sess-date  { font-size: 11px; font-family: 'DM Mono',monospace; color: #4a4a6a; }
.co-sess-map   { font-size: 12px; font-weight: 500; color: #a0a0c0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.co-sess-score { font-size: 11px; font-family: 'DM Mono',monospace; }
.co-sess-pct   { font-size: 12px; font-family: 'DM Mono',monospace; font-weight: 700; text-align:center; padding: 2px 5px; border-radius: 4px; background: rgba(0,0,0,.25); }
.co-sess-time  { font-size: 11px; font-family: 'DM Mono',monospace; color: #4a4a6a; }
.co-sess-qual  { font-size: 11px; font-family: 'DM Mono',monospace; white-space:nowrap; }

/* ── Empty states ───────────────────────────────────────────────────────────── */
.co-empty {
  padding: 24px;
  text-align: center;
  color: #4a4a6a;
  font-size: 13px;
  font-family: 'DM Mono', monospace;
}
.co-empty-hero {
  padding: 60px 24px;
  text-align: center;
}
.co-empty-icon {
  font-size: 48px;
  color: rgba(109,94,246,.3);
  margin-bottom: 16px;
}
.co-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: #8080a0;
  margin-bottom: 8px;
}
.co-empty-sub {
  font-size: 13px;
  color: #4a4a6a;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Override page background when on coaching page ─────────────────────────── */
#page-coaching { background: #0d0c1a; min-height: 100%; }
#page-coaching .page-header { display: none; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .co-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .co-sess-row { grid-template-columns: 1fr auto auto; }
  .co-sess-date, .co-sess-score, .co-sess-time, .co-sess-qual { display: none; }
  .co-card-head { flex-wrap: wrap; }
  .co-shell { padding: 0 0 24px; }
}
@media (max-width: 400px) {
  .co-kpi-row { grid-template-columns: 1fr 1fr; }
  .co-kpi-val { font-size: 18px; }
}

[data-theme="light"] #page-coaching { background: #f0eeff; }
[data-theme="light"] .co-card { background: rgba(255,255,255,.8); border-color: rgba(109,94,246,.2); }
[data-theme="light"] .co-card-head { background: rgba(109,94,246,.05); }
[data-theme="light"] .co-kpi { background: rgba(255,255,255,.85); border-color: rgba(109,94,246,.2); }
[data-theme="light"] .co-header-title { color: #1a1028; }
[data-theme="light"] .co-header-sub { color: #8080a0; }
[data-theme="light"] .co-kpi-val { color: #1a1028; }
[data-theme="light"] .co-kpi-lbl { color: #9090b0; }
[data-theme="light"] .co-card-title { color: #2a2840; }
[data-theme="light"] .co-map-tile { background: rgba(109,94,246,.04); border-color: rgba(109,94,246,.15); }
[data-theme="light"] .co-plan-row .co-sess-map,
[data-theme="light"] .co-sess-map { color: #3a3860; }
[data-theme="light"] .co-heat-cell { /* inherits inline bg */ }

/* ══════════════════════════════════════════════════════════════════════════════
   DASHBOARD PRO PANEL — Pro-user state
   ══════════════════════════════════════════════════════════════════════════════ */
@keyframes dproIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

.dpro-shell {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(109,94,246,.35);
  animation: dproIn .4s ease both;
}
.dpro-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%,  rgba(109,94,246,.22), transparent 60%),
    radial-gradient(ellipse 60% 80%  at 0%   100%, rgba(79,57,246,.12),  transparent 60%),
    linear-gradient(135deg, #0d0b1e 0%, #111028 50%, #0d0b22 100%);
}
.dpro-content { position: relative; padding: 22px 20px 18px; }
.dpro-top { margin-bottom: 18px; }
.dpro-badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-family: 'DM Mono',monospace; font-weight: 700;
  letter-spacing: .14em; padding: 3px 10px; border-radius: 20px;
  border: 1px solid rgba(109,94,246,.5);
  background: linear-gradient(90deg, rgba(26,16,96,.9), rgba(79,57,246,.5), rgba(26,16,96,.9));
  background-size: 200%; animation: premShimmer 3s linear infinite;
  color: #c4b8ff; margin-bottom: 8px;
}
.dpro-greeting {
  font-size: 19px; font-weight: 700; color: #e8e4ff;
  letter-spacing: -.02em; line-height: 1.2; margin-bottom: 4px;
}
.dpro-sub { font-size: 12px; color: #6a6a9a; font-family: 'DM Mono',monospace; }
.dpro-cards { display: flex; flex-direction: column; gap: 8px; }
.dpro-card {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: 11px;
  background: rgba(109,94,246,.1); border: 1px solid rgba(109,94,246,.25);
  cursor: pointer; text-align: left; width: 100%;
  transition: background .15s, border-color .15s, transform .12s;
  font-family: inherit;
}
.dpro-card:hover {
  background: rgba(109,94,246,.2); border-color: rgba(109,94,246,.5);
  transform: translateX(3px);
}
.dpro-card:active { transform: translateX(1px); }
.dpro-card-icon { font-size: 20px; color: #a89ef5; width: 28px; text-align: center; flex-shrink: 0; }
.dpro-card-info { flex: 1; }
.dpro-card-title { font-size: 14px; font-weight: 600; color: #dcd8ff; line-height: 1.2; }
.dpro-card-desc  { font-size: 11px; color: #6a6a8a; margin-top: 2px; }
.dpro-card-arrow { font-size: 16px; color: rgba(109,94,246,.6); transition: transform .15s; }
.dpro-card:hover .dpro-card-arrow { transform: translateX(3px); color: #a89ef5; }

/* ── Light mode overrides ── */
[data-theme="light"] .dpro-bg {
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%,  rgba(109,94,246,.12), transparent 60%),
    radial-gradient(ellipse 60% 80%  at 0%   100%, rgba(79,57,246,.07),  transparent 60%),
    linear-gradient(135deg, #f0eeff 0%, #ede8ff 100%);
}
[data-theme="light"] .dpro-greeting { color: #1a1040; }
[data-theme="light"] .dpro-sub { color: #8888b0; }
[data-theme="light"] .dpro-card { background: rgba(109,94,246,.07); border-color: rgba(109,94,246,.2); }
[data-theme="light"] .dpro-card:hover { background: rgba(109,94,246,.14); }
[data-theme="light"] .dpro-card-title { color: #2a1880; }
[data-theme="light"] .dpro-card-desc  { color: #8888b0; }

/* ══════════════════════════════════════════════════════════════════════════════
   DASHBOARD UPSELL PANEL — Free-user state
   ══════════════════════════════════════════════════════════════════════════════ */
.dup-shell {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(109,94,246,.25);
  animation: dproIn .4s ease both;
}
.dup-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 100% 100% at 100% 0%,  rgba(109,94,246,.15), transparent 55%),
    linear-gradient(135deg, #0d0b1e 0%, #100e28 100%);
}
.dup-content {
  position: relative;
  padding: 22px 20px 20px;
  display: flex; gap: 20px; flex-wrap: wrap;
}
.dup-left { flex: 1; min-width: 200px; }
.dup-right { flex-shrink: 0; display: flex; align-items: center; }
.dup-badge {
  display: inline-flex; font-size: 9px; font-family: 'DM Mono',monospace;
  font-weight: 700; letter-spacing: .14em; padding: 2px 9px; border-radius: 20px;
  border: 1px solid rgba(109,94,246,.4); color: #9888ee;
  background: rgba(109,94,246,.1); margin-bottom: 10px;
}
.dup-title {
  font-size: 20px; font-weight: 700; color: #e0dcf8;
  letter-spacing: -.025em; line-height: 1.25; margin-bottom: 14px;
}
.dup-feats { display: flex; flex-direction: column; gap: 6px; }
.dup-feat {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #8888a8; line-height: 1.4;
}
.dup-feat-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--c, #6d5ef6);
  box-shadow: 0 0 6px var(--c, rgba(109,94,246,.8));
}
/* Price buttons */
.dup-prices { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }
.dup-plan-btn {
  position: relative;
  display: flex; flex-direction: column; gap: 1px;
  padding: 12px 16px; border-radius: 11px;
  background: rgba(109,94,246,.12); border: 1px solid rgba(109,94,246,.3);
  cursor: pointer; text-align: left; font-family: inherit;
  transition: background .15s, border-color .15s, transform .12s;
  overflow: hidden;
}
.dup-plan-btn:hover {
  background: rgba(109,94,246,.22); border-color: rgba(109,94,246,.55);
  transform: translateY(-1px);
}
.dup-plan-btn:active { transform: translateY(0); }
.dup-plan-yr {
  border-color: rgba(109,94,246,.45);
  background: rgba(109,94,246,.18);
}
.dup-plan-save {
  position: absolute; top: 6px; right: 8px;
  font-size: 9px; font-family: 'DM Mono',monospace; font-weight: 700;
  color: #4ade80; letter-spacing: .06em;
  text-shadow: 0 0 8px rgba(74,222,128,.6);
}
.dup-plan-name  { font-size: 10px; color: #8888b0; font-family: 'DM Mono',monospace; letter-spacing:.04em; }
.dup-plan-price { font-size: 18px; font-weight: 700; color: #e0dcf8; letter-spacing: -.02em; }
.dup-plan-per   { font-size: 11px; font-weight: 400; color: #6a6a8a; }
.dup-plan-cta   { font-size: 11px; color: #a89ef5; margin-top: 3px; }
.dup-contact    { font-size: 12px; color: #6a6a8a; font-style: italic; padding: 8px 0; }

/* Light mode */
[data-theme="light"] .dup-bg {
  background:
    radial-gradient(ellipse 100% 100% at 100% 0%,  rgba(109,94,246,.09), transparent 55%),
    linear-gradient(135deg, #f0eeff 0%, #ebe5ff 100%);
}
[data-theme="light"] .dup-title { color: #1a1040; }
[data-theme="light"] .dup-feat  { color: #7070a0; }
[data-theme="light"] .dup-plan-btn { background: rgba(109,94,246,.07); border-color: rgba(109,94,246,.2); }
[data-theme="light"] .dup-plan-btn:hover { background: rgba(109,94,246,.15); }
[data-theme="light"] .dup-plan-price { color: #1a1040; }
[data-theme="light"] .dup-plan-name  { color: #9090b8; }

/* Mobile */
@media (max-width: 500px) {
  .dup-content { flex-direction: column; }
  .dup-right { width: 100%; }
  .dup-prices { flex-direction: row; }
  .dup-plan-btn { flex: 1; }
  .dpro-cards { gap: 7px; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PRO BADGE — Leaderboard
   ══════════════════════════════════════════════════════════════════════════════ */
@keyframes lbProPulse {
  0%,100% { opacity: 1; }
  50%     { opacity: .65; }
}
.lb-pro-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  background: linear-gradient(90deg, #1a1060, #4f39f6, #1a1060);
  background-size: 200%;
  animation: premShimmer 3s linear infinite;
  color: #c4b8ff;
  border: 1px solid rgba(109,94,246,.5);
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  letter-spacing: .04em;
}

/* ══════════════════════════════════════════════════════════════════════════════
   TEAM PLANNER
   ══════════════════════════════════════════════════════════════════════════════ */
#page-team-planner { background: #0a0914; min-height: 100%; }

.tp-loading {
  padding: 60px 24px;
  text-align: center;
  color: #4a4a6a;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
}

/* ── Shell layout ───────────────────────────────────────────────────────────── */
.tp-shell {
  display: flex;
  height: 100%;
  min-height: calc(100vh - 48px);
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.tp-sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid rgba(109,94,246,.15);
  background: rgba(10,9,20,.95);
  display: flex;
  flex-direction: column;
}
.tp-sidebar-head {
  padding: 18px 16px 12px;
  border-bottom: 1px solid rgba(109,94,246,.12);
}
.tp-sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: #c8c4e8;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}
.tp-logo {
  color: #6d5ef6;
  font-size: 16px;
}
.tp-new-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px dashed rgba(109,94,246,.4);
  background: rgba(109,94,246,.08);
  color: #8888b8;
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  transition: all .15s;
}
.tp-new-btn:hover {
  background: rgba(109,94,246,.18);
  border-color: rgba(109,94,246,.6);
  color: #c4b8ff;
}
.tp-board-list { flex: 1; overflow-y: auto; padding: 8px; }
.tp-board-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 12px;
  color: #4a4a6a;
  line-height: 1.6;
}
.tp-board-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 4px;
  transition: all .12s;
}
.tp-board-item:hover {
  background: rgba(109,94,246,.08);
  border-color: rgba(109,94,246,.2);
}
.tp-board-item.active {
  background: rgba(109,94,246,.15);
  border-color: rgba(109,94,246,.4);
}
.tp-board-item-title {
  font-size: 12px;
  font-weight: 600;
  color: #c8c4e8;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-board-item-meta {
  font-size: 10px;
  color: #4a4a6a;
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main area ──────────────────────────────────────────────────────────────── */
.tp-main { flex: 1; overflow-y: auto; padding: 0; }

.tp-empty-state {
  padding: 80px 40px;
  text-align: center;
}
.tp-empty-icon { font-size: 48px; color: rgba(109,94,246,.2); margin-bottom: 16px; }
.tp-empty-title { font-size: 18px; font-weight: 600; color: #4a4a6a; margin-bottom: 8px; }
.tp-empty-sub { font-size: 13px; color: #3a3a5a; max-width: 280px; margin: 0 auto; line-height: 1.6; }

/* ── Board ──────────────────────────────────────────────────────────────────── */
.tp-board { padding: 24px 28px 40px; max-width: 760px; }

.tp-board-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tp-board-title {
  font-size: 22px;
  font-weight: 700;
  color: #e8e4ff;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}
.tp-board-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tp-meta-chip {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(109,94,246,.12);
  border: 1px solid rgba(109,94,246,.25);
  color: #9888d8;
}
.tp-board-header-actions { display: flex; gap: 6px; flex-shrink: 0; }
.tp-action-btn {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border: 1px solid rgba(109,94,246,.3);
  background: rgba(109,94,246,.1);
  color: #a89ef5;
  transition: all .12s;
}
.tp-action-btn:hover { background: rgba(109,94,246,.22); color: #c4b8ff; }
.tp-action-save {
  background: rgba(109,94,246,.25);
  border-color: rgba(109,94,246,.5);
  color: #e0d8ff;
  font-weight: 600;
}
.tp-action-save:hover { background: rgba(109,94,246,.4); }
.tp-action-del { border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.08); color: #f87171; }
.tp-action-del:hover { background: rgba(239,68,68,.18); }

.tp-notes {
  font-size: 13px;
  color: #6a6a8a;
  line-height: 1.6;
  padding: 12px 14px;
  background: rgba(109,94,246,.05);
  border-radius: 8px;
  border-left: 3px solid rgba(109,94,246,.3);
  margin-bottom: 20px;
}

/* ── Sections ───────────────────────────────────────────────────────────────── */
.tp-section { margin-bottom: 24px; }
.tp-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.tp-section-icon { font-size: 13px; color: rgba(109,94,246,.6); }
.tp-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #a8a4c8;
  letter-spacing: .02em;
}
.tp-section-sub { font-size: 11px; color: #4a4a6a; font-family: 'DM Mono', monospace; }
.tp-add-strat-btn {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  border: 1px dashed rgba(109,94,246,.35);
  background: transparent;
  color: #6d5ef6;
  transition: all .12s;
}
.tp-add-strat-btn:hover { background: rgba(109,94,246,.1); color: #a89ef5; }

/* ── Inputs ─────────────────────────────────────────────────────────────────── */
.tp-inp {
  background: rgba(109,94,246,.06);
  border: 1px solid rgba(109,94,246,.15);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  color: #c8c4e0;
  font-family: 'DM Sans', sans-serif;
  width: 100%;
  transition: border-color .12s, background .12s;
  outline: none;
  resize: vertical;
}
.tp-inp:focus {
  border-color: rgba(109,94,246,.5);
  background: rgba(109,94,246,.1);
  color: #e8e4ff;
}
.tp-inp::placeholder { color: #4a4a6a; }

/* ── Lineup ─────────────────────────────────────────────────────────────────── */
.tp-lineup { display: flex; flex-direction: column; gap: 6px; }
.tp-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(109,94,246,.05);
  border: 1px solid rgba(109,94,246,.1);
  border-radius: 9px;
  transition: border-color .12s;
}
.tp-player-row:hover { border-color: rgba(109,94,246,.25); }
.tp-player-slot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(109,94,246,.2);
  border: 1px solid rgba(109,94,246,.4);
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  color: #a89ef5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tp-player-fields {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

/* ── Strats ─────────────────────────────────────────────────────────────────── */
.tp-strats { display: flex; flex-direction: column; gap: 8px; }
.tp-strats-empty { font-size: 12px; color: #4a4a6a; padding: 12px 0; font-family: 'DM Mono', monospace; }
.tp-strat {
  background: rgba(109,94,246,.06);
  border: 1px solid rgba(109,94,246,.12);
  border-radius: 10px;
  padding: 12px 14px;
}
.tp-strat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.tp-strat-phase {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid;
  flex-shrink: 0;
}
.tp-strat-title { flex: 1; }
.tp-strat-del {
  background: transparent;
  border: none;
  color: #4a4a6a;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .12s, background .12s;
  flex-shrink: 0;
}
.tp-strat-del:hover { color: #f87171; background: rgba(248,113,113,.1); }
.tp-strat-body { min-height: 60px; }

/* ── Bans ───────────────────────────────────────────────────────────────────── */
.tp-bans { display: flex; gap: 16px; flex-wrap: wrap; }
.tp-bans-col { flex: 1; min-width: 160px; }
.tp-bans-label { font-size: 11px; font-weight: 600; font-family: 'DM Mono', monospace; margin-bottom: 8px; letter-spacing: .04em; }
.tp-ban-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 8px;
  background: rgba(109,94,246,.05);
  border: 1px solid rgba(109,94,246,.12);
  border-radius: 8px;
  min-height: 42px;
}
.tp-ban-tag {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  padding: 3px 8px;
  border-radius: 20px;
  cursor: pointer;
  transition: opacity .12s;
}
.tp-ban-tag:hover { opacity: .6; }
.tp-ban-tag-ban  { background: rgba(248,113,113,.15); border: 1px solid rgba(248,113,113,.3); color: #f87171; }
.tp-ban-tag-watch{ background: rgba(251,191,36,.12);  border: 1px solid rgba(251,191,36,.3);  color: #fbbf24; }
.tp-ban-inp {
  background: transparent;
  border: none;
  outline: none;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: #8888a8;
  width: 120px;
  padding: 2px 4px;
}
.tp-ban-inp::placeholder { color: #3a3a5a; }

/* ── Light mode ─────────────────────────────────────────────────────────────── */
[data-theme="light"] .tp-sidebar { background: rgba(255,255,255,.9); border-color: rgba(109,94,246,.15); }
[data-theme="light"] .tp-sidebar-title { color: #2a1880; }
[data-theme="light"] .tp-board-item-title { color: #2a1880; }
[data-theme="light"] .tp-board-item.active { background: rgba(109,94,246,.1); }
[data-theme="light"] .tp-board-title { color: #1a1040; }
[data-theme="light"] .tp-inp { background: rgba(255,255,255,.8); border-color: rgba(109,94,246,.2); color: #1a1040; }
[data-theme="light"] .tp-inp:focus { background: white; }
[data-theme="light"] .tp-player-row { background: rgba(109,94,246,.04); }
[data-theme="light"] .tp-strat { background: rgba(109,94,246,.04); }
[data-theme="light"] .tp-ban-tags { background: rgba(109,94,246,.04); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .tp-shell { flex-direction: column; }
  .tp-sidebar { width: 100%; border-right: none; border-bottom: 1px solid rgba(109,94,246,.15); }
  .tp-board-list { display: flex; flex-direction: row; gap: 6px; overflow-x: auto; padding: 8px; }
  .tp-board-item { flex-shrink: 0; min-width: 140px; margin-bottom: 0; }
  .tp-player-fields { grid-template-columns: 1fr 1fr; }
  .tp-player-fields .tp-inp:last-child { grid-column: span 2; }
  .tp-board { padding: 16px; }
  .tp-board-header { flex-direction: column; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   TEAM PLANNER — SpielerPlus-style
   ══════════════════════════════════════════════════════════════════════════════ */


.tpx-loading {
  padding: 60px 24px; text-align: center;
  color: #4a4a6a; font-family: 'DM Mono', monospace; font-size: 13px;
}

/* ── Empty state ────────────────────────────────────────────────────────────── */
.tpx-empty-hero {
  padding: 80px 24px; text-align: center;
}
.tpx-empty-icon  { font-size: 48px; color: rgba(109,94,246,.3); margin-bottom: 16px; }
.tpx-empty-title { font-size: 18px; font-weight: 600; color: #c8c4e8; margin-bottom: 8px; }
.tpx-empty-sub   { font-size: 13px; color: #8888a8; max-width: 280px; margin: 0 auto; line-height: 1.6; }

/* ── Shell ──────────────────────────────────────────────────────────────────── */
.tpx-shell { display: flex; flex-direction: column; min-height: calc(100vh - 48px); }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.tpx-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 20px 14px; flex-wrap: wrap;
  background: rgba(109,94,246,.05);
  border-bottom: 1px solid rgba(109,94,246,.15);
}
.tpx-header-left { display: flex; align-items: center; gap: 12px; }
.tpx-team-badge {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(109,94,246,.3), rgba(79,57,246,.5));
  border: 1px solid rgba(109,94,246,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #c4b8ff;
}
.tpx-team-name {
  font-size: 18px; font-weight: 700; color: #e8e4ff;
  letter-spacing: -.02em; margin-bottom: 3px;
}
.tpx-team-meta { font-size: 11px; color: #6a6a8a; font-family: 'DM Mono', monospace; }

/* ── Tabs ───────────────────────────────────────────────────────────────────── */
.tpx-header-tabs { display: flex; gap: 6px; }
.tpx-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; font-size: 13px;
  font-weight: 500; cursor: pointer; transition: all .15s;
  border: 1px solid rgba(109,94,246,.2); background: transparent; color: #6a6a8a;
  font-family: 'DM Sans', sans-serif;
}
.tpx-tab:hover  { background: rgba(109,94,246,.1); color: #c4b8ff; }
.tpx-tab.active { background: rgba(109,94,246,.2); border-color: rgba(109,94,246,.5); color: #e0d8ff; }
.tpx-tab-count {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: rgba(109,94,246,.3);
  font-size: 10px; font-family: 'DM Mono', monospace; font-weight: 700;
  color: #c4b8ff; display: flex; align-items: center; justify-content: center;
}

/* ── Roster strip ───────────────────────────────────────────────────────────── */
.tpx-roster-strip {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 20px; border-bottom: 1px solid rgba(109,94,246,.1);
  background: rgba(0,0,0,.15);
}
.tpx-roster-avatar {
  position: relative; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(109,94,246,.2); border: 2px solid rgba(109,94,246,.3);
  font-size: 13px; font-weight: 700; color: #a89ef5;
  display: flex; align-items: center; justify-content: center;
  cursor: default; transition: border-color .12s;
}
.tpx-roster-avatar.tpx-roster-me {
  border-color: rgba(109,94,246,.7); background: rgba(109,94,246,.35); color: #e0d8ff;
}
.tpx-roster-crown {
  position: absolute; top: -4px; right: -4px; font-size: 9px; line-height: 1;
}

/* ── Tab body ───────────────────────────────────────────────────────────────── */
.tpx-tab-body   { padding: 16px 20px 40px; max-width: 740px; }
.tpx-action-bar { margin-bottom: 14px; }
.tpx-create-btn {
  padding: 9px 18px; border-radius: 9px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; font-family: 'DM Sans', sans-serif;
  background: rgba(109,94,246,.2); border: 1px solid rgba(109,94,246,.45);
  color: #c4b8ff;
}
.tpx-create-btn:hover { background: rgba(109,94,246,.35); color: #e8e2ff; border-color: rgba(109,94,246,.7); }

.tpx-section-label {
  font-size: 11px; font-family: 'DM Mono', monospace; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: #6d5ef6;
  margin-bottom: 10px;
}
.tpx-section-past { color: #4a4a6a; }

.tpx-events-empty {
  padding: 32px 20px; text-align: center;
  font-size: 13px; color: #a0a0b8;
  background: rgba(109,94,246,.04);
  border: 1px dashed rgba(109,94,246,.2);
  border-radius: 12px;
}

/* ── Event card ─────────────────────────────────────────────────────────────── */
.tpx-event-card {
  position: relative; display: flex;
  background: rgba(14,12,28,.85);
  border: 1px solid rgba(109,94,246,.15);
  border-radius: 12px; margin-bottom: 10px;
  overflow: hidden; transition: border-color .15s;
}
.tpx-event-card:hover { border-color: rgba(109,94,246,.3); }
.tpx-event-past { opacity: .55; }
.tpx-event-stripe {
  width: 4px; flex-shrink: 0;
  background: var(--ev-col, #6d5ef6);
  box-shadow: 0 0 8px var(--ev-col, rgba(109,94,246,.5));
}
.tpx-event-body { flex: 1; padding: 14px 14px 12px; }
.tpx-event-top {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px;
}
.tpx-event-type-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.tpx-event-main { flex: 1; }
.tpx-event-title {
  font-size: 14px; font-weight: 600; color: #e8e4ff;
  letter-spacing: -.01em; margin-bottom: 5px;
}
.tpx-event-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 11px; font-family: 'DM Mono', monospace; color: #6a6a8a;
}
.tpx-event-deadline { color: #f87171 !important; }
.tpx-event-notes {
  font-size: 12px; color: #7a7a9a; line-height: 1.5;
  margin-top: 6px; padding: 8px 10px;
  background: rgba(109,94,246,.06); border-radius: 6px;
}
.tpx-event-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* RSVP buttons */
.tpx-rsp-btn {
  width: 30px; height: 30px; border-radius: 50%; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .12s; border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06); color: #6a6a8a;
}
.tpx-rsp-btn-yes:hover,   .tpx-rsp-btn-yes.tpx-rsp-active   { background: rgba(74,222,128,.2);  border-color: rgba(74,222,128,.5);  color: #4ade80; }
.tpx-rsp-btn-maybe:hover, .tpx-rsp-btn-maybe.tpx-rsp-active { background: rgba(251,191,36,.2);  border-color: rgba(251,191,36,.5);  color: #fbbf24; }
.tpx-rsp-btn-no:hover,    .tpx-rsp-btn-no.tpx-rsp-active    { background: rgba(248,113,113,.2); border-color: rgba(248,113,113,.5); color: #f87171; }
.tpx-ev-del {
  background: transparent; border: none; font-size: 14px;
  cursor: pointer; color: #4a4a6a; padding: 4px; border-radius: 5px;
  transition: color .12s, background .12s;
}
.tpx-ev-del:hover { color: #f87171; background: rgba(248,113,113,.1); }

/* Attendance row */
.tpx-att-row {
  display: flex; align-items: center; gap: 10px;
  padding-top: 8px; border-top: 1px solid rgba(109,94,246,.08);
}
.tpx-att-label { display: flex; gap: 8px; font-size: 11px; font-family: 'DM Mono', monospace; }
.tpx-att-dots  { display: flex; gap: 3px; flex-wrap: wrap; }
.tpx-att-dot {
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
}
.tpx-att-yes     { background: rgba(74,222,128,.2);  color: #4ade80; border: 1px solid rgba(74,222,128,.4); }
.tpx-att-no      { background: rgba(248,113,113,.2); color: #f87171; border: 1px solid rgba(248,113,113,.4); }
.tpx-att-maybe   { background: rgba(251,191,36,.15); color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }
.tpx-att-pending { background: rgba(255,255,255,.05); color: #4a4a6a; border: 1px solid rgba(255,255,255,.08); }
.tpx-att-me      { box-shadow: 0 0 0 2px #6d5ef6; }

/* Response status text colors */
.tpx-rsp-yes     { color: #4ade80; font-weight: 600; }
.tpx-rsp-no      { color: #f87171; font-weight: 600; }
.tpx-rsp-maybe   { color: #fbbf24; font-weight: 600; }
.tpx-rsp-pending { color: #4a4a6a; }

/* ── Lineup cards ───────────────────────────────────────────────────────────── */
.tpx-lineup-card {
  background: rgba(14,12,28,.85);
  border: 1px solid rgba(109,94,246,.18);
  border-radius: 12px; margin-bottom: 12px;
  overflow: hidden;
}
.tpx-lineup-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(109,94,246,.1);
  background: rgba(109,94,246,.06);
}
.tpx-lineup-title {
  font-size: 14px; font-weight: 600; color: #e0d8ff; margin-bottom: 3px;
}
.tpx-lineup-meta {
  font-size: 11px; color: #6a6a8a; font-family: 'DM Mono', monospace;
}
.tpx-ln-edit, .tpx-ln-del {
  background: transparent; border: none; font-size: 14px;
  cursor: pointer; padding: 4px 6px; border-radius: 5px;
  transition: all .12s; color: #4a4a6a;
}
.tpx-ln-edit:hover { color: #c4b8ff; background: rgba(109,94,246,.15); }
.tpx-ln-del:hover  { color: #f87171; background: rgba(248,113,113,.1); }
.tpx-lineup-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: rgba(109,94,246,.1); border-bottom: 1px solid rgba(109,94,246,.1);
}
.tpx-lslot {
  background: rgba(10,8,22,.9); padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
}
.tpx-lslot-empty { opacity: .4; }
.tpx-lslot-num {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: rgba(109,94,246,.2); border: 1px solid rgba(109,94,246,.35);
  font-size: 10px; font-family: 'DM Mono', monospace; font-weight: 700;
  color: #8888b8; display: flex; align-items: center; justify-content: center;
}
.tpx-lslot-info { min-width: 0; }
.tpx-lslot-name { font-size: 12px; font-weight: 600; color: #c8c4e0; white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tpx-lslot-op   { font-size: 10px; color: #6d5ef6; font-family: 'DM Mono', monospace; }
.tpx-lslot-role { font-size: 10px; color: #6a6a8a; font-family: 'DM Mono', monospace; }
.tpx-lineup-notes {
  padding: 8px 14px; font-size: 12px; color: #6a6a8a; line-height: 1.5;
}

/* Lineup modal slot rows */
.tplm-slot-row {
  display: flex; align-items: center; gap: 6px;
}
.tplm-slot-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: rgba(109,94,246,.2); border: 1px solid rgba(109,94,246,.35);
  font-size: 11px; font-family: 'DM Mono', monospace; font-weight: 700;
  color: #a89ef5; display: flex; align-items: center; justify-content: center;
}

/* ── Light mode ─────────────────────────────────────────────────────────────── */
[data-theme="light"] #page-team-planner      { background: #f0eeff; }
[data-theme="light"] .tpx-header             { background: rgba(109,94,246,.06); }
[data-theme="light"] .tpx-team-name          { color: #1a1040; }
[data-theme="light"] .tpx-event-card         { background: rgba(255,255,255,.9); border-color: rgba(109,94,246,.2); }
[data-theme="light"] .tpx-event-title        { color: #1a1040; }
[data-theme="light"] .tpx-lineup-card        { background: rgba(255,255,255,.9); }
[data-theme="light"] .tpx-lineup-title       { color: #1a1040; }
[data-theme="light"] .tpx-lslot             { background: rgba(255,255,255,.85); }
[data-theme="light"] .tpx-lslot-name         { color: #2a1880; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .tpx-header       { flex-direction: column; align-items: flex-start; gap: 10px; }
  .tpx-lineup-grid  { grid-template-columns: repeat(2, 1fr); }
  .tpx-tab-body     { padding: 12px 14px 32px; }
  .tpx-event-meta   { flex-direction: column; gap: 3px; }
  .tplm-slot-row    { flex-wrap: wrap; }
  .tplm-slot-row select { width: 100% !important; }
}
