@font-face { font-family: "Inter"; src: url("/fonts/Inter-SemiBold.otf"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-Bold.otf"); font-weight: 700; font-display: swap; }
@font-face { font-family: "InterDisplay"; src: url("/fonts/InterDisplay-Black.otf"); font-weight: 900; font-display: swap; }

:root {
  --bg: #0d0b14; --surface: #17141f; --surface2: #201c2b; --line: #2c2639;
  --text: #f3f0f9; --muted: #9d96ae; --accent: #a27bff; --accent-ink: #120926;
  --ok: #3ef08f; --warn: #ffd43d; --bad: #ff5e6c; --info: #33d6ff;
  --r: 16px; --pad: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 600 15px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: InterDisplay, Inter, sans-serif; font-weight: 900; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--bad); min-height: 1.2em; margin: 8px 0 0; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--pad); }
.login-card { width: 100%; max-width: 360px; text-align: center; display: grid; gap: 12px; }
.login-card h1 { margin-top: 8px; }
.login-card p { margin: 0 0 8px; }
.logo { width: 64px; height: 64px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 900 34px InterDisplay, sans-serif; margin: 0 auto; }
.logo.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 17px; margin: 0 10px 0 0; display: inline-grid; }

/* ---------- structure ---------- */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--pad) 12px; background: rgba(13, 11, 20, 0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; font: 900 20px InterDisplay, sans-serif; }
.top-status { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); min-width: 0; }
main { max-width: 860px; margin: 0 auto; padding: var(--pad) var(--pad) calc(96px + var(--safe-b)); display: grid; gap: 16px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(23, 20, 31, 0.95); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs a { display: grid; justify-items: center; gap: 3px; padding: 10px 0 9px; font-size: 12px; color: var(--muted); }
.tabs svg { width: 24px; height: 24px; fill: currentColor; }
.tabs a.on { color: var(--accent); }
@media (min-width: 900px) {
  .tabs { top: 0; bottom: 0; right: auto; width: 96px; grid-template-columns: 1fr; grid-auto-rows: min-content; padding-top: 80px; border-top: 0; border-right: 1px solid var(--line); }
  .tabs a { padding: 14px 0; }
  .top { padding-left: calc(96px + var(--pad)); }
  main { padding-left: calc(96px + var(--pad)); max-width: calc(860px + 96px); padding-bottom: 40px; }
}

/* ---------- composants ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); display: grid; gap: 12px; }
.card.tight { gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 640px) { .grid3.wide { grid-template-columns: repeat(6, 1fr); } }
.stat { background: var(--surface2); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.stat b { font: 900 26px InterDisplay, sans-serif; }
.stat span { font-size: 12px; color: var(--muted); }
.btn { appearance: none; border: 1px solid var(--line); background: var(--surface2); color: var(--text); border-radius: 12px;
  padding: 11px 16px; font: 700 15px Inter, sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.btn:hover { border-color: #463d5a; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ok { background: var(--ok); color: #062014; border-color: var(--ok); }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: default; }
input, select, textarea { width: 100%; background: var(--surface2); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font: 600 16px Inter, sans-serif; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.switch input { appearance: none; width: 52px; height: 30px; border-radius: 15px; background: var(--line); position: relative; cursor: pointer; padding: 0; flex: none; border: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 25px; }
.switch div { display: grid; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 700; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-queued { color: var(--muted); }
.b-scripting, .b-checking, .b-voicing, .b-rendering { color: var(--info); }
.b-review, .b-manual { color: var(--warn); }
.b-ready { color: var(--ok); }
.b-sent { color: var(--accent); }
.b-published { color: #d7cff0; }
.b-failed, .b-rejected { color: var(--bad); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.off { background: var(--bad); }
.banner { border-radius: var(--r); padding: 14px var(--pad); display: grid; gap: 8px; background: rgba(255, 212, 61, 0.1); border: 1px solid rgba(255, 212, 61, 0.35); }
.banner.bad { background: rgba(255, 94, 108, 0.1); border-color: rgba(255, 94, 108, 0.4); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips button { flex: none; border-radius: 99px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 700 14px Inter, sans-serif; cursor: pointer; }
.chips button.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.vlist { display: grid; gap: 10px; }
.vitem { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; cursor: pointer; }
.vitem:hover { border-color: #463d5a; }
.thumb { width: 56px; height: 100px; border-radius: 8px; background: var(--surface2) center/cover; display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }
.vitem .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vitem .m { font-size: 13px; color: var(--muted); margin-top: 3px; }
.fcard { display: grid; gap: 10px; background: linear-gradient(135deg, #2c1166, #120926); border: 1px solid #3d2a6e; border-radius: var(--r); padding: 18px; cursor: pointer; }
.fcard .name { font: 900 28px InterDisplay, sans-serif; }
.player { display: grid; gap: 14px; }
@media (min-width: 720px) { .player { grid-template-columns: 300px 1fr; align-items: start; } }
video { width: 100%; max-width: 360px; aspect-ratio: 9/16; border-radius: 14px; background: #000; justify-self: center; }
.caption { background: var(--surface2); border-radius: 12px; padding: 12px; white-space: pre-wrap; font-weight: 600; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.q { border-top: 1px solid var(--line); padding-top: 10px; }
.q .good { color: var(--ok); }
.log { font-size: 13px; display: grid; gap: 6px; }
.log div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; }
.log .warn { color: var(--warn); } .log .error { color: var(--bad); }
.times { display: grid; gap: 8px; }
.times .row input { flex: 1; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg);
  padding: 12px 18px; border-radius: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); z-index: 20; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.back { color: var(--muted); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
