/* ============================================================ Spotigo */
:root {
  --bg: #ffffff;
  --surface: #f3f6f4;
  --surface-2: #e9eeeb;
  --text: #0d1512;
  --muted: #66756e;
  --line: #e1e7e3;
  --brand: #0c9a5e;
  --brand-strong: #077a4a;
  --brand-soft: #e2f5eb;
  --brand-grad: linear-gradient(135deg, #06663f 0%, #0b8a55 45%, #2cc67f 100%);
  --ring-grad: conic-gradient(from 210deg, #2cc67f, #b9f3d4, #0b8a55, #06663f, #2cc67f);
  --danger: #e5484d;
  --like: #ff3b5c;
  --media-bg: #0b0f0d;
  --shadow: 0 10px 40px rgba(6, 40, 25, .18);
  --radius: 14px;
  --tab-h: 60px;
  --top-h: 56px;
  --col: 560px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e0c;
    --surface: #131a16;
    --surface-2: #1b241f;
    --text: #eef3f0;
    --muted: #8c9b93;
    --line: #212a25;
    --brand: #2cc67f;
    --brand-strong: #22b06f;
    --brand-soft: #10301f;
    --shadow: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0e0c; --surface: #131a16; --surface-2: #1b241f; --text: #eef3f0; --muted: #8c9b93;
  --line: #212a25; --brand: #2cc67f; --brand-strong: #22b06f; --brand-soft: #10301f; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
.hidden { display: none !important; }
.ic { width: 24px; height: 24px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot img { border-radius: 22px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .8; } }

/* ------------------------------------------------------------ Coque */
.shell { max-width: var(--col); margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0 12px;
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-weight: 700; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 9px; flex: 1; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.wordmark { font-size: 23px; font-weight: 800; letter-spacing: -.6px; }
.wordmark span { color: var(--brand); }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; position: relative; }
.icon-btn:active { transform: scale(.9); }
.dot-badge { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--like); border: 2px solid var(--bg); }

.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  max-width: var(--col); margin: 0 auto;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: grid; place-items: center; color: var(--muted); position: relative; }
.tabbar a.active { color: var(--text); }
.tabbar a.active .ic { stroke-width: 2.4; }
.tabbar .new-ic {
  width: 46px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; box-shadow: 0 4px 14px rgba(11, 138, 85, .35);
}
.tabbar .tab-me .avatar { width: 28px; height: 28px; font-size: 12px; }
.tabbar .tab-me.active .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); }
.tab-label { display: none; }

.immersive .tabbar { background: #000; border-top-color: #1b1b1b; color-scheme: dark; }
.immersive .tabbar a { color: #8a8a8a; }
.immersive .tabbar a.active { color: #fff; }

@media (min-width: 960px) {
  .shell { padding-bottom: 0; }
  .tabbar {
    top: 0; bottom: 0; right: auto; width: 220px; height: auto; margin: 0;
    display: flex; flex-direction: column; gap: 4px; padding: 20px 12px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .tabbar::before {
    content: ""; display: block; height: 46px; margin: 0 8px 18px;
    background: url(/logo.png) left center / 40px no-repeat;
  }
  .tabbar a { display: flex; justify-content: flex-start; gap: 14px; padding: 12px; border-radius: 12px; font-weight: 500; }
  .tabbar a:hover { background: var(--surface); }
  .tabbar a.active { font-weight: 700; }
  .tab-label { display: inline; }
  .tabbar .new-ic { width: 24px; height: 24px; border-radius: 7px; box-shadow: none; }
  .tabbar .new-ic .ic { width: 18px; height: 18px; }
  .immersive .tabbar a:hover { background: #151515; }
}

/* ------------------------------------------------------------ Boutons & champs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 11px;
  font-weight: 650; background: var(--surface-2); color: var(--text);
  transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.block { width: 100%; height: 48px; font-size: 16px; }
.btn.small { height: 32px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.btn.danger { color: var(--danger); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-link { color: var(--brand); font-weight: 700; font-size: 14px; padding: 6px 4px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px 2px; }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface);
  outline: none; transition: border-color .15s, background .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); background: var(--bg); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 13px; color: var(--muted); }
.error-box { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }

/* ------------------------------------------------------------ Authentification */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 20px; position: relative; overflow: hidden; }
.auth::before {
  content: ""; position: absolute; inset: -40% -40% auto; height: 70%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 22%, transparent), transparent);
  pointer-events: none;
}
.auth-card { width: 100%; max-width: 380px; position: relative; }
.auth-logo { width: 88px; height: 88px; border-radius: 24px; margin: 0 auto 14px; box-shadow: var(--shadow); }
.auth h1 { text-align: center; font-size: 34px; letter-spacing: -1px; margin: 0; font-weight: 850; }
.auth h1 span { color: var(--brand); }
.auth .tagline { text-align: center; color: var(--muted); margin: 6px 0 28px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--muted); }
.auth-switch a { color: var(--brand); font-weight: 700; }
.auth-modes { display: flex; justify-content: center; gap: 18px; margin-top: 26px; color: var(--muted); font-size: 13px; }
.auth-modes span { display: inline-flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------ Avatars & stories */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px;
  background: var(--brand-grad); object-fit: cover;
}
img.avatar { background: var(--surface-2); }
.ring { padding: 2.5px; border-radius: 50%; background: var(--ring-grad); display: inline-grid; flex: none; }
.ring.seen { background: var(--line); }
.ring > .avatar { box-shadow: 0 0 0 2.5px var(--bg); }

.stories-bar { display: flex; gap: 14px; padding: 12px 14px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.stories-bar::-webkit-scrollbar { display: none; }
.story-bubble { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 72px; flex: none; cursor: pointer; position: relative; }
.story-bubble .avatar { width: 64px; height: 64px; font-size: 22px; }
.story-bubble .ring { padding: 3px; }
.story-bubble .nr { padding: 3px; }
.story-bubble small { font-size: 12px; max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.story-add {
  position: absolute; right: 2px; top: 48px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center; border: 2.5px solid var(--bg);
}
.story-add .ic { width: 14px; height: 14px; stroke-width: 3; }

/* ------------------------------------------------------------ Publications */
.post { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 12px; }
.post-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.uname { font-weight: 700; font-size: 14px; }
.loc { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc .ic { width: 13px; height: 13px; }

.carousel { position: relative; background: var(--media-bg); aspect-ratio: var(--ratio, 1); overflow: hidden; user-select: none; }
.track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; position: relative; }
.slide img, .slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.slide img { cursor: zoom-in; }
.counter {
  position: absolute; top: 12px; right: 12px; background: rgba(0, 0, 0, .6); color: #fff;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; pointer-events: none;
}
.q-badge {
  position: absolute; top: 12px; left: 12px; pointer-events: none;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .4px;
  padding: 3px 7px; border-radius: 6px; backdrop-filter: blur(6px);
}
.mute-btn {
  position: absolute; right: 12px; bottom: 12px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center;
}
.mute-btn .ic { width: 17px; height: 17px; }
.dots { display: flex; justify-content: center; gap: 4px; padding-top: 10px; height: 16px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.dots i.on { background: var(--brand); transform: scale(1.15); }
.heart-burst {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: #fff;
  opacity: 0; z-index: 3;
}
.heart-burst .ic { width: 96px; height: 96px; filter: drop-shadow(0 6px 22px rgba(0, 0, 0, .35)); }
.heart-burst.go { animation: burst .85s ease-out; }
@keyframes burst {
  0% { opacity: 0; transform: scale(.4); }
  15% { opacity: 1; transform: scale(1.15); }
  30% { transform: scale(.95); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1) translateY(-20px); }
}

.post-actions { display: flex; align-items: center; padding: 2px 4px 0; }
.post-actions.has-dots { margin-top: -16px; }
.post-actions .spacer { flex: 1; }
[data-act="like"].liked { color: var(--like); }
[data-act="like"].liked .ic { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.25); } }
.post-body { padding: 0 14px; display: flex; flex-direction: column; gap: 5px; }
.likes { font-weight: 700; font-size: 14px; }
.caption { margin: 0; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.caption .uname { margin-right: 4px; }
.tag { color: var(--brand); font-weight: 600; }
.muted-link { color: var(--muted); font-size: 14px; text-align: left; }
.time { color: var(--muted); font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
  border-radius: 20px; font-size: 12.5px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand-strong);
}
.chip.plain { background: var(--surface-2); color: var(--text); }
.chip b { font-weight: 800; }

/* ------------------------------------------------------------ Grilles */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.tile { position: relative; aspect-ratio: 3 / 4; background: var(--surface-2); overflow: hidden; display: block; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tile:hover img { transform: scale(1.04); }
.tile .tile-ic { position: absolute; top: 7px; right: 7px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
.tile .tile-ic .ic { width: 20px; height: 20px; }
.tile .tile-dur { position: absolute; left: 7px; bottom: 6px; color: #fff; font-size: 12px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.tile-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }

.empty { text-align: center; padding: 54px 28px; color: var(--muted); }
.empty .em-ic { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; border: 2px solid var(--text); color: var(--text); display: grid; place-items: center; }
.empty .em-ic .ic { width: 34px; height: 34px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 20px; }
.empty p { margin: 0 0 18px; }

.loader { display: flex; justify-content: center; padding: 26px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.section-title { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 8px; font-weight: 700; }
.section-title small { color: var(--muted); font-weight: 500; }

/* Suggestions */
.suggest { display: flex; gap: 10px; overflow-x: auto; padding: 0 14px 16px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest-card {
  flex: 0 0 150px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.suggest-card .avatar { width: 64px; height: 64px; font-size: 22px; }
.suggest-card .uname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-card small { color: var(--muted); font-size: 12px; margin-bottom: 4px; }

/* ------------------------------------------------------------ Listes */
.list-item { display: flex; align-items: center; gap: 12px; padding: 9px 14px; }
.list-item .grow { flex: 1; min-width: 0; line-height: 1.3; }
.list-item .grow small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .avatar { width: 44px; height: 44px; font-size: 17px; }
.list-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--surface-2); flex: none; }
.act-text { font-size: 14px; }
.act-text .time { margin-left: 4px; }

/* ------------------------------------------------------------ Explorer */
.searchbar { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 5; background: var(--bg); padding: 10px 12px 6px; }
.search-input { position: relative; }
.search-input .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 19px; height: 19px; }
.search-input input { padding-left: 40px; height: 42px; border-radius: 12px; }
.filter-chips { display: flex; gap: 7px; overflow-x: auto; padding: 8px 12px 10px; scrollbar-width: none; background: var(--bg); }
.filter-chips::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; height: 34px; padding: 0 13px; border-radius: 20px; border: 1.5px solid var(--line);
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.fchip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ------------------------------------------------------------ Profil */
.profile-head { padding: 18px 16px 6px; }
.ph-top { display: flex; align-items: center; gap: 20px; }
.ph-top .avatar { width: 88px; height: 88px; font-size: 32px; }
.ph-top .ring { padding: 3px; cursor: pointer; }
.ph-top .nr { padding: 3px; }
.stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.stats b { display: block; font-size: 18px; }
.stats span { font-size: 13px; color: var(--muted); }
.ph-name { font-weight: 700; margin-top: 12px; }
.ph-bio { white-space: pre-wrap; font-size: 14px; margin-top: 2px; }
.ph-actions { display: flex; gap: 8px; margin-top: 14px; }
.ph-actions .btn { flex: 1; height: 36px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-top: 12px; position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); background: var(--bg); z-index: 4; }
.tabs button { flex: 1; height: 46px; display: grid; place-items: center; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--text); }

/* ------------------------------------------------------------ Composer */
.composer { padding: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.seg a { text-align: center; padding: 9px; border-radius: 9px; font-weight: 650; color: var(--muted); }
.seg a.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--line)); border-radius: 18px;
  padding: 32px 18px; cursor: pointer; background: color-mix(in srgb, var(--brand-soft) 50%, transparent);
  transition: background .2s, border-color .2s;
}
.dropzone.drag { background: var(--brand-soft); border-color: var(--brand); }
.dropzone .dz-ic { width: 60px; height: 60px; border-radius: 18px; background: var(--brand-grad); color: #fff; display: grid; place-items: center; }
.dropzone .dz-ic .ic { width: 30px; height: 30px; }
.dropzone b { font-size: 16px; }
.lossless { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--brand-strong); background: var(--brand-soft); padding: 4px 10px; border-radius: 20px; }
.lossless .ic { width: 15px; height: 15px; }
.picked { display: flex; gap: 10px; overflow-x: auto; padding: 14px 0 4px; }
.pick { flex: 0 0 132px; position: relative; }
.pick-media { width: 132px; height: 176px; border-radius: 12px; overflow: hidden; background: var(--media-bg); position: relative; }
.pick-media img { width: 100%; height: 100%; object-fit: cover; }
.pick-media .pm-type { position: absolute; left: 6px; bottom: 6px; color: #fff; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .55); padding: 2px 6px; border-radius: 5px; display: flex; gap: 3px; align-items: center; }
.pick-media .pm-type .ic { width: 13px; height: 13px; }
.pick-rm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; }
.pick-rm .ic { width: 15px; height: 15px; }
.pick-num { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.pick small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.3; }
.pick-add { flex: 0 0 90px; height: 176px; border-radius: 12px; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.transport-pick { display: flex; flex-wrap: wrap; gap: 7px; }
.transport-pick label { cursor: pointer; }
.transport-pick input { position: absolute; opacity: 0; pointer-events: none; }
.transport-pick span { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px; border-radius: 20px; border: 1.5px solid var(--line); font-size: 14px; font-weight: 600; }
.transport-pick input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.transport-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.progress { margin-top: 14px; }
.progress .bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--brand-grad); transition: width .2s; }
.progress small { display: block; text-align: center; color: var(--muted); margin-top: 6px; }

/* ------------------------------------------------------------ Paramètres */
.settings { padding: 18px 16px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.avatar-edit .avatar { width: 76px; height: 76px; font-size: 28px; }

/* ------------------------------------------------------------ Feuilles (bottom sheets) */
.backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .5); animation: fade .2s; }
.sheet {
  position: fixed; z-index: 81; left: 0; right: 0; bottom: 0; max-width: var(--col); margin: 0 auto;
  background: var(--bg); border-radius: 18px 18px 0 0; max-height: 82dvh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom); animation: up .25s cubic-bezier(.2, .9, .3, 1);
  color: var(--text);
}
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 4px; flex: none; }
.sheet-title { text-align: center; font-weight: 700; padding: 6px 0 10px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-body { overflow-y: auto; flex: 1; min-height: 120px; }
.sheet-menu button, .sheet-menu a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 20px; font-size: 15px; text-align: left; }
.sheet-menu button:hover, .sheet-menu a:hover { background: var(--surface); }
.sheet-menu .danger { color: var(--danger); font-weight: 600; }
.sheet-info { padding: 12px 20px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

.comment { display: flex; gap: 10px; padding: 10px 14px; }
.comment .avatar { width: 34px; height: 34px; font-size: 13px; }
.comment .c-body { flex: 1; min-width: 0; font-size: 14px; }
.comment .c-body p { margin: 1px 0 3px; white-space: pre-wrap; word-break: break-word; }
.comment .c-meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; }
.comment-form { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); flex: none; }
.comment-form .input { height: 42px; border-radius: 22px; }
.comment-form button { font-weight: 700; color: var(--brand); padding: 0 6px; }

/* ------------------------------------------------------------ Toast */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #18211c; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ Spots (fil vertical) */
.spots-wrap { position: fixed; inset: 0 0 calc(var(--tab-h) + env(safe-area-inset-bottom)) 0; background: #000; color: #fff; color-scheme: dark; }
@media (min-width: 960px) { .spots-wrap { left: 220px; bottom: 0; } }
.spots { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.spots::-webkit-scrollbar { display: none; }
.spots-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5; pointer-events: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 12px) 12px 30px;
  background: linear-gradient(rgba(0, 0, 0, .45), transparent);
  font-weight: 800; font-size: 17px; text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.spots-top .icon-btn { pointer-events: auto; position: absolute; right: 8px; top: calc(env(safe-area-inset-top) + 2px); }
.spot { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; position: relative; overflow: hidden; }
.spot-stage { position: absolute; inset: 0; }
.spot-video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.spot-paused { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .15s; }
.spot.paused .spot-paused { opacity: 1; }
.spot-paused .ic { width: 74px; height: 74px; opacity: .85; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .5)); }
.spot-shade { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); pointer-events: none; }
.spot-actions {
  position: absolute; right: 8px; bottom: 22px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.spot-actions button, .spot-actions a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.spot-actions .ic { width: 32px; height: 32px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
.spot-actions [data-act="like"].liked { color: var(--like); }
.spot-actions [data-act="save"].saved { color: #ffd34d; }
.spot-avatar { position: relative; margin-bottom: 8px; }
.spot-avatar .avatar { width: 48px; height: 48px; border: 2px solid #fff; font-size: 18px; }
.spot-follow {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center;
}
.spot-follow .ic { width: 14px !important; height: 14px !important; stroke-width: 3; }
.spot-info { position: absolute; left: 14px; right: 80px; bottom: 20px; z-index: 3; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.spot-info .uname { font-size: 16px; }
.spot-info .caption { font-size: 14px; margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.spot-info .caption.open { -webkit-line-clamp: unset; }
.spot-info .chips { margin-top: 8px; }
.spot-info .chip { background: rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(8px); text-shadow: none; }
.spot-info .tag { color: #9ff0c6; }
.spot-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .18); z-index: 4; }
.spot-progress i { display: block; height: 100%; width: 0; background: #fff; }
.spot .heart-burst { color: var(--like); }
.spots-empty { height: 100%; display: grid; place-items: center; text-align: center; padding: 30px; color: #aaa; }
.spots-empty h3 { color: #fff; }

/* ------------------------------------------------------------ Visionneuse de stories */
.sv { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; display: flex; justify-content: center; animation: fade .2s; touch-action: none; color-scheme: dark; }
.sv-frame { position: relative; width: 100%; max-width: 480px; height: 100%; background: #111; overflow: hidden; }
@media (min-width: 600px) { .sv-frame { height: calc(100% - 40px); margin-top: 20px; border-radius: 14px; } }
.sv-media { position: absolute; inset: 0; overflow: hidden; }
.sv-media img, .sv-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sv-media .loader { position: absolute; inset: 0; align-items: center; }
.sv-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(30px) brightness(.45); }
.sv-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; padding: calc(env(safe-area-inset-top) + 8px) 8px 26px; background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.sv-bars { display: flex; gap: 3px; }
.sv-bars span { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.sv-bars i { display: block; height: 100%; width: 0; background: #fff; }
.sv-head { display: flex; align-items: center; gap: 9px; margin-top: 10px; padding-left: 4px; }
.sv-head .avatar { width: 34px; height: 34px; font-size: 13px; }
.sv-head .uname { font-size: 14px; }
.sv-head .time { color: rgba(255, 255, 255, .75); font-size: 13px; }
.sv-head .grow { flex: 1; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sv-head .icon-btn { width: 38px; height: 38px; }
.sv-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 40px 18px calc(env(safe-area-inset-bottom) + 22px);
  background: linear-gradient(transparent, rgba(0, 0, 0, .6)); text-align: center; pointer-events: none;
}
.sv-caption p { margin: 0 0 8px; font-size: 16px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.sv-caption .chip { background: rgba(255, 255, 255, .2); color: #fff; }
.sv-owner { pointer-events: auto; display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.sv-owner button { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.sv-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .85); color: #000; display: none; place-items: center; }
@media (hover: hover) and (min-width: 600px) { .sv-nav { display: grid; } }
.sv-prev { left: calc(50% - 300px); }
.sv-next { right: calc(50% - 300px); }

/* ------------------------------------------------------------ Visionneuse photo plein écran */
.lb { position: fixed; inset: 0; z-index: 110; background: #000; color: #fff; display: flex; flex-direction: column; animation: fade .2s; color-scheme: dark; }
.lb-top { display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top) + 6px) 8px 6px 14px; font-size: 13px; color: #bbb; }
.lb-top .grow { flex: 1; }
.lb-stage { flex: 1; overflow: auto; display: grid; place-items: center; cursor: zoom-in; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-stage.full { place-items: start; cursor: zoom-out; }
.lb-stage.full img { max-width: none; max-height: none; }

/* ------------------------------------------------------------ Divers */
.comment-form .avatar { width: 32px; height: 32px; font-size: 12px; }
.btn-link.following { color: var(--muted); }
.stats button { display: block; text-align: center; }
.page-pad { padding: 16px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.post-detail .comments-inline { border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
