/* Inter (variable 100–900), self-hosted — SIL Open Font License, see /fonts/OFL.txt.
   Latin covers French (accents, œ, €); latin-ext only downloads if a page needs it. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ─────────────────────────────────────────────────────────
   MonClip — design system
   Glassmorphism gris/noir (Apple), rigueur structurelle (Linear/Raycast)
   ───────────────────────────────────────────────────────── */

:root {
  --bg: #030303;
  --bg-raised: #0a0a0a;
  --text: #ffffff;
  --muted: #9a9a9a;
  --muted-2: #5f5f5f;
  --border: rgba(255, 255, 255, 0.10);
  --border-hover: rgba(255, 255, 255, 0.18);
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-bg-strong: rgba(255, 255, 255, 0.07);
  /* Monochrome: the accent is pure white, set apart from body text by glow */
  --accent: #ffffff;
  --accent-glow: rgba(255,255,255, 0.18);
  --danger: #ff6b6b;
  --danger-glow: rgba(255, 107, 107, 0.2);
  --success: #6fe3a1;
  --warning: #ffc86b;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}

/* Ambient background glow — subtle, no visible color gradient on content */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(700px 500px at 15% -10%, rgba(255,255,255, 0.035), transparent 60%),
    radial-gradient(600px 500px at 100% 20%, rgba(255, 255, 255, 0.035), transparent 55%);
  pointer-events: none;
}

.mono { font-family: var(--font-mono); }

a { color: inherit; }

::selection { background: var(--accent-glow); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); background-clip: padding-box; }

/* ─── Glass surfaces ─── */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.glass-interactive:hover {
  border-color: var(--border-hover);
  background: var(--glass-bg-strong);
  box-shadow: 0 0 0 1px var(--border-hover), 0 12px 32px -12px var(--accent-glow);
}
.glass-strong {
  background: rgba(15, 15, 15, 0.7);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

/* ─── Buttons (liquid glass) ─── */
.btn {
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  border-radius: 999px;
  padding: 12px 22px;
  min-height: 44px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), filter 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease), opacity 0.15s var(--ease);
  white-space: nowrap;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.35) 50%, transparent 65%);
  transform: translateX(-130%);
  transition: transform 0.55s var(--ease);
  pointer-events: none;
}
.btn:hover::after, .btn:active::after { transform: translateX(130%); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn:disabled::after { display: none; }

.btn-solid {
  background: linear-gradient(180deg, #ffffff 0%, #e4e4e4 55%, #c9c9c9 100%);
  color: #0a0a0a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -1px 0 rgba(0,0,0,0.12), 0 6px 18px -8px rgba(255,255,255,0.35);
}
.btn-solid:hover { filter: brightness(1.06); }

.btn-ghost {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-ghost:hover { border-color: var(--border-hover); background: var(--glass-bg-strong); }

.btn-danger {
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.14); border-color: rgba(255, 107, 107, 0.5); }

.btn-sm { padding: 8px 14px; font-size: 12px; min-height: 36px; }
.btn-block { width: 100%; }

/* ─── Inputs ─── */
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  font-family: var(--font-ui);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  min-height: 44px;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: rgba(255,255,255,0.06); }
input::placeholder { color: var(--muted-2); }

/* Input with a leading icon: <label class="field"><svg/><input/></label> */
.field { position: relative; display: flex; align-items: center; }
.field > svg {
  position: absolute; left: 14px; width: 16px; height: 16px;
  color: var(--muted-2); pointer-events: none; transition: color 0.15s var(--ease);
}
.field > input { width: 100%; padding-left: 40px; border-radius: 12px; }
.field:focus-within > svg { color: var(--accent); }

/* ─── Text tokens ─── */
.text-muted { color: var(--muted); }
.section-title {
  font-size: 14px; font-weight: 600; letter-spacing: -0.1px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.section-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.section-title .count {
  background: var(--glass-bg-strong); color: var(--muted);
  font-size: 10px; font-family: var(--font-mono);
  padding: 1px 7px; border-radius: 20px;
}

/* ─── Badges / status dots ─── */
.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot.live { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot.off { background: var(--danger); }
.dot.idle { background: var(--muted-2); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted); padding: 5px 11px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--glass-bg);
}

.tag {
  font-size: 10px; padding: 4px 9px; border-radius: 20px;
  font-weight: 600; letter-spacing: 0.2px; text-transform: lowercase;
  background: rgba(255,255,255,0.06); color: var(--muted);
  border: 1px solid var(--border);
}
.tag.funny { color: #ffc86b; border-color: rgba(255,200,107,0.25); }
.tag.hype { color: #6fe3a1; border-color: rgba(111,227,161,0.25); }
.tag.awkward { color: #d9a9ff; border-color: rgba(217,169,255,0.25); }
.tag.win { color: #ffffff; border-color: rgba(255,255,255,0.25); }
.tag.loss { color: #ff8f8f; border-color: rgba(255,143,143,0.25); }
.tag.rage { color: #ff6b6b; border-color: rgba(255,107,107,0.3); }
.tag.shock { color: #ffab7f; border-color: rgba(255,171,127,0.25); }
.tag.clutch { color: #6fe3a1; border-color: rgba(111,227,161,0.25); }
.tag.wholesome { color: #7fd8e8; border-color: rgba(127,216,232,0.25); }
.tag.drama { color: #e79cf0; border-color: rgba(231,156,240,0.25); }
.tag.sad { color: #9fb3d9; border-color: rgba(159,179,217,0.25); }
.tag.neutral { color: var(--muted); }
.tag.error { color: var(--danger); border-color: rgba(255,107,107,0.3); }

/* ─── Empty / loading states ─── */
.empty { color: var(--muted-2); font-size: 13px; padding: 40px 0; text-align: center; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }
/* Skeleton placeholder — shaped like the content it stands in for, with a
   soft shimmer, so a panel looks "arriving" instead of empty. */
.skel {
  display: inline-block; vertical-align: middle; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite;
}
.skel-text { height: 0.85em; border-radius: 6px; }
.skel-block { display: block; }
@keyframes skel { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* ─── Layout helpers ─── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ─── Focus visibility (a11y, keeps things clean otherwise) ─── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────
   Shared navigation — sticky glass topbar + mobile bottom tab bar
   ───────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  /* Nav sits right after the logo, so its position depends only on the
     logo — identical on every page, whatever the right side holds (plan
     pill, username, status…). A centred nav drifted from page to page. */
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; column-gap: 28px;
  padding: 12px 32px;
  background: rgba(5, 5, 5, 0.7);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.2px;
  text-decoration: none; color: var(--text);
}
.brand img { width: 26px; height: 26px; }
.topbar > .brand { grid-column: 1; justify-self: start; }
.topbar-nav { display: flex; align-items: center; gap: 4px; grid-column: 2; }
.topbar-nav a {
  font-size: 13px; font-weight: 500; color: var(--muted);
  text-decoration: none; padding: 8px 14px; border-radius: 20px;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.topbar-nav a:hover { color: var(--text); background: var(--glass-bg); }
.topbar-nav a.active { color: var(--text); background: var(--glass-bg-strong); }
.topbar-right { display: flex; align-items: center; gap: 10px; grid-column: 3; justify-self: end; }
.topbar-right .user-name { font-size: 12px; color: var(--muted); }
.topbar-right .avatar { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); }

.bottom-tabbar {
  display: none;
}

@media (max-width: 720px) {
  .topbar { padding: 10px 14px; grid-template-columns: auto 1fr; }
  .topbar-right { grid-column: 2; }
  .topbar-nav { display: none; }
  .brand span.brand-text { display: none; }

  .bottom-tabbar {
    display: flex; justify-content: space-around; align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(5, 5, 5, 0.75);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
  }
  .bottom-tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    text-decoration: none; color: var(--muted-2);
    font-size: 10px; font-weight: 600;
    padding: 6px 14px; min-width: 56px; min-height: 44px;
    border-radius: 12px; transition: color 0.15s var(--ease);
  }
  .bottom-tabbar a svg { width: 20px; height: 20px; }
  .bottom-tabbar a.active { color: var(--text); }
  .bottom-tabbar a:active { background: var(--glass-bg); }

  body.has-tabbar { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
}

/* ─────────────────────────────────────────────────────────
   Feed — moments on a vertical rail, grouped by day
   <div class="feed"><div class="feed-day">Aujourd'hui</div><div class="feed-item">…</div></div>
   ───────────────────────────────────────────────────────── */
.panel { background: var(--glass-bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }

.feed { position: relative; padding: 6px 8px 10px; }
.feed-day {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 500; color: var(--muted);
  padding: 14px 10px 8px;
}
.feed-day::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.feed-item { position: relative; padding-left: 38px; border-radius: 12px; }
/* rail segment: runs through the node column, stops at group edges */
.feed-item::before {
  content: ''; position: absolute; left: 22px; top: 0; bottom: 0; width: 1px; background: var(--border);
}
.feed-day + .feed-item::before { top: 22px; }
.feed-item:last-child::before, .feed-item:has(+ .feed-day)::before { bottom: calc(100% - 22px); }
.feed-day + .feed-item:last-child::before, .feed-day + .feed-item:has(+ .feed-day)::before { display: none; }

.feed-node {
  position: absolute; left: 12px; top: 12px; width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; z-index: 1;
  background: #0d0d0d; border: 1px solid var(--border-hover); color: var(--muted);
}
.feed-node svg { width: 11px; height: 11px; }
.feed-item.has-clip .feed-node { color: var(--accent); border-color: rgba(255,255,255,0.45); box-shadow: 0 0 10px var(--accent-glow); }

.feed-row {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 12px;
  padding: 11px 12px 11px 4px; cursor: pointer; border-radius: 12px;
  transition: background 0.15s var(--ease);
}
.feed-item:hover .feed-row, .feed-item.open .feed-row { background: rgba(255,255,255,0.03); }
.feed-line { font-size: 14px; color: var(--muted); min-width: 0; }
.feed-line b { color: var(--text); font-weight: 600; }
.feed-jump { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin: 0 2px; }
.feed-jump.high { color: var(--accent); }
.feed-jump.mega { color: var(--warning); }
.feed-time { font-size: 12px; color: var(--muted-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed-desc { grid-column: 1 / -1; font-size: 13px; color: var(--muted); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item.open .feed-desc { white-space: normal; }
.feed-item .tag { vertical-align: 1px; margin-left: 4px; }

/* ─── Shared header controls ─── */
.discord-link span { display: inline; }
.icon-btn { width: 40px; min-height: 40px; padding: 0; }
.icon-btn svg { width: 16px; height: 16px; }
.logout-label { display: none; }
@media (min-width: 721px) {
  .icon-btn { width: auto; padding: 0 16px; }
  .icon-btn svg { display: none; }
  .logout-label { display: inline; }
}
@media (max-width: 720px) {
  .topbar-right .user-name, .topbar-right .discord-link { display: none; }
}
.discord-link {
  font-size: 13px; color: var(--muted); text-decoration: none; padding: 0 14px; min-height: 40px;
  border: 1px solid var(--border); border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px; background: var(--glass-bg);
  transition: border-color 0.15s, color 0.15s;
}
.discord-link:hover { border-color: var(--border-hover); color: var(--text); }

/* ─────────────────────────────────────────────────────────
   Plan — header status pill + Free/Pro offer cards
   (header on every page, /tarifs.html, home pricing section)
   ───────────────────────────────────────────────────────── */
.plan-pill {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.1px; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  color: var(--muted); background: var(--glass-bg); border: 1px solid var(--border);
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.plan-pill[hidden] { display: none; }
.plan-pill:hover { color: var(--text); border-color: var(--border-hover); }
.plan-pill.pro {
  color: var(--accent); background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.4);
  box-shadow: 0 0 14px -4px var(--accent-glow);
}
.plan-pill.pro:hover { border-color: rgba(255,255,255,0.7); box-shadow: 0 0 18px -2px var(--accent-glow); }
.plan-pill.warn { color: var(--warning); background: rgba(255,200,107,0.08); border-color: rgba(255,200,107,0.35); }

.offers { display: grid; gap: 16px; }
@media (min-width: 760px) { .offers { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.offer { position: relative; padding: 24px 22px; border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 18px; }
.offer.featured {
  /* Monochrome: Pro is lit, not tinted */
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 40px rgba(255,255,255,0.08);
}
.offer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.offer-name { font-size: 15px; font-weight: 650; display: inline-flex; align-items: center; gap: 8px; }
/* Gold vector mark on the Pro card. drop-shadow follows the logo's shape
   (a box-shadow would draw a square halo around the image box). */
.offer-logo { width: 26px; height: 26px; flex-shrink: 0; filter: drop-shadow(0 0 5px rgba(244,212,136,0.45)) drop-shadow(0 0 1px rgba(244,212,136,0.6)); }
.offer-ribbon {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  color: #0a0a0a; background: linear-gradient(180deg, #ffffff 0%, #e4e4e4 55%, #c9c9c9 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -1px 0 rgba(0,0,0,0.12);
}
.offer-price { display: flex; align-items: baseline; gap: 6px; }
.offer-price .amount { font-size: 46px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.offer-price .per { font-size: 14px; color: var(--muted); }
.offer-sub { font-size: 13px; color: var(--muted); margin-top: -10px; }
.offer-list { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.45; }
.offer-list li { display: flex; gap: 10px; align-items: flex-start; }
.offer-list li svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.offer.featured .offer-list li svg { color: var(--text); }
.offer-list li b { font-weight: 600; }
.offer-cta { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.offer-cta .btn { width: 100%; min-height: 48px; font-size: 14px; }
.offer-cta .hint { font-size: 12px; color: var(--muted-2); text-align: center; }
.offer-current {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px;
  border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--muted); border: 1px dashed var(--border-hover);
}
.offer.featured .offer-current { color: var(--text); border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ─────────────────────────────────────────────────────────
   Header state before /auth/me answers — set on <html> by plan.js from the
   last known session, so the header paints right the first time
   ───────────────────────────────────────────────────────── */
html:not([data-admin="1"]) .admin-only { display: none !important; }
html[data-auth="in"] #loginBtn { display: none; }
html[data-auth="in"] .user-link { display: flex; }
/* Live-status pill: text goes "connexion…" → "En direct" / "Hors ligne";
   a fixed width keeps its neighbours from shifting when it changes */
.topbar-right > .pill { min-width: 104px; justify-content: flex-start; }

/* ─────────────────────────────────────────────────────────
   Smooth page changes (cross-document View Transitions). Header and tab
   bar are named so they stay put while the page content crossfades.
   Browsers without support ignore all of this.
   ───────────────────────────────────────────────────────── */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.bottom-tabbar { view-transition-name: tabbar; }
::view-transition-group(topbar), ::view-transition-group(tabbar) { animation: none; }
::view-transition-old(topbar), ::view-transition-old(tabbar) { display: none; }
::view-transition-new(topbar), ::view-transition-new(tabbar) { animation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ─── Compact header between phone and wide desktop ───
   Logo + nav + right cluster don't fit on one line below ~1100px once
   logged in: icons instead of labels, then drop the least useful bits. */
@media (min-width: 721px) and (max-width: 1100px) {
  .discord-link { padding: 0 12px; }
  .discord-link span { display: none; }
  .topbar-right .user-name, .user-link span { display: none; }
  .icon-btn { width: 40px; padding: 0; }
  .icon-btn svg { display: inline; }
  .logout-label { display: none; }
}
@media (min-width: 721px) and (max-width: 960px) {
  .brand span.brand-text { display: none; }
  .topbar-right > .pill { display: none; }
}

/* ─────────────────────────────────────────────────────────
   Site footer — injected server-side at <!-- SITE_FOOTER -->
   ───────────────────────────────────────────────────────── */
.site-footer {
  max-width: 980px; margin: 48px auto 0; padding: 20px 16px 28px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; }
.site-footer nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  font-size: 13px; color: var(--muted); text-decoration: none;
  transition: color 0.15s var(--ease);
}
.site-footer nav a:hover { color: var(--text); }
.site-footer p { font-size: 12px; color: var(--muted-2); }
@media (min-width: 900px) { .site-footer { padding: 24px 32px 32px; } }

/* ─────────────────────────────────────────────────────────
   Legal pages (CGU, confidentialité, mentions légales)
   ───────────────────────────────────────────────────────── */
.legal { max-width: 760px; margin: 0 auto; padding: 32px 16px 0; }
@media (min-width: 900px) { .legal { padding: 64px 32px 0; } }
.legal h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.legal .updated { font-size: 13px; color: var(--muted-2); margin-top: 10px; }
.legal .toc { margin-top: 24px; padding: 16px 18px; border-radius: var(--radius-lg); }
.legal .toc ol { list-style: none; display: grid; gap: 2px; counter-reset: toc; }
.legal .toc a { display: block; padding: 6px 0; font-size: 14px; color: var(--muted); text-decoration: none; }
.legal .toc a:hover { color: var(--text); }
.legal section { padding-top: 32px; scroll-margin-top: 72px; }
.legal h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; }
.legal h3 { font-size: 15px; font-weight: 600; margin-top: 18px; }
.legal p, .legal li { font-size: 15px; color: var(--muted); line-height: 1.7; }
.legal p { margin-top: 10px; }
.legal ul { margin-top: 10px; padding-left: 20px; display: grid; gap: 6px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--text); text-underline-offset: 3px; }
.legal .table-wrap { margin-top: 14px; overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.legal table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13.5px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--border); line-height: 1.55; }
.legal th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,0.02); }
.legal td { color: var(--muted); }
.legal td:first-child { color: var(--text); font-weight: 500; }
.legal tr:last-child td { border-bottom: none; }
.legal dl { margin-top: 12px; display: grid; gap: 10px; }
.legal dt { font-size: 13px; color: var(--muted-2); }
.legal dd { font-size: 15px; color: var(--text); line-height: 1.6; }

/* ─── Blocking CGU acceptance screen (plan.js) ─── */
html.cgu-locked, html.cgu-locked body { overflow: hidden; }
.cgu-gate {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 16px;
  background: rgba(3, 3, 3, 0.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cgu-gate-card { width: 100%; max-width: 440px; padding: 24px; border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 14px; }
.cgu-gate-card h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.cgu-gate-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.cgu-gate-check {
  display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start;
  padding: 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: rgba(255,255,255,0.02);
  font-size: 13.5px; color: var(--muted); line-height: 1.55;
}
.cgu-gate-check:has(input:checked) { border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.06); }
.cgu-gate-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.cgu-gate-check a { color: var(--text); text-underline-offset: 3px; }
.cgu-gate-card .btn { min-height: 48px; }
.cgu-gate-error { font-size: 13px; color: var(--danger); }
.cgu-gate-logout {
  background: none; border: none; font: inherit; font-size: 13px; color: var(--muted);
  min-height: 44px; cursor: pointer;
}
.cgu-gate-logout:hover { color: var(--text); }
