@font-face {
  font-family: "Inter";
  src:
    local("Inter Bold"),
    local("Inter-Bold"),
    url("/static/font/inter/Inter-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #060912;
  --panel: rgba(18, 23, 39, 0.88);
  --panel-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f6f7fb;
  --muted: #a4adbd;
  --accent: #7c5cff;
  --accent-2: #1fb6ff;
  --ok: #18c37e;
  --warn: #ffb547;
  --danger: #ff6f7d;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at top, #172033 0%, #0a1020 30%, var(--bg) 70%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
h4 { display: flex; justify-content: center; align-items: center; text-align: center; text-wrap: balance; line-height: 1.4; margin: 4px 0 12px; }
.page-shell { max-width: 1400px; margin: 0 auto; padding: 18px; }
.shell-session .page-shell, .shell-xpra-stub .page-shell { max-width: none; padding: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border); background: rgba(4, 6, 12, 0.82);
}
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.brand-wordmark {
  display: block;
  width: auto;
  height: 28px;
  max-width: 128px;
}
.topbar-side { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.server-status-wrap { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); font-size: 0.78rem; }
.server-status-wrap.ok .server-status-dot { background: var(--ok); }
.server-status-wrap.error .server-status-dot { background: var(--danger); }
.server-status-wrap.unknown .server-status-dot { background: var(--muted); }
.server-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.server-status-label { color: var(--muted); }
.server-status-detail { color: var(--muted); font-size: 0.74rem; }
.profile-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2);
}
.profile-copy { display: grid; gap: 2px; }
.profile-name { font-size: 0.9rem; font-weight: 700; }
.profile-role { font-size: 0.74rem; color: var(--muted); }
.avatar {
  width: 34px; height: 34px; border-radius: 999px; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; font-weight: 800; box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.avatar-lg { width: 40px; height: 40px; }
.avatar-soft { background: rgba(124, 92, 255, 0.16); color: #dcd3ff; }
.shell-launcher .topbar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  left: auto;
  width: auto;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
}
.shell-launcher .brand { display: inline-flex; }
.shell-launcher .brand-wordmark { height: 22px; max-width: 100px; }
.shell-launcher .page-shell { padding-top: 96px; }
.topnav { display: flex; align-items: center; gap: 10px; }
.icon-link {
  min-width: 42px; min-height: 42px; display: inline-grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
}
.flash-stack { display: grid; gap: 12px; margin-bottom: 16px; }
.alert { padding: 12px 14px; border-radius: 18px; border: 1px solid transparent; }
.alert.ok { background: rgba(24, 195, 126, 0.12); border-color: rgba(24, 195, 126, 0.3); }
.alert.error { background: rgba(255, 111, 125, 0.12); border-color: rgba(255, 111, 125, 0.3); }
.eyebrow { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.hint { font-size: 0.82rem; color: var(--muted); line-height: 1.55; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); }
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth-card, .panel, .empty-card, .xpra-stub-card, .manage-card, .contrib-card, .member-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--shadow);
}
.auth-card, .panel, .xpra-stub-card { padding: 22px; }
.auth-card { width: min(100%, 420px); }
.auth-brand { margin-bottom: 8px; line-height: 0; display: flex; justify-content: center; align-items: center; flex-direction: row-reverse; gap: 10px; }
.auth-wordmark { display: block; width: auto; max-height: 60px; max-width: 160px; }
.auth-brand img:first-child { max-height: 44px; }
.stack-form { display: grid; gap: 12px; }
.simple-form label { display: grid; gap: 6px; }
.simple-form label > span { font-size: 0.84rem; color: var(--muted); }
input, select {
  width: 100%; border-radius: 16px; padding: 14px 16px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--text);
}
select option { background: var(--bg); color: var(--text); }
.primary-btn, .ghost-btn, .button-link {
  min-height: 46px; border-radius: 16px; border: 1px solid var(--border); padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.primary-btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: white; }
.ghost-btn, .button-link { background: rgba(255,255,255,0.04); color: var(--text); }
.ghost-btn.danger { color: #ffd6da; }
.manage-shell, .launcher-shell { display: grid; gap: 18px; }
.manage-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.compact-header { align-items: center; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.manage-header h1, .auth-card h1 { margin: 6px 0 0; font-size: clamp(1.6rem, 4vw, 2.6rem); }
.badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); font-size: 0.82rem;
}
.launcher-shell { min-height: calc(100dvh - 110px); align-content: start; }
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 128px));
  gap: 20px 16px;
  justify-content: center;
  align-items: start;
  align-content: start;
}
.launcher-tile-form { margin: 0; justify-self: center; width: 100%; max-width: 128px; }
.launcher-tile {
  position: relative; width: 100%; min-height: 178px; padding: 12px 8px 12px;
  border-radius: 28px; border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  display: grid; align-content: start; justify-items: center; gap: 8px;
  color: var(--text); box-shadow: var(--shadow);
}
.launcher-tile.state-libre { border-color: rgba(24, 195, 126, 0.35); }
.launcher-tile.state-libre-force { border-color: rgba(255, 181, 71, 0.42); }
.launcher-tile.state-encours { border-color: rgba(124, 92, 255, 0.42); }
.launcher-tile.state-salon { border-color: rgba(124, 92, 255, 0.42); }
.launcher-tile.state-indisponible { border-color: rgba(255, 181, 71, 0.32); opacity: 0.72; }
.launcher-tile.state-quota-ko { border-color: rgba(255, 181, 71, 0.42); }
.tile-media-wrap { display: grid; justify-items: center; width: 100%; }
.tile-media {
  width: 68px; height: 68px; border-radius: 22px; overflow: hidden; position: relative;
  background: var(--bg); display: grid; place-items: center;
}
.favicon { width: 100%; height: 100%; object-fit: contain; background: transparent; }
.tile-label { font-size: 0.98rem; font-weight: 700; text-align: center; line-height: 1.15; max-width: 100%; text-wrap: balance; }
.tile-owner, .tile-meta { font-size: 0.72rem; color: var(--muted); text-align: center; line-height: 1.15; }
.tile-state-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 0.72rem; border: 1px solid var(--border); background: rgba(255,255,255,0.06); }
.tile-state-pill.state-libre { color: #d8ffef; border-color: rgba(24, 195, 126, 0.45); }
.tile-state-pill.state-libre-force { color: #ffe9c5; border-color: rgba(255, 181, 71, 0.45); }
.tile-state-pill.state-encours { color: #e5dcff; border-color: rgba(124, 92, 255, 0.45); }
.tile-state-pill.state-salon { color: #e5dcff; border-color: rgba(124, 92, 255, 0.45); }
.tile-state-pill.state-indisponible { color: #ffe9c5; border-color: rgba(255, 181, 71, 0.45); }
.tile-state-pill.state-quota-ko { color: #ffe9c5; border-color: rgba(255, 181, 71, 0.45); }
.launcher-empty { max-width: 420px; }
.table-wrap, .list-wrap { overflow: auto; max-height: min(70dvh, 720px); border-radius: 18px; border: 1px solid rgba(255,255,255,0.04); }
.list-wrap { padding: 8px; display: grid; gap: 10px; }
.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; }
.empty-card { padding: 26px; }
.manage-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.manage-cards-simple { max-width: 920px; }
.manage-card { padding: 20px; display: grid; gap: 8px; }
.manage-layout { display: grid; gap: 18px; grid-template-columns: minmax(280px, 360px) 1fr; }
.users-layout { grid-template-columns: minmax(280px, 360px) 1fr; }
.panel.wide { overflow: auto; }
.narrow { max-width: 520px; }
.manage-contrib-list { display: grid; gap: 14px; }
.contrib-card, .member-card { padding: 16px; display: grid; gap: 12px; }
.member-card { border-radius: 22px; }
.contrib-actions-row, .member-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.contrib-head, .member-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.member-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.compact-form { display: flex; gap: 8px; align-items: center; max-width: 220px; }
.compact-form input { min-width: 78px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge.ok { background: rgba(24,195,126,0.12); border-color: rgba(24,195,126,0.4); }
.badge.warn { background: rgba(255,181,71,0.12); border-color: rgba(255,181,71,0.4); }
.inline-form { display: flex; gap: 8px; align-items: center; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.session-shell { display: grid; gap: 0; min-height: 100dvh; background: black; }
.session-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: rgba(8, 10, 16, 0.78); border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(14px); transition: transform 180ms ease, opacity 180ms ease;
}
.session-banner.hidden { transform: translateY(-100%); opacity: 0; }
#banner-hotspot { position: fixed; top: 0; left: 0; right: 0; height: 16px; z-index: 39; cursor: none; }
.session-title-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; overflow: hidden; }
.session-note.hidden { display: none; }
.session-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.session-stage { width: 100vw; height: 100dvh; background: #000; }
.session-stage iframe { width: 100%; height: 100%; border: none; display: block; background: #000; }
.session-note {
  position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  padding: 10px 14px; border-radius: 999px; background: rgba(8,10,16,0.78); border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(14px); color: var(--muted); max-width: min(92vw, 420px);
}
.xpra-stub-body { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: #02050a; }
.xpra-stub-card { max-width: 520px; text-align: center; }
.xpra-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(2, 4, 10, 0.88); backdrop-filter: blur(18px);
}
.xpra-overlay.hidden { display: none; }
.xpra-overlay-content {
  display: grid; place-items: center; gap: 20px;
  text-align: center; padding: 32px; max-width: min(90vw, 460px);
}
.xpra-overlay-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2rem;
}
.xpra-overlay.loading .xpra-overlay-icon {
  border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--accent);
  animation: xpra-spin 0.9s linear infinite;
}
.xpra-overlay.disconnected .xpra-overlay-icon {
  background: rgba(255,111,125,0.12); border: 1px solid rgba(255,111,125,0.35); color: var(--danger);
}
.xpra-overlay-msg { font-size: clamp(1.1rem, 3vw, 1.4rem); color: var(--text); margin: 0; line-height: 1.4; }
.xpra-overlay-diag { font-size: 0.82rem; color: var(--muted); margin: 0; opacity: 0.75; max-width: 360px; line-height: 1.5; }
.xpra-overlay-diag.hidden { display: none; }
.xpra-overlay-btn { min-width: 180px; font-size: 1.05rem; min-height: 52px; }
.xpra-overlay-btn.hidden { display: none; }
.tile-cause { font-size: 0.68rem; color: var(--muted); text-align: center; line-height: 1.3; padding: 0 4px; }
.launcher-tile-wrap { position: relative; }
.launcher-tile-observe-form { position: absolute; top: 8px; right: 8px; z-index: 2; }
.observe-btn { background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.18); color: var(--text); border-radius: 6px; padding: 4px 8px; font-size: 1rem; cursor: pointer; line-height: 1; }
.observe-btn:hover { background: rgba(255,255,255,0.12); }
@keyframes xpra-spin { to { transform: rotate(360deg); } }
code { white-space: pre-wrap; word-break: break-word; }
@media (max-width: 900px) {
  .manage-layout, .users-layout, .simple-manage-layout { grid-template-columns: 1fr; }
}
@media (min-width: 1600px) {
  .launcher-grid { grid-template-columns: repeat(auto-fit, minmax(124px, 144px)); gap: 22px 20px; }
  .launcher-tile-form { max-width: 144px; }
  .launcher-tile { min-height: 196px; }
  .tile-media { width: 74px; height: 74px; }
}
@media (min-width: 1920px) {
  .page-shell { max-width: 1760px; padding: 28px; }
  .topbar { padding: 18px 28px; }
  .brand-wordmark { height: 32px; max-width: 148px; }
  .launcher-grid { grid-template-columns: repeat(auto-fit, minmax(144px, 168px)); gap: 28px 24px; }
  .launcher-tile-form { max-width: 168px; }
  .launcher-tile { min-height: 228px; padding: 16px 10px; border-radius: 32px; }
  .tile-media { width: 88px; height: 88px; border-radius: 26px; }
  .tile-label { font-size: 1.05rem; }
  .tile-owner, .tile-meta { font-size: 0.76rem; }
  .tile-state-pill { font-size: 0.76rem; min-height: 26px; }
  .manage-layout, .users-layout { grid-template-columns: minmax(300px, 400px) 1fr; }
  .avatar { width: 38px; height: 38px; }
  .avatar-lg { width: 46px; height: 46px; }
  .icon-link { min-width: 48px; min-height: 48px; }
  .auth-card { width: min(100%, 480px); }
}
@media (max-width: 540px) {
  .server-status-detail { display: none; }
  .server-status-label { display: none; }
  .server-status-wrap { padding: 4px 6px; }
  .header-actions { width: 100%; }
  h4 { font-size: clamp(0.78rem, 3.5vw, 0.92rem); }
}
@media (max-width: 720px) {
  .page-shell { padding: 14px; }
  .profile-copy { display: none; }
  .launcher-grid { grid-template-columns: repeat(auto-fit, minmax(90px, 100px)); gap: 14px 12px; }
  .launcher-tile-form { max-width: 100px; }
  .launcher-tile { min-height: 148px; padding: 12px 8px; border-radius: 24px; }
  .tile-media { width: 56px; height: 56px; border-radius: 18px; }
  .tile-owner, .tile-meta { font-size: 0.66rem; }
  .tile-state-pill { min-height: 22px; font-size: 0.64rem; padding: 0 8px; }
  .topbar { padding: 12px 14px; }
  .brand-wordmark { height: 26px; max-width: 118px; }
  .shell-launcher .brand-wordmark { height: 20px; max-width: 90px; }
  .compact-form { max-width: none; width: 100%; }
  .member-main { flex-direction: column; }
}
@media (max-width: 480px) {
  .shell-launcher .topbar { top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); padding: 6px 8px; }
  .brand-wordmark { height: 24px; max-width: 108px; }
  .shell-launcher .brand-wordmark { height: 18px; max-width: 82px; }
  .shell-launcher .page-shell { padding-top: 74px; }
  .profile-chip { padding: 6px 8px; }
  .avatar-lg { width: 34px; height: 34px; }
  .icon-link { min-width: 38px; min-height: 38px; }
  .launcher-grid { grid-template-columns: repeat(3, minmax(82px, 92px)); gap: 12px 10px; }
  .launcher-tile-form { max-width: 92px; }
  .launcher-tile { min-height: 138px; }
  .session-banner { padding: 10px 12px; }
  .session-note { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
}
@media (max-width: 420px) {
  .server-status-wrap { display: none; }
  .icon-link { min-width: 34px; min-height: 34px; }
  .topbar { gap: 6px; padding: 8px 10px; }
  .brand-wordmark { max-width: 100px; }
  .stack-form .primary-btn { width: 100%; }
}

.simple-manage-layout { grid-template-columns: minmax(260px, 340px) 1fr; }
.simple-panel { padding: 18px; }
.compact-stack { gap: 10px; }
.compact-card { gap: 10px; border-radius: 20px; }
.compact-badges { gap: 6px; }
.compact-alert { margin-top: 12px; }

/* ── Sessions actives dans la gestion des contributions ── */
.session-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.session-chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); }
.session-chip--rw { border-color: rgba(124, 92, 255, 0.35); }
.session-chip-av { width: 26px; height: 26px; font-size: 0.75rem; flex-shrink: 0; }
.session-chip-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.session-chip-mode { font-size: 0.7rem; font-weight: 700; color: var(--muted); letter-spacing: 0.05em; }
.session-chip--rw .session-chip-mode { color: #c4b2ff; }
.session-kick { width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(255, 111, 125, 0.15); color: var(--danger); font-size: 0.75rem; display: grid; place-items: center; padding: 0; transition: background 0.15s; }
.session-kick:hover { background: rgba(255, 111, 125, 0.35); }

/* ── Remember me ── */
.remember-label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); cursor: pointer; user-select: none; }
.remember-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent, #7c5cff); flex-shrink: 0; cursor: pointer; }
