/* Rask Hub — inspiré des interfaces iOS / macOS */

:root {
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --side: rgba(255, 255, 255, 0.72);
  --bar: rgba(249, 249, 249, 0.82);
  --text: #1D1D1F;
  --muted: #6E6E73;
  --line: rgba(0, 0, 0, 0.08);
  --fill: rgba(118, 118, 128, 0.12);
  --seg: #FFFFFF;
  --field: #FFFFFF;
  --link: #0066CC;
  --accent: #0071E3;
  --danger: #D70015;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --overlay: rgba(0, 0, 0, 0.32);
  --edge: 0 0 0 0 transparent;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --card: #1C1C1E;
    --side: rgba(28, 28, 30, 0.78);
    --bar: rgba(22, 22, 24, 0.82);
    --text: #F5F5F7;
    --muted: #A1A1A6;
    --line: rgba(255, 255, 255, 0.10);
    --fill: rgba(118, 118, 128, 0.24);
    --seg: #636366;
    --field: #2C2C2E;
    --link: #409CFF;
    --danger: #FF6961;
    --shadow: none;
    --overlay: rgba(0, 0, 0, 0.6);
    --edge: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --card: #1C1C1E;
  --side: rgba(28, 28, 30, 0.78);
  --bar: rgba(22, 22, 24, 0.82);
  --text: #F5F5F7;
  --muted: #A1A1A6;
  --line: rgba(255, 255, 255, 0.10);
  --fill: rgba(118, 118, 128, 0.24);
  --seg: #636366;
  --field: #2C2C2E;
  --link: #409CFF;
  --danger: #FF6961;
  --shadow: none;
  --overlay: rgba(0, 0, 0, 0.6);
  --edge: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--link); text-decoration: none; }
a:hover { opacity: 0.8; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; flex-shrink: 0; }
[hidden] { display: none !important; }

.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;
}

:focus-visible { outline: 3px solid rgba(0, 113, 227, 0.5); outline-offset: 2px; }

/* ── Boutons et champs ───────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border: 0; border-radius: 18px;
  background: var(--fill); color: var(--link);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-danger { background: transparent; color: var(--danger); }
.btn-small { height: 30px; padding: 0 14px; border-radius: 15px; }
.btn-large { height: 48px; border-radius: 12px; font-size: 16px; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }

.icon-btn {
  width: 36px; height: 36px; border: 0; border-radius: 18px;
  background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--fill); }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; width: 260px; max-width: 100%;
  border-radius: 10px; background: var(--fill); color: var(--muted);
}
.search input { border: 0; outline: 0; background: transparent; color: var(--text); width: 100%; font-size: 14px; }
.search input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--field); color: var(--text); font-size: 16px;
}
.field textarea { height: auto; min-height: 80px; padding: 10px 14px; resize: vertical; }

/* ── Segmented control ───────────────────────── */

.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px;
  border-radius: 10px; background: var(--fill); max-width: 100%;
}
.seg button {
  height: 30px; padding: 0 14px; border: 0; border-radius: 8px;
  background: transparent; font-size: 13px; font-weight: 500;
}
.seg button[aria-pressed="true"] { background: var(--seg); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* ── Connexion ───────────────────────────────── */

.login {
  min-height: 100vh; min-height: 100dvh; padding: 48px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px;
}
.login-card {
  width: 100%; max-width: 400px; padding: 40px 32px 32px; border-radius: 24px;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.login-head { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.login-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.login-head p { margin: 0; color: var(--muted); }
.login form { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.stack-fields { display: flex; flex-direction: column; border-radius: 12px; border: 1px solid var(--line); background: var(--field); overflow: hidden; }
.stack-fields input { height: 48px; padding: 0 16px; border: 0; outline: 0; background: transparent; font-size: 16px; }
.stack-fields input + input, .stack-fields label + input { border-top: 1px solid var(--line); }
.stack-fields input:focus-visible { outline: none; background: var(--fill); }
.login-foot { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.form-error { margin: 0; font-size: 14px; color: var(--danger); text-align: center; }
.link-btn { border: 0; background: transparent; color: var(--link); font-size: 14px; align-self: center; padding: 6px; }

.logo {
  width: 32px; height: 32px; border-radius: 8px; background: #1D1D1F;
  display: flex; align-items: center; justify-content: center; color: #FFFFFF;
  box-shadow: var(--edge);
}
.logo-lg { width: 72px; height: 72px; border-radius: 17px; box-shadow: var(--edge), 0 6px 16px rgba(0, 0, 0, 0.18); }

/* ── Structure ───────────────────────────────── */

.shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: 248px; flex-shrink: 0; padding: 24px 16px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  background: var(--side);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.2px; color: var(--text); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title { padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px;
  border-radius: 8px; color: var(--text); font-size: 14px;
}
.nav a:hover { background: var(--fill); opacity: 1; }
.nav a[aria-current="page"] { background: var(--fill); font-weight: 600; }
.nav .count { margin-left: auto; font-size: 13px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }

.me {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 12px; background: var(--fill); color: var(--text);
}
.me:hover { opacity: 1; }
.avatar {
  width: 32px; height: 32px; border-radius: 16px; background: var(--accent); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text span { font-size: 12px; color: var(--muted); }

.main { flex: 1; min-width: 0; padding: 40px 48px 64px; }
.page { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.6px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.sub { font-size: 15px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; }
.cols > :first-child { flex: 2 1 420px; min-width: 0; }
.cols > :last-child { flex: 1 1 280px; min-width: 0; }

.card { border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.pad { padding: 20px; }

/* ── Tableau de bord ─────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stat span { font-size: 13px; color: var(--muted); }
.stat strong { font-size: 34px; font-weight: 700; letter-spacing: -0.8px; line-height: 1.1; }

.springboard {
  padding: 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 24px 12px;
}
.spring-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 0; background: transparent; padding: 0; color: var(--text); font-size: 12px; text-align: center; line-height: 1.3;
}
.spring-item:hover .app-icon { transform: scale(1.04); }

.app-icon {
  width: 64px; height: 64px; border-radius: 15px; color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--edge), 0 2px 6px rgba(0, 0, 0, 0.12); transition: transform 0.15s ease;
}
.app-icon.md { width: 52px; height: 52px; border-radius: 12px; }
.app-icon.sm { width: 36px; height: 36px; border-radius: 9px; box-shadow: var(--edge); }

.list { overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 0 16px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--fill); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-text strong { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text span, .row-meta { font-size: 13px; color: var(--muted); }
.row-meta { white-space: nowrap; }
.chev { color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 16px; }
.bar-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.bar-label span:last-child { color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.bar > div { height: 100%; border-radius: 3px; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ── Bibliothèque ────────────────────────────── */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tile { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tile-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.tile-body h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.3; }
.tile-body p { margin: 0; font-size: 13px; color: var(--muted); }
.tile-actions { display: flex; align-items: center; gap: 4px; }
.fav[aria-pressed="true"] { color: #FF9F0A; }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px;
  background: var(--fill); color: var(--muted); font-size: 11px; font-weight: 600;
}

/* ── Comptes et réglages ─────────────────────── */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.settings-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row strong { font-weight: 500; }
.settings-row p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.role-select { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); font-size: 14px; }

/* ── Fenêtre modale ──────────────────────────── */

dialog {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0;
  border: 0; border-radius: 20px; background: var(--card); color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
dialog::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog > form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.dialog-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.dialog-body { flex: 1; min-height: 0; padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
.dialog-foot .actions { margin-left: auto; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 16px; border: 3px solid transparent; padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--text); }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-pick button { height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); display: flex; align-items: center; justify-content: center; }
.icon-pick button[aria-pressed="true"] { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.preview { display: flex; align-items: center; gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ── Clients et projets ──────────────────────── */

.back { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; margin-bottom: -16px; align-self: flex-start; }
.lead { margin: -12px 0 0; font-size: 17px; line-height: 1.5; max-width: 680px; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); }
.share-link { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px !important; overflow-wrap: anywhere; user-select: all; }
a.row { color: var(--text); }
a.row:hover { opacity: 1; }
.row .badge { flex-shrink: 0; }

/* ── Galerie ─────────────────────────────────── */

.masonry { display: flex; gap: 12px; align-items: flex-start; }
.m-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.g-tile { position: relative; border-radius: 12px; overflow: hidden; background: var(--fill); }
.g-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; position: relative; cursor: zoom-in; }
.g-open img { display: block; width: 100%; height: auto; object-fit: cover; transition: transform 0.3s ease, opacity 0.3s ease; }
.g-open:hover img { transform: scale(1.02); }
.g-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 26px; color: #FFFFFF;
  background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center; padding-left: 3px;
}
.g-play svg { fill: currentColor; }
.g-badge {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.55); color: #FFFFFF; font-size: 12px; font-weight: 600;
}
.g-dl {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 17px;
  display: flex; align-items: center; justify-content: center; color: #FFFFFF;
  background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; transition: opacity 0.2s ease;
}
.g-tile:hover .g-dl, .g-dl:focus-visible { opacity: 1; }
.g-dl:hover { opacity: 1; background: rgba(0, 0, 0, 0.7); }
@media (hover: none) { .g-dl { opacity: 1; } }
.g-file {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 28px 16px; color: var(--text); text-align: center; font-size: 13px; overflow-wrap: anywhere;
}
.g-file small { color: var(--muted); }

/* Navigation par type et cartes vidéo */
.g-nav { display: flex; flex-wrap: wrap; gap: 8px; position: sticky; top: 0; z-index: 5; padding: 10px 0; background: var(--bg); }
.g-nav a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 19px; background: var(--fill); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.g-nav a b { font-weight: 500; color: var(--muted); }
.section[id] { scroll-margin-top: 64px; }
.section-head h2 svg { vertical-align: -2px; margin-right: 8px; }
.v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.v-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v-open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000000; border-radius: 12px; overflow: hidden; cursor: pointer; }
.v-frame { display: block; width: 100%; max-height: 520px; background: #000000; }
.v-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.v-meta { display: flex; align-items: center; gap: 12px; }
.v-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v-text strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-text span { font-size: 13px; color: var(--muted); }
.v-dl { flex: none; width: 38px; height: 38px; border-radius: 19px; display: flex; align-items: center; justify-content: center; background: var(--fill); color: var(--text); }

/* ── Visionneuse ─────────────────────────────── */

dialog.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0;
  border-radius: 0; background: #000000; color: #FFFFFF; box-shadow: none;
  display: none; flex-direction: column;
}
dialog.lightbox[open] { display: flex; }
dialog.lightbox::backdrop { background: #000000; }
.lb-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
}
.lb-title { display: flex; flex-direction: column; min-width: 0; }
.lb-title strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-title span { font-size: 13px; color: #A1A1A6; }
.lb-stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 0 16px 16px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lb-stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; background: #000000; border-radius: 4px; }
.lb-stage iframe { width: min(100%, 1280px); height: 100%; max-height: 80vh; border: 0; border-radius: 8px; background: #111111; }
.lb-btn {
  width: 44px; height: 44px; border: 0; border-radius: 22px; color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12); display: inline-flex; align-items: center; justify-content: center;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.22); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* ── Page de livraison publique ──────────────── */

.wordmark { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
.delivery-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; background: var(--side);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.delivery .main { padding-top: 48px; }
.delivery-hero { display: flex; flex-direction: column; gap: 8px; }
.delivery-hero h1 { margin: 0; font-size: 44px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; }
.delivery-hero .lead { margin: 8px 0 0; }
.delivery-hero .sub { margin: 4px 0 0; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.delivery-foot { padding: 24px 0 8px; text-align: center; font-size: 13px; color: var(--muted); }

/* ── Toast ───────────────────────────────────── */

.toast {
  inset: auto auto 24px 50%; margin: 0; border: 0; overflow: visible;
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  padding: 12px 18px; border-radius: 14px; background: rgba(29, 29, 31, 0.92); color: #FFFFFF;
  font-size: 14px; font-weight: 500; pointer-events: none; box-shadow: var(--edge), 0 8px 24px rgba(0, 0, 0, 0.2); transition: all 0.25s ease; z-index: 100;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Barre d'onglets mobile ──────────────────── */

.tabbar { display: none; }

@media (max-width: 760px) {
  .sidebar { display: none; }
  .main { padding: 24px 16px calc(100px + env(safe-area-inset-bottom)); }
  .page { gap: 24px; }
  .page-head h1 { font-size: 30px; }
  .page-head .search { width: auto; flex: 1; }
  .page-head .actions { width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat strong { font-size: 26px; }
  .springboard { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 18px 8px; gap: 18px 4px; }
  .app-icon { width: 58px; height: 58px; border-radius: 14px; }
  .spring-item { font-size: 11px; }
  .seg { flex-wrap: nowrap; overflow-x: auto; width: 100%; }
  .seg button { flex-shrink: 0; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .hide-sm { display: none; }
  .masonry, .m-col { gap: 8px; }
  .g-tile { border-radius: 8px; }
  .delivery .main { padding: 28px 16px 48px; }
  .delivery-hero h1 { font-size: 32px; }
  .delivery-bar { padding: 10px 16px; }
  .lb-prev, .lb-next { display: none; }

  .tabbar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 6px 8px env(safe-area-inset-bottom);
    background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 10px; font-weight: 500;
  }
  .tabbar a[aria-current="page"] { color: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.code-box { display: flex; align-items: flex-end; gap: 10px; }
.code-box[hidden] { display: none; }

/* ── Page de livraison client : thème « course » noir et blanc ── */

.g-num { display: none; }

body.fx {
  --bg: #0A0A0A; --card: #161616; --text: #FFFFFF; --muted: #9A9A9A; --line: #262626;
  --fill: rgba(255, 255, 255, 0.08); --link: #FFFFFF; --danger: #FF6961;
  background: #0A0A0A; color: #FFFFFF; color-scheme: dark;
}
.fx-page, .fx-gate { font-family: Archivo, "Helvetica Neue", Arial, sans-serif; }
.fx-mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #9A9A9A; }
.fx-logo { font-size: 22px; font-weight: 900; font-style: italic; font-stretch: 125%; letter-spacing: -0.5px; text-transform: uppercase; color: #FFFFFF; }

.fx-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 40px; background: rgba(10, 10, 10, 0.92);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid #262626;
}
.fx-bar-right { display: flex; align-items: center; gap: 28px; }

.fx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 26px; border: 0;
  background: #FFFFFF; color: #0A0A0A; font-family: Archivo, sans-serif; font-size: 13px; font-weight: 800; font-style: italic;
  font-stretch: 112%; letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); cursor: pointer;
}
.fx-btn:hover { background: #D9D9D9; color: #0A0A0A; opacity: 1; }
.fx-btn-full { width: 100%; height: 52px; }

.fx-hero { position: relative; height: 640px; overflow: hidden; border-bottom: 1px solid #262626; }
.fx-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fx-hero::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.fx-hero-plain { height: auto; padding-top: 140px; }
.fx-hero-plain::after { display: none; }
.fx-hero-text { position: absolute; z-index: 1; left: 40px; right: 40px; bottom: 40px; display: flex; flex-direction: column; gap: 22px; }
.fx-hero-plain .fx-hero-text { position: relative; inset: auto; padding: 0 40px 40px; }
.fx-hero h1, .fx-gate h1 {
  margin: 0; font-size: clamp(44px, 8vw, 112px); line-height: 0.9; font-weight: 900; font-style: italic;
  font-stretch: 125%; letter-spacing: -2px; text-transform: uppercase; overflow-wrap: anywhere;
}
.fx-kicker { display: flex; align-items: center; gap: 14px; }
.fx-kicker .fx-mono { color: #FFFFFF; letter-spacing: 3px; }
.fx-speed { display: flex; gap: 5px; }
.fx-speed i { width: 4px; height: 22px; background: #FFFFFF; transform: skewX(-20deg); }
.fx-stats { display: flex; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, 0.5); padding-top: 18px; }
.fx-stat { display: flex; flex-direction: column; gap: 4px; padding-right: 36px; margin-right: 36px; border-right: 1px solid rgba(255, 255, 255, 0.3); }
.fx-stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.fx-stat .fx-mono { font-size: 10px; color: #BDBDBD; }
.fx-stat strong { font-size: 40px; font-weight: 800; font-style: italic; font-stretch: 75%; line-height: 1; }

.fx-main { max-width: 1360px; margin: 0 auto; padding: 48px 40px 40px; display: flex; flex-direction: column; gap: 48px; }
.fx-lead { margin: 0; max-width: 720px; font-size: 19px; line-height: 1.5; color: #CFCFCF; }
.fx-hint { margin: -28px 0 0; }
.fx-head { display: flex; align-items: center; gap: 20px; }
.fx-head h2 { margin: 0; font-size: 30px; font-weight: 900; font-style: italic; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.5px; }
.fx-rule { flex: 1; height: 1px; background: #3A3A3A; }
.fx-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid #262626; }

body.fx .masonry, body.fx .m-col { gap: 4px; }
body.fx .g-tile { border-radius: 0; background: #161616; }
body.fx .g-open:hover img { transform: scale(1.03); }
body.fx .g-num {
  display: block; position: absolute; left: 12px; bottom: 10px; color: #FFFFFF;
  font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: 1px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
body.fx .g-dl { border-radius: 0; background: #FFFFFF; color: #0A0A0A; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.fx .g-dl:hover { background: #D9D9D9; }
body.fx .g-play { border-radius: 0; width: 64px; height: 64px; background: transparent; border: 2px solid #FFFFFF; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.fx .g-badge { border-radius: 0; font-family: "JetBrains Mono", monospace; font-weight: 400; background: #0A0A0A; }
body.fx .g-file { color: #FFFFFF; }
body.fx .g-nav { top: 64px; background: #0A0A0A; gap: 0; padding: 0; border-bottom: 1px solid #262626; }
body.fx .g-nav a { border-radius: 0; background: transparent; color: #FFFFFF; height: 48px; padding: 0 20px 0 0; margin-right: 20px; font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
body.fx .g-nav a b { color: #8A8A8A; font-weight: 400; }
body.fx .section { scroll-margin-top: 124px; }
body.fx .v-grid { gap: 28px 4px; }
body.fx .v-open { border-radius: 0; }
body.fx .v-text strong { font-family: "JetBrains Mono", monospace; font-size: 13px; color: #FFFFFF; }
body.fx .v-text span { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: 1px; color: #8A8A8A; }
body.fx .v-dl { border-radius: 0; background: #FFFFFF; color: #0A0A0A; }
body.fx .lb-title strong { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 13px; }
body.fx .lb-title span { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: 1px; }
body.fx .lb-btn { border-radius: 0; }
body.fx .lightbox .btn-primary { border-radius: 0; background: #FFFFFF; color: #0A0A0A; font-style: italic; text-transform: uppercase; letter-spacing: 1px; }
body.fx .toast { border-radius: 0; background: #FFFFFF; color: #0A0A0A; font-family: "JetBrains Mono", monospace; font-size: 12px; }

.fx-gate { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.fx-gate-box { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 28px; }
.fx-gate h1 { font-size: clamp(36px, 7vw, 56px); }
.fx-gate p { margin: 0; color: #BDBDBD; }
.fx-gate form { display: flex; flex-direction: column; gap: 12px; }
.fx-gate input {
  height: 64px; padding: 0; border: 0; border-bottom: 2px solid #FFFFFF; background: transparent; color: #FFFFFF; outline: 0;
  font-family: "JetBrains Mono", monospace; font-size: 28px; letter-spacing: 8px;
}
.fx-gate input::placeholder { color: #4A4A4A; }
.fx-gate .form-error { text-align: left; color: #FF6961; font-family: "JetBrains Mono", monospace; font-size: 12px; }

@media (max-width: 760px) {
  .fx-bar { padding: 12px 16px; }
  .fx-logo { font-size: 17px; }
  .fx-bar .fx-btn { height: 40px; width: 52px; padding: 0; }
  .fx-bar .fx-btn span { display: none; }
  .fx-hero { height: 520px; }
  .fx-hero-text { left: 16px; right: 16px; bottom: 24px; gap: 16px; }
  .fx-hero-plain .fx-hero-text { padding: 0 16px 24px; }
  .fx-stat { padding-right: 18px; margin-right: 18px; }
  .fx-stat strong { font-size: 30px; }
  .fx-main { padding: 28px 16px 32px; gap: 32px; }
  .fx-hint { margin-top: -16px; }
  .fx-head h2 { font-size: 22px; }
}

/* ── Instagram ───────────────────────────────── */

.ig-kw {
  flex-shrink: 0; padding: 6px 12px; border-radius: 8px; background: var(--text); color: var(--bg);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
}
.ig-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.ig-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.ig-check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.ig-check.on { color: var(--text); }
.ig-check.on svg { color: #248A3D; }
.ig-check:not(.on) svg { color: var(--danger); }
.ig-test { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.92em; padding: 1px 5px; border-radius: 5px; background: var(--fill); }

.switch { position: relative; display: inline-flex; width: 51px; height: 31px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch-ui { width: 100%; height: 100%; border-radius: 16px; background: var(--fill); transition: background 0.2s ease; position: relative; pointer-events: none; }
.switch-ui::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px;
  background: #FFFFFF; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s ease;
}
.switch input:checked + .sr-only + .switch-ui { background: #34C759; }
.switch input:checked + .sr-only + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .sr-only + .switch-ui { outline: 3px solid rgba(0, 113, 227, 0.5); outline-offset: 2px; }
