/* ===================================================================
   LOGICIAX — habillage façon Discord, avec thèmes premium déblocables
   =================================================================== */

:root {
  --bg-app: #1e1f22;
  --bg-sidebar: #2b2d31;
  --bg-main: #313338;
  --bg-elevated: #383a40;
  --bg-floating: #111214;
  --ink: #f2f3f5;
  --muted: #949ba4;
  --muted-2: #b5bac1;
  --line: rgba(255, 255, 255, 0.06);
  --accent: #5b6eff;
  --accent-strong: #4453e0;
  --accent-grad-1: #7c5cff;
  --accent-grad-2: #22d3ee;
  --green: #23a55a;
  --red: #f23f43;
  --yellow: #f0b232;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: "Manrope", Inter, ui-sans-serif, sans-serif;
}

/* ----- Thème clair (bouton lune/soleil) ----- */
body.light-mode {
  --bg-app: #e3e5e8;
  --bg-sidebar: #f2f3f5;
  --bg-main: #ffffff;
  --bg-elevated: #f7f7f9;
  --bg-floating: #ffffff;
  --ink: #060607;
  --muted: #5c5e66;
  --muted-2: #4a4c52;
  --line: rgba(6, 6, 7, 0.08);
  --shadow: 0 14px 36px rgba(20, 24, 36, 0.1);
}

/* ----- Thèmes payants (Boutique → Stripe) ----- */
body[data-theme="aurora"] {
  --accent: #7c5cff;
  --accent-strong: #6342e0;
  --accent-grad-1: #7c5cff;
  --accent-grad-2: #22d3ee;
}
body[data-theme="aurora"]:not(.light-mode) {
  --bg-app: #15162a; --bg-sidebar: #1b1d36; --bg-main: #20223f; --bg-elevated: #292c4f;
}

body[data-theme="sakura"] {
  --accent: #ff5da2;
  --accent-strong: #e0428a;
  --accent-grad-1: #ff9ec4;
  --accent-grad-2: #ff5da2;
}
body[data-theme="sakura"]:not(.light-mode) {
  --bg-app: #1f1318; --bg-sidebar: #28191f; --bg-main: #2e2228; --bg-elevated: #382a31;
}

body[data-theme="gold"] {
  --accent: #caa45d;
  --accent-strong: #a9853f;
  --accent-grad-1: #f3d189;
  --accent-grad-2: #caa45d;
}
body[data-theme="gold"]:not(.light-mode) {
  --bg-app: #100f0c; --bg-sidebar: #161410; --bg-main: #1c1a14; --bg-elevated: #24211a;
  --ink: #f6efe0;
}

body[data-theme="synthwave"] {
  --accent: #ff2bd6;
  --accent-strong: #c91fb0;
  --accent-grad-1: #ff2bd6;
  --accent-grad-2: #22d3ee;
}
body[data-theme="synthwave"]:not(.light-mode) {
  --bg-app: #0f0a1c; --bg-sidebar: #150e26; --bg-main: #1a1330; --bg-elevated: #221940;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg-app);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  transition: background 0.25s ease, color 0.25s ease;
}

button, input, textarea, select { font: inherit; }
button {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
button:active { transform: scale(0.97); }
button:disabled { cursor: default; opacity: 0.55; transform: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
img, video { display: block; max-width: 100%; }
.sprite, .is-hidden { display: none !important; }

/* Les inputs file restent dans le flux (juste invisibles) plutôt que display:none,
   pour garantir que le déclenchement programmé (input.click()) ouvre bien le
   sélecteur de fichiers sur tous les navigateurs, y compris mobiles. */
.file-input-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* ===================== AUTH ===================== */

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--accent-grad-1) 35%, transparent), transparent 55%),
    radial-gradient(circle at 85% 90%, color-mix(in srgb, var(--accent-grad-2) 30%, transparent), transparent 55%),
    var(--bg-app);
}

.auth-card {
  width: min(980px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-main);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-pitch {
  padding: 48px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent-grad-1) 22%, var(--bg-main)), var(--bg-main) 60%);
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
  font-weight: 900;
  font-family: var(--font-display);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-grad-1) 50%, transparent);
}

.logo-mark.small { width: 28px; height: 28px; font-size: 0.86rem; border-radius: 8px; }

.auth-card h1 {
  margin: 18px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-card p { max-width: 480px; color: var(--muted-2); line-height: 1.6; margin: 0; }

.pitch-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.pitch-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}

.auth-box {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 42px 38px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--line);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  padding: 4px;
  gap: 4px;
}

.tab {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab:hover:not(.is-active) { color: var(--ink); background: var(--bg-elevated); }

.tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}

.social-grid { display: grid; gap: 8px; margin-top: 4px; }

.social-btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--ink);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.social-btn:hover { background: var(--bg-main); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.18); }
.social-btn:active { transform: translateY(0) scale(0.98); }

.social-icon {
  width: 18px; height: 18px;
  display: inline-grid; place-items: center;
  font-weight: 900; font-size: 0.85rem;
  border-radius: 4px;
}

.social-btn.google .social-icon { color: #fff; background: #ea4335; }

.divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 0.76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 6px 0 2px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-form { display: grid; gap: 10px; }

input, textarea, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: var(--ink);
  background: var(--bg-app);
  outline: 0;
}

textarea { min-height: 86px; padding: 13px 14px; resize: vertical; }

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.primary-btn, .outline-button, .ghost-btn, .success-btn, .danger-btn {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 800;
  padding: 0 18px;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
.primary-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 45%, transparent); }
.primary-btn:active { transform: translateY(0) scale(0.98); }

.outline-button { border: 1px solid var(--line); background: var(--bg-elevated); color: var(--ink); }
.outline-button:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.outline-button.on-dark { color: #fff; border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.06); }
.outline-button.on-dark:hover { border-color: #fff; background: rgba(255,255,255,0.14); color: #fff; }

.hint, .auth-message { min-height: 18px; margin: 0; color: var(--muted); font-size: 0.84rem; }
.auth-message { color: var(--red); font-weight: 700; }

/* ===================== APP SHELL ===================== */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 72px 240px minmax(0, 1fr) 280px;
  background: var(--bg-app);
}

/* ===================== SERVER RAIL (far left) ===================== */
.server-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  background: var(--bg-app);
  border-right: 1px solid var(--line);
  z-index: 10;
}

.server-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background: var(--bg-main);
  color: var(--ink);
  font-size: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 0;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.server-btn:hover {
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
}

.server-btn.is-active {
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
}

.server-btn::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: all 0.2s ease;
}

.server-btn:hover::before {
  opacity: 1;
  height: 20px;
  border-radius: 4px;
}

.server-btn.is-active::before {
  opacity: 1;
  height: 40px;
  border-radius: 4px;
}

.server-btn.logo-btn {
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
}

.server-separator {
  width: 32px;
  height: 2px;
  background: var(--line);
  margin: 4px 0;
  border-radius: 1px;
}

/* ===================== SIDEBAR (Channels / Nav) ===================== */
.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
}

.sidebar-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  margin-bottom: 8px;
}

.search-fake-btn {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg-app);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  transition: background 0.15s ease;
}

.search-fake-btn:hover { background: var(--bg-main); color: var(--ink); }

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===================== PULSE (TikTok-like) ===================== */
.pulse-view {
  display: flex; flex-direction: column; height: calc(100vh - 64px); padding: 0;
}
.pulse-hero {
  padding: 16px 24px; display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-main); border-bottom: 1px solid var(--line);
}
.pulse-scroll {
  flex: 1; overflow-y: auto; scroll-snap-type: y mandatory;
  display: flex; flex-direction: column;
  background: #000;
}
.pulse-slide {
  position: relative; width: 100%; height: 100%; min-height: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; justify-content: center; align-items: center;
}
.pulse-slide video {
  width: auto; max-width: 100%; height: 100%; max-height: 100%; object-fit: contain;
}
.pulse-caption {
  position: absolute; bottom: 20px; left: 20px; right: 80px;
  color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.pulse-actions {
  position: absolute; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.pulse-actions button {
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,0.15); color: #fff; backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.pulse-actions button:hover { background: rgba(255,255,255,0.25); transform: scale(1.05); }

/* ===================== ONBOARDING MODAL ===================== */
.onboarding-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
  display: grid; place-items: center;
}
.onboarding-card {
  width: 90%; max-width: 400px;
  background: var(--bg-main); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px; text-align: center; box-shadow: var(--shadow);
}
.onboarding-card h2 { margin-top: 0; font-family: var(--font-display); }
.onboarding-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.onboarding-options {
  display: flex; justify-content: center; gap: 16px; margin-bottom: 16px;
}
.avatar-option {
  width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 50%;
  overflow: hidden; cursor: pointer; transition: transform 0.2s;
}
.avatar-option img { width: 100%; height: 100%; object-fit: cover; }
.avatar-option:hover { transform: scale(1.05); border-color: var(--accent); }

.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--bg-elevated); }

.account-row {
  margin-top: auto;
  display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  border: 1px solid transparent;
  margin: 0 8px 8px;
}
.account-row:hover { border-color: var(--line); }

.account-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.account-text span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.86rem; font-weight: 700;
}
.account-text small { color: var(--muted); font-size: 0.72rem; }

.account-controls { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

.icon-toggle {
  border: 0; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--muted-2); background: transparent; font-size: 0.98rem;
}
.icon-toggle:hover { color: var(--ink); background: var(--bg-elevated); }
.icon-toggle.is-off { color: var(--red); }
.icon-toggle.is-off:hover { background: color-mix(in srgb, var(--red) 16%, transparent); }
.icon-toggle.logout:hover { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }

.search-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: center; }

.search-row input { min-height: 36px; background: var(--bg-app); border: 1px solid var(--line); padding: 0 10px; font-size: 0.85rem; }

.search-row button, .text-action {
  border: 0; border-radius: var(--radius-sm); background: var(--bg-elevated);
  font-weight: 800; color: var(--accent);
}

.search-row button:hover, .text-action:hover { background: var(--accent); color: #fff; }

.side-block { padding: 4px 6px; }

.side-block h2 {
  margin: 0 0 10px; color: var(--muted);
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
}

.text-action { margin-top: 10px; padding: 6px 0; background: transparent; }

.workspace { min-width: 0; border-right: 1px solid var(--line); background: var(--bg-main); }

.topbar {
  height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
  background: var(--bg-main);
}

.topbar h1 {
  margin: 0; text-align: center; font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 800;
}

.top-actions { display: flex; align-items: center; gap: 14px; }

.moon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; background: var(--bg-elevated); color: var(--yellow);
}
.moon-btn:hover { background: color-mix(in srgb, var(--yellow) 18%, var(--bg-elevated)); transform: rotate(-12deg); }

.view-pane { min-height: calc(100vh - 64px); padding: 26px 24px; }

.empty-line { margin: 18px 0; color: var(--muted); }

.contact-list { display: grid; gap: 14px; }

.contact-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px;
  align-items: center; max-width: 560px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-elevated); border: 1px solid var(--line);
}

.contact-card .avatar { width: 42px; height: 42px; }
.contact-card h3 { margin: 0; font-size: 0.95rem; }
.contact-card p { margin: 2px 0; color: var(--muted); font-size: 0.8rem; }

.message-layout {
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto;
  min-height: calc(100vh - 116px);
  gap: 14px;
}

.message-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.message-head h2 { font-family: var(--font-display); }

.message-thread {
  display: grid; align-content: end; gap: 10px;
  padding: 18px; border-radius: var(--radius);
  background: var(--bg-elevated); border: 1px solid var(--line);
  overflow-y: auto;
}

.bubble {
  width: fit-content; max-width: min(560px, 80%);
  padding: 10px 14px; border-radius: 14px;
  background: var(--bg-main); border: 1px solid var(--line);
}

.bubble.mine {
  justify-self: end; color: #fff; border: 0;
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
}

.composer-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; max-width: 760px; }

.small-btn {
  min-height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 12px; background: var(--bg-elevated); color: var(--ink); font-weight: 700;
}
.small-btn:hover { border-color: var(--accent); color: var(--accent); }

.primary-small {
  min-height: 38px; border: 0; border-radius: var(--radius-sm); padding: 0 16px;
  color: #fff; background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2)); font-weight: 800;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
.primary-small:hover { filter: brightness(1.08); transform: translateY(-1px); }

.call-log {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.call-log-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px;
  align-items: center; min-height: 56px; padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated); border: 1px solid var(--line);
}

.section-title { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.3rem; }

/* ----- Appels : bannière entrante + superposition d'appel en cours ----- */

.incoming-call {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 16px;
  background: var(--bg-floating); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-width: min(360px, calc(100vw - 32px));
  animation: incoming-pulse 1.6s ease-in-out infinite;
}

@keyframes incoming-pulse {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  50% { box-shadow: var(--shadow), 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); }
}

.incoming-call .avatar { width: 44px; height: 44px; }

.incoming-call-text { flex: 1; min-width: 0; display: flex; flex-direction: column; color: #fff; }
.incoming-call-text strong { font-size: 0.94rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incoming-call-text span { color: var(--muted); font-size: 0.8rem; }

.incoming-call-actions { display: flex; gap: 8px; }

.incoming-call-actions .round-action { width: 42px; height: 42px; font-size: 1rem; }
.incoming-call-actions .accept { background: var(--green); }
.incoming-call-actions .decline { background: var(--red); }

.call-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: #000;
}

.call-overlay #remoteVideo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #07080c;
}

.call-overlay #localVideo {
  position: absolute; right: 18px; top: 18px; width: 140px; height: 190px;
  border-radius: 14px; object-fit: cover; background: #111;
  border: 2px solid rgba(255, 255, 255, 0.2); box-shadow: var(--shadow);
}

.call-avatar-view { display: none; place-items: center; }

.call-overlay.audio-only #remoteVideo,
.call-overlay.audio-only #localVideo { display: none; }

.call-overlay.audio-only .call-avatar-view { display: grid; }
.call-overlay.audio-only .call-avatar-view .avatar {
  width: 128px; height: 128px;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 25%, transparent);
}

.call-info {
  position: absolute; left: 50%; top: 28px; transform: translateX(-50%);
  text-align: center; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; gap: 4px;
}

.call-info strong { font-family: var(--font-display); font-size: 1.2rem; }
.call-info span { color: rgba(255,255,255,0.75); font-size: 0.86rem; }

.call-controls {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 16px;
}

.call-controls .round-action { width: 56px; height: 56px; font-size: 1.3rem; background: rgba(255,255,255,0.14); }
.call-controls .round-action.is-off { background: rgba(255, 90, 90, 0.35); }
.call-controls .hangup { background: var(--red); }


/* ----- Pulse ----- */

.pulse-view {
  margin: -26px -24px;
  min-height: calc(100vh - 64px);
  color: #fff;
  background: #07080c;
}

.pulse-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.pulse-hero h2 { font-family: var(--font-display); }
.pulse-hero p { margin: 6px 0 0; color: rgba(255,255,255,0.65); }

.pulse-scroll { height: calc(100vh - 172px); overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; }
.pulse-scroll::-webkit-scrollbar { display: none; }

.pulse-slide {
  position: relative; height: calc(100vh - 172px); scroll-snap-align: start;
  display: grid; place-items: center; background: #000; overflow: hidden;
}

.pulse-slide video { width: 100%; height: 100%; object-fit: cover; }

.pulse-slide .pulse-caption {
  position: absolute; left: 18px; right: 90px; bottom: 22px; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.pulse-actions { position: absolute; right: 14px; bottom: 30px; display: grid; gap: 12px; }

.round-action {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px); font-size: 0.78rem; font-weight: 700;
}
.round-action:hover { background: rgba(255,255,255,0.22); transform: translateY(-1px); }
.round-action:active { transform: translateY(0) scale(0.94); }

.pulse-empty { display: grid; place-items: center; height: calc(100vh - 172px); color: rgba(255,255,255,0.6); text-align: center; gap: 10px; }

/* ----- Boutique de thèmes ----- */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  max-width: 980px;
}

.theme-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.theme-card .theme-swatch { height: 92px; }

.theme-card .theme-body { padding: 14px; display: grid; gap: 8px; }
.theme-card h3 { margin: 0; font-family: var(--font-display); font-size: 1rem; }
.theme-card .theme-price { color: var(--muted); font-size: 0.84rem; font-weight: 700; }

.theme-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.theme-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.18); }

.theme-card button {
  min-height: 40px; border: 0; border-radius: var(--radius-sm);
  font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
}
.theme-card button:not([disabled]):hover { filter: brightness(1.1); }

.theme-card button[disabled] {
  background: var(--bg-main); color: var(--muted); cursor: default;
}

.theme-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

.mini-theme-badge {
  display: inline-block; padding: 8px 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
  color: #fff; font-weight: 800; font-size: 0.82rem;
}

/* ----- Profil / Admin ----- */

.profile-panel { min-width: 0; padding: 30px 18px; background: var(--bg-sidebar); display: flex; flex-direction: column; gap: 18px; }

.profile-card { display: grid; justify-items: center; gap: 10px; text-align: center; }
.profile-card .avatar { width: 96px; height: 96px; }
.profile-card h2 { margin: 0; font-family: var(--font-display); }

.profile-field { width: 100%; display: grid; gap: 8px; margin-top: 22px; text-align: left; }
.profile-field label { color: var(--accent); font-size: 0.74rem; text-transform: uppercase; font-weight: 800; }

.admin-grid { display: grid; gap: 10px; max-width: 980px; }

.admin-row {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px;
  align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px;
  background: var(--bg-elevated);
}

.admin-row.is-banned { opacity: 0.55; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.success-btn { color: #fff; background: var(--green); }
.success-btn:hover:not([disabled]) { filter: brightness(1.1); transform: translateY(-1px); }
.danger-btn { color: #fff; background: var(--red); }
.danger-btn:hover:not([disabled]) { filter: brightness(1.1); transform: translateY(-1px); }

/* ----- Posts ----- */

.post-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--bg-elevated); }

.post-card img, .post-card video { border-radius: var(--radius-sm); margin: 10px 0; max-height: 420px; width: 100%; object-fit: cover; }

.post-card .post-actions { display: flex; gap: 16px; margin-top: 8px; }
.post-card .post-actions button { border: 0; background: transparent; font-weight: 700; color: var(--muted); }

/* ----- Toast ----- */

.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 20;
  min-width: min(380px, calc(100vw - 32px)); min-height: 44px;
  display: grid; place-items: center; padding: 0 18px;
  border-radius: var(--radius-sm); color: #fff;
  background: var(--bg-floating);
  border: 1px solid var(--line);
  opacity: 0; transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none; font-weight: 700;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ===================== RESPONSIVE ===================== */

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .profile-panel { display: none; }
}

@media (max-width: 760px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-pitch { padding: 32px 26px 14px; }
  .auth-box { padding: 26px; border-left: 0; border-top: 1px solid var(--line); }

  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 30;
    width: min(290px, 82vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: translateX(0); }

  .topbar { grid-template-columns: auto 1fr; height: auto; min-height: 64px; padding: 10px 14px; }
  .top-actions { grid-column: 1 / -1; justify-content: flex-end; }

  .view-pane { padding: 18px 14px; }
  .admin-row, .composer-line { grid-template-columns: 1fr; }
}
