:root {
  --bg: #0e0f12;
  --panel: #16181d;
  --panel-2: #1d2027;
  --line: #2a2e37;
  --text: #eceef2;
  --muted: #9ba1ad;
  --accent: #4f7cff;
  --accent-2: #3a63e0;
  --ok: #2fbf71;
  --danger: #ef4f4f;
  --warn: #f2b33d;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: 9px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
button:hover:not(:disabled), .btn:hover { border-color: #3c4250; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--accent-2); }
button.danger { color: var(--danger); }
button.ghost { background: transparent; border-color: transparent; padding: 4px 8px; color: var(--muted); }
button.ghost:hover { color: var(--text); }

input, textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
input[type="file"] { padding: 6px; color: var(--muted); font-size: 13px; }
input[type="file"]::file-selector-button {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 10px; margin-right: 10px; cursor: pointer;
}
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.narrow { max-width: 420px; width: 100%; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.topbar .brand { font-weight: 650; }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: #1f5a3b; }

/* ---------- Review ---------- */
.review-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px;
  padding: 20px; max-width: 1600px; margin: 0 auto;
}
@media (max-width: 980px) { .review-layout { grid-template-columns: 1fr; padding: 12px; } }

.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.player-wrap video { display: block; width: 100%; max-height: 72vh; background: #000; }
.no-video { aspect-ratio: 16/9; display: grid; place-items: center; color: var(--muted); }

.markers {
  position: relative; height: 22px; margin: 10px 2px 0; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--line); cursor: pointer;
}
.markers .progress { position: absolute; left: 0; top: 0; bottom: 0; background: #23314f; border-radius: 6px 0 0 6px; pointer-events: none; }
.markers .dot {
  position: absolute; top: 3px; width: 4px; height: 14px; margin-left: -2px;
  background: var(--warn); border-radius: 2px; border: none; padding: 0;
}
.markers .dot:hover { background: #fff; transform: scaleX(1.6); }

.composer { margin-top: 14px; }
.timechip {
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px;
  background: #23314f; color: #b9c9ff; border: 1px solid #2f4270; border-radius: 7px; padding: 2px 8px;
}
button.timechip { cursor: pointer; }
button.timechip:hover { background: #2c3e66; }
.kbd { font-size: 12px; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; color: var(--muted); }

.sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.comments { max-height: 60vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 980px) { .comments { max-height: none; } }
.comment { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.comment.active { border-color: var(--accent); }
.comment .text { white-space: pre-wrap; word-break: break-word; margin-top: 6px; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.comment .meta { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment .actions { display: flex; gap: 0; flex-shrink: 0; }
.comment .actions button { padding: 3px 6px; font-size: 12px; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

.drop {
  border: 1.5px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center;
  color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: #4f7cff14; }
.filelist { display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; gap: 8px; align-items: center; font-size: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; width: 0; background: var(--accent); }

.saved { color: var(--ok); font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px;
  box-shadow: 0 10px 30px #0008; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.error { border-color: var(--danger); color: #ffb3b3; }

/* ---------- Admin ---------- */
.admin-layout { max-width: 1100px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.projects { display: flex; flex-direction: column; gap: 10px; }
.project { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.project-head { display: flex; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer; flex-wrap: wrap; }
.project-title { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.project-body { border-top: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }

/* ---------- Mobil ---------- */
.badge { white-space: nowrap; }
@media (max-width: 640px) {
  .topbar { padding: 12px 14px; }
  .topbar .brand { font-size: 15px; }
  .player-wrap video { max-height: 58vh; }
  .desktop-only { display: none !important; }
  .card { padding: 14px; }
  .composer .row > input { max-width: none !important; flex: 1 1 100%; }
  .composer #comp-save { flex: 1; justify-content: center; }
  .linkbox { flex-wrap: wrap; }
  .linkbox input { flex: 1 1 100%; }
}
@media (hover: none) { .desktop-only { display: none !important; } }
