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

:root {
  --page-bg: #f5f6fa;
  --sidebar-bg: #14162b;
  --sidebar-width: 260px;
  --surface: #ffffff;
  --surface2: #f5f6fb;
  --border: #e8e9f2;
  --accent: #6c5ce7;
  --accent-hover: #5b4fd6;
  --accent-glow: rgba(108, 92, 231, 0.14);
  --accent-rgb: 108, 92, 231;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
  --success: #16a34a;
  --error: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
}

html { scroll-behavior: smooth; }

body {
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header / sidebar ──
   Same markup as before (logo + header-right > nav + lang-toggle +
   userChipSlot) -- turned into a fixed left sidebar with pure CSS
   (flex-direction: column + fixed position), no HTML/JS changes needed.
   --text/--text-muted/--surface2/--border are redefined within this scope
   only, so every descendant that already read those tokens (nav links,
   the lang toggle, the user chip) automatically gets the light-on-dark
   palette the sidebar needs instead of the page's light-theme values. */
.site-header {
  --text: #ffffff;
  --text-muted: #9496b3;
  --surface2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background:
    url("images/sidebar-wave.png") left bottom / 100% auto no-repeat,
    radial-gradient(500px 260px at 20% 105%, rgba(148, 130, 255, 0.22), transparent 70%),
    linear-gradient(165deg, #15112a 0%, #1a1440 40%, #241a52 75%, #2e1e66 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.header-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
  padding: 0 8px;
  margin-bottom: 28px;
}

.logo-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-icon img { width: 30px; height: auto; display: block; }

.header-right { display: flex; flex-direction: column; flex: 1; gap: 16px; min-height: 0; }

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

.lang-toggle { display: flex; gap: 6px; margin-top: auto; padding: 0 8px; }

/* When the toggle is hidden (logged-in users on every page but Account --
   see app.js), its margin-top: auto no longer exists to push the plan/
   credits card down with it -- transfer that job to the card itself so it
   still lands at the sidebar's bottom instead of riding up under the nav. */
.header-right:has(> .lang-toggle.hidden) #userChipSlot { margin-top: auto; }

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  letter-spacing: 0.3px;
}
.lang-btn:hover { color: var(--text); border-color: var(--text-muted); }
.lang-btn.active { color: #ffffff; border-color: transparent; background: linear-gradient(135deg, #9b8cff, #6c5ce7); }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-link.active {
  color: #ffffff;
  background: linear-gradient(120deg, #8b7cff, #6c5ce7);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
}
.nav-icon { display: inline-flex; flex-shrink: 0; }
.nav-icon svg { display: block; }

/* ── Main ── */
.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  margin-left: var(--sidebar-width);
}

/* Fixed sidebars don't work on phone-width screens -- collapse back to a
   plain top bar there instead of eating half the viewport. */
@media (max-width: 860px) {
  .site-header {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-link { padding: 6px 12px; }
  .main { margin-left: 0; padding: 24px 16px 40px; }

  /* The full "Plan Pro" card (label + two-row layout) is sized for the
     vertical sidebar it was designed for -- on the horizontal mobile top
     bar it doesn't fit next to nav+lang-toggle and pushed everything off
     the right edge. Collapse it to one compact row, same idea as the
     pre-redesign .user-chip. */
  .user-plan-card { flex-direction: row; align-items: center; gap: 10px; padding: 6px 12px; }
  .user-plan-label { display: none; }
  .user-plan-row { gap: 10px; }
  /* nowrap: the compact chip is sized to fit its own content (auto grid
     column on Acasă, see below) with no slack for the row's desktop
     space-between/wrap behavior to work with -- without this, credits and
     the avatar button wrap onto their own lines instead of sitting side by
     side. Two-class selector (not just .user-plan-row) so this reliably
     wins over the unconditional flex-wrap: wrap declared alongside the
     desktop .user-plan-row rule much later in this file -- same
     specificity, but source order alone would let that later rule win
     regardless of viewport. */
  .user-plan-card .user-plan-row { flex-wrap: nowrap; }

  /* Pages with the bottom mobile-tabbar (see reports.html) get their
     navigation there instead of the collapsed top row -- showing both
     would be redundant. Other pages keep the top nav for now (no
     mobile-tabbar markup on them yet). */
  .has-mobile-tabbar .header-right .nav { display: none; }
  .has-mobile-tabbar .main { padding-bottom: 88px; } /* clears the fixed tabbar */

  /* Same small grid on every page's mobile header: logo + RO/EN share row
     1 (logo left, lang-toggle right after it via the auto columns; a 1fr
     spacer column keeps them from being stretched apart), nav gets its
     own full-width row 2 (wraps its own links), and the user chip
     (Plan Pro card on web, plain email+logout chip on events) gets a
     right-aligned row 3. .header-right itself contributes no box here
     (display: contents unwraps it) since its children -- nav, lang-toggle,
     the chip, and (Acasă-only) the relocated bell/avatar chip -- each need
     their own grid cell, not one shared flex line between them. */
  .header-inner {
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    align-items: center;
    padding: 12px 16px;
    column-gap: 12px;
    row-gap: 8px;
  }
  .logo { grid-column: 1; grid-row: 1; margin-bottom: 0; }
  .header-right { display: contents; }
  .lang-toggle { grid-column: 2; grid-row: 1; margin-top: 0; padding: 0; }
  .header-right .nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  #userChipSlot { grid-column: 1 / -1; grid-row: 3; display: flex; justify-content: flex-end; }

  /* Acasă-only (.has-mobile-tabbar): nav is hidden (see above). With the
     lang toggle now hidden for logged-in users (see app.js), row 1 would
     otherwise be just the lone logo -- so both the relocated bell/avatar
     chip (see reports.js) and the plan/credits chip share row 1 with it
     (5th column added to .header-inner above just for this), hugging the
     right edge together instead of the credits chip sitting alone on its
     own row below. */
  .has-mobile-tabbar .home-topbar-right {
    grid-column: 4;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .has-mobile-tabbar #userChipSlot { grid-column: 5; grid-row: 1; }

  /* The bell chip is a light-on-white circle by design in its native
     .home-topbar context (desktop) -- once relocated into the dark purple
     header on mobile (see reports.js), a solid white circle reads as a
     jarring blob instead of blending in, so give it a transparent
     white-on-dark treatment there instead, same idea as the sidebar nav's
     own hover states. */
  .has-mobile-tabbar .home-bell { background: rgba(255, 255, 255, 0.14); border: none; color: #ffffff; }
  .has-mobile-tabbar .home-bell:hover { background: rgba(255, 255, 255, 0.22); }

  /* Icon-only avatar chip once relocated into the tight mobile top bar --
     the full name is already shown right below in the "Bun venit, X!"
     welcome text, so it's not lost, just not duplicated here. */
  .home-avatar-name { display: none; }
}

/* ── Bottom mobile tab bar (reports.html only, for now) ── */
.mobile-tabbar { display: none; }

@media (max-width: 860px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 100;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.06);
  }
  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
  }
  .mobile-tab:hover { background: var(--surface2); }
  .mobile-tab.active { color: var(--accent); }
}

/* ── Page title ── */
.page-title-block { margin-bottom: 32px; }
.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.page-subtitle { color: var(--text-muted); font-size: 15px; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.card-desc {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 24px;
}

/* ── Fields ── */
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
}

.field-group { display: flex; flex-direction: column; gap: 8px; }

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  -moz-appearance: textfield;
}
.input-field::-webkit-inner-spin-button,
.input-field::-webkit-outer-spin-button { -webkit-appearance: none; }
.input-field::placeholder { color: var(--text-dim); }
.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.age-row { display: flex; gap: 10px; align-items: center; }
.age-input { flex: 1; }

.toggle-group { display: flex; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 14px;
  transition: background 0.15s, color 0.15s;
}
.toggle-btn.active { background: var(--accent); color: #fff; }
.toggle-btn:not(.active):hover { background: var(--border); color: var(--text); }

/* ── Switch row (account settings) ── */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.switch-row-text { flex: 1; }
.switch-row-label { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.switch-row-hint { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.switch input:checked + .switch-slider { background: var(--accent-glow); border-color: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); background: var(--accent); }
.switch input:disabled + .switch-slider { opacity: 0.6; cursor: default; }

.height-row { display: flex; gap: 10px; align-items: center; }
.height-input { flex: 1; }
.unit-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  flex-shrink: 0;
}

/* ── Categories ── */
.categories { display: flex; flex-direction: column; gap: 16px; }

.category-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}
.category-card.uploaded { border-color: var(--success); }
.category-card.uploading { border-color: var(--accent); }

/* Free-plan teaser (see applyPlanTestLock in app.js) -- visible, not
   hidden, so the athlete/coach can see what's behind the paywall instead
   of wondering why a test is just missing. */
.category-card.locked { opacity: 0.55; }
.category-card.locked .category-actions,
.category-card.locked .file-input { pointer-events: none; }
.category-lock-badge {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.category-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 18px 20px;
}

.category-icon { flex-shrink: 0; display: flex; color: var(--accent); }

/* Approved raster icon set (FutureMVP_Web_Icons_Approved) -- PNG artwork
   recolored via CSS mask instead of an <img>, so it inherits currentColor
   (from .category-icon above) exactly like the inline-SVG nav icons do. */
.fm-icon {
  width: 28px;
  height: 28px;
  display: block;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.fm-running          { --icon: url('images/icons/alergare-64.png'); }
.fm-coordination      { --icon: url('images/icons/coordonare-64.png'); }
.fm-long-jump         { --icon: url('images/icons/saritura-in-lungime-64.png'); }
.fm-balance-left      { --icon: url('images/icons/echilibru-picior-stang-64.png'); }
.fm-balance-right     { --icon: url('images/icons/echilibru-picior-drept-64.png'); }
.fm-y-balance-left    { --icon: url('images/icons/y-balance-picior-stang-64.png'); }
.fm-y-balance-right   { --icon: url('images/icons/y-balance-picior-drept-64.png'); }
.fm-body-measurements { --icon: url('images/icons/masuratori-corp-64.png'); }

/* AI recommendation-card icons (FutureMVP_Recommendation_Icons) -- same
   --icon custom-property convention as the set above, reused by
   .home-ai-rec-icon below instead of .fm-icon (different size/color there:
   a dark-ink icon with no background badge, not a flat accent-coloured
   one). */
.fm-stability      { --icon: url('images/icons/stabilitate-unipodala-64.png'); }
.fm-mobility       { --icon: url('images/icons/mobilitate-glezna-dorsiflexie-64.png'); }
.fm-strength       { --icon: url('images/icons/core-lant-posterior-64.png'); }
.fm-posture        { --icon: url('images/icons/consult-specialitate-coloana-64.png'); }
.fm-cross-training { --icon: url('images/icons/inot-64.png'); }

/* flex-basis 140px is a preferred minimum, not a fixed width -- once the
   card is too narrow for icon + name + actions on one line (phones), this
   is what makes .category-actions (nowrap, doesn't shrink) the item that
   wraps onto its own row, while icon + name/status stay together on the
   first row (needs to be narrow enough to actually leave them room next
   to the icon within the card's real interior width -- a too-large basis
   here made the name wrap away from the icon instead, onto its own row). */
.category-info { flex: 1 1 140px; min-width: 0; }

.category-name { font-size: 15px; font-weight: 600; }
.category-status { font-size: 13px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-status.done { color: var(--success); }
.category-status.error { color: var(--error); }

/* margin-left: auto only matters once .category-header wraps (see above)
   -- right-aligns this on its own new line instead of sitting flush left
   under the icon. */
.category-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: auto; }

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.upload-btn:hover { background: var(--accent-hover); }
.upload-btn:active { transform: scale(0.97); }
.upload-btn-icon { font-style: normal; }
.file-input { display: none; }

.remove-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.remove-btn:hover { background: var(--error); border-color: var(--error); color: #fff; }

/* ── Progress ── */
.upload-progress {
  padding: 0 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; min-width: 70px; text-align: right; }

/* ── Video preview ── */
.video-preview {
  padding: 0 20px 16px;
}
.video-preview video {
  width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  background: #000;
  display: block;
}
.preview-pending {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2, rgba(255,255,255,0.04));
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Submit ── */
.submit-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 0 0;
}

.submit-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 18px 60px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(var(--accent-rgb), 0.25);
}
.submit-btn:hover { background: var(--accent-hover); box-shadow: 0 6px 32px rgba(var(--accent-rgb), 0.4); transform: translateY(-1px); }
.submit-btn:active { transform: scale(0.98) translateY(0); }
.submit-btn:disabled { background: var(--surface2); color: var(--text-dim); box-shadow: none; cursor: not-allowed; transform: none; }

.submit-hint { color: var(--text-dim); font-size: 13px; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--error); color: var(--error); }

/* ── Waiting panel ── */
.waiting-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-top: 24px;
}

.waiting-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.waiting-text { flex: 1; }
.waiting-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.waiting-sub { font-size: 13px; color: var(--text-muted); }
.waiting-progress { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 6px; }

.cancel-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 20px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cancel-btn:hover { border-color: var(--error); color: var(--error); background: rgba(220,38,38,0.07); }

/* ── Results ── */
.results-card { margin-top: 24px; }
.history-empty { text-align: center; color: var(--text-muted); }
.history-session + .history-session { margin-top: 24px; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.results-badge {
  background: var(--success);
  color: #fff;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  letter-spacing: 0.3px;
}

.results-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Result athlete header ── */
.result-athlete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.result-athlete-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.athlete-name { font-size: 16px; font-weight: 700; color: var(--text); }
.athlete-chip { font-size: 12px; color: var(--text-muted); background: var(--surface); padding: 3px 10px; border-radius: 20px; }

/* ── Result panel (per category) ── */
.result-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.result-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.rp-icon { font-size: 18px; line-height: 1; }
.rp-name { font-size: 14px; font-weight: 600; flex: 1; }
.rp-time { font-size: 12px; color: var(--text-muted); }
.rp-error { padding: 10px 16px; color: var(--error); font-size: 13px; }

/* badges */
.rp-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-success { background: rgba(22,163,74,.1);  color: #15803d; border: 1px solid rgba(22,163,74,.25); }
.badge-error   { background: rgba(220,38,38,.1);   color: #b91c1c; border: 1px solid rgba(220,38,38,.25); }
.badge-warn    { background: rgba(217,119,6,.1);   color: #b45309; border: 1px solid rgba(217,119,6,.25); }
.badge-muted   { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }

/* panel body: media + metrics side by side */
.rp-body {
  display: flex;
  gap: 16px;
  padding: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.rp-media {
  flex: 0 0 auto;
  width: min(340px, 100%);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}
.rp-media video,
.rp-media img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}
.rp-download {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: var(--accent);
  background: var(--surface2);
  text-decoration: none;
  border-top: 1px solid var(--border);
}
.rp-download:hover { background: var(--border); }
.rp-metrics-col { flex: 1; min-width: 200px; }

/* ── Body-measurement group panel: shows only the combined Remotion
   video once ready (see buildBodyGroupPanel); this is the placeholder
   shown while waiting on one or more of the 4 views ── */
.rp-body-waiting { padding: 16px; }
.rp-body-waiting-label { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }

/* ── Metric cards grid ── */
.result-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}
.metric-card.metric-hi {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), .06);
}
.metric-value { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.metric-card.metric-hi .metric-value { color: var(--accent); }
.metric-unit { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.metric-label { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.result-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

/* ── Sport suitability bars ── */
.sport-bars { display: flex; flex-direction: column; gap: 7px; }
.sport-bar-row { display: flex; align-items: center; gap: 8px; }
.sport-bar-label { width: 100px; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sport-bar-track { flex: 1; height: 7px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.sport-bar-fill  { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #4834d4); transition: width .8s ease; }
.sport-bar-score { width: 38px; font-size: 12px; color: var(--text); text-align: right; }

/* ── JSON viewer button & drawer ── */
.json-btn {
  margin-left: auto;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-family: monospace;
  padding: 3px 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.json-btn:hover, .json-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.json-drawer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  overflow: auto;
  max-height: 420px;
}
.json-drawer.hidden { display: none; }
.json-pre {
  font-family: 'Consolas', 'Fira Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: pre;
  line-height: 1.55;
}

/* ── Data quality warning ── */
.dq-warning {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.dq-unreliable { background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.3); color: #b91c1c; }
.dq-questionable { background: rgba(217,119,6,0.08); border: 1px solid rgba(217,119,6,0.3); color: #b45309; }
.dq-title { font-weight: 600; margin-bottom: 4px; }
.dq-issues { margin: 4px 0 0 16px; font-size: 12px; opacity: 0.9; }
.dq-issues li { margin-bottom: 3px; }

/* ── AI Summary ── */
.ai-card { margin-top: 24px; border-color: rgba(var(--accent-rgb), 0.3); }

.ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.ai-icon {
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.ai-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: auto;
  flex-shrink: 0;
}

.ai-download-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ai-download-btn:hover {
  background: var(--accent);
  color: #000;
}

.ai-icon-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ai-icon-btn:hover:not(:disabled) { background: var(--accent-glow); color: var(--accent); border-color: var(--accent); }
.ai-icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ai-body {
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  min-height: 20px;
}

.ai-report-meta {
  font-size: 11.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  margin-top: -10px;
  margin-bottom: 16px;
}

.ai-body strong, .ai-body b { color: var(--accent); font-weight: 700; }

.ai-upsell-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.ai-upsell-banner:hover { background: rgba(var(--accent-rgb), 0.2); border-color: rgba(var(--accent-rgb), 0.55); }
.ai-upsell-cta { color: var(--accent); font-weight: 700; white-space: nowrap; }

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Camera button variants ── */
.camera-open-btn {
  background: #1a2a1a;
  border: 1px solid #2a4a2a;
  color: #00ffc4;
}
.camera-open-btn:hover { background: #1e3a1e; border-color: #00ffc4; }
.upload-btn-secondary {
  background: var(--surface2);
  font-size: 13px;
  padding: 0 12px;
  color: var(--text-muted);
}
.upload-btn-secondary:hover { background: var(--border); color: var(--text); }
.upload-btn-browse {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}
.upload-btn-browse:hover { background: var(--border); border-color: var(--accent); color: var(--accent); }
.upload-btn-sm { padding: 6px 12px; font-size: 12px; gap: 4px; }

/* ── Body photo slots ── */
.body-photo-slots { display: flex; flex-direction: column; gap: 0; margin: 8px 0 12px; }
.body-slot { border-top: 1px solid var(--border); padding: 10px 0 6px; }
.body-slot-row { display: flex; align-items: center; gap: 10px; }
.body-slot-label { font-size: 13px; font-weight: 600; color: var(--text-muted); width: 52px; flex-shrink: 0; }
.body-slot-row .category-status { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.body-slot-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.body-slot .video-preview img { max-height: 160px; width: 100%; object-fit: contain; border-radius: var(--radius-sm); margin-top: 6px; }

/* ── Camera modal ── */
.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.camera-container {
  width: 100%;
  height: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
}
.camera-wrapper {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #000;
}
#cameraFeed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Pose guide overlay ── */
.pose-guide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.pose-svg {
  width: 55%;
  height: 88%;
  opacity: 0.82;
  animation: pulse-guide 2.4s ease-in-out infinite;
}
@keyframes pulse-guide {
  0%, 100% { opacity: 0.75; filter: drop-shadow(0 0 6px #00ffc4); }
  50%       { opacity: 0.95; filter: drop-shadow(0 0 18px #00ffc4) drop-shadow(0 0 6px #00ffc4); }
}
.guide-instructions {
  width: 100%;
  padding: 10px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
}
.guide-line {
  font-size: 13px;
  font-weight: 600;
  color: #00ffc4;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}

/* ── Camera controls bar ── */
.camera-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 24px;
  background: #0a0a0a;
  gap: 16px;
}
.cam-btn {
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.12s, background 0.15s;
}
.cam-btn:active { transform: scale(0.93); }
.cam-cancel {
  background: var(--surface2);
  color: var(--text-muted);
  padding: 10px 20px;
  flex: 1;
}
.cam-cancel:hover { background: var(--border); color: var(--text); }
.cam-flip {
  background: var(--surface2);
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: 18px;
  flex: 1;
}
.cam-flip:hover { background: var(--border); color: var(--text); }

/* ── Shutter button ── */
.cam-capture {
  background: #00ffc4;
  color: #000;
  padding: 14px 28px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 2;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0,255,196,0.35);
}
.cam-capture:hover { background: #00e8b0; box-shadow: 0 0 30px rgba(0,255,196,0.5); }
.cam-shutter {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #000;
  border: 2px solid #000;
  box-shadow: 0 0 0 3px #00ffc4;
  flex-shrink: 0;
}

/* ── Auth: header user chip ──
   On the sidebar (its only real placement -- see #userChipSlot), rendered
   as a compact "plan" card: label, credits row, logout pill. Elsewhere
   (there is currently no other placement) the plain-row rules below still
   apply as a fallback. */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.user-chip-email { color: var(--text); font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-credits {
  color: var(--accent, var(--text-muted));
  font-weight: 500;
  white-space: nowrap;
  border-left: 1px solid var(--border);
  padding-left: 10px;
}
.user-chip-logout {
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 12px;
  transition: color .15s, border-color .15s;
}
.user-chip-logout:hover { color: var(--text); border-color: var(--text-muted); }

.user-plan-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.user-plan-card:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.16); }
.user-plan-label { font-size: 13px; font-weight: 700; color: #ffffff; }
.user-plan-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; }
.user-plan-credits { display: flex; align-items: center; gap: 6px; color: #cabfff; font-weight: 600; font-size: 13px; white-space: nowrap; }

/* Avatar-initials button on the sidebar plan card -- click opens a small
   menu (currently just Log out) instead of navigating to /plan.html like
   the rest of the card does. */
.user-avatar-wrap { position: relative; flex-shrink: 0; }
.user-avatar-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #9f8cff);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.15s;
}
.user-avatar-btn:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14); }
.user-avatar-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #241c4d;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 6px;
  min-width: 140px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 20;
}
.user-avatar-menu-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.user-avatar-menu-item:hover { background: rgba(255, 255, 255, 0.1); }

/* ── Auth: login/register page ── */
.auth-main {
  max-width: 420px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}
.auth-logo { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 6px; }
.auth-tagline { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }

.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }

.auth-providers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.auth-provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  text-decoration: none;
}
.auth-provider-btn svg { flex-shrink: 0; }
.auth-provider-btn:hover:not(:disabled) { background: var(--border); }
.auth-provider-btn:disabled,
.auth-provider-btn.disabled {
  opacity: .45;
  cursor: not-allowed;
}
.auth-provider-google { background: #f1f3f4; color: #1f1f1f; border-color: #dadce0; }
.auth-provider-google:hover:not(:disabled) { background: #e8eaed; }
.auth-provider-yahoo { background: #5f01d1; color: #fff; border-color: #5f01d1; }
.auth-provider-yahoo:hover:not(:disabled) { background: #6f1de0; }

.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 22px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-tabs { display: flex; gap: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 22px; }
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active { background: var(--accent); color: #fff; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form.hidden { display: none; }

.auth-error {
  display: none;
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-error.show { display: block; }

/* ── Admin panel ── */
.admin-layout { display: flex; gap: 24px; align-items: flex-start; }
@media (max-width: 720px) { .admin-layout { flex-direction: column; } }

.admin-users-col { width: 320px; flex-shrink: 0; }
@media (max-width: 720px) { .admin-users-col { width: 100%; } }

.admin-users-list { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--text);
  font: inherit;
}
.admin-user-row:hover { border-color: var(--text-muted); }
.admin-user-row.active { border-color: var(--accent); background: var(--accent-glow); }
.admin-user-email { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-meta { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.admin-user-count {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}
.admin-user-provider {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
}
.admin-user-credits {
  font-size: 11.5px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.admin-detail-col { flex: 1; min-width: 0; }
.admin-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.admin-detail-email { font-size: 18px; font-weight: 600; }

.admin-delete-btn {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.admin-delete-btn:hover:not(:disabled) { background: var(--error); color: #fff; }
.admin-delete-btn:disabled { opacity: .5; cursor: not-allowed; }

.admin-empty-state { color: var(--text-muted); text-align: center; padding: 48px 0; }

.admin-ai-template { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.admin-ai-template-title { font-size: 15px; margin-bottom: 4px; }
.admin-ai-template-tokens { font-family: 'Consolas', 'Fira Mono', monospace; font-size: 12px; }
.admin-ai-template-textarea {
  width: 100%;
  min-height: 340px;
  margin-top: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: 'Consolas', 'Fira Mono', monospace;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-ai-template-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.admin-ai-template-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 10px; }
.admin-ai-template-status { font-size: 12.5px; color: var(--text-muted); margin-right: auto; }
.admin-ai-template-status.success { color: var(--success); }
.admin-ai-template-status.error { color: var(--error); }
.admin-ai-template-reset {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.admin-ai-template-reset:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); }
.admin-ai-template-save {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.admin-ai-template-save:hover:not(:disabled) { background: var(--accent-hover); }
.admin-ai-template-reset:disabled, .admin-ai-template-save:disabled { opacity: 0.6; cursor: not-allowed; }

.admin-active-tests-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 20px;
  margin-top: 14px;
}
.admin-active-tests-list .checkbox-row { gap: 8px; }
.admin-active-tests-list .checkbox-row label { display: flex; align-items: center; gap: 6px; }

.version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.version-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
}
.version-name {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.version-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.version-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.version-unavailable { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── My Children page ── */

.select-field {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.select-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.eula-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  max-height: 340px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.eula-box p { margin-bottom: 10px; }
.eula-box strong { color: var(--text); }
.eula-box h3 { color: var(--text); font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
.eula-box h3:first-child { margin-top: 0; }
.eula-box .eula-warn {
  background: rgba(217,119,6,0.08);
  border: 1px solid rgba(217,119,6,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
}

.eula-scroll-hint { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; transition: opacity 0.2s; }
.eula-scroll-hint.hidden { display: none; }

.eula-decline-link { display: block; text-align: center; margin-top: 14px; color: var(--text-muted); font-size: 13px; text-decoration: none; }
.eula-decline-link:hover { color: var(--text); text-decoration: underline; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
.checkbox-row input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.5; }
.checkbox-row label { font-size: 14px; color: var(--text); cursor: pointer; }

.status-banner {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}
.status-banner.success { background: rgba(22,163,74,0.1); border: 1px solid var(--success); color: var(--success); }
.status-banner.error   { background: rgba(220,38,38,0.12); border: 1px solid var(--error); color: var(--error); }
.status-banner.info    { background: var(--accent-glow); border: 1px solid var(--accent); color: var(--accent); }

.test-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.test-card-info { flex: 1; }
.test-card-type { font-size: 15px; font-weight: 600; color: var(--text); }
.test-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.processing { background: var(--accent-glow); color: var(--accent); }
.badge.processing .badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: badge-pulse 1.2s infinite; }
@keyframes badge-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.badge.success { background: rgba(22,163,74,0.1); color: var(--success); }
.badge.partial { background: rgba(217,119,6,0.1); color: #b45309; }
.badge.error, .badge.empty, .badge.skipped { background: rgba(220,38,38,0.12); color: var(--error); }

.test-card-toggle, .test-card-delete {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.test-card-toggle:hover { color: var(--text); border-color: var(--text-muted); }
.test-card-delete:hover { color: var(--error); border-color: var(--error); }

.session-delete-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--error);
  background: rgba(220,38,38,.08);
  color: var(--error);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  padding: 0;
  cursor: pointer;
}
.session-delete-btn:hover { background: var(--error); color: #fff; }

.test-card-json {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 12px;
  font-size: 12px;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text-muted);
}

/* ── Dashboard page ── */
.dash-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.dash-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}
.dash-summary-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.dash-summary-value { font-size: 26px; font-weight: 700; color: var(--text); }
.dash-summary-unit { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.dash-summary-meta { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.dash-summary-delta { font-size: 13px; font-weight: 600; margin-top: 8px; }
.dash-delta-up { color: var(--success); }
.dash-delta-down { color: var(--error); }
.dash-delta-flat { color: var(--text-muted); }

.dash-chart-svg { width: 100%; height: auto; display: block; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.dash-legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.dash-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.dash-summary-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--accent-glow);
  font-size: 18px;
  margin-bottom: 12px;
}

/* ── Acasă: top bar (search + bell + avatar) ── */
.home-topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.home-search {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}
.home-search-icon { position: absolute; left: 16px; font-size: 14px; opacity: 0.5; pointer-events: none; }
.home-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 16px 11px 40px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.home-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.home-search-input::placeholder { color: var(--text-dim); }

.home-child-select {
  border-radius: 999px;
  padding: 11px 16px;
  width: 100%;
}

/* ── Scanner combo (experimental child-selector UI, design: combo-scanner-style.html, recolored to the site's light theme) ── */
.scan-native-select { display: none; }

.scan-combo { position: relative; width: 100%; font-family: inherit; }

.scan-trigger {
  position: relative;
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.scan-trigger:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); transform: translateY(-1px); }

.scan-trigger::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 10%; width: 2px;
  background: #43f6c0;
  box-shadow: 0 0 6px #43f6c0, 0 0 16px #43f6c0, 0 0 32px #43f6c0;
  animation: scan-sweep 2.6s infinite alternate ease-in-out;
  pointer-events: none;
}
@keyframes scan-sweep { from { left: 10%; } to { left: 90%; } }

.scan-trigger::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 0; width: 80px;
  background: linear-gradient(90deg, transparent, #43f6c022, transparent);
  filter: blur(8px);
  animation: scan-glow 2.6s infinite alternate ease-in-out;
  pointer-events: none;
}
@keyframes scan-glow { from { transform: translateX(-20px); } to { transform: translateX(300px); } }

.scan-trigger-content { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; min-width: 0; }

.scan-avatar {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--accent-glow);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
  font-size: 10.5px; font-weight: 800;
}
.scan-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scan-name { font-size: 13.5px; font-weight: 700; letter-spacing: -0.2px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-meta { color: var(--text-muted); font-size: 10.5px; }

.scan-arrow { position: relative; z-index: 2; color: var(--text-dim); font-size: 16px; flex-shrink: 0; transition: transform 0.25s ease, color 0.25s ease; }
.scan-combo.open .scan-arrow { transform: rotate(180deg); color: var(--accent); }

.scan-menu {
  position: absolute; z-index: 100;
  top: calc(100% + 8px); left: 0; right: 0;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.16), 0 0 0 1px var(--border);
  opacity: 0;
  visibility: hidden;
  max-height: 340px;
  overflow-y: auto;
  transform: translateY(-7px) scale(0.985);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}
.scan-combo.open .scan-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.scan-menu-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px 9px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px; letter-spacing: 1px; text-transform: uppercase;
}
.scan-menu-header span:last-child { color: var(--accent); }

.scan-options { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }

.scan-option {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.scan-option:hover { background: var(--surface2); }
.scan-option.selected { background: var(--accent-glow); border: 1px solid rgba(var(--accent-rgb), 0.25); box-shadow: inset 3px 0 var(--accent); }

.scan-option-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.scan-option .scan-avatar { width: 30px; height: 30px; font-size: 9.5px; }
.scan-option-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scan-option-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-option-meta { color: var(--text-muted); font-size: 9.5px; }

.scan-check { margin-left: 8px; color: var(--accent); opacity: 0; flex-shrink: 0; transition: opacity 0.2s; }
.scan-option.selected .scan-check { opacity: 1; }

.home-topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }

.home-bell {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.home-bell:hover { border-color: var(--text-muted); background: var(--surface2); }
.home-bell-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #9b8cff, #6c5ce7);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.home-bell-wrap { position: relative; }
.home-bell-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 8px;
  z-index: 50;
}
.home-bell-panel.hidden { display: none; }
.home-bell-panel-header { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; padding: 6px 8px 10px; }
.home-notif-empty { padding: 16px 8px; text-align: center; color: var(--text-muted); font-size: 13px; }
.home-notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: var(--radius-sm); text-decoration: none; color: inherit; }
.home-notif-item:hover { background: var(--surface2); }
.home-notif-icon { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-glow); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.home-notif-body { min-width: 0; }
.home-notif-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.home-notif-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.home-notif-link { font-size: 12px; font-weight: 700; color: var(--accent); margin-top: 6px; }

.home-avatar-chip { display: flex; align-items: center; gap: 10px; }
.home-avatar-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
.home-avatar-email { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* ── Acasă: hero grid (topbar + welcome + banner) ──
   Named grid areas so the same three elements can reorder/regroup per
   breakpoint without moving them in the DOM: desktop pairs welcome+banner
   side by side under a full-width topbar; mobile stacks them
   welcome -> topbar -> banner (see the media query below). */
.home-hero-grid {
  display: grid;
  grid-template-areas: "topbar topbar" "welcome banner";
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}
.home-topbar { grid-area: topbar; margin-bottom: 0; }
.home-welcome-row { grid-area: welcome; }
.home-banner { grid-area: banner; }

.home-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 260px;
  max-width: 460px;
  background: linear-gradient(120deg, var(--accent), #4834d4);
  border-radius: var(--radius);
  padding: 22px 26px;
  color: #fff;
  box-shadow: 0 8px 28px var(--accent-glow);
}
.home-banner-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.home-banner-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.home-banner-sub { font-size: 13px; opacity: 0.85; }

/* ── Acasă: two-column layout ── */
.home-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 960px) {
  .home-grid { grid-template-columns: 1fr; }
}
.home-col-main, .home-col-side { min-width: 0; }

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.home-see-all { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
.home-see-all:hover { text-decoration: underline; }

/* ── Acasă: session history rows ── */
.home-session-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.home-session-row:hover { background: var(--surface2); }
.home-session-row + .home-session-row { border-top: 1px solid var(--border); }

.home-session-thumb {
  position: relative;
  width: 88px; height: 62px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
.home-session-thumb img, .home-session-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-session-thumb-fallback { font-size: 22px; }
.home-session-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 14px;
  pointer-events: none;
}

.home-session-info { flex: 1; min-width: 0; }
.home-session-date { font-size: 12px; color: var(--text-dim); margin-bottom: 2px; }
.home-session-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.home-session-cat { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.home-session-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.home-session-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  border-radius: 20px;
  padding: 2px 9px;
}

.home-session-vitals {
  display: flex;
  gap: 18px;
  flex-shrink: 0;
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
}
.home-session-vitals strong { color: var(--text); font-size: 15px; }
.home-session-vitals-label { font-size: 11px; color: var(--text-dim); }

/* ── Acasă: performance score donut ── */
.home-score-card { text-align: center; }
.home-donut-wrap { position: relative; display: inline-block; margin: 4px 0 8px; }
.home-donut-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.home-donut-value { font-size: 30px; font-weight: 800; color: var(--text); }
.home-donut-max { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.home-donut-sub-title { font-size: 14.5px; font-weight: 700; color: var(--text); margin-top: 4px; }
.home-donut-sub { font-size: 12.5px; color: var(--text-muted); margin-bottom: 16px; }
.home-donut-breakdown { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.home-donut-breakdown-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.home-donut-breakdown-row strong { margin-left: auto; color: var(--text); }

.home-score-empty { padding: 12px 4px 4px; }
.home-score-empty-icon { font-size: 28px; opacity: 0.5; margin-bottom: 10px; }
.home-score-empty-title { font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.home-score-empty-sub { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; }

/* ── Acasă: AI recommendations ── */
.home-ai-recs { display: flex; flex-direction: column; gap: 10px; }
.home-ai-rec-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}
.home-ai-rec-card:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); border-color: var(--text-muted); }
.home-ai-rec-icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  background-color: var(--text);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.home-ai-rec-body { flex: 1; min-width: 0; }
.home-ai-rec-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.home-ai-rec-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.home-ai-rec-arrow { margin-left: auto; color: var(--text-dim); font-size: 15px; flex-shrink: 0; }

/* ── Acasă: bottom CTA banner ── */
.home-cta-banner {
  display: block;
  background: linear-gradient(135deg, #1a1c35, #2a1f4d);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-decoration: none;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.2s;
}
.home-cta-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.25); }
.home-cta-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.home-cta-sub { font-size: 12.5px; opacity: 0.75; margin-bottom: 14px; }
.home-cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
}

@media (max-width: 860px) {
  /* .home-topbar-right (bell + avatar chip) has already relocated into
     .header-right by this width (see the 860px block above + reports.js)
     -- .home-topbar itself is just the child-selector combo from here
     down, so it no longer needs to wrap for a second row. */
  .home-search { max-width: 100%; }
  .home-avatar-email { display: none; }

  /* Welcome text, then the child-selector combo, then the banner --
     placed after .home-hero-grid's own (unconditional) definition above
     so this actually wins the cascade at this width. */
  .home-hero-grid {
    grid-template-areas: "welcome" "topbar" "banner";
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Stat cards (Copii activi, Videoclipuri analizate, etc.) go from a
     stacked icon-over-number-over-label layout to a single row -- there's
     plenty of horizontal room once the cards are full-width in the
     mobile single-column grid, so no need for the vertical stack. */
  .dash-summary-card { display: flex; align-items: center; gap: 14px; }
  .dash-summary-icon { margin-bottom: 0; flex-shrink: 0; }
  .dash-summary-label { margin-bottom: 0; }
}

/* ── Plan page (plan.html) ── */
.pp-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.pp-balance-label { color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.pp-diamond { font-size: 12px; }

.pp-manage-sub { margin: -12px 0 24px; }
.pp-manage-btn { width: auto; padding: 8px 18px; display: inline-block; }

.pp-billing-toggle { margin-bottom: 28px; }
.pp-save-pill { background: rgba(22, 163, 74, 0.15); color: var(--success); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px; margin-left: 2px; }

.pp-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 48px; }
@media (max-width: 900px) { .pp-plans { grid-template-columns: 1fr; } }

.pp-plan {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
}
.pp-pop {
  border: 2px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(160deg, #8b7cff, var(--accent)) border-box;
  box-shadow: 0 18px 40px rgba(var(--accent-rgb), 0.2);
}
@media (min-width: 901px) { .pp-pop { transform: translateY(-6px); } }

.pp-pop-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(120deg, #8b7cff, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.4);
  white-space: nowrap;
}

.pp-plan-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.pp-plan-audience { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.pp-plan-price { display: flex; align-items: baseline; gap: 6px; }
.pp-amount { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.pp-unit { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.pp-plan-annual-note { font-size: 11.5px; color: var(--success); font-weight: 600; margin: 2px 0 18px; min-height: 15px; }

.pp-plan-credits {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}
.pp-pop .pp-plan-credits { background: var(--accent-glow); border-color: rgba(var(--accent-rgb), 0.25); }

.pp-plan-features { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pp-plan-features li { position: relative; padding-left: 24px; font-size: 13px; color: var(--text); }
.pp-plan-features li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--success); font-weight: 700; }
.pp-plan-features li.muted { color: var(--text-dim); }
.pp-plan-features li.muted::before { content: "–"; color: var(--text-dim); }

.pp-plan-cta {
  display: block;
  width: 100%;
  text-align: center;
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  padding: 11px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.pp-plan-cta:hover:not(:disabled) { background: var(--border); transform: translateY(-1px); }
.pp-plan-cta:disabled { cursor: default; color: var(--text-dim); }
.pp-plan-cta-primary {
  background: linear-gradient(120deg, #8b7cff, var(--accent));
  color: #fff;
  border: none;
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.3);
}
.pp-plan-cta-primary:hover { background: linear-gradient(120deg, #8b7cff, var(--accent)); }

.pp-packs-card { margin-bottom: 24px; }
.pp-packs-sub { font-size: 12.5px; color: var(--text-muted); }
.pp-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .pp-packs { grid-template-columns: 1fr; } }

.pp-pack { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; }
.pp-pack-best { background: var(--accent-glow); border-color: rgba(var(--accent-rgb), 0.25); }
.pp-pack-credits { font-size: 14.5px; font-weight: 700; }
.pp-pack-best .pp-pack-credits { color: var(--accent); }
.pp-pack-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.pp-pack-price { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pp-pack-per { font-size: 11px; color: var(--text-dim); margin-bottom: 12px; }
.pp-pack .pp-plan-cta { width: auto; padding: 8px 18px; display: inline-block; }

.pp-note { display: flex; gap: 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.pp-note-icon { flex-shrink: 0; font-size: 16px; }
.pp-note-title { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.pp-note-body { font-size: 13px; color: var(--text-muted); line-height: 1.65; max-width: 640px; }
