:root {
  --bg: #0b0b0f;
  --bg2: #111117;
  --panel: #15151d;
  --panel2: #1b1b25;
  --line: #262633;
  --text: #ececf1;
  --muted: #9a9aab;
  --pink: #ff3ea5;
  --pink2: #ff6ec4;
  --purple: #8b5cf6;
  --green: #2ee59d;
  --gold: #f5b83d;
  --blue: #4f8cff;
  --red: #ff4d5e;
  --side: 248px;
  --top: 64px;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--red); min-height: 1.2em; margin: 0; }

/* ---------- Icônes (masques SVG) ---------- */
.ic { display: inline-block; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ic-home { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21h-6v-6H9v6H3z'/%3E%3C/svg%3E"); }
.ic-heart { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 20s-7-4.5-9-9a4.8 4.8 0 0 1 9-3 4.8 4.8 0 0 1 9 3c-2 4.5-9 9-9 9z'/%3E%3C/svg%3E"); }
.ic-heart-fill { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20s-7-4.5-9-9a4.8 4.8 0 0 1 9-3 4.8 4.8 0 0 1 9 3c-2 4.5-9 9-9 9z'/%3E%3C/svg%3E"); }
.ic-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ic-gear { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1'/%3E%3C/svg%3E"); }
.ic-spark { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3l2 6 6 2-6 2-2 6-2-6-6-2 6-2zM19 3v4M17 5h4'/%3E%3C/svg%3E"); }
.ic-search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); }
.ic-video { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='13' height='12' rx='2'/%3E%3Cpath d='m16 10 5-3v10l-5-3z'/%3E%3C/svg%3E"); }
.ic-fire { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 21a6 6 0 0 0 6-6c0-4-3-6-4-10-2 2-3 4-3 6-1-1-2-2-2-4-2 2-3 5-3 8a6 6 0 0 0 6 6z'/%3E%3C/svg%3E"); }
.ic-star { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.8 5.8 6.2.9-4.5 4.4 1 6.2L12 17.4 6.5 20.3l1-6.2L3 9.7l6.2-.9z'/%3E%3C/svg%3E"); }
.ic-star-fill { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 3 2.8 5.8 6.2.9-4.5 4.4 1 6.2L12 17.4 6.5 20.3l1-6.2L3 9.7l6.2-.9z'/%3E%3C/svg%3E"); }
.ic-grid { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E"); }
.ic-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.ic-globe { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/%3E%3C/svg%3E"); }
.ic-camera { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 7h4l2-2h4l2 2h4v12H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.ic-crown { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m3 7 4.5 4L12 5l4.5 6L21 7l-2 11H5z'/%3E%3C/svg%3E"); }
.ic-out { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 4h5v16h-5M10 8l-4 4 4 4M6 12h10'/%3E%3C/svg%3E"); }
.ic-menu { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E"); }
.ic-x { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.ic-play { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4v16l13-8z'/%3E%3C/svg%3E"); }
.ic-vol { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4zM16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12'/%3E%3C/svg%3E"); }
.ic-mute { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4zM17 9l5 6M22 9l-5 6'/%3E%3C/svg%3E"); }
.ic-tag { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 12V3h9l9 9-9 9z'/%3E%3Ccircle cx='8' cy='8' r='1.5'/%3E%3C/svg%3E"); }
.ic-image { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='m21 17-5-5-9 8'/%3E%3C/svg%3E"); }
.ic-folder { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 6h6l2 2h10v11H3z'/%3E%3C/svg%3E"); }
.ic-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2 20a7 7 0 0 1 14 0M16 4.5a3.5 3.5 0 0 1 0 7M18 13.5a7 7 0 0 1 4 6.5'/%3E%3C/svg%3E"); }
.ic-chev { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E"); }
.ic-full { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E"); }

/* ---------- Auth ---------- */
.auth { position: fixed; inset: 0; display: grid; place-items: center; background:
  radial-gradient(800px 400px at 70% 20%, #3a0f3a 0, transparent 60%), var(--bg); padding: 20px; }
.auth-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: grid; gap: 12px; }
.auth-card input { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; outline: none; }
.auth-card input:focus { border-color: var(--pink); }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--side); overflow-y: auto;
  background: var(--bg2); border-right: 1px solid var(--line); padding: 10px 8px 24px; z-index: 40;
  scrollbar-width: thin; scrollbar-color: #2a2a36 transparent;
}
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #d8d8e2; margin: 1px 0; }
.sidebar a:hover { background: #1a1a23; }
.sidebar a.active { background: #22222d; color: #fff; font-weight: 600; }
.sidebar a.active .ic { color: var(--pink); }
.sidebar a.green { color: var(--green); font-weight: 600; }
.sidebar a.pink { color: var(--pink2); }
.side-label { font-size: 12px; letter-spacing: .06em; color: var(--muted); padding: 6px 10px; }
.side-sep { height: 1px; background: var(--line); margin: 10px 4px; }
.side-head { display: flex; align-items: center; gap: 10px; margin: 14px 2px 4px; padding: 9px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .04em; background: #1a1a22; border-left: 3px solid var(--pink); }
.side-head.pink { color: #f2f2f6; } .side-head.pink .ic { color: var(--pink); }
.side-head.green { color: var(--green); border-color: var(--green); background: #0f2a20; }
.side-head.gold { color: var(--gold); border-color: var(--gold); background: #2a2110; }
.side-head.blue { color: var(--blue); border-color: var(--blue); background: #101c33; }
.muted-link { color: var(--muted) !important; }

.main { margin-left: var(--side); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: rgba(11, 11, 15, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.brand.big { font-size: 26px; justify-content: center; margin-bottom: 4px; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: url(/icon.svg) center / cover; }
.search { flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 8px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 40px; color: var(--muted); }
.search input { flex: 1; background: none; border: 0; outline: none; color: var(--text); height: 100%; }
.search:focus-within { border-color: var(--pink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel2);
  padding: 9px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #3a3a4a; }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--purple)); border: 0; color: #fff; }
.btn.vip { background: linear-gradient(135deg, #12c2a0, #2ee59d); color: #04140e; border: 0; }
.btn.small { padding: 6px 10px; font-size: 12.5px; }
.ai-filter { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg2); color: #c8b6ff; cursor: pointer; }
.ai-filter select { background: none; border: 0; outline: none; color: var(--text); font-weight: 600; cursor: pointer; }
.ai-filter select option { background: #15151d; }
.ai-filter.on { border-color: var(--purple); background: #1d1530; }
.btn.danger { color: var(--red); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; }
.icon-btn:hover { border-color: #3d3d4d; }
.icon-btn .ic { width: 18px; height: 18px; }
.menu-btn { display: none; }
.backdrop { display: none; }

.view { padding: 22px 24px 60px; max-width: 1640px; }

/* ---------- Panneau stats (accueil) ---------- */
.stats-panel { border: 1px solid #5b1e4a; border-radius: 12px; background: linear-gradient(180deg, #16111a, #121218); padding: 18px; margin-bottom: 16px; }
.rating { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.stars { display: flex; gap: 2px; color: var(--gold); }
.stars .ic { width: 17px; height: 17px; }
.members { display: flex; align-items: center; gap: 8px; color: #c9c9d6; margin: 6px 0 14px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.stat { display: flex; align-items: center; gap: 12px; background: #17171f; border-radius: 8px; padding: 10px 14px; }
.stat .ic { width: 18px; height: 18px; }
.stat b { display: block; font-size: 14px; }
.stat small { color: var(--muted); font-size: 11px; }

/* ---------- Bannière ---------- */
.hero { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; margin-bottom: 18px;
  background: radial-gradient(600px 220px at 60% 50%, rgba(139, 92, 246, .35), transparent 70%), linear-gradient(90deg, #121218, #1c1226 60%, #241033); }
.hero h1 { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--pink2); }
.hero p { margin: 0 0 10px; color: #cfcfe0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid #6b2a5c; background: #24121f;
  font-size: 12px; font-weight: 600; cursor: pointer; color: #f0dbe9; }
.chips.related .chip { background: #1b1b25; border-color: var(--line); color: #e6e6ee; font-size: 12.5px; padding: 6px 12px; border-radius: 8px; }
.chip:hover, .chip.on { border-color: var(--pink); background: #3a1430; color: #fff; }
.hero .hint { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.hero .hint b { color: #c8b6ff; font-weight: 600; }
.hero-badge { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); border: 1px solid var(--gold); color: var(--gold);
  background: #241c0c; padding: 8px 14px; border-radius: 8px; font-weight: 700; display: flex; gap: 8px; align-items: center; }

/* ---------- Sections ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.section-head h2 { margin: 0; font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-head h2 .ic { color: var(--pink); width: 18px; height: 18px; }
.view-all { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg2); color: var(--pink2);
  padding: 7px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 700; }
.view-all:hover { border-color: var(--pink); }
.view-all .ic { width: 12px; height: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.card { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); cursor: pointer;
  aspect-ratio: 3 / 4; }
.card.wide { aspect-ratio: 16 / 10; }
.card img, .card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, opacity .2s; }
.card:hover img { transform: scale(1.04); }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .85)); pointer-events: none; }
.card .label { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; font-weight: 700; font-size: 13.5px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 3px #000; }
.card .badge { position: absolute; z-index: 2; top: 8px; right: 8px; background: rgba(0, 0, 0, .75); padding: 2px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; }
.card .src { position: absolute; z-index: 2; top: 8px; left: 8px; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.src.eporner { background: #ff3ea5d9; } .src.redtube { background: #e2233bd9; } .src.rule34 { background: #2fa36bd9; } .src.redgifs { background: #4f8cffd9; }
.card .fav-dot { position: absolute; z-index: 3; bottom: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s; border: 0; cursor: pointer; }
.card:hover .fav-dot, .card .fav-dot.on { opacity: 1; }
.card .fav-dot.on { color: var(--pink); }
.card .meta-line { position: absolute; z-index: 2; left: 10px; right: 10px; bottom: 10px; font-size: 11.5px; color: #c9c9d4; display: flex; gap: 10px; }
.card.has-meta .label { bottom: 28px; }
.card .play { position: absolute; z-index: 2; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, .55);
  display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.card:hover .play { opacity: 1; }
.card .play .ic { width: 18px; height: 18px; margin-left: 3px; }
.skeleton { background: linear-gradient(90deg, #15151d 0, #1e1e29 50%, #15151d 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.masonry { columns: 5 220px; column-gap: 12px; }
.masonry .card { aspect-ratio: auto; break-inside: avoid; margin-bottom: 12px; }
.masonry .card img { position: static; height: auto; display: block; }
.masonry .card.tall img { object-position: top; }
.card video.hover-prev { z-index: 1; pointer-events: none; }
.masonry .card.tall::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); pointer-events: none; }
.card .badge.tall-badge { top: auto; right: auto; bottom: 8px; left: 8px; }
.modal-stage.scroll { display: block; overflow-y: auto; text-align: center; padding-top: 4px; padding-bottom: 24px; }
.modal-stage.scroll img { width: min(100%, 900px); max-height: none; height: auto; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 800; flex: 1 1 auto; display: flex; align-items: center; gap: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar input, .toolbar select, .field input, .field select, .field textarea {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; outline: none; min-width: 0; }
.toolbar input:focus, .field input:focus, .field textarea:focus { border-color: var(--pink); }
.toolbar .grow { flex: 1 1 260px; }
.tabs { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--panel2); color: #fff; }
.sentinel { height: 60px; display: grid; place-items: center; color: var(--muted); }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.error-box { padding: 16px; border-radius: 10px; background: #2a1116; border: 1px solid #5a1f2a; color: #ffc2c9; margin-bottom: 16px; }
.error-box a { color: #fff; text-decoration: underline; }

/* Autocomplete */
.ac-wrap { position: relative; flex: 1 1 320px; }
.ac-wrap input { width: 100%; }
.ac-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ac-list div { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.ac-list div:hover, .ac-list div.on { background: var(--panel2); }
.ac-list small { color: var(--muted); }

/* ---------- Modal lecteur ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(4, 4, 7, .94); display: flex; }
.modal-inner { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.modal-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.modal-title { flex: 1; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-actions { display: flex; gap: 8px; }
.modal-actions .on { color: var(--pink); border-color: var(--pink); }
.modal-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 64px; }
.modal-stage iframe { width: min(100%, calc((100vh - 170px) * 16 / 9)); aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.modal-stage img, .modal-stage video { max-width: 100%; max-height: calc(100vh - 170px); border-radius: 8px; background: #000; }
.modal-meta { padding: 10px 18px 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-height: 110px; overflow: auto; }
.modal-meta .tag { padding: 3px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 12px; cursor: pointer; }
.modal-meta .tag:hover { border-color: var(--pink); }
.modal-meta .info { color: var(--muted); margin-right: 8px; font-size: 12.5px; }
.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 70px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .06);
  color: #fff; font-size: 34px; cursor: pointer; }
.nav-arrow:hover { background: rgba(255, 255, 255, .14); }
.nav-arrow.left { left: 10px; } .nav-arrow.right { right: 10px; }

/* ---------- Feed TikTok ---------- */
.feed-shell { position: fixed; top: var(--top); left: var(--side); right: 0; bottom: 0; background: #000; }
.feed-bar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 8px; align-items: center;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(8px); padding: 6px; border-radius: 12px; border: 1px solid #ffffff1a; max-width: calc(100% - 20px); }
.feed-bar input { background: #ffffff12; border: 1px solid #ffffff22; border-radius: 8px; padding: 7px 10px; outline: none; width: 200px; }
.feed-bar select { background: #ffffff12; border: 1px solid #ffffff22; border-radius: 8px; padding: 7px 8px; }
.feed-bar option { background: #111; }
.feed { height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.feed::-webkit-scrollbar { display: none; }
.slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; overflow: hidden; }
.slide .bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(30px) brightness(.35); }
.slide .media { position: relative; height: 100%; width: 100%; display: grid; place-items: center; }
.slide video, .slide img.full { max-height: 100%; max-width: 100%; object-fit: contain; }
.slide iframe { width: min(100%, 1100px); aspect-ratio: 16 / 9; border: 0; }
.slide .poster { position: relative; cursor: pointer; }
.slide .poster img { max-height: 70vh; max-width: min(92vw, 900px); border-radius: 12px; display: block; }
.slide .poster .play { position: absolute; inset: 0; margin: auto; width: 74px; height: 74px; border-radius: 50%; background: rgba(0, 0, 0, .6); display: grid; place-items: center; }
.slide .poster .play .ic { width: 28px; height: 28px; margin-left: 4px; }
.slide .caption { position: absolute; left: 16px; right: 90px; bottom: 18px; z-index: 3; text-shadow: 0 1px 4px #000; pointer-events: none; }
.slide .caption b { display: block; font-size: 15px; margin-bottom: 4px; }
.slide .caption span { font-size: 12.5px; color: #ddd; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide .rail { position: absolute; right: 14px; bottom: 90px; z-index: 3; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.rail button { width: 50px; height: 50px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; cursor: pointer; color: #fff; }
.rail button .ic { width: 24px; height: 24px; }
.rail button.on { color: var(--pink); }
.rail small { display: block; text-align: center; font-size: 11px; margin-top: 3px; color: #eee; }
.feed-nav { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 12px; }
.feed-nav button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid #ffffff2a; background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(6px); }
.feed-nav button:hover { background: rgba(255, 62, 165, .55); border-color: var(--pink); }
.feed-nav .ic { width: 22px; height: 22px; }
.slide .rail { bottom: 24px !important; }
.feed-empty { height: 100%; display: grid; place-items: center; color: #bbb; text-align: center; padding: 20px; }

/* ---------- Réglages ---------- */
.settings { display: grid; gap: 16px; max-width: 900px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.panel h3 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.panel p.desc { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.api-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.api-row:first-of-type { border-top: 0; }
.api-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.api-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.field { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); }
.field.full { grid-column: 1 / -1; }
.field input, .field textarea { color: var(--text); width: 100%; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.status.ok { background: #0f2a20; color: var(--green); } .status.ko { background: #2a1116; color: #ff9aa5; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #2b2b38; border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--pink); }
.switch input:checked + span::before { transform: translateX(18px); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.note { font-size: 12.5px; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }

.progress { height: 8px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; margin-top: 10px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--purple)); transition: width .4s; }
.toolbar select:disabled { opacity: .45; cursor: not-allowed; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 200; background: #22222d; border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 10px; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .duo { grid-template-columns: 1fr; }
  .hero-badge { display: none; }
}
@media (max-width: 860px) {
  :root { --side: 0px; }
  .sidebar { width: 270px; transform: translateX(-100%); transition: transform .25s; }
  body.side-open .sidebar { transform: none; }
  body.side-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 35; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand { font-size: 0; gap: 0; }
  .btn.vip { display: none; }
  .ai-filter { padding: 0 6px; }
  .ai-filter .ic { display: none; }
  .view { padding: 16px 12px 50px; }
  .stats-grid { grid-template-columns: 1fr; }
  .row3 { gap: 8px; }
  .modal-stage { padding: 0 8px; }
  .nav-arrow { display: none; }
  .feed-bar input { width: 120px; }
  .api-fields { grid-template-columns: 1fr; }
}
