/* ============================================================
   ParciFilms / ParciMusique — feuille de style
   ============================================================ */

:root {
  --bg: #0e1014;
  --bg-elev: #14171e;
  --surface: #171b23;
  --surface-2: #1e2330;
  --surface-3: #262c3a;
  --border: #262c38;
  --border-soft: #1e232d;
  --text: #e9ecf2;
  --text-dim: #a2abba;
  --text-faint: #6d7686;
  --accent: #ff5c47;
  --accent-soft: rgba(255, 92, 71, .14);
  --accent-text: #fff;
  --danger: #e5484d;
  --ok: #37b26b;
  --warn: #e2a03f;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --maxw: 1360px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-section="music"] {
  --accent: #8b7bff;
  --accent-soft: rgba(139, 123, 255, .16);
}

[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e6e9ee;
  --border: #e0e4ea;
  --border-soft: #eaedf1;
  --text: #12151b;
  --text-dim: #5b6373;
  --text-faint: #838c9c;
  --accent: #e2402b;
  --accent-soft: rgba(226, 64, 43, .1);
  --shadow: 0 4px 18px rgba(20, 25, 35, .08);
}

[data-theme="light"][data-section="music"] {
  --accent: #5b46e8;
  --accent-soft: rgba(91, 70, 232, .1);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ------------------------------------------------------------ en-tete */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 600; flex-shrink: 0; }
.brand:hover { color: inherit; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  /* Les icones sont des dessins au trait noir sur fond transparent :
     un aplat clair garantit leur lisibilite en theme sombre. */
  background: #fff; overflow: hidden; padding: 2px; flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark-lg { width: 46px; height: 46px; border-radius: 12px; padding: 3px; }
.brand-text b { font-weight: 750; color: var(--accent); }
.hide-sm { display: inline; }

.mainnav { display: flex; gap: 4px; }
.mainnav a {
  padding: 7px 13px; border-radius: 8px; color: var(--text-dim);
  font-size: 14.5px; font-weight: 500; transition: background .12s, color .12s;
}
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a.active { background: var(--accent-soft); color: var(--accent); }

.searchbox {
  flex: 1; max-width: 460px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 12px; height: 38px; color: var(--text-faint);
}
.searchbox:focus-within { border-color: var(--accent); color: var(--accent); }
.searchbox input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--text); font: inherit; font-size: 14px; height: 100%;
}
.searchbox input::placeholder { color: var(--text-faint); }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  cursor: pointer; transition: .12s;
}
.icon-btn:hover { color: var(--text); border-color: var(--surface-3); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.theme-toggle .ico-moon { display: none; }
[data-theme="light"] .theme-toggle .ico-moon { display: block; }
[data-theme="light"] .theme-toggle .ico-sun { display: none; }

.avatar-btn { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; line-height: 0; }
.avatar-btn:hover { box-shadow: 0 0 0 2px var(--accent); }

.avatar { border-radius: 50%; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.avatar-initials {
  display: grid; place-items: center; font-weight: 600; color: #fff;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #7a5cff));
}

/* ---------------------------------------------------------- menus */
.menu { position: relative; }
.menu-panel {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 210px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; display: none; z-index: 60;
}
.menu-panel.menu-right { left: auto; right: 0; }
.menu.open .menu-panel { display: block; }
.menu-panel a, .menu-link-btn {
  display: block; width: 100%; text-align: left; padding: 8px 11px; border-radius: 8px;
  font-size: 14px; color: var(--text-dim); background: none; border: 0; cursor: pointer; font: inherit;
}
.menu-panel a:hover, .menu-link-btn:hover { background: var(--surface-2); color: var(--text); }
.menu-head { padding: 8px 11px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.menu-head strong { display: block; font-size: 14px; }
.menu-head span { font-size: 12.5px; color: var(--text-faint); }
.menu-sep { height: 1px; background: var(--border-soft); margin: 6px 0; }

/* --------------------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 550; cursor: pointer;
  transition: .13s; white-space: nowrap;
}
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-accent:hover { filter: brightness(1.08); color: var(--accent-text); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }
.btn-xs { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { display: flex; width: 100%; margin-bottom: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  font-size: 13px; color: var(--text-dim); text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: var(--text); }
.link-btn.danger:hover { color: var(--danger); }

/* ------------------------------------------------------------ page */
.page { max-width: var(--maxw); margin: 0 auto; padding: 26px 20px 60px; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-title { font-size: 26px; }
.page-sub { color: var(--text-dim); font-size: 14px; margin: 4px 0 0; }
.page-head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.section-title { font-size: 17px; margin-bottom: 14px; }
.sub-title { font-size: 14px; color: var(--text-dim); margin: 18px 0 10px; font-weight: 550; }
.block { margin-bottom: 38px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block-more { font-size: 13.5px; color: var(--text-dim); }

.flash {
  padding: 11px 15px; border-radius: 10px; margin-bottom: 18px; font-size: 14px;
  border: 1px solid var(--border);
}
.flash-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.flash-error { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

/* ------------------------------------------------------------ hero */
.hero {
  background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 34px 32px; margin-bottom: 36px;
}
.hero h1 { font-size: 28px; margin-bottom: 6px; }
.hero p { color: var(--text-dim); margin-bottom: 16px; }
.hero-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 20px; color: var(--text-dim); font-size: 14px; }
.hero-stats strong { color: var(--text); font-size: 17px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----------------------------------------------------------- cartes */
.grid { display: grid; gap: 20px 18px; }
.grid-films { grid-template-columns: repeat(auto-fill, minmax(266px, 1fr)); }
.grid-music { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }

.card-thumb {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid var(--border-soft);
}
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-1x1 { aspect-ratio: 1 / 1; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-thumb img { transform: scale(1.035); }
.thumb-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); }

.card-body { padding: 10px 2px 0; }
.card-title { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.card-title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.muted-link { color: var(--text-dim); }
.dot { opacity: .5; }
.card-rating { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.role-text { font-style: italic; }

.stars-mini i { font-style: normal; color: var(--text-faint); font-size: 12px; letter-spacing: -1px; }
.stars-mini i.on { color: var(--warn); }

.badge {
  position: absolute; bottom: 7px; right: 7px;
  background: rgba(0, 0, 0, .78); color: #fff; font-size: 11.5px; font-weight: 550;
  padding: 2px 6px; border-radius: 5px; letter-spacing: .01em;
}
.badge-draft { top: 7px; left: 7px; bottom: auto; right: auto; background: rgba(0, 0, 0, .78); }
.badge-clip { top: 7px; right: 7px; bottom: auto; background: var(--accent); }
.badge-status { top: 7px; left: 7px; bottom: auto; right: auto; }
.badge-processing, .badge-queued { background: var(--warn); color: #23180a; }
.badge-failed { background: var(--danger); color: #fff; }

.play-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .35); color: #fff; opacity: 0; transition: opacity .18s;
}
.card:hover .play-overlay { opacity: 1; }

.resume-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .25); }
.resume-bar i { display: block; height: 100%; background: var(--accent); }

.empty-state {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 34px 20px; text-align: center; color: var(--text-dim);
}
.empty-hint { color: var(--text-faint); font-size: 13.5px; }

/* ------------------------------------------------------- visionnage */
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.watch-main { min-width: 0; }
.watch-side { position: sticky; top: 80px; }

.player-wrap {
  background: #000; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16 / 9; border: 1px solid var(--border-soft);
}
.video-player { width: 100%; height: 100%; display: block; background: #000; }
.player-placeholder { display: grid; place-items: center; background: var(--surface); }
.processing-box { text-align: center; padding: 24px; max-width: 460px; }
.processing-box h3 { margin: 12px 0 6px; font-size: 16px; }
.processing-box p { color: var(--text-dim); font-size: 13.5px; }
.processing-pct { font-size: 13px; color: var(--text-dim); }
.processing-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-dim); font-size: 14px; margin: 14px 0; }
.mono-err { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--danger); word-break: break-word; }

.spinner {
  width: 30px; height: 30px; border-radius: 50%; margin: 0 auto;
  border: 3px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2px; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 12px 0 6px; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.progress-lg { height: 10px; }

.resume-note { font-size: 13px; color: var(--text-dim); margin-top: 8px; display: flex; gap: 8px; align-items: center; }

.watch-head { padding: 16px 0 4px; }
.watch-title { font-size: 22px; margin-bottom: 7px; }
.watch-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--text-dim); font-size: 13.5px; }
.watch-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-top: 14px;
}
.watch-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.watch-buttons form { display: inline; }

.tag { font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--border); color: var(--text-dim); }
.tag-admin { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.tag-draft { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-top: 18px;
}
.panel-inline { margin-top: 10px; }
.author-panel { display: flex; flex-direction: column; gap: 12px; }
.author-link { display: flex; align-items: center; gap: 11px; }
.author-link span { display: flex; flex-direction: column; }
.author-link small { color: var(--text-faint); font-size: 12.5px; order: -1; }
.description { white-space: pre-wrap; color: var(--text-dim); font-size: 14.5px; }
.lyrics { white-space: pre-wrap; font-size: 15px; line-height: 1.75; color: var(--text-dim); }

.linked-media {
  display: flex; align-items: center; gap: 14px; margin-top: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; transition: .15s;
}
.linked-media:hover { border-color: var(--accent); color: inherit; }
.linked-cover {
  width: 58px; height: 58px; border-radius: 9px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-2); display: grid; place-items: center; color: var(--text-faint);
}
.linked-cover-wide { width: 96px; height: 54px; }
.linked-cover img { width: 100%; height: 100%; object-fit: cover; }
.linked-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.linked-text small { color: var(--text-faint); font-size: 12.5px; }
.linked-text strong { font-size: 15px; }
.linked-arrow { color: var(--accent); font-size: 19px; }

.credits-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.credit-group h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: 9px; font-weight: 600; }
.credit-group li { margin-bottom: 8px; }
.credit-person { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.credit-detail { display: block; font-size: 12.5px; color: var(--text-faint); margin-left: 36px; font-style: italic; }

/* -------------------------------------------------------- notation */
.rating { display: flex; align-items: center; gap: 14px; }
.rating-score { display: flex; align-items: baseline; gap: 3px; }
.rating-score strong { font-size: 23px; font-weight: 650; }
.rating-score span { font-size: 12.5px; color: var(--text-faint); }
.stars { display: flex; gap: 1px; }
.star {
  background: none; border: 0; cursor: pointer; padding: 0 1px;
  font-size: 21px; line-height: 1; color: var(--surface-3); transition: color .1s, transform .1s;
}
[data-theme="light"] .star { color: #d3d8e0; }
.star:hover { transform: scale(1.12); }
.star.on, .stars:hover .star.hover { color: var(--warn); }
.rating-meta { font-size: 12.5px; color: var(--text-faint); display: flex; gap: 5px; align-items: center; }

/* ---------------------------------------------------- commentaires */
.comments { margin-top: 30px; }
.comment-form { display: flex; gap: 12px; margin-bottom: 26px; }
.comment-form-main { flex: 1; min-width: 0; }
.comment-form textarea {
  width: 100%; background: none; border: 0; border-bottom: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 14.5px; padding: 6px 0; resize: none;
  outline: none; min-height: 34px;
}
.comment-form textarea:focus { border-bottom-color: var(--accent); }
.comment-form-actions { display: none; justify-content: flex-end; align-items: center; gap: 9px; margin-top: 9px; }
.comment-form.active .comment-form-actions { display: flex; }
.form-error { color: var(--danger); font-size: 13px; margin-right: auto; }

.comment-list { display: flex; flex-direction: column; gap: 20px; }
.comment { display: flex; gap: 12px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-author { font-size: 13.5px; font-weight: 600; }
.comment-date { font-size: 12.5px; color: var(--text-faint); }
.comment-body { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; margin: 3px 0 5px; }
.comment-body.deleted { color: var(--text-faint); }
.comment-actions { display: flex; gap: 14px; }
.comment-replies { margin-top: 14px; display: flex; flex-direction: column; gap: 16px; }
.comment-replies:empty { margin: 0; }

/* ------------------------------------------------ colonne laterale */
.side-list { display: flex; flex-direction: column; gap: 12px; }
.side-item { display: flex; gap: 10px; }
.side-thumb {
  width: 132px; flex-shrink: 0; border-radius: 9px; overflow: hidden;
  background: var(--surface-2); position: relative;
}
.side-item-music .side-thumb { width: 68px; }
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-text { display: flex; flex-direction: column; min-width: 0; }
.side-text strong { font-size: 13.5px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-text small { font-size: 12px; color: var(--text-faint); }

/* ------------------------------------------------- lecteur audio */
.audio-player {
  display: flex; align-items: center; gap: 14px; margin: 18px 0 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 16px;
}
.play-btn {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff; border: 0; cursor: pointer;
  display: grid; place-items: center; transition: filter .12s;
}
.play-btn:hover { filter: brightness(1.1); }
.play-btn .ico-pause { display: none; }
.audio-player.playing .ico-play { display: none; }
.audio-player.playing .ico-pause { display: block; }
.audio-track { flex: 1; min-width: 0; }
.audio-bar { position: relative; height: 6px; border-radius: 99px; background: var(--surface-3); cursor: pointer; }
.audio-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); width: 0; }
.audio-bar b {
  position: absolute; top: 50%; left: 0; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); transform: translate(-50%, -50%); opacity: 0; transition: opacity .12s;
}
.audio-bar:hover b, .audio-player.playing .audio-bar b { opacity: 1; }
.audio-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-faint); margin-top: 5px; }
.audio-volume { display: flex; align-items: center; gap: 7px; color: var(--text-dim); }
.audio-volume input { width: 78px; accent-color: var(--accent); }

.listen-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.listen-main { min-width: 0; }
.listen-hero { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 26px; align-items: start; }
.listen-cover { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); position: relative; border: 1px solid var(--border-soft); }
.listen-cover img { width: 100%; height: 100%; object-fit: cover; }
.listen-info { min-width: 0; }

/* ------------------------------------------------------ formulaires */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.form-main { min-width: 0; }
.form-side { position: sticky; top: 80px; }
.form-side .panel:first-child { margin-top: 0; }
.form-main .panel:first-child { margin-top: 0; }
.form-submit { display: flex; flex-direction: column; }

.field { display: block; margin-bottom: 16px; }
.field > span:first-child { display: block; font-size: 13px; font-weight: 550; margin-bottom: 6px; color: var(--text-dim); }
.field > span em { color: var(--accent); font-style: normal; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-hint { display: block; font-size: 12.5px; color: var(--text-faint); margin-top: 5px; }

.input {
  width: 100%; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 12px; color: var(--text);
  font: inherit; font-size: 14px; outline: none; transition: border-color .12s;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; line-height: 1.6; }
.lyrics-input { font-size: 14px; line-height: 1.7; }
select.input { cursor: pointer; }

.sep { height: 1px; background: var(--border-soft); margin: 20px 0; }
.sortbar { display: flex; gap: 8px; }
.sortbar .input { width: auto; min-width: 170px; }
.filterbar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.filterbar .field { margin-bottom: 0; }
.filterbar .input { min-width: 190px; }

.current-thumb { margin-top: 14px; }
.current-thumb img { width: 240px; border-radius: 9px; border: 1px solid var(--border); }
.current-thumb-square img { width: 150px; }

.avatar-edit { display: flex; gap: 20px; align-items: flex-start; }
.avatar-edit-side { flex: 1; min-width: 0; }

/* -------------------------------------------------------- uploader */
.uploader-drop {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 16px 18px; transition: .14s; background: var(--bg-elev);
}
.uploader-drop:hover, .uploader-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.uploader-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex-shrink: 0; }
.uploader-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.uploader-text strong { font-size: 14px; }
.uploader-text .field-hint { margin-top: 2px; }
.uploader-progress { margin-top: 12px; }
.uploader-file { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.uploader-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploader-status { font-size: 12.5px; color: var(--text-faint); }
.uploader-current { font-size: 12.5px; color: var(--text-faint); margin-top: 9px; }

/* -------------------------------------------------------- credits */
.credit-row { display: grid; grid-template-columns: 150px 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 9px; align-items: center; }
.credit-row .input { padding: 7px 10px; font-size: 13.5px; }
.credits-editor .btn { margin-top: 4px; }

/* ------------------------------------------------------- tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 11px 14px; font-size: 12px; font-weight: 600;
  color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table-compact td, .table-compact th { padding: 8px 12px; }
.table-actions { white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.table-actions form { display: inline; }
.table-media { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table-media span { display: flex; flex-direction: column; min-width: 0; }
.table-media strong { font-size: 13.5px; font-weight: 600; }
.table-media small { font-size: 12px; color: var(--text-faint); }
.table-thumb { width: 74px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.table-thumb.ratio-1x1 { width: 40px; }
.table-thumb img { width: 100%; height: 100%; object-fit: cover; }
.comment-cell { max-width: 420px; white-space: pre-wrap; word-break: break-word; }
.log-cell pre { font-size: 11.5px; white-space: pre-wrap; word-break: break-word; max-width: 420px; color: var(--text-dim); }
.ua { color: var(--text-faint); font-size: 11.5px; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 550;
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
}
.pill-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill-err { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill-draft { color: var(--text-faint); }
.pill-admin { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.pill-film { color: #ff7a5c; border-color: rgba(255, 122, 92, .4); }
.pill-music { color: #8b7bff; border-color: rgba(139, 123, 255, .4); }

.mini-progress { width: 90px; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.mini-progress i { display: block; height: 100%; background: var(--accent); }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 11px; border-radius: 8px; font-size: 13px; color: var(--text-dim); border: 1px solid var(--border); }
.pager a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ------------------------------------------------------ statistiques */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column;
}
.stat strong { font-size: 22px; font-weight: 650; }
.stat span { font-size: 12.5px; color: var(--text-faint); }
.stat-warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.stat-err { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }

.admin-nav { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 22px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.admin-nav a { padding: 7px 13px; border-radius: 8px; font-size: 13.5px; color: var(--text-dim); }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent); }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.admin-cols .panel { margin-top: 0; }

.feed { display: flex; flex-direction: column; gap: 12px; }
.feed li { display: flex; gap: 10px; align-items: flex-start; }
.feed-text { font-size: 13.5px; color: var(--text-dim); min-width: 0; }
.feed-text a { color: var(--text); }
.feed-text small { display: block; font-size: 12px; color: var(--text-faint); }

.rank li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.rank li:last-child { border-bottom: 0; }
.rank b { color: var(--text-dim); }

.kv li { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--text-faint); }
.kv b { font-weight: 550; text-align: right; word-break: break-word; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.disk { margin-bottom: 14px; }
.disk p { font-size: 13.5px; color: var(--text-dim); }

/* ---------------------------------------------------------- profil */
.profile-head { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 34px; flex-wrap: wrap; }
.profile-info { flex: 1; min-width: 240px; }
.profile-handle { color: var(--text-faint); font-size: 14px; margin: 3px 0 10px; display: flex; align-items: center; gap: 8px; }
.profile-bio { color: var(--text-dim); white-space: pre-wrap; max-width: 640px; }
.profile-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-faint); margin-top: 10px; }
.profile-stats strong { color: var(--text); }
.profile-actions { display: flex; gap: 9px; margin-top: 14px; flex-wrap: wrap; }

.people-row { display: flex; gap: 12px; flex-wrap: wrap; }
.person-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 99px;
}
.person-chip:hover { border-color: var(--accent); color: inherit; }
.person-chip span { display: flex; flex-direction: column; }
.person-chip small { font-size: 12px; color: var(--text-faint); }

/* --------------------------------------------------------- erreurs */
.error-box { text-align: center; padding: 70px 20px; }
.error-box h1 { font-size: 24px; margin-bottom: 8px; }
.error-box p { color: var(--text-dim); }

/* -------------------------------------------------------- connexion */
.login-page { display: grid; place-items: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 400px; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.login-brand h1 { font-size: 22px; }
.login-brand b { color: var(--accent); }
.login-intro { color: var(--text-dim); font-size: 13.5px; margin-bottom: 22px; }
.login-form .field { margin-bottom: 15px; }
.login-foot { margin: 18px 0 0; font-size: 12.5px; color: var(--text-faint); text-align: center; }

/* ------------------------------------------------------ pied de page */
.sitefoot { border-top: 1px solid var(--border-soft); margin-top: 40px; }
.sitefoot-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 20px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-faint);
}
.sitefoot b { color: var(--text-dim); }
.sitefoot nav { display: flex; gap: 16px; }

/* -------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .watch-layout, .listen-layout, .form-layout { grid-template-columns: minmax(0, 1fr); }
  .watch-side, .form-side { position: static; }
  .admin-cols { grid-template-columns: 1fr; }
  .credit-row { grid-template-columns: 1fr 1fr; }
  .credit-row .icon-btn { justify-self: end; }
}

@media (max-width: 860px) {
  .searchbox { order: 10; max-width: none; flex-basis: 100%; margin: 0 0 10px; }
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .mainnav { order: 5; }
  .listen-hero { grid-template-columns: minmax(0, 1fr); }
  .listen-cover { max-width: 260px; }
  .hide-sm { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .grid-films { grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); }
  .grid-music { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .page { padding: 20px 16px 50px; }
  .hero { padding: 24px 20px; }
}

@media (max-width: 560px) {
  .credit-row { grid-template-columns: 1fr; }
  .watch-actions { flex-direction: column; align-items: flex-start; }
  .grid-films { grid-template-columns: 1fr; }
  .side-item-music .side-thumb { width: 56px; }
}
