/* ==========================================================================
   RCS Analyse vidéo — styles communs
   Toutes les couleurs sont centralisées ici : ajuster la palette du club ici.
   ========================================================================== */

@font-face {
    font-family: "Oswald";
    src: url("../fonts/oswald-latin-wght.woff2") format("woff2");
    font-weight: 200 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Palette club */
    --rcs-black: #111111;
    --rcs-black-2: #1E1E1E;
    --rcs-yellow: #FFD100;
    --rcs-yellow-dark: #E0B400;
    --rcs-offwhite: #F7F7F2;
    --rcs-grey: #8A8A8A;

    /* Tonalités des clips */
    --tone-positive: #22A55B;
    --tone-negative: #E5484D;
    --tone-neutral: #8A8A8A;

    /* Typo */
    --font-display: "Oswald", "Barlow Condensed", "Arial Narrow", sans-serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

    /* Échelle */
    --radius: 8px;
    --radius-sm: 5px;
    --gap: 16px;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    --focus: 0 0 0 3px rgba(255, 209, 0, .45);
}

/* Thème sombre (admin) */
.theme-dark {
    --bg: var(--rcs-black);
    --surface: var(--rcs-black-2);
    --surface-2: #2A2A2A;
    --border: #333333;
    --text: var(--rcs-offwhite);
    --text-muted: #A3A39C;
    --accent: var(--rcs-yellow);
    --accent-hover: var(--rcs-yellow-dark);
    --on-accent: var(--rcs-black);
    color-scheme: dark;
}

/* Thème clair (vue publique, impression) */
.theme-light {
    --bg: var(--rcs-offwhite);
    --surface: #FFFFFF;
    --surface-2: #EFEFE8;
    --border: #DCDCD3;
    --text: var(--rcs-black);
    --text-muted: #5E5E58;
    --accent: var(--rcs-yellow);
    --accent-hover: var(--rcs-yellow-dark);
    --on-accent: var(--rcs-black);
    color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font-body);
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg, video { max-width: 100%; }
code { font-family: var(--font-mono); font-size: .9em; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.h1, .h2, .h3 {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: .02em;
    line-height: 1.15;
    margin: 0 0 .4em;
}
.h1 { font-size: 2rem; font-weight: 700; }
.h2 { font-size: 1.5rem; font-weight: 600; }
.h3 { font-size: 1.15rem; font-weight: 600; }
.muted { color: var(--text-muted); }

/* ---------- Barre du haut ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 24px;
    background: #000;
    border-bottom: 3px solid var(--rcs-yellow);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 42px; height: 46px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-family: var(--font-display); text-transform: uppercase; }
.brand-text strong { font-size: 1.1rem; color: var(--rcs-yellow); letter-spacing: .04em; }
.brand-text small { font-size: .75rem; color: var(--text-muted); letter-spacing: .12em; }

.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 500;
}
.mainnav a:hover { background: var(--surface); text-decoration: none; }
.mainnav a.is-active { color: var(--rcs-yellow); box-shadow: inset 0 -3px 0 var(--rcs-yellow); border-radius: 0; }
.topbar-logout { margin: 0; }

@media (max-width: 640px) {
    .topbar { gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
    .brand-text small { display: none; }
    .mainnav { order: 3; flex-basis: 100%; }
}

/* ---------- Mise en page ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; }
.page-wide { max-width: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); flex-wrap: wrap; margin-bottom: 20px; }
.page-head .h1 { margin: 0; }
@media (max-width: 640px) { .page { padding: 20px 16px 48px; } }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.card-flush { padding: 0; overflow: hidden; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: 600 .95rem/1.2 var(--font-display);
    text-transform: uppercase;
    letter-spacing: .05em;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; color: var(--tone-negative); border-color: var(--tone-negative); }
.btn-danger:hover:not(:disabled) { background: var(--tone-negative); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: .8rem; }
.btn-block { width: 100%; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .8rem;
    color: var(--text-muted);
}
input[type="text"], input[type="password"], input[type="date"], input[type="number"],
input[type="search"], input[type="color"], select, textarea {
    width: 100%;
    padding: 9px 11px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
textarea { resize: vertical; min-height: 80px; }

/* ---------- Messages ---------- */
.flash {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 4px solid var(--text-muted);
    background: var(--surface-2);
}
.flash-success { border-left-color: var(--tone-positive); }
.flash-error { border-left-color: var(--tone-negative); }
.flash-warning { border-left-color: var(--rcs-yellow); }

.empty-state { text-align: center; padding: 48px 20px; }
.empty-code { font: 700 4rem/1 var(--font-display); color: var(--accent); margin: 0 0 12px; }

/* ---------- Tableaux ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th {
    font: 500 .8rem var(--font-display);
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    background: var(--surface-2);
}
.table tr:last-child td { border-bottom: 0; }
.col-narrow { width: 1%; white-space: nowrap; }

/* ---------- Pastilles ---------- */
.cat-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cat, var(--rcs-grey));
    margin-right: 10px;
    vertical-align: -1px;
}

/* ---------- Liste des matchs ---------- */
.match-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.match-card { border-top: 3px solid var(--accent); }
.match-date { font: 500 .8rem var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 4px; }
.score { font: 700 1.6rem var(--font-display); margin-top: 8px; }

/* ---------- Connexion ---------- */
.layout-bare {
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, transparent 0 48%, rgba(255, 209, 0, .06) 48% 52%, transparent 52%) 0 0 / 60px 60px,
        var(--bg);
}
.bare { width: 100%; max-width: 420px; padding: 24px 16px; }
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--rcs-yellow);
    border-radius: var(--radius);
    padding: 32px 28px;
    text-align: center;
    box-shadow: var(--shadow);
}
.login-card .form { text-align: left; margin-top: 20px; }
.login-logo { width: 140px; height: auto; display: block; margin: 0 auto 12px; }
.login-title { font: 700 1.6rem var(--font-display); text-transform: uppercase; letter-spacing: .06em; margin: 0; color: var(--rcs-yellow); }
.login-sub { margin: 2px 0 0; color: var(--text-muted); font-family: var(--font-display); text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; }

/* ==========================================================================
   Composants communs (étapes 2+)
   ========================================================================== */

.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.padded { padding: 16px 20px; }
.padded-x { padding-left: 20px; padding-right: 20px; }
.text-danger { color: var(--tone-negative); }
.text-ok { color: var(--tone-positive); }
.inline-form { display: inline; margin: 0; }
[hidden] { display: none !important; }
kbd {
    display: inline-block;
    min-width: 1.5em;
    padding: 0 .35em;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    font: 600 .75em/1.5 var(--font-mono);
    text-align: center;
    background: var(--bg);
    color: var(--text);
}
.btn kbd { background: transparent; border-color: currentColor; opacity: .7; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.btn-icon { padding: 6px 9px; min-width: 32px; }
.btn.is-disabled { opacity: .45; }
.btn-group { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.form-narrow { max-width: 760px; }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.crumbs { font-size: .85rem; color: var(--text-muted); margin-bottom: 14px; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 6px; opacity: .6; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head .h2, .section-head .h3 { margin: 0; }
.section-head.padded { margin: 0; border-bottom: 1px solid var(--border); }
.count-badge {
    display: inline-block; min-width: 1.6em; padding: 0 .45em; margin-left: 4px;
    border-radius: 999px; background: var(--surface-2); color: var(--text-muted);
    font: 600 .75em/1.6 var(--font-body); text-align: center; vertical-align: middle;
}

/* Contrôles segmentés (radios) */
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px 14px; font-size: .9rem; border-right: 1px solid var(--border); background: var(--bg); transition: background-color .12s; }
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.segmented input:focus-visible + span { box-shadow: inset var(--focus); }
.segmented-sm span { padding: 8px 12px; min-width: 38px; text-align: center; }
.tones { display: flex; }
.tones label { flex: 1; text-align: center; }
.tone-opt-positive input:checked + span { background: var(--tone-positive); color: #fff; }
.tone-opt-negative input:checked + span { background: var(--tone-negative); color: #fff; }
.tone-opt-neutral input:checked + span { background: var(--tone-neutral); color: #fff; }

/* Tonalités / priorité / puces */
.tone-positive { --tone: var(--tone-positive); }
.tone-negative { --tone: var(--tone-negative); }
.tone-neutral { --tone: var(--tone-neutral); }
.tone {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font: 600 .75rem/1.5 var(--font-body); text-transform: uppercase; letter-spacing: .03em; color: #fff;
    background: var(--tone, var(--tone-neutral)); white-space: nowrap;
}
.tone-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--tone, var(--tone-neutral)); flex: none; }
.prio {
    display: inline-block; padding: 0 6px; border-radius: 4px; margin-left: 6px;
    font: 700 .7rem/1.6 var(--font-body); vertical-align: middle; white-space: nowrap;
}
.prio-1 { background: var(--rcs-yellow); color: var(--rcs-black); }
.chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); font-size: .82rem; white-space: nowrap;
}
.chip-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 1rem; line-height: 1; opacity: .6; }
.chip-x:hover { opacity: 1; color: var(--tone-negative); }

/* Champ de tags */
.tags {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    padding: 6px 8px; min-height: 42px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg); cursor: text;
}
.tags:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.tags-chips { display: contents; }
.tags input.tags-text { flex: 1; width: auto; min-width: 120px; border: 0; padding: 4px; background: transparent; box-shadow: none; }

/* Notifications */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
    padding: 10px 16px; border-radius: var(--radius-sm); background: #000; color: var(--rcs-offwhite);
    border-left: 4px solid var(--rcs-grey); box-shadow: var(--shadow); font-size: .92rem;
    opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s;
}
.toast.is-in { opacity: 1; transform: none; }
.toast-success { border-left-color: var(--tone-positive); }
.toast-error { border-left-color: var(--tone-negative); }
.toast-info { border-left-color: var(--rcs-yellow); }

/* ---------- Liste des matchs ---------- */
a.match-card { display: block; color: var(--text); transition: border-color .15s, transform .15s; }
a.match-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.match-card.is-win { border-top-color: var(--tone-positive); }
.match-card.is-loss { border-top-color: var(--tone-negative); }
.match-card-top { display: flex; justify-content: space-between; gap: 8px; }
.match-card-title { margin: 4px 0 2px; }
.match-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-muted); }

/* ---------- Page match ---------- */
.match-head { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center; margin-bottom: 20px; border-left: 4px solid var(--accent); }
.match-head.is-win { border-left-color: var(--tone-positive); }
.match-head.is-loss { border-left-color: var(--tone-negative); }
.match-head .h1 { margin: 2px 0 0; }
.match-head-score { font: 700 2.6rem/1 var(--font-display); color: var(--accent); }
.match-head-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.match-notes { color: var(--text-muted); margin: 8px 0 0; font-size: .92rem; }
.match-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; align-items: start; }
@media (max-width: 960px) { .match-grid { grid-template-columns: 1fr; } }

.video-list { list-style: none; margin: 12px 0; padding: 0; counter-reset: vid; display: flex; flex-direction: column; gap: 8px; }
.video-row {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
    padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
    counter-increment: vid;
}
.video-row.is-broken { border-style: dashed; opacity: .8; }
.video-pos::before { content: counter(vid); font: 700 1.2rem var(--font-display); color: var(--accent); }
.video-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.video-info .input-label { padding: 5px 8px; }
.video-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.video-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.clock-field { display: flex; flex-direction: column; gap: 2px; }
.clock-field .field-label { font-size: .68rem; }
input.input-clock { width: 76px; text-align: center; font-family: var(--font-mono); padding: 5px 6px; }
.drag-handle { cursor: grab; color: var(--text-muted); user-select: none; letter-spacing: -3px; padding: 4px 2px; font-weight: 700; }
.drag-handle:active { cursor: grabbing; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow); }
@media (max-width: 640px) {
    .video-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .video-pos { display: none; }
    .clock-field { grid-column: 2; }
}

.dropzone {
    border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center;
    transition: border-color .15s, background-color .15s;
}
.dropzone p { margin: 4px 0; }
.dropzone.is-over { border-color: var(--accent); background: rgba(255, 209, 0, .06); }
.upload-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.upload-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.upload-row-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-pct { font: 600 .9rem var(--font-mono); }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upload-row.is-done .progress-bar { background: var(--tone-positive); }
.upload-row.is-error { border-color: var(--tone-negative); }
.upload-row.is-error .progress-bar { background: var(--tone-negative); }
.upload-row.is-error > .muted { color: var(--tone-negative); }

.report-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.report-list li { display: flex; align-items: center; gap: 8px; }
.report-link { flex: 1; display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--bg); }
.report-link:hover { border-color: var(--accent); text-decoration: none; }
.new-report { padding-top: 14px; border-top: 1px solid var(--border); gap: 10px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; padding: 6px 9px; font-size: .88rem; }
.filters input[type="search"] { flex: 1; min-width: 140px; }
.clip-table td { vertical-align: top; }
@media (max-width: 760px) {
    .clip-table thead { display: none; }
    .clip-table tr { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
    .clip-table td { padding: 0; border: 0; }
    .clip-table td:first-child { grid-row: span 4; }
}

/* ---------- Catégories ---------- */
.cat-card { max-width: 760px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.cat-row input.cat-name { background: transparent; border-color: transparent; font-weight: 500; }
.cat-row input.cat-name:hover { border-color: var(--border); }
.cat-row input.cat-name:focus { background: var(--bg); border-color: var(--accent); }
input[type="color"] { width: 38px; height: 34px; padding: 2px; cursor: pointer; flex: none; }
.cat-new { display: flex; gap: 10px; align-items: center; padding: 14px; background: var(--surface-2); }
.cat-new input[type="text"] { flex: 1; }

/* ---------- Lecteur MatchPlayer (commun) ---------- */
.mp { position: relative; background: #000; overflow: hidden; }
.mp-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; visibility: hidden; background: #000; }
.mp-video.is-active { visibility: visible; }

/* ---------- Barre de timeline (zoomable) ---------- */
.tl { position: relative; user-select: none; display: flex; flex-direction: column; gap: 6px; }
.tl-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-bar-label { font: 600 .72rem var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.tl-bar .btn-sm { padding: 3px 9px; }
.tl-bar-spacer { flex: 1; }
.tl-range { font-size: .8rem; color: var(--text); }
.tl.is-zoomed .tl-range { color: var(--accent); }
.tl-bar-hint { font-size: .75rem; }
@media (max-width: 900px) { .tl-bar-hint { display: none; } }

/* Vue d'ensemble : tout le match, cadre = partie affichée */
.tl-overview { position: relative; height: 10px; border-radius: 3px; background: var(--surface-2); cursor: pointer; display: none; touch-action: none; }
.tl.is-zoomed .tl-overview { display: block; }
.tl-ov-markers { position: absolute; inset: 2px 0; pointer-events: none; }
.tl-ov-marker { position: absolute; top: 0; bottom: 0; background: var(--mk); opacity: .55; border-radius: 1px; }
.tl-ov-marker.is-active { opacity: 1; }
.tl-ov-window { position: absolute; top: -2px; bottom: -2px; border: 2px solid var(--accent); border-radius: 3px; background: rgba(255, 209, 0, .12); cursor: grab; }
.tl-ov-head { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }

.tl-main { position: relative; padding-top: 18px; overflow: hidden; border-radius: 4px; touch-action: none; }
.tl-markers { position: absolute; top: 0; left: 0; right: 0; height: 15px; }
.tl-marker {
    position: absolute; top: 1px; height: 13px; border: 0; padding: 0 4px; border-radius: 3px;
    background: var(--mk); opacity: .75; cursor: pointer; overflow: hidden;
    color: #111; font: 600 .66rem/13px var(--font-body); text-align: left; white-space: nowrap; text-overflow: ellipsis;
}
.tl-marker:hover, .tl-marker.is-active { opacity: 1; box-shadow: inset 0 0 0 2px #fff; z-index: 2; }
.tl-track { position: relative; height: 34px; background: var(--surface-2); border-radius: 4px; cursor: pointer; overflow: hidden; }
.tl-ticks { position: absolute; inset: 0; pointer-events: none; }
.tl-tick { position: absolute; bottom: 0; width: 1px; background: rgba(255, 255, 255, .18); }
.tl-tick.is-minor { height: 6px; }
.tl-tick.is-major { height: 12px; background: rgba(255, 255, 255, .45); }
.tl-tick span { position: absolute; bottom: 13px; left: 3px; font: .66rem var(--font-mono); color: var(--text-muted); white-space: nowrap; }
.tl-progress { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 209, 0, .14); pointer-events: none; }
.tl-head { position: absolute; top: 14px; bottom: 0; width: 3px; margin-left: -1px; background: var(--rcs-yellow); border-radius: 2px; pointer-events: none; box-shadow: 0 0 6px rgba(0, 0, 0, .6); z-index: 4; }
.tl-head::before { content: ""; position: absolute; top: -5px; left: -4px; border: 5.5px solid transparent; border-top-color: var(--rcs-yellow); }
.tl-boundaries { position: absolute; inset: 0; pointer-events: none; }
.tl-boundary { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bg); }
.tl-selection { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, .16); border-left: 2px solid var(--tone-positive); border-right: 2px solid var(--tone-negative); min-width: 2px; pointer-events: none; z-index: 2; }
.tl-selection.is-point { border-right: 0; background: none; }
.tl-edge { position: absolute; top: 0; bottom: 0; width: 14px; pointer-events: auto; cursor: ew-resize; touch-action: none; }
.tl-edge::after { content: ""; position: absolute; top: 8px; bottom: 8px; width: 4px; border-radius: 2px; left: 5px; opacity: .9; }
.tl-edge-in { left: -8px; }
.tl-edge-in::after { background: var(--tone-positive); }
.tl-edge-out { right: -8px; }
.tl-edge-out::after { background: var(--tone-negative); }
.tl-edge:hover::after { top: 3px; bottom: 3px; width: 6px; left: 4px; }
/* Hors du clip verrouillé : hachuré, inaccessible */
.tl-outside {
    position: absolute; top: 0; bottom: 0; z-index: 1; pointer-events: none;
    background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, .55) 0 6px, rgba(0, 0, 0, .35) 6px 12px);
}
.tl-tip { position: absolute; top: 0; transform: translateX(-50%); padding: 1px 7px; border-radius: 4px; background: #000; color: #fff; font: .74rem var(--font-mono); white-space: nowrap; pointer-events: none; z-index: 6; }

/* ---------- Dessins sur la vidéo ---------- */
.dw-layer {
    position: absolute; z-index: 3; overflow: visible; pointer-events: none;
    opacity: 0; transition: opacity .3s ease;
}
.dw-layer.is-visible { opacity: 1; }
.dw-layer.is-fading { opacity: 0; }
.dw-layer.is-editing { pointer-events: auto; cursor: crosshair; opacity: 1; touch-action: none; }
.dw-handle { fill: #fff; stroke: #0A84FF; }
.dw-text text { font-family: var(--font-display); font-weight: 600; letter-spacing: .02em; }
.dw-text-input {
    position: absolute; z-index: 5; transform: translate(-50%, -50%); resize: none; overflow: hidden;
    min-height: 0; padding: .1em .35em; margin: 0; border: 2px dashed #4DA3FF; border-radius: .22em;
    background: rgba(0, 0, 0, .7); font-family: var(--font-display); font-weight: 600; line-height: 1.15;
    text-align: center; white-space: pre; outline: none; box-shadow: none;
}
.dw-handle-curve { fill: #0A84FF; stroke: #fff; }
.dw-sel-box, .dw-sel-wire { fill: none; stroke: #fff; opacity: .85; }
.dw-hint {
    position: absolute; z-index: 4; left: 50%; bottom: 7%; transform: translateX(-50%);
    display: grid; place-items: center; width: clamp(48px, 6vw, 84px); height: clamp(34px, 4vw, 56px); padding: 0;
    border-radius: 999px; border: 2px solid var(--rcs-yellow); background: rgba(0, 0, 0, .75); color: var(--rcs-yellow);
    cursor: pointer; animation: dw-pulse 1.6s ease-in-out infinite;
}
.dw-hint svg { width: 58%; height: auto; }
.dw-hint:hover { background: rgba(0, 0, 0, .9); }
@keyframes dw-pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 209, 0, .25); } }
