/* =====================================================
   XFITPAL — Design System v2
   Single source of truth. No duplicate rules.
   ===================================================== */

/* ── 1. Tokens ─────────────────────────────────────── */
:root {
  --bg:      #f3f6fb;
  --panel:   #ffffff;
  --panel2:  #eef2f8;
  --text:    #0b1220;
  --muted:   #55657a;
  --line:    #dbe4f0;
  --brand:   #ff5a1f;
  --brand2:  #ff8a3d;
  --accent:  #2563eb;
  --good:    #16a34a;
  --warn:    #f59e0b;
  --danger:  #dc2626;
  --shadow:  0 4px 20px rgba(15,23,42,.09);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.13);
  --radius:  16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

[data-theme="dark"] {
  --bg:     #0d1117;
  --panel:  #141c2a;
  --panel2: #101826;
  --text:   #f0f6ff;
  --muted:  #a6b3c7;
  --line:   #2a3b55;
  --shadow: 0 4px 20px rgba(0,0,0,.32);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.45);
}

/* ── 2. Reset & Base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box }
html, body { height: 100%; margin: 0; overflow-x: hidden }

body {
  background:
    radial-gradient(1100px 560px at 12% -10%, color-mix(in oklab, var(--brand) 15%, transparent), transparent 60%),
    radial-gradient(900px 520px at 92% 10%,  color-mix(in oklab, var(--accent) 12%, transparent), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a { color: inherit }
img, svg, video { max-width: 100%; height: auto; display: block }
h1,h2,h3,h4 { margin: 0 }
p { margin: 0 }

/* ── 3. Layout ─────────────────────────────────────── */
.wrap        { max-width: 1120px; margin: 0 auto; padding: 0 18px }
.page        { padding: 24px 0 48px }
.page-narrow { max-width: 720px; margin: 0 auto }

/* grids */
.grid-2  { display: grid; grid-template-columns: 1fr 1fr;     gap: 14px }
.grid-3  { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px }
.grid-4  { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px }
.grid-aside { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; align-items: start }

@media (max-width: 980px) { .grid-aside  { grid-template-columns: 1fr } }
@media (max-width: 860px) { .grid-3      { grid-template-columns: 1fr 1fr } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr } }

/* flex helpers */
.row         { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.col         { display: flex; flex-direction: column; gap: 10px }
.stack       { display: flex; flex-direction: column; gap: 14px }

/* spacing */
.gap-4  { gap: 4px }
.gap-6  { gap: 6px }
.gap-8  { gap: 8px }
.gap-12 { gap: 12px }
.gap-16 { gap: 16px }
.gap-20 { gap: 20px }
.mt-4   { margin-top: 4px }
.mt-8   { margin-top: 8px }
.mt-12  { margin-top: 12px }
.mt-16  { margin-top: 16px }
.mt-24  { margin-top: 24px }
.mb-8   { margin-bottom: 8px }
.mb-12  { margin-bottom: 12px }
.mb-16  { margin-bottom: 16px }

/* ── 4. Typography ─────────────────────────────────── */
.text-xs   { font-size: 11px }
.text-sm   { font-size: 13px }
.text-base { font-size: 15px }
.text-lg   { font-size: 18px }
.text-xl   { font-size: 22px }
.text-2xl  { font-size: 28px }
.text-3xl  { font-size: 36px }
.font-bold { font-weight: 700 }
.font-black { font-weight: 900 }
.muted     { color: var(--muted) }
.brand     { color: var(--brand) }
.small     { font-size: 12px; color: var(--muted) }
.label     { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted) }
.truncate  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }

/* ── 5. Cards & Panels ─────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad   { padding: 18px }
.card-tight { padding: 12px }

/* Legacy alias */
.cardPad { padding: 18px }

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-title { font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--text) }
.panel-sub   { font-size: 12px; color: var(--muted); margin-top: 2px }

/* appPanel alias */
.appPanel { padding: 14px; border-radius: var(--radius) }
.appPanel .panelHd  { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px }
.appPanel .panelTitle { font-size: 13px; font-weight: 800; letter-spacing: .02em; margin: 0 }
.appPanel .panelSub { font-size: 12px; color: var(--muted); margin-top: 2px }

/* ── 6. Nav / Topbar ───────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: saturate(120%) blur(12px);
  -webkit-backdrop-filter: saturate(120%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.logo img { width: 20px; height: 20px; object-fit: contain }
.brand strong { font-size: 15px; letter-spacing: .2px }
.brand .small { margin-top: 1px; font-size: 11px }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* ── 7. Nav Dropdowns ──────────────────────────────── */
.navDrop { position: relative; display: inline-flex; align-items: center }

.navDropMenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 50;
}
.navDrop.open .navDropMenu { display: block }

@media (min-width: 761px) {
  .navDrop:hover .navDropMenu,
  .navDrop:focus-within .navDropMenu { display: block }
}

.navDropMenu .dropItem {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.navDropMenu .dropItem:hover {
  background: var(--panel2);
  border-color: color-mix(in oklab, var(--brand) 30%, var(--line));
}
.dropIcon       { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0 }
.navDropSmall   { font-size: 11px; color: var(--muted); margin-top: 1px }

.navPillActive  { border-color: var(--brand) !important; color: var(--brand) !important; font-weight: 600 }
.navDropActive > .navDropBtn { border-color: var(--brand) !important; color: var(--brand) !important; font-weight: 600 }
.navThemeBtn    { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; font-size: 15px; border-radius: var(--radius-pill) }
.navDropBtn     { user-select: none }

/* Mobile nav */
.menuBtn {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  font-size: 20px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .menuBtn { display: inline-flex }
  .topbar .wrap { position: relative }
  .nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0; right: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    margin: 0 12px;
  }
  .nav.open { display: flex }
  .nav .pill, .nav .btn, .nav button { width: 100%; justify-content: center }
  .navDrop { flex-direction: column; align-items: stretch }
  .navDropMenu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 8px;
    min-width: unset;
  }
  .navDrop.open .navDropMenu { display: block }
}

/* ── 8. Buttons & Pills ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color .12s, background .12s;
  white-space: nowrap;
}
.btn:hover  { border-color: color-mix(in oklab, var(--brand) 50%, var(--line)) }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  box-shadow: 0 4px 16px color-mix(in oklab, var(--brand) 35%, transparent);
}
.btn.primary:hover { filter: brightness(1.06) }
.btn.ghost  { background: transparent; box-shadow: none }
.btn.danger { border-color: var(--danger); color: var(--danger) }
.btn.sm     { padding: 6px 12px; font-size: 13px; border-radius: 10px }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--panel) 80%, transparent);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .12s;
}
.pill:hover { border-color: color-mix(in oklab, var(--brand) 50%, var(--line)) }

/* Mini pill */
.appMiniPill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .12s;
}
.appMiniPill:hover { border-color: color-mix(in oklab, var(--brand) 40%, var(--line)) }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid color-mix(in oklab, var(--brand) 28%, var(--line));
  background: color-mix(in oklab, var(--brand) 9%, var(--panel));
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-size: 12px;
}

/* ── 9. Form Inputs ────────────────────────────────── */
.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: border-color .12s, outline .12s;
}
.input:focus {
  outline: 2px solid color-mix(in oklab, var(--brand) 35%, transparent);
  border-color: color-mix(in oklab, var(--brand) 60%, var(--line));
}
textarea.input { resize: vertical; min-height: 80px }
select.input   { appearance: none; cursor: pointer }

.field { display: flex; flex-direction: column; gap: 6px }
.field > label { font-size: 13px; font-weight: 600; color: var(--text) }

/* ── 10. Page Sections ─────────────────────────────── */
/* Hero (landing) */
.hero      { padding: 32px 0 20px }
.heroGrid  { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; align-items: center }
.hTitle    { font-size: 44px; line-height: 1.05; letter-spacing: -.8px; margin-bottom: 12px }
.hSub      { color: var(--muted); max-width: 52ch; margin-bottom: 20px }
@media (max-width: 980px) { .heroGrid { grid-template-columns: 1fr } }
@media (max-width: 520px) { .hTitle  { font-size: 34px } }

/* Feature grid */
.featureGrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px }
@media (max-width: 900px) { .featureGrid { grid-template-columns: repeat(2,1fr) } }
@media (max-width: 560px) { .featureGrid { grid-template-columns: 1fr } }
.feature    { display: flex; gap: 12px; align-items: flex-start }
.icon       { width: 38px; height: 38px; flex-shrink: 0; border-radius: 13px;
              background: color-mix(in oklab, var(--brand) 11%, var(--panel2));
              border: 1px solid color-mix(in oklab, var(--brand) 20%, var(--line));
              display: grid; place-items: center }
.icon svg   { width: 18px; height: 18px }
.feature h3 { font-size: 15px; margin-bottom: 3px }
.feature p  { color: var(--muted); font-size: 13px }

/* Why grid */
.whyGrid  { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 12px }
.whyItem  { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: color-mix(in oklab, var(--panel) 90%, transparent) }
@media (max-width: 860px) { .whyGrid { grid-template-columns: 1fr } }

/* ── 11. Dashboard ─────────────────────────────────── */
.dashGrid   { display: grid; grid-template-columns: 1fr .88fr; gap: 14px; align-items: start }
.dashQuad   { display: grid; grid-template-columns: 1fr 1fr;   gap: 14px; align-items: start }
.statGrid   { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px }
@media (max-width: 980px) { .dashGrid, .dashQuad { grid-template-columns: 1fr } }
@media (max-width: 520px) { .statGrid { grid-template-columns: 1fr } }

.statCard  { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 14px }
.statLabel { font-size: 12px; color: var(--muted) }
.statValue { font-size: 24px; font-weight: 900; letter-spacing: -.5px; margin-top: 4px }
.statRow .statCard:nth-child(1) .statValue { color: #1aa7ff }
.statRow .statCard:nth-child(2) .statValue { color: #22c55e }
.statRow .statCard:nth-child(3) .statValue { color: #f59e0b }
.statRow .statCard:nth-child(4) .statValue { color: #a855f7 }

.statNum        { font-weight: 800 }
.statNum.green  { color: #22c55e }
.statNum.blue   { color: #1aa7ff }
.statNum.gold   { color: #f59e0b }
.statNum.purple { color: #a855f7 }

/* List rows */
.listRows { display: flex; flex-direction: column; gap: 8px }
.rowItem  {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: border-color .12s;
}
.rowItem:hover    { border-color: color-mix(in oklab, var(--brand) 35%, var(--line)) }
.rowItem .left    { display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.rowItem .right   { display: flex; gap: 8px; align-items: center; flex-shrink: 0 }
.rowTitle         { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch }
@media (max-width: 520px) { .rowTitle { max-width: 28ch } }

/* ── 12. Calendar ──────────────────────────────────── */
.calLayout { display: grid; grid-template-columns: 1fr .42fr; gap: 14px; align-items: start }
@media (max-width: 980px) { .calLayout { grid-template-columns: 1fr } }

.calGrid  { display: grid; grid-template-columns: repeat(7,1fr); gap: 8px }
.calHead  { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0 }
.calCell  {
  min-height: 84px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow);
  appearance: none;
  -webkit-appearance: none;
  -webkit-text-fill-color: var(--text);
  transition: border-color .12s;
}
.calCell:hover     { border-color: color-mix(in oklab, var(--brand) 45%, var(--line)) }
.calCell .dayNum   { font-weight: 800; color: var(--text) !important }
.calCell .wodName  { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.3; max-height: 2.6em; overflow: hidden }
.calCell.selected  { outline: 2px solid color-mix(in oklab, var(--brand) 55%, transparent); border-color: color-mix(in oklab, var(--brand) 55%, var(--line)) }
.calCell.filled    { background: color-mix(in oklab, var(--brand) 8%, var(--panel)); border-color: color-mix(in oklab, var(--brand) 22%, var(--line)) }
.calCell.filled::after {
  content: "";
  position: absolute;
  right: 8px; bottom: 8px;
  width: 7px; height: 7px;
  border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--brand) 65%, var(--panel));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--panel) 70%, transparent);
}
@media (max-width: 760px) { .calCell { min-height: 68px; padding: 8px; border-radius: 12px } }

/* ── 13. Modals ────────────────────────────────────── */
.modalBackdrop {
  position: fixed; inset: 0;
  display: none;
  align-items: flex-end; justify-content: center;
  padding: 12px;
  background: rgba(0,0,0,.55);
  z-index: 9999;
}
.modalBackdrop.show { display: flex }
.modalCard {
  width: min(900px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}
.modalTop {
  position: sticky; top: 0;
  background: color-mix(in oklab, var(--panel) 92%, var(--panel2));
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border-radius: 20px 20px 0 0;
}
.modalBody { padding: 16px }
@media (min-width: 760px) { .modalBackdrop { align-items: center } }

/* ── 14. Tables ────────────────────────────────────── */
.table { border-collapse: separate; border-spacing: 0; width: 100% }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top }
.table thead th { position: sticky; top: 0; background: var(--panel); font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-transform: uppercase }
.table tbody tr:hover { background: color-mix(in oklab, var(--panel2) 55%, transparent) }

/* ── 15. Profile ───────────────────────────────────── */
.profileHero    { overflow: hidden; position: relative }
.profile-banner { width: 100%; height: 180px; background-size: cover; background-position: center; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0 }
.profileTop     { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-top: -46px; position: relative; padding: 0 18px 0 }
.profileMeta    { min-width: 0; flex: 1; padding-bottom: 4px }
.profileNameRow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
@media (max-width: 760px) { .profileTop { margin-top: -36px } }

.avatarWrap     { width: 86px; height: 86px; border-radius: var(--radius-pill); flex-shrink: 0; position: relative }
.avatarImg      { width: 100%; height: 100%; border-radius: var(--radius-pill); object-fit: cover; display: block; background: var(--panel2) }
.avatarFallback { width: 100%; height: 100%; border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 28px; background: color-mix(in oklab, var(--brand) 13%, var(--panel2)); border: 1px solid var(--line) }
.avatar-frame   { position: absolute; top: -3px; left: -3px; width: calc(100% + 6px); height: calc(100% + 6px); pointer-events: none; border-radius: var(--radius-pill); object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0,0,0,.15)) }

.profileStats   { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 14px }
@media (max-width: 760px) { .profileStats { grid-template-columns: repeat(2,1fr) } }
.miniStat       { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 12px }
.miniStatVal    { font-size: 22px; font-weight: 900; letter-spacing: -.3px; margin-top: 4px }

.profileActions  { display: flex; gap: 10px; flex-wrap: wrap }
.profileLinkCard { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 12px; color: inherit; text-decoration: none; transition: border-color .12s }
.profileLinkCard:hover { border-color: color-mix(in oklab, var(--brand) 40%, var(--line)) }
.publicBanner    { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: var(--radius); background: color-mix(in oklab, var(--panel) 70%, transparent) }

/* ── 16. Achievements & PRs ────────────────────────── */
.achGrid  { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px }
@media (max-width: 820px) { .achGrid { grid-template-columns: 1fr } }
.achCard  { display: flex; gap: 12px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 14px }
.achCard.locked { opacity: .55; filter: saturate(.5) }
.achIcon  { width: 42px; height: 42px; flex-shrink: 0; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: color-mix(in oklab, var(--brand) 10%, var(--panel2)); border: 1px solid var(--line); font-size: 20px }
.achTitle { font-weight: 800 }
.achProgressRow { display: flex; gap: 10px; align-items: center; margin-top: 10px }
.achBar   { flex: 1; height: 8px; border-radius: var(--radius-pill); background: var(--panel2); overflow: hidden }
.achFill  { height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--brand), var(--brand2)) }

.prGrid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px }
@media (max-width: 520px) { .prGrid { grid-template-columns: 1fr } }
.prCard { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 14px }
.prLift { font-weight: 800; text-transform: lowercase; font-size: 13px; color: var(--muted) }
.prVal  { font-size: 22px; font-weight: 900; letter-spacing: -.3px; margin-top: 4px }

/* ── 17. Forum ─────────────────────────────────────── */
.postGrid { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: start }
@media (max-width: 760px) { .postGrid { grid-template-columns: 1fr } }
.postMeta { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel) }
.postMeta .metaName   { font-weight: 800 }
.postMeta .metaHandle { opacity: .7; font-size: 13px }
.postMeta .metaLink   { margin-top: 8px; display: inline-block; font-size: 13px }

.userChip  { display: inline-flex; gap: 6px; align-items: center; padding: 4px 9px; border-radius: var(--radius-pill); text-decoration: none; color: inherit; background: color-mix(in oklab, var(--panel2) 80%, transparent); border: 1px solid var(--line) }
.uAvatar   { width: 20px; height: 20px; border-radius: var(--radius-pill); overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--panel2); flex-shrink: 0 }
.uAvatar img { width: 100%; height: 100%; object-fit: cover }
.uInit     { font-size: 10px; font-weight: 800 }

/* ── 18. Cosmetics / Themes ────────────────────────── */
.theme-carbon  { --brand: #ff5a1f }
.theme-classic { --brand: #22c55e }
.theme-ice     { --brand: #1AA7FF }
.theme-inferno { --brand: #ff2d55 }
.theme-neon    { --brand: #00e6ff }
.theme-ocean   { --brand: #0ea5e9 }
.theme-forest  { --brand: #16a34a }
.theme-sunset  { --brand: #f97316 }

.frame-none   { background: color-mix(in oklab, var(--panel2) 80%, var(--panel)) }
.frame-bronze { background: linear-gradient(135deg, #b46a2a, #f1c27d) }
.frame-silver { background: linear-gradient(135deg, #9ca3af, #e5e7eb) }
.frame-gold   { background: linear-gradient(135deg, #f59e0b, #fde68a) }
.frame-neon   { background: linear-gradient(135deg, #00e6ff, #a78bfa) }
.frame-glow-blue   { background: linear-gradient(135deg, #1aa7ff, #60d0ff) }
.frame-glow-green  { background: linear-gradient(135deg, #22c55e, #86efac) }
.frame-glow-purple { background: linear-gradient(135deg, #a855f7, #d8b4fe) }
.frame-ice    { background: linear-gradient(135deg, #bae6fd, #e0f2fe) }
.frame-fire   { background: linear-gradient(135deg, #ef4444, #f97316) }
.frame-aura-gold { background: linear-gradient(135deg, #d97706, #fde68a, #d97706) }

/* ── 19. Toasts ────────────────────────────────────── */
.toastWrap { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; max-width: min(360px, calc(100vw - 32px)) }
.toast     { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: 14px; transform: translateY(8px); opacity: 0; transition: transform .2s ease, opacity .2s ease }
.toast.show { transform: translateY(0); opacity: 1 }
.toastTitle { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted) }
.toastBody  { font-size: 14px; font-weight: 800; margin-top: 4px }

/* ── 20. Mock / Landing Demo ───────────────────────── */
.mock    { aspect-ratio: 16/10; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in oklab, var(--brand) 12%, var(--panel)), color-mix(in oklab, var(--accent) 10%, var(--panel))); position: relative; overflow: hidden }
.mockUi  { position: absolute; inset: 12px; border-radius: 12px; background: color-mix(in oklab, var(--panel) 80%, transparent); border: 1px solid color-mix(in oklab, var(--line) 70%, transparent); backdrop-filter: blur(8px) }
.demoMock         { display: flex; flex-direction: column; gap: 10px; padding: 12px }
.demoTop          { display: flex; align-items: center; gap: 10px }
.demoAvatar       { width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand2)); flex-shrink: 0 }
.demoMeta         { flex: 1; min-width: 0 }
.demoNameLine     { height: 9px; width: 100px; border-radius: var(--radius-pill); background: color-mix(in oklab, var(--text) 12%, transparent) }
.demoSubLine      { margin-top: 5px; height: 7px; width: 140px; border-radius: var(--radius-pill); background: color-mix(in oklab, var(--text) 8%, transparent) }
.demoBadges       { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end }
.demoBadge        { font-size: 11px; border-radius: var(--radius-pill); padding: 5px 8px; border: 1px solid color-mix(in oklab, var(--line) 70%, transparent); background: color-mix(in oklab, var(--panel) 88%, transparent); color: var(--muted) }
.demoGrid         { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.demoPanel        { border: 1px solid color-mix(in oklab, var(--line) 75%, transparent); border-radius: 12px; padding: 10px; background: color-mix(in oklab, var(--panel) 88%, transparent) }
.demoPanelHd      { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px }
.demoPanelTitle   { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--muted); text-transform: uppercase }
.demoPill         { font-size: 10px; border-radius: var(--radius-pill); padding: 4px 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted) }
.demoPill.good    { border-color: color-mix(in oklab, var(--good) 30%, var(--line)); color: var(--good) }
.demoLine         { height: 7px; border-radius: var(--radius-pill); background: color-mix(in oklab, var(--text) 10%, transparent); margin-top: 6px }
.demoLine.w40{width:40%}.demoLine.w50{width:50%}.demoLine.w55{width:55%}.demoLine.w58{width:58%}.demoLine.w60{width:60%}
.demoLine.w62{width:62%}.demoLine.w65{width:65%}.demoLine.w70{width:70%}.demoLine.w72{width:72%}.demoLine.w75{width:75%}
.demoLine.w78{width:78%}.demoLine.w80{width:80%}.demoLine.w85{width:85%}
.demoRow          { display: flex; align-items: center; gap: 8px; margin-top: 7px }
.demoRow .dot     { width: 7px; height: 7px; border-radius: var(--radius-pill); background: color-mix(in oklab, var(--brand) 55%, var(--accent)) }
.demoCal          { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; margin-top: 6px }
.demoCal span     { height: 10px; border-radius: 4px; background: color-mix(in oklab, var(--text) 8%, transparent); border: 1px solid color-mix(in oklab, var(--line) 60%, transparent) }
.demoCal span.on  { background: color-mix(in oklab, var(--brand) 24%, transparent); border-color: color-mix(in oklab, var(--brand) 35%, var(--line)) }
.demoSpark        { height: 28px; border-radius: 10px; margin-top: 10px; border: 1px solid color-mix(in oklab, var(--line) 60%, transparent); background: linear-gradient(90deg, color-mix(in oklab, var(--brand) 26%, transparent), color-mix(in oklab, var(--accent) 20%, transparent)) }
.demoSplit        { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start }
.demoBig          { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in oklab, var(--brand) 11%, var(--panel2)), color-mix(in oklab, var(--accent) 9%, var(--panel2))); overflow: hidden }
.demoBigInner     { padding: 14px }
.demoGridBig      { grid-template-columns: 1.15fr .85fr }
.demoCalBig span  { height: 12px }
@media (max-width: 860px) { .demoGridBig { grid-template-columns: 1fr } }

/* ── 21. Ad slots ──────────────────────────────────── */
.adSlotWrap  { max-width: 1120px; margin: 0 auto; padding: 8px 18px 24px }
.adSlot      { border: 1px dashed var(--line); border-radius: var(--radius); min-height: 88px; display: grid; place-items: center }
.adSlotInner { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted) }

/* ── 22. Footer ────────────────────────────────────── */
.footer, .site-footer {
  padding: 20px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.site-footer a { color: inherit; opacity: .8; text-decoration: none }
.site-footer a:hover { opacity: 1; text-decoration: underline }

/* ── 23. Embed mode ────────────────────────────────── */
body.embed { overflow-x: hidden; background: transparent; margin: 0 }
body.embed .wrap { max-width: 100%; padding: 0 }
body.embed .heroGrid, body.embed .dashGrid { grid-template-columns: 1fr !important }

/* ── 24. Mobile safety ─────────────────────────────── */
@media (max-width: 520px) {
  .wrap { padding-left: 12px; padding-right: 12px }
  .field3 { min-width: 100% !important }
}
.field3 { flex: 1; min-width: 160px }

/* ── 25. WOD/tab specific ──────────────────────────── */
#wodTabs { max-width: 100%; overflow: hidden }
#wodTabs .pill { max-width: 100% }
.embedWell { border-radius: var(--radius); overflow: hidden; border: 1px solid color-mix(in oklab, var(--line) 70%, transparent); background: color-mix(in oklab, var(--panel2) 70%, transparent) }
