/* Bibliothèque vidéo — présentation inspirée de YouTube (couleurs, formes, typographie). */
.ytv, .ytv-strip { --yt-bg: #fff; --yt-text: #0f0f0f; --yt-mute: #606060; --yt-chip: rgba(0,0,0,.05); --yt-chip-h: rgba(0,0,0,.1); --yt-line: rgba(0,0,0,.1); --yt-red: #f00; }
.ytv { display: flex; align-items: flex-start; gap: 0; background: var(--yt-bg); color: var(--yt-text);
    font-family: Roboto, Arial, sans-serif; font-size: 14px; line-height: 1.4; min-height: 70vh; }
.ytv a { color: inherit; text-decoration: none; }
.ytv a:hover { text-decoration: none; }
.ytv h1, .ytv h3 { font-family: Roboto, Arial, sans-serif; letter-spacing: 0; text-transform: none; }

/* Menu latéral */
.ytv-guide { position: sticky; top: calc(var(--header-h, 64px) + 8px); flex: 0 0 240px; width: 240px; max-height: calc(100vh - var(--header-h, 64px) - 16px); overflow-y: auto; padding: 12px; scrollbar-width: thin; }
.ytv-gi { display: flex; align-items: center; gap: 24px; height: 40px; padding: 0 12px; border-radius: 10px; font-size: 14px; color: var(--yt-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ytv-gi:hover { background: var(--yt-chip); }
.ytv-gi.is-on { background: var(--yt-chip); font-weight: 500; }
.ytv-gi svg { flex: 0 0 auto; }
.ytv-gi span { overflow: hidden; text-overflow: ellipsis; }
.ytv-guide hr { border: 0; border-top: 1px solid var(--yt-line); margin: 12px 0; }
.ytv-gt { margin: 4px 12px 6px; font-size: 16px; font-weight: 500; }

/* Colonne principale */
.ytv-main { flex: 1 1 auto; min-width: 0; padding: 0 24px 48px; }
.ytv-top { display: flex; align-items: center; gap: 24px; padding: 14px 0 6px; }
.ytv-brand { display: inline-flex; align-items: center; gap: 6px; font-size: 19px; font-weight: 700; letter-spacing: -.6px; white-space: nowrap; }
.ytv-brand sup { font-size: 10px; font-weight: 400; color: var(--yt-mute); margin-left: 2px; letter-spacing: 0; }
.ytv-brand-play { display: inline-grid; place-items: center; width: 30px; height: 21px; border-radius: 6px; background: var(--yt-red); }
.ytv-search { display: flex; flex: 0 1 640px; margin: 0 auto; height: 40px; }
.ytv-search input { flex: 1; min-width: 0; height: 40px; padding: 0 4px 0 16px; border: 1px solid #ccc; border-right: 0; border-radius: 40px 0 0 40px; font: inherit; font-size: 16px; color: var(--yt-text); background: #fff; box-shadow: inset 0 1px 2px #eee; outline: none; }
.ytv-search input:focus { border-color: #1c62b9; box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.ytv-search button { width: 64px; height: 40px; border: 1px solid #d3d3d3; border-radius: 0 40px 40px 0; background: #f8f8f8; color: var(--yt-text); cursor: pointer; display: grid; place-items: center; }
.ytv-search button:hover { background: #f0f0f0; box-shadow: 0 1px 0 rgba(0,0,0,.1); }

/* Filtres « chips » */
.ytv-chips { position: sticky; top: var(--header-h, 64px); z-index: 4; display: flex; gap: 12px; padding: 12px 0; background: var(--yt-bg); overflow-x: auto; scrollbar-width: none; }
.ytv-chips::-webkit-scrollbar { display: none; }
.ytv-chip { flex: 0 0 auto; display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--yt-chip); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s; }
.ytv-chip:hover { background: var(--yt-chip-h); }
.ytv-chip.is-on, .ytv-chip.is-on:hover { background: var(--yt-text); color: #fff !important; }
.ytv-chips.is-small { position: static; padding: 0 0 12px; gap: 8px; }
.ytv-h1 { margin: 8px 0 18px; font-size: 20px; font-weight: 700; line-height: 28px; }

/* Grille de vignettes */
.ytv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 16px; }
.ytv-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #e5e5e5; }
.ytv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.ytv-card:hover .ytv-thumb { border-radius: 0; transition: border-radius .2s .1s; }
.ytv-dur { position: absolute; right: 8px; bottom: 8px; padding: 1px 4px; border-radius: 4px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px; font-weight: 500; line-height: 18px; letter-spacing: .3px; }
.ytv-info { display: flex; gap: 12px; padding-top: 12px; }
.ytv-avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #0f0f0f; color: #fff; font-weight: 500; font-size: 16px; }
.ytv-avatar.is-lg { flex-basis: 40px; width: 40px; height: 40px; font-size: 18px; }
.ytv-text { min-width: 0; }
.ytv-title { margin: 0 0 4px; font-size: 16px; font-weight: 500; line-height: 22px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ytv-meta { margin: 0; color: var(--yt-mute); font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ytv-prod { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 8px; border-radius: 6px; background: var(--yt-chip); color: var(--yt-text) !important; font-size: 12px; font-weight: 500; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ytv-prod:hover { background: var(--yt-chip-h); }
.ytv-pager { margin-top: 36px; }
.ytv-empty { padding: 60px 0; text-align: center; color: var(--yt-mute); }

/* Boutons « pilule » */
.ytv-pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: 18px; background: var(--yt-chip); color: var(--yt-text) !important; font: 500 14px/36px Roboto, Arial, sans-serif; white-space: nowrap; cursor: pointer; }
.ytv-pill:hover { background: var(--yt-chip-h); }
.ytv-pill.is-dark { background: var(--yt-text); color: #fff !important; }
.ytv-pill.is-dark:hover { background: #272727; }
.ytv-pill.is-block { display: flex; width: 100%; margin-top: 8px; border: 1px solid var(--yt-line); background: none; color: #065fd4 !important; }

/* Page de lecture */
.ytv-watch-page { display: block; }
.ytv-watch { display: grid; grid-template-columns: minmax(0, 1fr) 402px; gap: 24px; max-width: 1754px; margin: 0 auto; padding: 24px 24px 48px; }
.ytv-player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.ytv-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ytv-wtitle { margin: 12px 0 0; font-size: 20px; font-weight: 700; line-height: 28px; word-break: break-word; }
.ytv-owner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.ytv-owner-l, .ytv-owner-r { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ytv-owner-r { gap: 8px; }
.ytv-owner-txt { display: flex; flex-direction: column; min-width: 0; margin-right: 12px; }
.ytv-owner-txt strong { font-size: 16px; font-weight: 500; line-height: 22px; }
.ytv-owner-txt small { color: var(--yt-mute); font-size: 12px; line-height: 18px; }
.ytv-desc { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--yt-chip); font-size: 14px; line-height: 20px; }
.ytv-desc p { margin: 0 0 8px; }
.ytv-desc-meta a { color: #065fd4; font-weight: 500; margin-left: 6px; }
.ytv-desc-prod { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px; border-radius: 12px; background: #fff; }
.ytv-desc-prod img { width: 72px; height: 54px; object-fit: contain; border-radius: 8px; background: #f2f2f2; }
.ytv-desc-prod span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ytv-desc-prod small { color: var(--yt-mute); }
.ytv-desc-prod em { font-style: normal; padding: 0 16px; height: 36px; line-height: 36px; border-radius: 18px; background: var(--yt-text); color: #fff; font-weight: 500; }
.ytv-next { display: flex; gap: 8px; margin-bottom: 8px; }
.ytv-next .ytv-thumb { flex: 0 0 168px; width: 168px; border-radius: 8px; }
.ytv-next .ytv-dur { right: 4px; bottom: 4px; font-size: 12px; }
.ytv-next-txt { display: flex; flex-direction: column; min-width: 0; padding-right: 8px; }
.ytv-next-txt strong { margin-bottom: 4px; font-size: 14px; font-weight: 500; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ytv-next-txt small { color: var(--yt-mute); font-size: 12px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bloc vidéos (blog, fiches) */
.ytv-strip { font-family: Roboto, Arial, sans-serif; color: #0f0f0f; }
.ytv-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ytv-strip-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-family: Roboto, Arial, sans-serif; font-size: 20px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.ytv-strip .ytv-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 32px 16px; }
.ytv-strip a { color: inherit; text-decoration: none; }

@media (max-width: 1312px) { .ytv-guide { flex-basis: 72px; width: 72px; padding: 4px; } .ytv-gi { flex-direction: column; justify-content: center; gap: 6px; height: 74px; padding: 0 2px; font-size: 10px; } .ytv-gi span { max-width: 64px; text-align: center; } .ytv-guide hr, .ytv-gt, .ytv-guide .ytv-gi:nth-last-child(-n+3) { display: none; } }
@media (max-width: 1100px) { .ytv-watch { grid-template-columns: minmax(0, 1fr); } }
.ytv-primary, .ytv-secondary { min-width: 0; }
@media (max-width: 800px) {
    .ytv-guide { display: none; }
    .ytv-main { padding: 0 16px 40px; }
    .ytv-top { flex-wrap: wrap; gap: 10px; }
    .ytv-search { flex-basis: 100%; }
    .ytv-grid { grid-template-columns: 1fr; gap: 28px; }
    .ytv-watch { padding: 0 0 40px; gap: 16px; }
    .ytv-player { border-radius: 0; }
    .ytv-wtitle, .ytv-owner, .ytv-desc, .ytv-secondary { margin-left: 12px; margin-right: 12px; }
    .ytv-wtitle { font-size: 18px; line-height: 26px; }
    .ytv-owner-l .ytv-pill { margin-left: auto; }
    .ytv-owner-r { overflow-x: auto; scrollbar-width: none; }
    .ytv-next .ytv-thumb { flex-basis: 150px; width: 150px; }
}

/* ============ Espace client : « Ma vidéothèque » (tutoriels, notices, vidéos des machines) ============ */
.ytv-acc { display: block; min-height: 0; margin-top: 8px; }
.ytv-acc .ytv-main { padding: 0 0 24px; }
.ytv-acc [hidden] { display: none !important; }
.ytv-acc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 0 4px; }
.ytv-acc-brand { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.4px; }
.ytv-acc-sub { margin: 6px 0 0; color: var(--yt-mute); font-size: 14px; }
.ytv-acc-tv { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 18px; background: var(--yt-chip); font-weight: 500; transition: background .15s; }
.ytv-acc-tv:hover { background: var(--yt-chip-h); }
.ytv-acc-chips { position: static; margin: 10px 0 6px; }
.ytv-acc-chips .ytv-chip { border: 0; cursor: pointer; font-family: inherit; color: var(--yt-text); }
.ytv-acc-sec { margin-top: 18px; }
.ytv-acc-sec .ytv-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px 16px; }
.ytv-acc .ytv-h1 { font-size: 20px; margin: 10px 0 14px; }

/* Vignette tutoriel : bouton lecture et badge */
.ytv-acc-play, .ytv-acc-ext { width: 100%; padding: 0; border: 0; cursor: pointer; }
.ytv-acc-ext img { object-fit: contain !important; background: #f2f2f2; }
.ytv-acc-badge { position: absolute; left: 8px; top: 8px; padding: 2px 7px; border-radius: 4px; background: rgba(0,0,0,.78); color: #fff; font-size: 12px; font-weight: 500; line-height: 18px; }
.ytv-acc-playico { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; border-radius: 14px; background: rgba(33,33,33,.82); transform: translate(-50%, -50%); transition: background .2s; }
.ytv-acc-playico::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.ytv-card:hover .ytv-acc-playico { background: var(--yt-red); }
.ytv-acc-av { overflow: hidden; background: #f2f2f2; color: var(--yt-text); }
.ytv-acc-av img { width: 100%; height: 100%; object-fit: cover; }

/* Notices : vignette « document » */
.ytv-acc-doc { display: block; color: inherit; }
.ytv-acc-docthumb { display: grid; place-items: center; background: linear-gradient(160deg, #f4f4f4, #e7e7e7); }
.ytv-acc-docthumb img { position: absolute; inset: 0; object-fit: contain !important; padding: 12% 40% 12% 8%; box-sizing: border-box; mix-blend-mode: multiply; }
.ytv-acc-sheet { position: absolute; right: 9%; top: 50%; transform: translateY(-50%) rotate(4deg); display: grid; place-items: center; gap: 4px; width: 34%; aspect-ratio: 3 / 4; border-radius: 6px; background: #fff; color: #0f0f0f; box-shadow: 0 10px 24px rgba(0,0,0,.16); transition: transform .3s; }
.ytv-acc-sheet b { padding: 1px 6px; border-radius: 3px; background: var(--yt-red); color: #fff; font-size: 11px; letter-spacing: .04em; }
.ytv-acc-doc:hover .ytv-acc-sheet { transform: translateY(-52%) rotate(0); }
.ytv-acc-doc .ytv-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ytv-acc-doc .ytv-meta { display: block; }
.ytv-acc-dl { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--yt-chip); font-size: 13px; font-weight: 500; }
.ytv-acc-doc:hover .ytv-acc-dl { background: var(--yt-text); color: #fff; }

/* État vide */
.ytv-acc-empty { display: grid; justify-items: center; gap: 6px; padding: 48px 16px; margin-top: 12px; border-radius: 16px; background: #f6f6f6; text-align: center; }
.ytv-acc-empty h2 { margin: 12px 0 0; font-size: 20px; }
.ytv-acc-empty p { margin: 0; color: var(--yt-mute); }
.ytv-acc-empty-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.ytv-brand-play.is-xl { width: 64px; height: 44px; border-radius: 12px; }

/* Lecteur */
.ytv-acc-player { width: min(1100px, 94vw); max-width: none; padding: 0; border: 0; border-radius: 14px; background: #000; color: #fff; overflow: hidden; }
.ytv-acc-player::backdrop { background: rgba(0,0,0,.82); }
.ytv-acc-player-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; font-family: Roboto, Arial, sans-serif; font-size: 15px; }
.ytv-acc-player-bar strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ytv-acc-player-bar button { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.ytv-acc-frame { aspect-ratio: 16 / 9; background: #000; }
.ytv-acc-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 560px) { .ytv-acc-brand { font-size: 20px; } .ytv-acc-sec .ytv-grid { grid-template-columns: 1fr; } }
.ytv-acc, .ytv-acc .ytv-main { min-width: 0; max-width: 100%; }

/* ============ Lecteur maison (YouTube sans interface, aucun lien sortant) ============ */
.srp { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #000; overflow: hidden; color: #fff; outline: none; user-select: none; -webkit-user-select: none; }
.srp-stage, .srp-stage iframe, .srp-yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.srp-stage { pointer-events: none; }
/* agrandit légèrement la vidéo : rogne les bords où YouTube place titre et logo */
.srp-stage iframe { transform: scale(1.02); }
.srp-shield { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; }
.srp-poster { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: #000 center / cover no-repeat; cursor: pointer; transition: opacity .3s; }
.srp-poster::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.45)); }
.srp:not(.is-idle) .srp-poster { opacity: 0; pointer-events: none; }
.srp.is-paused .srp-poster { opacity: .92; pointer-events: auto; }
.srp-big { position: relative; display: grid; place-items: center; width: 76px; height: 54px; border-radius: 16px; background: rgba(15,15,15,.82); color: #fff; transition: background .2s, transform .2s; }
.srp-poster:hover .srp-big { background: #f00; transform: scale(1.05); }
.srp.is-loading .srp-big { background: rgba(15,15,15,.6); }
.srp.is-loading .srp-big svg { animation: srp-spin 1s linear infinite; opacity: .5; }
@keyframes srp-spin { to { transform: rotate(360deg); } }
/* barre de commandes */
.srp-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 26px 10px 8px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.7)); opacity: 0; transition: opacity .25s; }
.srp:hover .srp-bar, .srp.is-paused .srp-bar, .srp:focus-within .srp-bar { opacity: 1; }
.srp.is-idle .srp-bar { display: none; }
.srp-b { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.srp-b:hover { background: rgba(255,255,255,.14); }
.srp-time { font: 500 13px/1 Roboto, Arial, sans-serif; white-space: nowrap; padding: 0 6px; font-variant-numeric: tabular-nums; }
.srp-seek { flex: 1; min-width: 40px; height: 4px; margin: 0 6px; -webkit-appearance: none; appearance: none; border-radius: 4px; cursor: pointer;
    background: linear-gradient(90deg, #f00 var(--p, 0%), rgba(255,255,255,.3) var(--p, 0%)); }
.srp-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #f00; border: 0; }
.srp-seek::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #f00; border: 0; }
/* fin de vidéo */
.srp-end { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.88); }
.srp-end[hidden] { display: none; }
.srp-end-in { display: grid; gap: 14px; justify-items: center; width: min(520px, 100%); }
.srp-next { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.08); color: #fff !important; text-decoration: none !important; }
.srp-next:hover { background: rgba(255,255,255,.16); }
.srp-next-thumb { position: relative; display: grid; place-items: center; flex: 0 0 168px; aspect-ratio: 16 / 9; border-radius: 8px; background: #222 center / cover; }
.srp-next-thumb svg { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: rgba(0,0,0,.6); box-sizing: content-box; }
.srp-next-txt { display: grid; gap: 4px; min-width: 0; font-family: Roboto, Arial, sans-serif; }
.srp-next-txt small { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #aaa; }
.srp-next-txt strong { font-size: 15px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.srp-end-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.srp-replay, .srp-prod { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 19px; border: 0; font: 500 14px/38px Roboto, Arial, sans-serif; cursor: pointer; text-decoration: none !important; }
.srp-replay { background: rgba(255,255,255,.14); color: #fff; }
.srp-prod { background: #fff; color: #0f0f0f !important; }
.srp:fullscreen, .srp:-webkit-full-screen { aspect-ratio: auto; width: 100vw; height: 100vh; }
@media (max-width: 560px) { .srp-next-thumb { flex-basis: 120px; } .srp-time { font-size: 12px; } .srp-b { width: 34px; height: 34px; } }
.ytv-acc-frame .srp { aspect-ratio: auto; height: 100%; }
