:root {
  --red: #ee3444;
  --red-soft: #fdecee;
  --ink: #16181d;
  --muted: #6b7080;
  --line: #e7e8ec;
  --bg: #f6f6f8;
  --card: #ffffff;
  --ok: #1f9d55;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Barlow", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
}
h1 { font-size: 28px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red); min-height: 1.4em; margin: 10px 0 0; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); }

.top {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
#logout { margin-left: auto; }
.tab { padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.tab.active { background: var(--red-soft); color: var(--red); }
.tab.soon { color: #a3a7b3; }
.tab.soon::after { content: " · sắp có"; font-weight: 500; font-size: 12px; }

.wrap { max-width: 1040px; margin: 24px auto; padding: 0 16px; display: grid; gap: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

.step { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 22px 0 10px; }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; display: grid; place-items: center; }

.drop {
  display: block; position: relative; border: 2px dashed #d3d5dc; border-radius: var(--radius);
  padding: 28px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--red); background: #fffafa; }
.drop.has { border-style: solid; border-color: var(--ok); background: #f4fbf7; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-inner { display: grid; gap: 4px; }

.bar { height: 6px; border-radius: 6px; background: #eceef2; overflow: hidden; margin-top: 14px; }
.bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .3s; }
.bar.ok i { background: var(--ok); }

.styles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.style-card {
  text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 14px;
  cursor: pointer; font: inherit; color: inherit; display: grid; gap: 6px; align-content: start;
}
.style-card:hover { border-color: #c9ccd4; }
.style-card[aria-checked="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.style-card b { font-size: 16px; }
.style-card .desc { font-size: 13.5px; color: var(--muted); }
.chip { justify-self: start; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #f0f1f4; color: var(--muted); }
.chip.ai { background: var(--red-soft); color: var(--red); }

.music-pick { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; position: relative; }
.music-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.music-pick::before { content: "♪"; font-weight: 800; color: var(--red); }

.actions { display: flex; align-items: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font: inherit; font-weight: 700; border-radius: 10px; padding: 12px 22px; border: 1px solid transparent; cursor: pointer; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:disabled { background: #f3a9b0; cursor: not-allowed; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 600; text-decoration: underline; }

.list-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.jobs { display: grid; gap: 12px; }
.job { display: grid; grid-template-columns: 96px 1fr; gap: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.job .thumb { width: 96px; aspect-ratio: 9 / 16; border-radius: 8px; background: #eceef2 center / cover no-repeat; position: relative; overflow: hidden; }
.job .thumb video { width: 100%; height: 100%; object-fit: cover; }
.job-title { font-weight: 700; overflow-wrap: anywhere; }
.job-meta { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 2px 0 8px; }
.status { font-weight: 700; font-size: 14px; }
.status.done { color: var(--ok); }
.status.error { color: var(--red); }
.job .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.job select { font: inherit; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); }
.err-text { font-size: 13.5px; color: var(--red); margin-top: 6px; overflow-wrap: anywhere; }
.hook { font-size: 13.5px; margin-top: 4px; }

dialog.player { border: 0; border-radius: 16px; padding: 0; background: #000; max-width: min(420px, 92vw); }
dialog.player video { display: block; width: 100%; max-height: 86vh; }
dialog.player::backdrop { background: rgba(10, 10, 14, .7); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.login-card h1 { margin-top: 18px; }
.login-card form { display: grid; gap: 8px; margin-top: 18px; }
.login-card label { font-weight: 600; font-size: 14px; }
.login-card input { font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.login-card input:focus { outline: 2px solid var(--red-soft); border-color: var(--red); }
.login-card .btn { margin-top: 8px; }

@media (max-width: 820px) {
  .styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
  .tabs { order: 3; flex-basis: 100%; }
}
@media (max-width: 480px) {
  .styles { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  h1 { font-size: 24px; }
  .job { grid-template-columns: 72px 1fr; gap: 12px; }
  .job .thumb { width: 72px; }
}
