/* RulePlay : interface sombre et sobre. Gris anthracite neutres, un seul accent (vermillon), police système. */
:root {
    --bg: #0b0b0c;
    --bg-raised: #0f0f11;
    --surface: #141416;
    --surface-2: #1c1c1f;
    --surface-3: #26262a;
    --line: #222225;
    --line-2: #2e2e33;
    --ink: #ededea;
    --ink-2: #c4c4bf;
    --muted: #8f8f8a;
    --faint: #5e5e5a;
    --accent: #ff5a36;
    --accent-ink: #ff7b5e;
    --danger: #ff7a70;
    --type-artist: #e3a25f;
    --type-character: #5fb3e3;
    --type-copyright: #c58be8;
    --type-metadata: #d8c060;

    /* Données (palette validée sur la surface #141416) */
    --series-1: #f2502c;
    --series-2: #3987e5;
    --status-good: #0ca30c;
    --status-neutral: #6b6b67;
    --status-warning: #fab219;
    --status-critical: #d03b3b;

    --radius: 10px;
    --radius-sm: 8px;
    --gutter: 16px;
    --header-h: 112px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-2) transparent; scrollbar-width: thin; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.icon { display: inline-flex; flex: none; }
.icon svg { display: block; }
.spacer { flex: 1; }

/* ---------- En-tête ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: transform .25s ease, border-color .2s;
    padding-top: env(safe-area-inset-top);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner {
    max-width: 1480px;
    margin: 0 auto;
    padding: 8px var(--gutter) 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "logo settings" "search search";
    align-items: center;
    gap: 8px;
}
.header-inner > .logo { grid-area: logo; }
.header-inner > .search { grid-area: search; }
.header-inner > .settings { grid-area: settings; }

/* Réglages (langue, recommandations) */
.settings { position: relative; }
.settings-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2);
}
.settings-btn:hover { color: var(--ink); background: var(--surface-2); }
.settings-lang { font-size: 12.5px; font-weight: 650; letter-spacing: .02em; }
.settings-panel {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; width: 260px; padding: 6px;
    border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2);
    box-shadow: 0 12px 32px rgb(0 0 0 / .5);
}
.settings-title { padding: 8px 10px 4px; color: var(--muted); font-size: 12.5px; }
.settings-option {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 0 10px;
    border: 0; border-radius: 6px; background: none; color: var(--ink); font-size: 14px; text-align: left;
}
.settings-option:hover { background: var(--surface-3); }
.settings-name { display: inline-flex; align-items: center; gap: 10px; }
.flag { display: inline-flex; flex: none; width: 18px; height: 12px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgb(255 255 255 / .12); }
.flag svg { display: block; width: 100%; height: 100%; }
.flag-auto { align-items: center; justify-content: center; box-shadow: none; color: var(--muted); overflow: visible; }
.flag-auto .icon, .settings-option .flag-auto .icon { display: inline-flex; color: var(--muted); }
.settings-option .icon { color: var(--accent); }
.settings-sub { margin-left: 8px; color: var(--muted); font-size: 12.5px; }
.settings-sep { height: 1px; margin: 6px 4px; background: var(--line-2); }
.logo { display: inline-flex; align-items: center; height: 36px; justify-self: start; user-select: none; }

/* Logo : R vermillon + triangle de lecture blanc, suivi de « uleplay » */
.logo-lockup { display: inline-block; font-size: 22px; font-weight: 750; letter-spacing: -0.045em; line-height: 1; color: var(--ink); white-space: nowrap; }
.logo-r { display: inline-block; height: 0.74em; width: 0.68em; margin-right: 0.035em; overflow: visible; vertical-align: baseline; }
.logo-r-body { fill: var(--accent); }
.logo-r-play {
    fill: #fff; transform-box: fill-box; transform-origin: 30% 50%;
    animation: logo-play-in .7s cubic-bezier(.2, .8, .2, 1.2) .15s both;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1.4), fill .2s;
}
.logo-word { display: inline-block; }
.logo-mark { display: inline-flex; font-size: 24px; }
.logo-mark .logo-r { margin: 0; }
a.logo:hover .logo-r-play, a.admin-side-brand:hover .logo-r-play { transform: translateX(14%) scale(1.12); }
a.logo:active .logo-r { transform: scale(.94); }
body.is-busy .logo .logo-r-play { animation: logo-pulse 1.1s ease-in-out infinite; }
@keyframes logo-play-in { from { transform: translateX(-60%) scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes logo-pulse { 0%, 100% { transform: none; opacity: 1; } 50% { transform: translateX(14%) scale(.82); opacity: .55; } }

.search {
    position: relative; display: flex; align-items: center; height: 44px; min-width: 0;
    border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface);
    transition: border-color .15s, background .15s;
}
.search.focused { border-color: var(--faint); background: var(--surface-2); }
.search-field {
    flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 0;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none; cursor: text;
}
.search-field::-webkit-scrollbar { display: none; }
.search-field input {
    flex: 1 0 120px; min-width: 120px; height: 100%; padding: 0; border: 0; outline: none; background: none;
    font-size: 16px; /* évite le zoom automatique sur iOS */
}
.search-field input::placeholder { color: var(--muted); }
.search-icon { flex: none; margin: 0 10px 0 12px; color: var(--muted); pointer-events: none; }
.search-clear {
    flex: none; margin-right: 3px; width: 36px; height: 36px; display: grid; place-items: center;
    border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted);
}
.search-clear:hover { color: var(--ink); background: var(--surface-3); }

/* Puces de tags dans le champ */
.token {
    flex: none; display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 2px 0 9px;
    border-radius: 6px; background: var(--surface-3); color: var(--ink); font-size: 13.5px; white-space: nowrap;
    animation: token-in .18s ease-out;
}
.token::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--faint); }
.token[data-type="artist"]::before, .type-dot[data-type="artist"] { background: var(--type-artist); }
.token[data-type="character"]::before, .type-dot[data-type="character"] { background: var(--type-character); }
.token[data-type="copyright"]::before, .type-dot[data-type="copyright"] { background: var(--type-copyright); }
.token[data-type="metadata"]::before, .type-dot[data-type="metadata"] { background: var(--type-metadata); }
.token.negative { color: var(--danger); text-decoration: line-through; text-decoration-color: rgb(255 122 112 / .5); }
.token.negative::before { background: var(--danger); }
.token.armed { outline: 1px solid var(--accent); }
.token-label { cursor: pointer; }
.token-x { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 4px; background: none; color: var(--muted); }
.token-x:hover { background: var(--line-2); color: var(--ink); }
@keyframes token-in { from { transform: scale(.85); opacity: 0; } }
.type-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }

.suggestions {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
    margin: 0; padding: 6px; list-style: none;
    max-height: min(60vh, 380px); overflow-y: auto; overscroll-behavior: contain;
    border: 1px solid var(--line-2); border-radius: var(--radius);
    background: var(--surface-2);
    box-shadow: 0 12px 32px rgb(0 0 0 / .5);
}
.suggestions:not([hidden]) { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0 4px; }
.suggestions > li { flex: 1 0 100%; min-width: 0; }
.suggestions li[role="option"] {
    display: flex; align-items: center; gap: 8px;
    min-height: 34px; padding: 0 8px; border-radius: 6px; font-size: 14px; cursor: pointer;
}
.suggestions li[role="option"]:hover, .suggestions li[aria-selected="true"] { background: var(--surface-3); }
.suggestions li.suggest-chip {
    flex: none; min-height: 28px; margin: 2px 0; padding: 0 10px; border-radius: 999px;
    background: var(--surface-3); color: var(--ink-2); font-size: 13px; white-space: nowrap;
}
.suggestions li.suggest-chip:hover { background: var(--line-2); color: var(--ink); }
.suggest-head { display: flex; justify-content: space-between; align-items: center; height: 26px; padding: 4px 8px 0; color: var(--muted); font-size: 12px; }
.suggest-head .link-btn { font-size: 12px; }
.suggest-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-type { color: var(--muted); font-size: 12px; }
.suggest-count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.suggest-combine { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line-2); border-radius: 6px 6px 0 0 !important; margin-bottom: 2px; }
@media (pointer: coarse) {
    .suggestions li[role="option"] { min-height: 36px; }
    .suggestions li.suggest-chip { min-height: 30px; }
}
@media (max-width: 599px) {
    .suggestions { max-height: min(55vh, 360px); }
    .suggest-type { display: none; } /* la pastille de couleur suffit */
}
.suggest-combine .icon { color: var(--accent); }
.suggest-kbd { padding: 0 6px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--muted); font: 12px var(--font); }

@media (max-width: 719px) {
    .site-header.collapsed { transform: translateY(-100%); }
}
@media (min-width: 720px) {
    .header-inner { grid-template-columns: auto minmax(0, 600px) auto; grid-template-areas: "logo search settings"; justify-content: space-between; padding: 12px 24px; gap: 24px; }
    .search { height: 40px; }
    .search-field input { font-size: 14px; }
}

.notice {
    max-width: 1480px; margin: 8px auto 0; width: calc(100% - 2 * var(--gutter));
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2); font-size: 13.5px;
}

/* ---------- Mise en page ---------- */
main { max-width: 1480px; margin: 0 auto; padding: 4px var(--gutter) calc(48px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { main { padding: 8px 24px 64px; } }

/* ---------- Boutons, champs, puces ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--ink);
    font-size: 14px; font-weight: 550; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary:hover:not(:disabled) { background: #fff; }
.btn-danger { background: transparent; border-color: rgb(208 59 59 / .45); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--status-critical); border-color: var(--status-critical); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-small { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-wide { width: 100%; max-width: 340px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); }
.icon-btn:disabled { opacity: .35; }
.link-btn { border: 0; background: none; padding: 4px 2px; color: var(--ink-2); font-size: 13.5px; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }

.input {
    width: 100%; height: 44px; padding: 0 12px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--bg-raised); outline: none; font-size: 16px;
}
.input:focus { border-color: var(--accent); }
.input-small { height: 36px; font-size: 14px; max-width: 260px; }
@media (min-width: 720px) { .input { font-size: 14px; height: 40px; } }

.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select {
    appearance: none; height: 36px; padding: 0 32px 0 12px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--surface); font-size: 14px; outline: none; cursor: pointer;
}
.select:hover { border-color: var(--faint); }
.select-wrap .icon { position: absolute; right: 10px; color: var(--muted); pointer-events: none; }
.select-small .select { height: 36px; font-size: 13.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 12px;
    border: 1px solid var(--line-2); border-radius: 999px;
    background: transparent; color: var(--ink-2); font-size: 13.5px; white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-tag { background: var(--surface-2); border-color: var(--surface-2); color: var(--ink); }
.chip-tag .icon { color: var(--muted); }
.chip.negative { color: var(--danger); }
.chip-count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip-static { padding-right: 4px; background: var(--surface-2); border-color: var(--surface-2); }
.chip-x { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.chip-x:hover { background: var(--surface-3); color: var(--ink); }

.error-box { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 32px 0; }
.empty h2 { font-size: 17px; font-weight: 650; }
.empty p { color: var(--muted); max-width: 52ch; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--ink-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Catalogue ---------- */
.categories {
    display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
    border-bottom: 1px solid var(--line);
}
.categories::-webkit-scrollbar { display: none; }
.category {
    position: relative; flex: none; display: inline-flex; align-items: center; height: 44px;
    color: var(--muted); font-size: 14.5px; white-space: nowrap; transition: color .15s;
}
.category:hover { color: var(--ink); }
.category[aria-current="page"] { color: var(--ink); font-weight: 600; }
.category[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
@media (min-width: 720px) { .categories { margin: 0; padding: 0; gap: 28px; } }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 12px; }
.toolbar-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.toolbar-title h1 { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.result-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.view-catalog > .chips { padding-bottom: 16px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 14px; } }

.card {
    display: flex; flex-direction: column; gap: 6px; min-width: 0;
    -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
    touch-action: pan-y; /* le défilement vertical reste natif, le glissement horizontal sert à prévisualiser */
}
.card.no-swipe { touch-action: manipulation; }
.thumb {
    position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
    border-radius: var(--radius-sm); background: var(--surface);
    transition: transform .15s ease;
}
.thumb img, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.thumb img { opacity: 0; transition: opacity .3s; }
.thumb.loaded img { opacity: 1; }
.card:not(.skeleton) .thumb:not(.loaded) { animation: pulse 1.6s ease-in-out infinite; }
.thumb-video { opacity: 0; transition: opacity .2s; z-index: 1; background: #000; }
.thumb-video.ready { opacity: 1; }
.card:active .thumb { transform: scale(.985); }
.card.previewing .thumb { transform: none; }
@media (hover: hover) { .card:hover .thumb img { filter: brightness(1.08); } }

.thumb-badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; z-index: 2; }
.thumb-badges span, .thumb-duration, .thumb-label {
    padding: 1px 5px; border-radius: 4px; background: rgb(0 0 0 / .72); color: #fff;
    font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: .01em; font-variant-numeric: tabular-nums;
}
.thumb-duration { position: absolute; right: 6px; bottom: 6px; z-index: 2; }
.thumb-label { position: absolute; left: 6px; bottom: 6px; z-index: 2; display: inline-flex; align-items: center; gap: 3px; }
.thumb-label .icon { display: inline-flex; opacity: .8; }
.card.previewing .thumb-label { opacity: 0; }
.thumb-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 3; opacity: 0; transition: opacity .15s; }
.thumb-progress i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s linear; }
.card.previewing .thumb-progress { opacity: 1; }
.card.scrubbing .thumb-progress { height: 3px; }
.card.scrubbing .thumb-progress i { transition: none; }
.card.scrubbing .thumb-duration { background: rgb(0 0 0 / .85); }

.swipe-hint {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 14px; padding: 10px 6px 10px 14px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface);
    color: var(--ink-2); font-size: 13.5px;
}
.swipe-hint button { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.card.preview-loading .thumb-progress i { width: 30%; transform: none; animation: indeterminate 1s ease-in-out infinite; }
@keyframes indeterminate { from { margin-left: -30%; } to { margin-left: 100%; } }

.card-meta { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 2px; color: var(--muted); font-size: 12.5px; }
.card-score { display: inline-flex; align-items: center; gap: 3px; flex: none; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card-score .icon { color: var(--faint); }
.card-tags { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.skeleton .thumb { animation: pulse 1.6s ease-in-out infinite; }
.skeleton .line { display: block; height: 10px; width: 60%; margin-top: 4px; border-radius: 4px; background: var(--surface); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.sentinel { height: 1px; }

/* « Pour vous » */
.category-foryou { color: var(--accent-ink); }
.category-foryou[aria-current="page"] { color: var(--ink); }
.foryou-row { display: flex; flex-direction: column; gap: 12px; padding: 18px 0 6px; }
.foryou-row .rail {
    display: grid; grid-auto-flow: column; grid-auto-columns: 44%; grid-template-columns: none; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
}
@media (min-width: 720px) {
    .foryou-row .rail { grid-auto-columns: 240px; margin: 0; padding: 0 0 4px; gap: 14px; scrollbar-width: thin; }
}
.foryou-tastes { display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; }
.foryou-tastes .chip { gap: 8px; }
.list-footer { display: flex; justify-content: center; padding: 24px 0 8px; }
.list-footer:empty { padding: 0; }
.list-end { color: var(--faint); font-size: 13px; }

/* ---------- Lecture ---------- */
.view-watch { padding-left: 0; padding-right: 0; }
.watch-top { padding: 4px var(--gutter) 8px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; height: 36px; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--ink); }
.stage { width: 100%; }
.watch-body { padding: 16px var(--gutter) 0; display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 720px) {
    .view-watch { padding-left: 24px; padding-right: 24px; }
    .watch-top, .watch-body { padding-left: 0; padding-right: 0; }
}

.watch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.watch-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.watch-title h1 { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; overflow-wrap: anywhere; }
.watch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--muted); font-size: 13.5px; }
.watch-meta a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.watch-meta a:hover { color: var(--ink); }
.meta-score { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.watch-nav { display: flex; gap: 8px; flex: none; }

.tag-groups { display: flex; flex-direction: column; gap: 16px; }
.tag-group { display: flex; flex-direction: column; gap: 8px; }
.tag-group h2 { font-size: 13px; font-weight: 600; color: var(--muted); }
.tag-group .chip { height: 32px; font-size: 13px; }

.suggestions-wrap { display: flex; flex-direction: column; gap: 28px; padding-top: 8px; border-top: 1px solid var(--line); }
.suggestions-wrap:empty { display: none; }
.suggestions-wrap:not(:has(> .suggestion-row)) { border-top: 0; padding-top: 0; }
.suggestions-sentinel { height: 1px; }
.suggestion-row { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 16px; font-weight: 650; }
.section-head a { color: var(--muted); font-size: 13.5px; }
.section-head a:hover { color: var(--ink); }
.rail {
    display: grid; grid-auto-flow: column; grid-auto-columns: 44%; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
}
.rail::-webkit-scrollbar { display: none; }
.rail > .card { scroll-snap-align: start; }
@media (min-width: 720px) {
    .rail { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-auto-columns: unset; overflow: visible; margin: 0; padding: 0; gap: 24px 14px; }
}

/* ---------- Lecteur ---------- */
.player {
    position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 78vh;
    background: #000; overflow: hidden; user-select: none; -webkit-user-select: none; outline: none;
    color: #fff;
}
@media (min-width: 720px) { .player { border-radius: var(--radius); } }
.player-skeleton { background: var(--surface); display: grid; place-items: center; }
.player-skeleton-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--ink-2); animation: spin .8s linear infinite; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-surface { position: absolute; inset: 0; z-index: 1; touch-action: manipulation; }
.player.is-fullscreen { aspect-ratio: auto; width: 100vw; height: 100vh; max-height: none; border-radius: 0; }
.player:not(.controls-visible):not(.is-paused) { cursor: none; }

/* Voile discret en bas pour garder les commandes lisibles sur une image claire */
.player::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 96px; z-index: 2; pointer-events: none;
    background: linear-gradient(transparent, rgb(0 0 0 / .65)); opacity: 0; transition: opacity .2s;
}
.player.controls-visible::after { opacity: 1; }

.player-bar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
    padding: 0 8px calc(4px + env(safe-area-inset-bottom));
    opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.player.controls-visible .player-bar { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 720px) { .player-bar { padding: 0 12px 8px; } }

.player-progress { position: relative; height: 24px; display: flex; align-items: center; cursor: pointer; touch-action: none; margin: 0 6px; }
.bar-track { position: relative; width: 100%; height: 3px; border-radius: 2px; background: rgb(255 255 255 / .22); transition: height .12s; }
.player-progress:hover .bar-track, .player.scrubbing .bar-track, .player.touch .bar-track { height: 4px; }
.bar-buffered, .bar-played { position: absolute; inset: 0; border-radius: inherit; transform-origin: left; transform: scaleX(0); }
.bar-buffered { background: rgb(255 255 255 / .35); }
.bar-played { background: var(--accent); }
.bar-knob {
    position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
    background: #fff; transform: scale(0); transition: transform .12s;
}
.player-progress:hover .bar-knob, .player.scrubbing .bar-knob, .player.touch .bar-knob { transform: scale(1); }
.bar-bubble {
    position: absolute; bottom: 26px; transform: translateX(-50%); padding: 2px 6px; border-radius: 4px;
    background: rgb(0 0 0 / .8); font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none;
}

.player-row { display: flex; align-items: center; gap: 2px; }
.pbtn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 6px; background: none; color: #fff; }
.pbtn:hover { background: rgb(255 255 255 / .1); }
.player-time { padding: 0 6px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-spacer { flex: 1; }
.player-quality-tag { padding: 0 5px; border: 1px solid rgb(255 255 255 / .45); border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 1.5; }
.player-volume-wrap { display: flex; align-items: center; }
.player-volume { width: 72px; accent-color: #fff; margin: 0 6px 0 0; }
.player.touch .player-volume { display: none; }

.player-big {
    position: absolute; top: 50%; left: 50%; z-index: 3; width: 68px; height: 68px; margin: -34px 0 0 -34px;
    display: grid; place-items: center; border: 0; border-radius: 50%; background: rgb(0 0 0 / .55); color: #fff;
    opacity: 0; pointer-events: none; transition: opacity .15s;
}
.player-big .icon { margin-left: 4px; }
.player.is-paused:not(.is-loading) .player-big { opacity: 1; pointer-events: auto; }

.player-spinner {
    position: absolute; top: 50%; left: 50%; z-index: 3; width: 40px; height: 40px; margin: -20px 0 0 -20px;
    border-radius: 50%; border: 3px solid rgb(255 255 255 / .2); border-top-color: #fff;
    animation: spin .8s linear infinite; opacity: 0; transition: opacity .2s .3s; pointer-events: none;
}
.player.is-loading .player-spinner { opacity: 1; }

.player-flash {
    position: absolute; top: 50%; z-index: 3; display: flex; align-items: center; gap: 6px;
    padding: 10px 14px; margin-top: -22px; border-radius: 999px; background: rgb(0 0 0 / .55);
    font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none;
}
.player-flash.left { left: 12%; }
.player-flash.right { right: 12%; }
.player-flash.show { animation: flash .6s ease-out; }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

.player-toast {
    position: absolute; top: 12px; left: 50%; z-index: 5; transform: translateX(-50%);
    padding: 6px 12px; border-radius: 999px; background: rgb(0 0 0 / .75); font-size: 13px; white-space: nowrap;
}
.player-unmute {
    position: absolute; top: 12px; left: 12px; z-index: 5; display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: rgb(0 0 0 / .7); color: #fff; font-size: 13px;
}

.player-menu {
    position: absolute; right: 12px; bottom: 76px; z-index: 6; width: 228px; max-width: calc(100% - 16px); max-height: calc(100% - 92px); overflow-y: auto;
    padding: 6px; border: 1px solid rgb(255 255 255 / .1); border-radius: var(--radius); background: rgb(22 22 24 / .97);
    box-shadow: 0 12px 32px rgb(0 0 0 / .5);
}
.menu-head, .menu-toggle { display: flex; align-items: center; gap: 10px; padding: 0 6px; font-size: 13.5px; color: #fff; }
.menu-head { height: 28px; }
.menu-label { flex: 1; }
.menu-value { color: var(--accent); font-size: 13px; font-variant-numeric: tabular-nums; }
.menu-speeds { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 2px; margin: 2px 0 6px; border-radius: 8px; background: rgb(255 255 255 / .06); }
.menu-speed {
    height: 30px; min-width: 0; padding: 0; border: 0; border-radius: 6px; background: none;
    color: rgb(255 255 255 / .75); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.menu-speed:hover { background: rgb(255 255 255 / .08); color: #fff; }
.menu-speed[aria-checked="true"] { background: #fff; color: #111; font-weight: 600; }
.menu-toggle { width: 100%; height: 38px; border: 0; border-top: 1px solid rgb(255 255 255 / .08); border-radius: 0 0 6px 6px; background: none; text-align: left; }
.menu-toggle:hover { background: rgb(255 255 255 / .05); }
.menu-switch { position: relative; flex: none; width: 30px; height: 18px; border-radius: 999px; background: rgb(255 255 255 / .22); transition: background .15s; }
.menu-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.menu-toggle[aria-checked="true"] .menu-switch { background: var(--accent); }
.menu-toggle[aria-checked="true"] .menu-switch::after { transform: translateX(12px); }
.player-menu :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 599px) {
    .player-menu { right: 8px; bottom: 58px; max-height: calc(100% - 66px); }
}

/* ---------- Pied de page (présentation et liens populaires, rendu par le serveur) ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.55; }
.site-footer:empty, body[data-view="admin"] .site-footer { display: none; }
.footer-inner { max-width: 1480px; margin: 0 auto; padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.footer-about { max-width: 90ch; }
.footer-links h2 { margin-bottom: 6px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.footer-links div { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }
.footer-legal { color: var(--faint); font-size: 12px; }
main { padding-bottom: 32px; }

/* ---------- Administration ---------- */
.check-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; }
.check-list legend { margin-bottom: 4px; padding: 0; color: var(--muted); font-size: 13px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check-row input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
/* Drapeaux emoji des pays : Windows n'en affiche pas, la police Twemoji Country Flags (MIT, graphismes Twemoji
   CC-BY 4.0) les fournit ; unicode-range limite son usage (et son téléchargement) aux seuls drapeaux. */
@font-face {
    font-family: "Twemoji Country Flags";
    src: url("/fonts/TwemojiCountryFlags.woff2") format("woff2");
    unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
    font-display: swap;
}
.country { display: inline-flex; align-items: center; gap: 6px; }
.country-flag, .bar-list, .country { font-family: "Twemoji Country Flags", var(--font); }
.country-flag { font-size: 15px; line-height: 1; }
body[data-view="admin"] .site-header, body[data-view="admin"] .notice { display: none; }
.view-admin { max-width: none; padding: 0; }
.admin-loading { display: grid; place-items: center; min-height: 40vh; }

.auth-wrap { display: grid; place-items: center; min-height: 100vh; padding: 24px var(--gutter); }
.auth-card {
    width: min(100%, 380px); display: flex; flex-direction: column; gap: 16px;
    padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.auth-card-wide { width: min(100%, 440px); }
.auth-back { align-self: center; color: var(--muted); font-size: 13.5px; }
.auth-back:hover { color: var(--ink); }
.admin-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.admin-brand .logo-lockup { font-size: 20px; }
.admin-brand-sub { color: var(--muted); font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 13.5px; }
.form-error { color: var(--danger); font-size: 13.5px; }
.stack-form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.stack-form .btn { align-self: flex-start; }
.panel-wide .stack-form { max-width: 640px; }
.form-row { display: grid; gap: 14px; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.meter-row { display: flex; align-items: center; gap: 10px; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; width: 120px; }
.meter i { height: 4px; border-radius: 2px; background: var(--surface-3); }
.meter[data-score="1"] i:nth-child(-n+1) { background: var(--status-critical); }
.meter[data-score="2"] i:nth-child(-n+2) { background: var(--status-warning); }
.meter[data-score="3"] i:nth-child(-n+3) { background: var(--status-good); }
.meter[data-score="4"] i { background: var(--status-good); }

.admin { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.admin-side {
    position: sticky; top: 0; z-index: 30;
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand foot" "nav nav";
    align-items: center; gap: 4px 12px; padding: calc(8px + env(safe-area-inset-top)) var(--gutter) 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
}
.admin-side-brand { grid-area: brand; padding: 4px 0; }
.admin-nav { grid-area: nav; display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav-link { position: relative; flex: none; display: flex; align-items: center; height: 44px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.admin-nav-link:hover { color: var(--ink); }
.admin-nav-link[aria-current="page"] { color: var(--ink); font-weight: 600; }
.admin-nav-link[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.admin-side-foot { grid-area: foot; display: flex; align-items: center; gap: 8px; }
.admin-side-foot .btn { height: 36px; padding: 0 10px; }
.live-status { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.live-dot.on { background: var(--status-good); }

@media (max-width: 519px) {
    .admin-side-foot .btn { font-size: 0; gap: 0; width: 36px; padding: 0; }
    .live-status span:last-child { display: none; }
}
@media (min-width: 960px) {
    .admin { grid-template-columns: 232px minmax(0, 1fr); }
    .admin-side {
        top: 0; height: 100vh; display: flex; flex-direction: column; align-items: stretch; gap: 24px;
        padding: 20px 12px; border-bottom: 0; border-right: 1px solid var(--line); background: var(--bg-raised);
    }
    .admin-side-brand { padding: 0 8px; }
    .admin-nav { flex-direction: column; gap: 2px; margin: 0; padding: 0; overflow: visible; }
    .admin-nav-link { height: 38px; padding: 0 10px; border-radius: 6px; }
    .admin-nav-link:hover { background: var(--surface); }
    .admin-nav-link[aria-current="page"] { background: var(--surface-2); }
    .admin-nav-link[aria-current="page"]::after { left: 0; top: 9px; bottom: 9px; right: auto; width: 2px; height: auto; }
    .admin-side-foot { margin-top: auto; flex-direction: column; align-items: stretch; gap: 12px; padding: 0 8px; }
    .admin-side-foot .btn { justify-content: flex-start; }
}

.admin-main { min-width: 0; padding: 16px var(--gutter) calc(48px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) { .admin-main { padding: 24px 32px 64px; } }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.admin-head-actions { display: flex; align-items: center; gap: 8px; }
.admin-content { display: flex; flex-direction: column; gap: 16px; }
.range-note { margin-top: -6px; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; } }
.kpi { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.kpi-value { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 18px; }
.kpi-sub { color: var(--faint); font-size: 12.5px; }
.tone-bad { color: var(--danger); }
.tone-warn { color: var(--status-warning); }
.tone-good { color: #46c46a; }
.delta {
    display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: 999px;
    font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: help;
    background: rgb(255 255 255 / .06);
}
.delta svg { flex: none; }
.delta.good { color: #46c46a; background: rgb(70 196 106 / .12); }
.delta.bad { color: var(--danger); background: rgb(255 122 112 / .12); }
.delta.neutral { color: var(--muted); }
.sub-delta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.kpi-main { align-items: center; }
.sparkline .line { fill: none; stroke: var(--series-1); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1100px) {
    .admin-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 720px) and (max-width: 1099px) { .admin-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 15px; font-weight: 600; }
.panel-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.panel-foot { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-raised); }
.segmented button { height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 13px; white-space: nowrap; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-checked="true"] { background: var(--surface-3); color: var(--ink); font-weight: 600; }

.status-list { display: flex; flex-direction: column; gap: 14px; }
.status-line { display: flex; align-items: flex-start; gap: 10px; }
.status-line .status-dot { margin-top: 7px; }
.status-text { display: flex; flex-direction: column; min-width: 0; }
.status-name { font-size: 14px; font-weight: 550; }
.status-detail { color: var(--muted); font-size: 13px; }
.status-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--status-neutral); }
.status-dot.ok { background: var(--status-good); }
.status-dot.warn { background: var(--status-warning); }
.status-dot.down { background: var(--status-critical); }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .status-dot { margin-top: 7px; }
.feed-item div { display: flex; flex-direction: column; min-width: 0; }
.feed-title { font-weight: 550; }
.feed-meta { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item time, td time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.facts { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Graphiques */
.chart { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 12.5px; }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chart-area { position: relative; }
.chart-plot { width: 100%; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .gridline { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { stroke: var(--line-2); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .area { fill-opacity: .1; }
.chart-svg .crosshair { stroke: var(--faint); stroke-width: 1; }
.chart-svg .dot { stroke: var(--surface); stroke-width: 2; }
.chart-svg .hit { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.chart-tooltip {
    position: absolute; z-index: 5; min-width: 140px; padding: 8px 10px; pointer-events: none;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2);
    box-shadow: 0 8px 24px rgb(0 0 0 / .45); font-size: 12.5px;
}
.tt-time { color: var(--muted); margin-bottom: 4px; white-space: nowrap; }
.tt-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tt-row strong { font-variant-numeric: tabular-nums; }
.tt-row span { color: var(--ink-2); }
.chart-table summary { color: var(--faint); font-size: 12.5px; cursor: pointer; width: fit-content; }
.chart-table summary:hover { color: var(--ink-2); }
.chart-table .table-scroll { max-height: 260px; margin-top: 8px; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }

.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; margin-bottom: 4px; }
.bar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.bar-label:hover { text-decoration: underline; text-underline-offset: 3px; }
.bar-value { flex: none; font-variant-numeric: tabular-nums; }
.bar-share { margin-left: 8px; color: var(--faint); font-size: 12px; }
.bar-track-h { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar-track-h i { display: block; height: 100%; border-radius: 3px; background: var(--series-1); transform-origin: left; }

/* Tableaux */
.table-scroll { overflow-x: auto; min-width: 0; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; text-align: left; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.data-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: var(--surface-2); }
.data-table tr.row-bad td:first-child { box-shadow: inset 2px 0 0 var(--status-critical); }
.data-table tr.row-warn td:first-child { box-shadow: inset 2px 0 0 var(--status-warning); }
.path-cell { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-row td { background: var(--bg-raised); cursor: default; }
.detail-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 0 0 10px; font-size: 13px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.detail-actions, .row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.detail-actions { justify-content: flex-start; }
.table-empty { padding: 8px 0; }
.live-table { max-height: 70vh; overflow: auto; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.http-status { display: inline-block; min-width: 38px; padding: 1px 6px; border-radius: 4px; text-align: center; font-family: var(--mono); font-size: 12px; font-weight: 600; background: var(--surface-2); }
.http-status.s2 { color: #46c46a; }
.http-status.s3 { color: var(--ink-2); }
.http-status.s4 { color: var(--status-warning); }
.http-status.s5 { color: #ff6b6b; }
.country { font-family: var(--mono); font-size: 12.5px; }
.badge { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; line-height: 1.6; vertical-align: 1px; }
.audit-type { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.video-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.video-cell img, .video-cell-ph { width: 72px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--surface-2); flex: none; }
.video-cell span { display: flex; flex-direction: column; min-width: 0; }
.video-cell strong { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.video-cell:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.progress-cell { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }
@media (max-width: 719px) { .hide-sm { display: none; } }

.admin-toasts { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 100; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.admin-toast {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; pointer-events: auto;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); box-shadow: 0 8px 24px rgb(0 0 0 / .5); font-size: 14px;
}
.admin-toast.error { border-color: rgb(208 59 59 / .6); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------
   Avertissement d'âge
   --------------------------------------------------------------- */
body.age-locked { overflow: hidden; }
body.age-locked .site-header, body.age-locked #app { filter: blur(14px); pointer-events: none; user-select: none; }
.age-gate {
    position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    background: rgb(11 11 12 / 0.78);
}
.age-card {
    width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px;
    padding: 28px 24px 24px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface);
}
.age-brand { display: flex; align-items: center; justify-content: space-between; font-size: 20px; }
.age-badge {
    display: inline-grid; place-items: center; min-width: 42px; height: 28px; padding: 0 8px;
    border: 1.5px solid var(--accent); border-radius: 6px; color: var(--accent-ink); font-weight: 700; font-size: 14px;
}
.age-card h1 { margin: 6px 0 0; font-size: 20px; line-height: 1.25; }
.age-card p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.age-card .age-confirm { color: var(--muted); font-size: 13.5px; }
.age-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.age-actions .btn-wide { max-width: none; justify-content: center; }
.age-leave { text-decoration: none; }

/* ---------------------------------------------------------------
   Contenu envoyé par le serveur (lisible sans JavaScript, remplacé au démarrage de l'application)
   --------------------------------------------------------------- */
/* Contenu pour moteurs et navigateurs sans JavaScript : masqué ici, affiché par noscript.css */
.ssr { display: none; max-width: 1280px; margin: 0 auto; padding: 16px var(--gutter) 48px; }
.boot-tabs { height: 44px; margin: 0 calc(-1 * var(--gutter)); border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .boot-tabs { margin: 0; } }
.boot-line { display: block; height: 12px; width: 70%; border-radius: 4px; background: var(--surface); animation: pulse 1.6s ease-in-out infinite; }
.boot-title { height: 20px; width: 160px; max-width: 50%; }
.boot-back { width: 70px; height: 14px; margin: 11px 0; }
.boot-short { width: 40%; }
.boot-pill { display: inline-block; height: 32px; width: 92px; border-radius: 999px; background: var(--surface); animation: pulse 1.6s ease-in-out infinite; }
.boot-chips { display: flex; gap: 8px; padding-bottom: 16px; }
.boot-chips .boot-pill { width: 72px; }
.watch-skeleton { display: flex; flex-direction: column; gap: 10px; }
.ssr h1 { font-size: 22px; margin: 8px 0; }
.ssr h2 { font-size: 15px; margin: 28px 0 10px; color: var(--ink-2); }
.ssr-lead { color: var(--muted); max-width: 70ch; line-height: 1.5; }
.ssr-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.ssr-grid a { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); text-decoration: none; font-size: 13px; }
.ssr-grid img, .ssr-poster { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.ssr-poster { max-width: 640px; display: block; margin: 12px 0; }
.ssr-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ssr-chips a { display: inline-block; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; text-decoration: none; }

/* ---------------------------------------------------------------
   Panel : double authentification, adresse secrète
   --------------------------------------------------------------- */
.input-code { font-family: var(--mono); font-size: 20px; letter-spacing: 0.18em; max-width: 180px; }
.secret-key { display: block; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-family: var(--mono); font-size: 15px; letter-spacing: 0.06em; word-break: break-all; user-select: all; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); line-height: 1.5; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.disclosure summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 4px 0; }
.disclosure[open] summary { margin-bottom: 12px; }
.view-notfound .empty { padding: 64px var(--gutter); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------
   Menu de tri (liste déroulante aux couleurs du site) et « Mélanger »
   --------------------------------------------------------------- */
.select option { background: var(--surface-2); color: var(--ink); }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dropdown { position: relative; }
.dropdown-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface);
    color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}
.dropdown-btn:hover { border-color: var(--faint); background: var(--surface-2); }
.dropdown-btn .icon { color: var(--muted); transition: transform 0.15s ease; }
.dropdown-btn[aria-expanded="true"] { border-color: var(--faint); background: var(--surface-2); }
.dropdown-btn[aria-expanded="true"] .icon { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 190px;
    margin: 0; padding: 6px; list-style: none;
    border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2);
    box-shadow: 0 12px 32px rgb(0 0 0 / 0.45);
}
.dropdown-option {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 40px; padding: 0 10px; border-radius: 6px; color: var(--ink-2); font-size: 14px; cursor: pointer; outline: none;
}
.dropdown-option:hover, .dropdown-option:focus-visible { background: var(--surface-3); color: var(--ink); }
.dropdown-option[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.dropdown-option[aria-selected="true"] .icon { color: var(--accent); }
.btn-shuffle { height: 36px; gap: 6px; padding: 0 12px; font-size: 14px; }
.btn-shuffle .icon { color: var(--accent-ink); }
@media (max-width: 420px) { .btn-shuffle span:not(.icon) { display: none; } .btn-shuffle { padding: 0 9px; } }

/* Miniature noire remplacée par une image de la vidéo (sous la preview, au-dessus de la miniature) */
.thumb .thumb-frame { opacity: 0; transition: opacity .3s; background: transparent; }
.thumb .thumb-frame.ready { opacity: 1; z-index: 1; }
