/* ═══════════════════════════════════════════════════════════════
   LOCKEDIN — STYLESHEET v2.0
   Merit-Based Player Evaluation PWA
   
   All styles use rem units for Dynamic Type / accessibility.
   Base: 16px = 1rem at default system font size.
   
   TABLE OF CONTENTS
   1. Reset & Root Variables
   2. Accessibility & Dynamic Type
   3. Base Elements & Layout
   4. Header & Navigation
   5. Hamburger Menu
   6. Buttons
   7. Cards & Panels
   8. Forms & Inputs
   9. Modals & Overlays
   10. Home Page
   11. Player Selection
   12. Recording Interface
   13. Practice Timer
   14. Stats & Charts
   15. Library
   16. Spotify Integration
   17. Toast & Feedback
   18. Ellipsis Menus
   19. Custom Dropdowns
   20. Accordion
   21. Drag & Drop
   22. Image Lightbox
   23. Auth Pages
   24. Voice Controls
   25. Utility Classes
   26. Responsive
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. RESET & ROOT VARIABLES ─── */

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

:root {
  /* Background & Surface */
  --bg: #0B0F14;
  --card: #12171E;
  --card-h: #171D26;
  --bdr: rgba(255,255,255,0.055);

  /* Text */
  --t1: #E8ECF1;
  --t2: #8B9AAD;
  --t3: #5A6878;

  /* Brand */
  --gold: #D4883A;
  --gold-d: rgba(212,136,58,0.12);
  --gold-b: rgba(212,136,58,0.3);

  /* Semantic */
  --grn: #34C47C;
  --grn-d: rgba(52,196,124,0.1);
  --grn-b: rgba(52,196,124,0.25);
  --red: #D44A3A;
  --red-d: rgba(212,74,58,0.1);
  --red-b: rgba(212,74,58,0.25);
  --blu: #4A8FB8;
  --amb: #D4A03A;
  --org: #D4703A;

  /* Border Radius */
  --rs: 10px;
  --rm: 14px;
  --rl: 20px;
  --rx: 24px;

  /* Typography */
  --fd: 'Outfit', sans-serif;
  --fb: 'DM Sans', sans-serif;

  /* Safe Area */
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
}

/* ─── 2. ACCESSIBILITY & DYNAMIC TYPE ─── */

*:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; z-index: 999; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; width: auto; height: auto; padding: 12px 20px; background: var(--gold); color: #fff; font-family: var(--fd); font-size: 1rem; font-weight: 800; border-radius: var(--rs); z-index: 9999; }

html { overflow-x: hidden; font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

@supports (font: -apple-system-body) {
  html { font: -apple-system-body; font-family: var(--fb); }
}

@media (prefers-contrast: more) {
  :root { --t2: #B0BDCC; --t3: #8899AA; --bdr: rgba(255,255,255,0.12); }
}

/* ─── 3. BASE ELEMENTS & LAYOUT ─── */

body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--fb);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  font-size: 1rem;
  padding-top: var(--st);
  padding-bottom: var(--sb);
}

#app { max-width: 500px; margin: 0 auto; min-height: 100dvh; position: relative; }
.bod { padding: 14px 14px 100px; }

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── 4. HEADER & NAVIGATION ─── */

.hdr {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: rgba(11,15,20,0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bdr);
}

.hdr-logo { display: flex; align-items: center; gap: 11px; }
.hdr-t { font-family: var(--fd); font-weight: 800; font-size: 1.25rem; letter-spacing: 0.5px; color: #fff; }
.hdr-s { font-size: 0.72rem; letter-spacing: 2.5px; text-transform: uppercase; color: var(--t2); margin-top: 1px; font-weight: 600; }
.hdr-c { text-align: center; flex: 1; }
.hdr-ct { font-family: var(--fd); font-weight: 700; font-size: 1.0625rem; color: #fff; }
.hdr-cs { font-size: 0.8125rem; color: var(--t2); margin-top: 1px; }
.hdr-right { width: 64px; display: flex; justify-content: flex-end; }
.hdr-spacer { width: 64px; flex-shrink: 0; }

/* ─── 5. HAMBURGER MENU ─── */

.ham-btn { background: none; border: none; color: var(--t1); padding: 6px; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; border-radius: var(--rs); }
.ham-btn:active { background: rgba(255,255,255,0.06); }
.ham-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.ham-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 190; }
.ham-drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 85vw; background: var(--bg); border-right: 1px solid var(--bdr); z-index: 191; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ham-hdr { padding: 20px 16px; border-bottom: 1px solid var(--bdr); }
.ham-logo { font-family: var(--fd); font-size: 1.25rem; font-weight: 800; color: #fff; letter-spacing: 0.5px; }
.ham-sub { font-size: 0.69rem; letter-spacing: 2.5px; text-transform: uppercase; color: var(--t2); margin-top: 2px; font-weight: 600; }

.ham-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--bdr); color: var(--t1); font-family: var(--fb); font-size: 0.8125rem; font-weight: 600; cursor: pointer; transition: background 0.1s; }
.ham-item:active { background: rgba(255,255,255,0.06); }
.ham-item.act { color: var(--gold); background: var(--gold-d); }
.ham-item .ham-icon { width: 18px; height: 18px; opacity: 0.6; flex-shrink: 0; }
.ham-sep { height: 1px; background: var(--bdr); margin: 8px 0; }

/* ─── 6. BUTTONS ─── */

.bbk { background: none; border: none; color: var(--gold); font-size: 1rem; font-weight: 700; cursor: pointer; padding: 6px 4px; min-width: 44px; min-height: 44px; text-align: left; font-family: var(--fb); }

.bsm { background: var(--gold-d); border: 1px solid var(--gold-b); color: var(--gold); border-radius: 20px; padding: 7px 15px; min-height: 44px; font-size: 0.84rem; font-weight: 700; cursor: pointer; font-family: var(--fb); letter-spacing: 0.3px; transition: all 0.15s; display: inline-flex; align-items: center; }
.bsm:active { transform: scale(0.96); }

.bbtn { width: 100%; padding: 14px; min-height: 44px; border-radius: var(--rm); border: 1px solid var(--bdr); background: var(--card); color: var(--t2); font-family: var(--fb); font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: all 0.15s; letter-spacing: 0.3px; }
.bbtn:active { background: var(--card-h); transform: scale(0.98); }

.ebtn { border-radius: var(--rm); border: 1px solid var(--bdr); background: rgba(255,255,255,0.025); color: var(--t2); font-family: var(--fb); font-size: 0.75rem; font-weight: 700; padding: 8px 12px; min-height: 44px; min-width: 44px; cursor: pointer; transition: all 0.15s; flex: 1; text-align: center; }
.ebtn:active { background: rgba(255,255,255,0.07); }

.eadd { width: 100%; padding: 14px; min-height: 44px; border-radius: var(--rm); border: 1px dashed var(--bdr); background: transparent; color: var(--gold); font-family: var(--fb); font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.eadd:active { background: rgba(255,255,255,0.03); }

.erow { display: flex; gap: 6px; padding-top: 10px; border-top: 1px solid var(--bdr); margin-top: 10px; }

/* ─── 7. CARDS & PANELS ─── */

.scard { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rx); padding: 16px; margin-bottom: 14px; }
.scard.fu { opacity: 0; animation: fadeUp 0.35s ease forwards; }

.sch { display: flex; align-items: center; gap: 9px; margin-bottom: 3px; }
.sci { font-size: 1.19rem; }
.sct { font-family: var(--fd); font-size: 0.875rem; font-weight: 700; color: var(--t1); flex: 1; }
.scs { font-size: 0.78rem; color: var(--t2); margin-bottom: 12px; line-height: 1.5; }

.pbar { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rl); padding: 16px; margin-bottom: 16px; }
.pbar.fu { opacity: 0; animation: fadeUp 0.35s ease forwards; }
.pbt { font-family: var(--fd); font-size: 0.75rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--t2); margin-bottom: 10px; }
.pgr { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; text-align: center; }
.pv { font-family: var(--fd); font-size: 0.875rem; font-weight: 800; color: var(--gold); }
.pl { font-size: 0.625rem; color: var(--t3); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 2px; font-weight: 600; }

.pcard { display: flex; align-items: center; width: 100%; background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rm); padding: 13px 15px; min-height: 44px; margin-bottom: 7px; cursor: pointer; color: var(--t1); text-align: left; transition: all 0.15s; font-family: var(--fb); }
.pcard:active { background: var(--card-h); transform: scale(0.985); }
.pd { flex: 1; font-size: 0.97rem; font-weight: 700; }
.pc { font-size: 0.78rem; color: var(--t2); margin-right: 10px; }
.pch { font-size: 1.31rem; color: var(--t3); font-weight: 300; }

.wkg { margin-bottom: 18px; }
.wkh { font-family: var(--fd); font-size: 0.875rem; font-weight: 800; color: var(--gold); margin-bottom: 7px; padding-left: 4px; letter-spacing: 0.3px; }
.slbl { font-family: var(--fd); font-size: 0.75rem; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--t2); margin: 12px 0 10px 4px; }

/* ─── 8. FORMS & INPUTS ─── */

.mi { width: 100%; padding: 12px; border-radius: var(--rm); border: 1px solid var(--bdr); background: var(--card); color: var(--t1); font-family: var(--fb); font-size: 0.875rem; }
.mi:focus { border-color: var(--gold-b); outline: none; }

/* ─── 9. MODALS & OVERLAYS ─── */

.mo { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.mb { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rl); padding: 20px; width: 100%; max-width: 400px; max-height: 85vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mt { font-family: var(--fd); font-size: 1.0625rem; font-weight: 700; margin-bottom: 16px; color: var(--t1); }
.mbs { display: flex; gap: 8px; margin-top: 16px; }
.mbn { flex: 1; padding: 12px; min-height: 44px; border-radius: var(--rm); border: none; font-family: var(--fb); font-size: 0.875rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.mbn:active { transform: scale(0.97); }
.mbn.cc { background: rgba(255,255,255,0.06); color: var(--t2); }
.mbn.cf { background: var(--gold); color: #fff; }
.mbn.cd { background: var(--red); color: #fff; }

/* ─── 10. HOME PAGE ─── */

.hnav { display: flex; gap: 8px; margin-bottom: 16px; }
.hnb { flex: 1; padding: 12px; min-height: 44px; border-radius: var(--rm); border: 1px solid var(--bdr); background: var(--card); color: var(--t1); font-family: var(--fb); font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.hnb:active { background: var(--card-h); transform: scale(0.97); }
.hnb .ni { display: none; }

/* ─── 11. PLAYER SELECTION ─── */

.pgrid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.plcard { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rl); padding: 16px 10px; min-height: 44px; text-align: center; cursor: pointer; color: var(--t1); transition: all 0.15s; font-family: var(--fb); }
.plcard:active { transform: scale(0.97); background: var(--card-h); }
.plcard.done { border-color: var(--grn-b); background: var(--grn-d); }
.plav { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--org)); display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; font-size: 0.9375rem; font-weight: 800; color: #fff; font-family: var(--fd); }
.pln { font-size: 0.91rem; font-weight: 700; }
.plp { font-size: 0.75rem; color: var(--t2); margin-top: 4px; }

/* ─── 12. RECORDING INTERFACE ─── */

.acard { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rl); padding: 14px; margin-bottom: 9px; }
.an { font-family: var(--fd); font-size: 0.9375rem; font-weight: 700; margin-bottom: 10px; color: var(--t1); }
.rprow { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
.rpb { border-radius: var(--rm); padding: 11px 2px; text-align: center; cursor: pointer; transition: all 0.18s; border: 2px solid var(--bdr); background: rgba(255,255,255,0.02); color: var(--t2); font-family: var(--fb); min-height: 54px; min-width: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rpb:active { transform: scale(0.94); }
.rpl { font-size: 1.03rem; font-weight: 800; line-height: 1.1; font-family: var(--fd); }
.rps { font-size: 0.66rem; margin-top: 2px; opacity: 0.75; font-weight: 600; }
.brow { display: flex; gap: 8px; margin-top: 10px; }
.obsb { flex: 1; padding: 12px 4px; border-radius: var(--rm); border: none; cursor: pointer; font-family: var(--fb); font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.15s; min-height: 44px; }
.obsb:active { transform: scale(0.96); }
.obsi { font-size: 1.125rem; }

/* ─── 13. PRACTICE TIMER ─── */

.tac { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rl); margin-bottom: 2px; overflow: hidden; }
.tac.act { border-color: var(--gold-b); box-shadow: 0 0 0 1px var(--gold-b); }
.tac.dn { opacity: 0.45; }
.tat { display: flex; align-items: center; padding: 14px; cursor: pointer; gap: 10px; min-height: 44px; }
.tan { font-family: var(--fd); font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--t3); white-space: nowrap; }
.tac.act .tan { color: var(--gold); }
.tam { font-family: var(--fd); font-size: 0.9375rem; font-weight: 700; color: var(--t1); flex: 1; }
.tad { font-size: 0.75rem; color: var(--t3); font-weight: 600; flex-shrink: 0; }
.tadc { font-size: 0.78rem; color: var(--t2); padding: 0 14px; margin-bottom: 8px; line-height: 1.5; cursor: pointer; }
.tsi { display: flex; align-items: center; padding: 8px 14px; border-top: 1px solid var(--bdr); gap: 8px; min-height: 44px; }
.tsi.as { background: var(--gold-d); }
.tsi.ds { opacity: 0.45; }
.tsn { font-size: 0.78rem; font-weight: 600; flex: 1; color: var(--t1); }

.taj { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--bdr); background: rgba(255,255,255,0.03); color: var(--t2); font-size: 1rem; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.taj:active { background: rgba(255,255,255,0.08); }
.taj-del { color: var(--red); border-color: var(--red-b); }

.td { text-align: center; margin-bottom: 10px; }
.tc { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.tb { flex: 1; padding: 12px; min-height: 50px; border-radius: var(--rm); border: 1px solid var(--bdr); font-family: var(--fb); font-size: 0.9375rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.tb:active { transform: scale(0.96); }
.tb.go { background: var(--grn); border-color: var(--grn); color: #fff; }
.tb.pa { background: var(--amb); border-color: var(--amb); color: #fff; }
.tb.bk, .tb.sk { background: rgba(255,255,255,0.04); color: var(--t2); }

.tpg { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; margin-bottom: 10px; overflow: hidden; }
.tpb { height: 100%; background: var(--gold); border-radius: 2px; transition: width 0.3s; }
.tp { font-size: 0.78rem; color: var(--t2); margin-top: 4px; }

/* ─── 14. STATS & CHARTS ─── */

.st-sel { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.st-pb { padding: 8px 14px; min-height: 36px; border-radius: 20px; border: 1px solid var(--bdr); background: rgba(255,255,255,0.02); color: var(--t2); font-family: var(--fb); font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.st-pb:active { transform: scale(0.96); }
.st-pb.act { border-color: var(--gold-b); background: var(--gold-d); color: var(--gold); }

.st-tabs { display: flex; gap: 0; margin-bottom: 16px; border: 1px solid var(--bdr); border-radius: var(--rm); overflow: hidden; }
.st-tab { flex: 1; padding: 10px 4px; min-height: 44px; border: none; background: transparent; color: var(--t3); font-family: var(--fb); font-size: 0.69rem; font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; transition: all 0.15s; }
.st-tab.act { background: var(--gold-d); color: var(--gold); }

.st-card { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rl); padding: 16px; margin-bottom: 12px; }
.st-card-t { font-family: var(--fd); font-size: 0.875rem; font-weight: 700; color: var(--t1); margin-bottom: 10px; }

.st-kpi { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 14px; }
.st-kpi-item { text-align: center; padding: 10px 4px; background: rgba(255,255,255,0.02); border: 1px solid var(--bdr); border-radius: var(--rs); }
.st-kpi-val { font-family: var(--fd); font-size: 1.25rem; font-weight: 800; color: var(--gold); }
.st-kpi-lbl { font-size: 0.625rem; color: var(--t3); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.st-chart-wrap { position: relative; width: 100%; }

/* ─── 15. LIBRARY ─── */

.lib-wrap { display: flex; gap: 0; min-height: calc(100vh - 60px); }

.lib-nav { width: 100px; flex-shrink: 0; border-right: 1px solid var(--bdr); padding: 8px 0; }
.lib-nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; cursor: pointer; color: var(--t3); font-size: 0.5625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; border-left: 3px solid transparent; transition: all 0.15s; }
.lib-nav-item.act { color: var(--gold); border-left-color: var(--gold); background: var(--gold-d); }
.lib-nav-item:active { background: rgba(255,255,255,0.04); }
.lib-nav-item svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.lib-content { flex: 1; min-width: 0; padding: 12px; }
.lib-toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.lib-search { flex: 1; min-width: 120px; }
.lib-search input { width: 100%; padding: 8px 10px; border-radius: var(--rs); border: 1px solid var(--bdr); background: var(--card); color: var(--t1); font-family: var(--fb); font-size: 0.75rem; }

.lib-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--bdr); border-radius: var(--rs); background: rgba(255,255,255,0.02); margin-bottom: 6px; }
.lib-file:active { background: rgba(255,255,255,0.04); }
.lib-file-name { flex: 1; font-size: 0.78rem; font-weight: 700; color: var(--t1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-file-date { font-size: 0.625rem; color: var(--t3); flex-shrink: 0; }
.lib-file-menu { flex-shrink: 0; position: relative; }
.lib-empty { font-size: 0.75rem; color: var(--t3); font-style: italic; text-align: center; padding: 30px 10px; }

/* ─── 16. SPOTIFY INTEGRATION ─── */

.sp-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--bdr); border-radius: var(--rm); }
.sp-art { width: 36px; height: 36px; border-radius: var(--rs); flex-shrink: 0; }
.sp-info { flex: 1; min-width: 0; }
.sp-track { font-size: 0.75rem; font-weight: 700; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-artist { font-size: 0.625rem; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--bdr); background: rgba(255,255,255,0.03); color: var(--t2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sp-btn:active { background: rgba(255,255,255,0.08); }
.sp-btn svg { width: 14px; height: 14px; }

.sp-pl { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--rs); cursor: pointer; transition: background 0.1s; }
.sp-pl:active { background: rgba(255,255,255,0.06); }
.sp-pl-img { width: 36px; height: 36px; border-radius: var(--rs); flex-shrink: 0; object-fit: cover; background: var(--card); }
.sp-pl-name { font-size: 0.75rem; font-weight: 700; color: var(--t1); }
.sp-pl-count { font-size: 0.625rem; color: var(--t3); }

/* ─── 17. TOAST & FEEDBACK ─── */

.tst { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--card); border: 1px solid var(--gold-b); color: var(--t1); padding: 12px 20px; border-radius: var(--rm); font-family: var(--fb); font-size: 0.78rem; font-weight: 700; z-index: 300; max-width: 320px; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.5); }

.sync-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-left: 6px; vertical-align: middle; }
.sync-dot.on { background: var(--grn); }
.sync-dot.off { background: var(--red); animation: pulse 1.5s ease infinite; }

/* ─── 18. ELLIPSIS MENUS ─── */

.iam-toggle { background: none; border: none; color: var(--t3); padding: 4px; min-width: 36px; min-height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: var(--rs); }
.iam-toggle:active { background: rgba(255,255,255,0.06); }
.iam-toggle svg { width: 18px; height: 18px; fill: currentColor; }

.iam-pop { position: absolute; right: 8px; top: 100%; z-index: 30; background: var(--card); border: 1px solid var(--gold-b); border-radius: var(--rm); box-shadow: 0 8px 24px rgba(0,0,0,0.5); min-width: 140px; overflow: hidden; }
.iam-pop-item { padding: 12px 14px; min-height: 44px; font-family: var(--fb); font-size: 0.78rem; font-weight: 600; color: var(--t1); cursor: pointer; border-bottom: 1px solid var(--bdr); display: flex; align-items: center; gap: 8px; transition: background 0.1s; }
.iam-pop-item:last-child { border-bottom: none; }
.iam-pop-item:active { background: rgba(255,255,255,0.06); }
.iam-pop-item.del { color: var(--red); }

/* ─── 19. CUSTOM DROPDOWNS ─── */

.cdd { position: relative; margin-bottom: 0; }
.cdd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; min-height: 44px; border-radius: var(--rm); border: 1px solid var(--bdr); background: var(--card); color: var(--t1); font-family: var(--fb); font-size: 0.8125rem; font-weight: 600; cursor: pointer; text-align: left; transition: border-color 0.15s; }
.cdd-btn.open { border-color: var(--gold-b); }
.cdd-btn .cdd-chev { color: var(--t2); flex-shrink: 0; margin-left: 8px; transition: transform 0.2s; }
.cdd-btn.open .cdd-chev { transform: rotate(180deg); }
.cdd-btn .cdd-placeholder { color: var(--t3); }

.cdd-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--card); border: 1px solid var(--gold-b); border-radius: var(--rm); overflow: hidden; z-index: 20; max-height: 220px; overflow-y: auto; -webkit-overflow-scrolling: touch; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.cdd-item { padding: 12px; min-height: 44px; font-family: var(--fb); font-size: 0.8125rem; color: var(--t1); cursor: pointer; border-bottom: 1px solid var(--bdr); display: flex; align-items: center; transition: background 0.1s; }
.cdd-item:last-child { border-bottom: none; }
.cdd-item:active { background: rgba(255,255,255,0.06); }
.cdd-item.sel { color: var(--gold); background: var(--gold-d); }
.cdd-edit { padding: 10px 12px; font-family: var(--fb); font-size: 0.75rem; color: var(--t3); cursor: pointer; border-top: 1px solid var(--bdr); display: flex; align-items: center; justify-content: center; gap: 6px; transition: background 0.1s; }
.cdd-edit:active { background: rgba(255,255,255,0.06); }

/* ─── 20. ACCORDION ─── */

.acc-sec { border: 1px solid var(--bdr); border-radius: var(--rm); margin-bottom: 8px; overflow: hidden; }
.acc-hdr { display: flex; align-items: center; padding: 12px 14px; cursor: pointer; gap: 8px; background: rgba(255,255,255,0.015); }
.acc-hdr:active { background: rgba(255,255,255,0.04); }
.acc-chev { color: var(--t3); font-size: 1.125rem; transition: transform 0.2s; flex-shrink: 0; }
.acc-sec.open .acc-chev { transform: rotate(90deg); }
.acc-title { font-size: 0.75rem; font-weight: 700; color: var(--t1); text-transform: uppercase; letter-spacing: 0.5px; flex: 1; }
.acc-edit { background: none; border: none; color: var(--t3); padding: 4px; cursor: pointer; flex-shrink: 0; min-width: 36px; min-height: 36px; display: flex; align-items: center; justify-content: center; }
.acc-body { display: none; padding: 14px; border-top: 1px solid var(--bdr); }
.acc-sec.open .acc-body { display: block; }

/* ─── 21. DRAG & DROP ─── */

/* ─── 22. IMAGE LIGHTBOX ─── */

.act-img-wrap { position: relative; display: inline-block; }
.act-img-wrap img { height: 64px; border-radius: var(--rs); border: 1px solid var(--bdr); }
.act-img-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--red); border: none; color: #fff; font-size: 0.75rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.img-wrap { position: relative; display: inline-block; flex-shrink: 0; }
.img-expand { position: absolute; bottom: 6px; right: 6px; width: 28px; height: 28px; border-radius: var(--rs); background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.2); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.img-expand:active { background: rgba(0,0,0,0.8); }

.img-lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.img-lightbox img { max-width: 95vw; max-height: 90vh; border-radius: var(--rm); object-fit: contain; }
.img-lightbox .img-contract { position: fixed; bottom: 20px; right: 20px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.img-lightbox .img-contract:active { background: rgba(255,255,255,0.3); }

/* ─── 23. AUTH PAGES ─── */

.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 20px; }
.auth-box { width: 100%; max-width: 360px; text-align: center; }
.auth-icon { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, var(--gold), var(--org)); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 1.875rem; font-weight: 800; color: #fff; font-family: var(--fd); box-shadow: 0 4px 24px rgba(212,136,58,0.3); }
.auth-title { font-family: var(--fd); font-size: 1.875rem; font-weight: 800; letter-spacing: 0.5px; margin-bottom: 4px; }
.auth-sub { font-size: 0.875rem; color: var(--t2); margin-bottom: 28px; }
.auth-input { width: 100%; padding: 14px; border-radius: var(--rm); border: 1px solid var(--bdr); background: var(--card); color: var(--t1); font-family: var(--fb); font-size: 0.9375rem; margin-bottom: 12px; }
.auth-input:focus { border-color: var(--gold-b); outline: none; }
.auth-btn { width: 100%; padding: 14px; min-height: 48px; border-radius: var(--rm); border: none; background: var(--gold); color: #fff; font-family: var(--fb); font-size: 0.9375rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.auth-btn:active { transform: scale(0.97); }
.auth-link { display: block; margin-top: 16px; color: var(--t2); font-size: 0.8125rem; cursor: pointer; background: none; border: none; font-family: var(--fb); }
.auth-link:hover { color: var(--t1); }
.auth-err { color: var(--red); font-size: 0.78rem; margin-bottom: 12px; }

.pw-wrap { position: relative; margin-bottom: 12px; }
.pw-wrap .auth-input { margin-bottom: 0; padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--t3); padding: 10px; cursor: pointer; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.pw-eye svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pw-str { height: 4px; background: var(--card); border-radius: 2px; margin-bottom: 4px; overflow: hidden; }
.pw-str-bar { height: 100%; border-radius: 2px; transition: width 0.3s, background 0.3s; }
.pw-str-label { font-size: 0.69rem; font-weight: 600; transition: color 0.3s; }

/* ─── 24. VOICE CONTROLS ─── */

.voice-pick { position: relative; }
.voice-pick summary { padding: 6px 10px; border-radius: var(--rs); border: 1px solid var(--bdr); background: rgba(255,255,255,0.03); color: var(--t2); font-family: var(--fb); font-size: 0.625rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 4px; list-style: none; white-space: nowrap; min-height: 28px; }
.voice-pick summary::-webkit-details-marker { display: none; }
.vp-chev { font-size: 0.75rem; color: var(--t3); transition: transform 0.2s; }
.voice-pick[open] .vp-chev { transform: rotate(90deg); }

.vp-list { position: absolute; left: 0; top: 100%; margin-top: 4px; background: var(--card); border: 1px solid var(--gold-b); border-radius: var(--rm); overflow: hidden; z-index: 20; max-height: 240px; overflow-y: auto; -webkit-overflow-scrolling: touch; box-shadow: 0 8px 24px rgba(0,0,0,0.4); min-width: 200px; }
.vp-item { padding: 10px 12px; min-height: 40px; font-family: var(--fb); font-size: 0.75rem; color: var(--t1); cursor: pointer; border-bottom: 1px solid var(--bdr); display: flex; align-items: center; transition: background 0.1s; }
.vp-item:last-child { border-bottom: none; }
.vp-item:active { background: rgba(255,255,255,0.06); }
.vp-item.sel { color: var(--gold); background: var(--gold-d); }

.vol-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 4px 0; }
.vol-label { font-size: 0.625rem; color: var(--t3); font-weight: 700; width: 36px; flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.5px; }
.vol-slider { flex: 1; height: 4px; -webkit-appearance: none; appearance: none; background: rgba(255,255,255,0.1); border-radius: 2px; outline: none; }
.vol-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); cursor: pointer; }
.vol-val { font-size: 0.5625rem; color: var(--t3); font-family: monospace; width: 26px; flex-shrink: 0; }

.vol-header { font-size: 0.66rem; color: var(--t2); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; margin-bottom: 12px; }

/* ─── 25. UTILITY CLASSES ─── */

/* Spacing */
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-60 { margin-bottom: 60px; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }

/* Display & Flex */
.d-flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-none { flex: none; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Typography */
.text-xs { font-size: 0.625rem; }
.text-s { font-size: 0.6875rem; }
.text-sm { font-size: 0.75rem; }
.text-base { font-size: 0.8125rem; }
.text-md { font-size: 0.875rem; }
.text-lg { font-size: 1rem; }
.font-bold { font-weight: 700; }
.text-t1 { color: var(--t1); }
.text-t2 { color: var(--t2); }
.text-t3 { color: var(--t3); }
.text-gold { color: var(--gold); }
.text-red { color: var(--red); }
.leading-relaxed { line-height: 1.6; }

/* Reusable patterns */
.section-label { font-size: 0.66rem; color: var(--t2); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; display: block; margin-bottom: 9px; }
.info-note { font-size: 0.6875rem; color: var(--t3); line-height: 1.6; padding: 10px; border: 1px solid var(--bdr); border-radius: var(--rs); background: rgba(255,255,255,0.02); }
.success-msg { font-size: 0.75rem; color: var(--grn); padding: 10px; border: 1px solid rgba(52,196,124,0.2); border-radius: var(--rs); background: rgba(52,196,124,0.05); line-height: 1.6; }
.error-msg { font-size: 0.75rem; color: var(--red); margin-bottom: 10px; }
.confirm-text { font-size: 0.84rem; color: var(--t2); line-height: 1.6; margin-bottom: 16px; }
.act-info-btn { white-space: nowrap; }

/* ─── 26. RESPONSIVE ─── */

@media (max-width: 380px) {
  .pgr { grid-template-columns: repeat(3,1fr); }
  .st-kpi { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 14px; }
  .rprow { grid-template-columns: repeat(3,1fr); }
  .hdr { padding: 12px 14px; }
  .bod { padding: 12px 12px 100px; }
  .act-info-btn { font-size: 0.625rem; }
}

@media (max-width: 320px) {
  .pgrid { grid-template-columns: 1fr; }
  .lib-nav { width: 80px; }
  .lib-nav-item { font-size: 0.5rem; padding: 8px 4px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a28; }

/* ─── ADDITIONAL UTILITY CLASSES (inline migration) ─── */

/* Chart containers */
.chart-h-180 { height: 180px; }
.chart-h-200 { height: 200px; }

/* Common padding */

/* Dropdown section header */
.dd-section-hdr { padding: 8px 12px; font-size: 0.625rem; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; border-bottom: 1px solid var(--bdr); }
.dd-section-hdr.bordered { border-top: 2px solid var(--bdr); }

/* Date range inputs */

/* Icon button (used for pencil, close in view popups) */

/* Bottom actions row */

/* Shared file meta */

/* Wellness/observation buttons */

/* View info popup styles */

/* ═══════════════════════════════════════════════════════════════
   COMPONENT CLASSES (migrated from inline styles)
   Every inline style in the JS has been converted to a named class.
   ═══════════════════════════════════════════════════════════════ */

/* --- Padding --- */
.p-2 { padding: 2px; }
.p-8-4 { padding: 8px 4px; }
.p-10 { padding: 10px; }
.p-12 { padding: 12px; }
.p-10-44 { padding: 10px; min-height: 44px; }
.pb-10 { padding-bottom: 10px; }

/* --- Margins --- */
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-3 { margin-bottom: 3px; }
.mt-10-mb-60 { margin-top: 10px; margin-bottom: 60px; }
.mt-8-mb-60 { margin-top: 8px; margin-bottom: 60px; }

/* --- Line height --- */
.lh-15 { line-height: 1.5; }

/* --- Text styles --- */
.text-italic { font-style: italic; }
.text-pre-wrap { white-space: pre-wrap; }
.text-underline { text-decoration: underline; }
.text-break-all { word-break: break-all; }

/* --- Background variants --- */
.bg-red { background: var(--red); }

/* --- Timer sub styles --- */
.timer-sub-stat { padding: 8px 4px; text-align: center; font-weight: 700; }
.timer-sub-stat-gold { padding: 8px 4px; text-align: center; font-weight: 800; color: var(--gold); }

/* --- Section headers --- */
.section-label-sm { font-size: 0.72rem; margin-bottom: 4px; }
.section-label-gold { font-size: 0.66rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.section-label-gold-flex { font-size: 0.66rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; flex: 1; }
.dd-section-hdr-muted { padding: 8px 12px; font-size: 0.625rem; color: var(--t2); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; border-bottom: 1px solid var(--bdr); border-top: 2px solid var(--bdr); }

/* --- View Info popup --- */
.view-popup-bg { position: fixed; inset: 0; z-index: 140; background: rgba(11,15,20,0.78); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.view-popup-box { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rl); max-width: 560px; width: 100%; max-height: calc(100vh - 80px); overflow-y: auto; padding: 20px; position: relative; }
.view-popup-title { font-family: var(--fd); font-size: 1.125rem; font-weight: 800; color: var(--t1); flex: 1; }
.view-img-main { height: 160px; border-radius: var(--rm); border: 1px solid var(--bdr); }
.view-img-field { height: 120px; border-radius: var(--rm); border: 1px solid var(--bdr); }

/* --- Icon button (pencil/close in popups) --- */
.icon-btn { background: none; border: none; color: var(--t3); padding: 4px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: var(--rs); flex-shrink: 0; }
.icon-btn:active { background: rgba(255,255,255,0.06); }
.icon-btn-sm { background: none; border: none; color: var(--t3); padding: 4px; min-width: 36px; min-height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: var(--rs); }

/* --- Recording card types --- */
.rec-stat-box { flex: 1; background: rgba(255,255,255,0.02); border: 1px solid var(--bdr); border-radius: var(--rm); padding: 12px; text-align: center; }
.rec-stat-pos { flex: 1; background: rgba(52,196,124,0.06); border: 1px solid var(--grn-b); border-radius: var(--rm); padding: 14px; text-align: center; }
.rec-stat-neg { flex: 1; background: rgba(212,74,58,0.06); border: 1px solid var(--red-b); border-radius: var(--rm); padding: 14px; text-align: center; }
.rec-stat-val-grn { font-family: var(--fd); font-size: 1.5rem; font-weight: 900; color: var(--grn); }
.rec-stat-val-red { font-family: var(--fd); font-size: 1.5rem; font-weight: 900; color: var(--red); }

/* --- Wellness buttons --- */
.well-btn { display: block; width: 100%; padding: 16px 20px; border: none; border-radius: 20px; color: #fff; font-family: var(--fd); font-size: 1rem; font-weight: 800; letter-spacing: 0.3px; cursor: pointer; text-align: center; box-shadow: 0 4px 20px rgba(52,196,124,0.25); transition: all 0.15s; }
.well-btn:active { transform: scale(0.97); }
.well-yes { background: linear-gradient(135deg, #34C47C, #28a868); }

/* --- Date range inputs --- */
.date-label { flex: 1; min-width: 120px; font-size: 0.72rem; color: var(--t2); font-weight: 600; }
.date-input { width: 100%; margin-top: 4px; padding: 10px; border-radius: var(--rm); border: 1px solid var(--bdr); background: var(--card); color: var(--t1); font-family: var(--fb); font-size: 0.8125rem; box-sizing: border-box; }

/* --- Stats page --- */
.stat-rank-title { text-transform: uppercase; letter-spacing: 3px; text-align: center; font-family: var(--fd); font-size: 1.125rem; font-weight: 800; }
.stat-rank-num { font-family: var(--fd); font-size: 1.25rem; font-weight: 900; letter-spacing: 4px; color: var(--gold); margin-top: 2px; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; color: var(--t1); }
.stat-th { border-bottom: 1px solid var(--bdr); color: var(--t2); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.8px; padding: 8px 6px; text-align: left; font-weight: 700; }
.stat-td { border-bottom: 1px solid rgba(255,255,255,0.03); padding: 8px 6px; font-weight: 700; }
.stat-badge-grn { font-size: 0.625rem; background: var(--grn-d); color: var(--grn); padding: 3px 8px; border-radius: 10px; font-weight: 700; white-space: nowrap; margin-left: 8px; }
.chart-h-240 { height: 240px; }

/* --- Spotify overlay --- */
.sp-pl-overlay-bg { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.7); }
.sp-pl-overlay-box { position: fixed; top: 10vh; left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: 400px; z-index: 201; background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rl); box-shadow: 0 16px 48px rgba(0,0,0,0.6); overflow: hidden; max-height: 80vh; display: flex; flex-direction: column; }
.sp-pl-overlay-hdr { padding: 14px 16px; font-size: 0.66rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; border-bottom: 1px solid var(--bdr); flex-shrink: 0; }
.sp-pl-overlay-list { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.sp-pl-overlay-empty { padding: 30px; text-align: center; color: var(--t3); font-size: 0.8125rem; }
.sp-pl-overlay-footer { padding: 10px 16px; border-top: 1px solid var(--bdr); flex-shrink: 0; }

/* --- IDP habit card --- */
.idp-habit-card { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rm); padding: 12px; margin-bottom: 8px; }
.idp-habit-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.idp-habit-name { flex: 1; font-size: 0.84rem; font-weight: 700; color: var(--t1); line-height: 1.4; }

/* --- Edit info custom field --- */
.custom-field-wrap { margin-bottom: 10px; background: rgba(255,255,255,0.02); border: 1px solid var(--bdr); border-radius: var(--rs); padding: 10px; }
.custom-field-header { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }

/* --- Modal textarea --- */
.mi-textarea { font-size: 0.8125rem; padding: 10px; min-height: 80px; resize: vertical; }

/* --- Sharing inbox --- */
.share-inbox { margin-bottom: 14px; padding: 14px; border: 1px solid rgba(107,191,255,0.2); border-radius: var(--rs); background: rgba(107,191,255,0.04); }
.share-inbox-hdr { font-size: 0.66rem; color: #6BBFFF; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.share-item-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--bdr); }
.share-accept-btn { padding: 6px 12px; min-height: 36px; font-size: 0.6875rem; color: #34C47C; border-color: rgba(52,196,124,0.3); }
.share-dismiss-btn { padding: 6px 12px; min-height: 36px; font-size: 0.6875rem; }

/* --- Misc --- */
.voice-toggle-wrap { margin-left: 6px; border-left: 1px solid var(--bdr); padding-left: 8px; display: flex; align-items: center; gap: 6px; }
.voice-controls-row { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px 4px; }
.timer-fixed-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--bdr); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.timer-fixed-inner { max-width: 500px; margin: 0 auto; }
.timer-tab-btn { flex: 1; cursor: pointer; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.plus-circle-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--bdr); background: rgba(255,255,255,0.03); color: var(--t2); font-size: 1rem; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-bottom: 12px; }
.dd-list-relative { position: relative; margin-top: 4px; max-height: 240px; }
.no-items-msg { padding: 14px; font-size: 0.75rem; color: var(--t3); font-style: italic; text-align: center; }

/* --- Final migration classes --- */
.summary-card { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rm); padding: 12px 16px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.summary-label { font-size: 0.72rem; color: var(--t2); margin-bottom: 12px; line-height: 1.5; }
.summary-label-sm { font-size: 0.75rem; color: var(--t2); margin-bottom: 12px; line-height: 1.5; }
.meta-label-sm { font-size: 0.66rem; color: var(--t2); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.meta-sub { font-size: 0.66rem; color: var(--t2); margin-top: 3px; font-weight: 600; }
.timer-avatar { width: 36px; height: 36px; font-size: 0.875rem; }
.timer-avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; flex-shrink: 0; }
.qr-btn-main { font-size: 0.875rem; padding: 10px 24px; min-height: 44px; }
.vol-section { padding: 2px 4px 20px; }

/* --- Observation buttons (coaching positive/negative) --- */
.obsb-pos-active { background: var(--grn); color: #fff; border-color: var(--grn); }
.obsb-pos-inactive { background: var(--grn-d); border: 2px solid var(--grn-b); color: var(--t3); }
.obsb-neg-active { background: var(--red); color: #fff; border-color: var(--red); }
.obsb-neg-inactive { background: var(--red-d); border: 2px solid var(--red-b); color: var(--t3); }

/* --- Chart theme constants (reference for JS Chart.js configs) ---
   Chart.js cannot read CSS variables, so these colors are also
   hardcoded in the JS chart configurations. If you change the
   theme colors above, update these Chart.js values too:
   
   --t2 (#8B9AAD) -> chart axis labels, legend text
   --t3 (#5A6878) -> chart point labels  
   --gold (#D4883A) -> player data color
   --grn (#34C47C) -> secondary data color
   --bdr (rgba 0.055) -> chart grid lines use rgba(255,255,255,0.04)
*/

/* --- Yes/No toggle buttons (cone, wellness, habits) --- */
.bbin-yes { background: var(--grn); color: #fff; border-color: var(--grn); }
.bbin-no { background: var(--red); color: #fff; border-color: var(--red); }

/* ─── MISSING CLASS DEFINITIONS (recovered) ─── */

/* Auth */
.auth-toggle { display: block; margin-top: 20px; color: var(--t2); font-size: 0.8125rem; }
.auth-toggle a { color: var(--gold); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.auth-loading { color: var(--t2); font-size: 0.78rem; margin-top: 10px; }

/* Utility (missed) */
.border-none { border: none; }
.cursor-pointer { cursor: pointer; }
.pt-0 { padding-top: 0; }
.px-14 { padding-left: 14px; padding-right: 14px; }
.text-xl { font-size: 1.125rem; }

/* Yes/No toggle buttons (bbin) */
.bbin { flex: 1; padding: 12px 4px; border-radius: var(--rm); border: 2px solid var(--bdr); background: rgba(255,255,255,0.02); color: var(--t2); font-family: var(--fb); font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: all 0.15s; min-height: 44px; text-align: center; }
.bbin:active { transform: scale(0.96); }

/* Ellipsis menu button */
.iam-btn { background: none; border: none; color: var(--t3); padding: 4px; min-width: 36px; min-height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: var(--rs); flex-shrink: 0; }
.iam-btn:active { background: rgba(255,255,255,0.06); }
.iam-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* Summary card components */
.sc { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rl); padding: 14px; margin-bottom: 9px; }
.sc.fu { opacity: 0; animation: fadeUp 0.35s ease forwards; }
.stp { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sn { font-family: var(--fd); font-size: 0.9375rem; font-weight: 700; color: var(--t1); }
.spts { font-size: 0.75rem; color: var(--t2); margin-left: 4px; }
.spu { font-size: 0.66rem; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-top: 1px; }
.sdtl { display: flex; flex-wrap: wrap; gap: 6px; }
.str { font-size: 0.6875rem; padding: 4px 8px; border-radius: 8px; font-weight: 600; }
.sr { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--bdr); font-size: 0.75rem; }
.srd { color: var(--t3); font-size: 0.6875rem; min-width: 60px; }
.srt { flex: 1; font-weight: 600; color: var(--t1); }
.srb { color: var(--gold); font-weight: 700; font-size: 0.75rem; flex-shrink: 0; }

/* Practice points */
.pi { text-align: center; }
.gd { color: var(--gold); font-weight: 800; }

/* Week picker */
.wpk { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.wpb { padding: 8px 14px; min-height: 36px; border-radius: 20px; border: 1px solid var(--bdr); background: rgba(255,255,255,0.02); color: var(--t2); font-family: var(--fb); font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.wpb.act { border-color: var(--gold-b); background: var(--gold-d); color: var(--gold); }
.wpb:active { transform: scale(0.96); }
.wps { font-size: 0.78rem; color: var(--t2); margin-bottom: 14px; }

/* Quick Rate overlay */
.qr-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,0.7); display: flex; align-items: flex-end; justify-content: center; }
.qr-inner { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--rl) var(--rl) 0 0; width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.qr-hdr { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--bdr); }
.qr-title { font-family: var(--fd); font-size: 1.0625rem; font-weight: 700; color: var(--t1); }
.qr-sub { font-size: 0.78rem; color: var(--t2); margin-top: 2px; }
.qr-close { background: none; border: 1px solid var(--bdr); border-radius: var(--rm); padding: 8px 16px; min-height: 44px; color: var(--t2); font-family: var(--fb); font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.qr-close:active { background: rgba(255,255,255,0.06); }
.qr-body { padding: 14px; }
.qr-pgrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 14px; }
.qr-pl { padding: 10px 4px; border-radius: var(--rm); border: 1px solid var(--bdr); background: rgba(255,255,255,0.02); cursor: pointer; text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--t2); transition: all 0.15s; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; }
.qr-pl:active { transform: scale(0.96); }
.qr-pl.act { border-color: var(--gold-b); background: var(--gold-d); color: var(--gold); }
.qr-nm { font-size: 0.625rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.qr-rate { padding: 14px; border-top: 1px solid var(--bdr); }
.qr-rate-name { font-family: var(--fd); font-size: 0.9375rem; font-weight: 700; margin-bottom: 4px; }
.qr-rate-act { font-size: 0.78rem; color: var(--t2); margin-bottom: 12px; }

/* Timer sub-rows */
.tas { padding: 0; }
.tsa { font-size: 0.78rem; color: var(--t3); margin-right: 6px; }
.tsd { font-size: 0.78rem; font-weight: 600; color: var(--t1); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Drag targets */
.dd-handle { cursor: grab; touch-action: none; }
.dd-handle:active { cursor: grabbing; }

/* Stats correlation */
.st-corr-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.st-corr-item { background: rgba(255,255,255,0.02); border: 1px solid var(--bdr); border-radius: var(--rs); padding: 10px; text-align: center; }
.st-corr-val { font-family: var(--fd); font-size: 1.125rem; font-weight: 800; }
.st-corr-val.pos { color: var(--grn); }
.st-corr-val.neg { color: var(--red); }
.st-corr-val.neu { color: var(--t3); }
.st-corr-lbl { font-size: 0.625rem; color: var(--t3); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Habit details */
.hab-details { border: 1px solid var(--bdr); border-radius: var(--rs); overflow: hidden; }
.hab-details summary { padding: 8px 12px; font-size: 0.75rem; color: var(--t2); cursor: pointer; list-style: none; }
.hab-details summary::-webkit-details-marker { display: none; }
.hab-info { padding: 8px 12px; font-size: 0.75rem; color: var(--t3); line-height: 1.5; border-top: 1px solid var(--bdr); }

/* Edit info inputs */

/* Spotify playlist item */
.sp-pl-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--rs); cursor: pointer; transition: background 0.1s; }
.sp-pl-item:active { background: rgba(255,255,255,0.06); }

/* --- Cone/observation button states --- */
.cone-yes { border-color: var(--grn-b); background: var(--grn-d); color: var(--grn); }
.cone-no { border-color: var(--bdr); background: rgba(255,255,255,0.02); color: var(--t3); }
.cone-sel { border-color: var(--grn-b); background: var(--grn); color: #fff; }

/* --- Timer countdown digits --- */
.tt { font-family: var(--fd); font-size: 3rem; font-weight: 800; letter-spacing: 2px; color: var(--t1); }
.tt.w { color: var(--gold); }
.tt.u { color: var(--red); animation: pulse 0.5s ease infinite; }

/* --- Timer sub-exercise drag targets --- */
