/* Layout and composer copied from Quick Magic (website-quickmagic create-video, cv-composer.css + CreateVideoPage.vue).
   Tokens: bg #0f1113 · panel #131517 · surface #1c1e20 · accent #f0ba2e · text #f7f7f8 · muted #898a8b. */
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; background: #0f1113; color: #f7f7f8; overflow: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
button { font-family: inherit; }
.cv-page { display: flex; align-items: flex-start; height: 100%; padding: 16px; gap: 0; }

/* ── Composer trái ── */
.cv-left { flex: 0 0 384px; width: 384px; display: flex; flex-direction: column; max-height: 100%; overflow: hidden;
  background: #131517; border: 1px solid rgba(217, 217, 217, 0.04); border-radius: 16px; }
.cv-subtabs { display: flex; gap: 12px; padding: 12px 16px 0; flex: 0 0 auto; }
.cv-subtab { background: none; border: none; border-bottom: 2px solid transparent; padding: 0 0 8px; font-size: 14px;
  font-weight: 500; color: rgba(255, 255, 255, 0.6); cursor: pointer; }
.cv-subtab--on { color: #fff; border-bottom-color: #fff; }
.cv-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.cv-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.cv-scroll > * { flex-shrink: 0; }
.cv-scroll::-webkit-scrollbar, .cv-main-body::-webkit-scrollbar { width: 6px; }
.cv-scroll::-webkit-scrollbar-thumb, .cv-main-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 3px; }

/* media card */
.cv-mcard { position: relative; margin: 0 0 8px; border-radius: 12px; overflow: hidden; aspect-ratio: 384 / 92;
  background: radial-gradient(ellipse 70% 120% at 85% 10%, rgba(240, 186, 46, .28), transparent 60%),
    linear-gradient(135deg, #2a2230, #15171a 70%); }
.cv-mcard-cap { position: absolute; left: 0; bottom: 0; width: 100%; padding: 10px 12px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent); }
.cv-mcard-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; text-transform: uppercase; color: #f0ba2e; line-height: 1.1; }
.cv-mcard-sub { margin: 1px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, 0.75); }

/* reference tray */
.cv-ref-tray { min-height: 96px; border-radius: 16px; background: #1c1e20; border: 1px dashed rgba(255, 255, 255, 0.16);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 12px; }
.cv-ref-tray--empty { flex-direction: column; gap: 0; width: 100%; cursor: pointer; color: inherit; }
.cv-reference-orb { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; margin-bottom: 6px;
  background: rgba(255, 255, 255, .04); box-shadow: 0 5px 11px rgba(0, 0, 0, .1), inset 0 -.3px 5.4px rgba(185, 185, 185, .35); color: #898a8b; }
.cv-ref-label { color: #898a8b; font-size: 14px; line-height: 20px; font-weight: 500; }
.cv-ref-hint { color: rgba(255, 255, 255, .6); font-size: 12px; line-height: 18px; font-weight: 500; }
.cv-ref-tile { position: relative; width: 48px; height: 48px; }
.cv-ref-add, .cv-ref-thumb { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; display: flex; align-items: center;
  justify-content: center; background: #26282b; border: none; cursor: pointer; color: rgba(255, 255, 255, .7); }
.cv-ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cv-ref-x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .75); color: #fff; font-size: 10px; line-height: 18px; padding: 0; }

/* prompt */
.cv-prompt { background: #1c1e20; border: 1px solid rgba(217, 217, 217, 0.04); border-radius: 12px; padding: 12px; }
.cv-prompt-label { margin: 0 0 6px; font-size: 13px; color: #898a8b; }
.cv-prompt-ta { width: 100%; min-height: 72px; resize: none; background: none; border: none; outline: none; color: #f7f7f8;
  font-size: 13px; font-family: inherit; line-height: 1.45; }
.cv-prompt-ta::placeholder { color: #6b6c6d; }

/* row pickers (model, facebook) */
.cv-frow { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 6px 12px; min-height: 48px;
  background: #1c1e20; border: none; border-radius: 6px; cursor: pointer; text-align: left; color: #f7f7f8; }
.cv-frow:hover { background: #23262a; }
.cv-frow-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cv-frow-label { font-size: 11px; color: #898a8b; }
.cv-frow-value { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #f7f7f8; }
.cv-frow-value b { color: #f0ba2e; font-weight: 600; }
.cv-frow-note { font-size: 11px; color: #e5837d; }
.cv-frow-chev { color: #898a8b; flex: 0 0 auto; }
.cv-controls-row { display: flex; align-items: center; gap: 8px; }
.cv-controls-row > * { flex: 1 1 0; min-width: 0; }
.cv-pill { display: flex; align-items: center; gap: 6px; width: 100%; height: 40px; padding: 0 8px; border: 0; border-radius: 6px;
  background: #1c1e20; color: #f7f7f8; font-size: 14px; cursor: pointer; }
.cv-pill:hover { background: #292c2f; }
.cv-pill svg { width: 16px; height: 16px; flex-shrink: 0; }
.cv-pill svg path { stroke-width: 2px; }

/* generate button */
.cv-genwrap { padding: 12px 16px 14px; flex: 0 0 auto; }
.cv-gen { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; font-size: 16px;
  font-weight: 600; color: #14151a; background: #f0ba2e; box-shadow: inset 0 -3px rgba(0, 0, 0, .43); padding-bottom: 2px;
  border: none; border-radius: 12px; cursor: pointer; transition: filter .15s, transform .05s, opacity .15s; }
.cv-gen:hover:not(:disabled) { filter: brightness(1.05); }
.cv-gen:active:not(:disabled) { transform: translateY(1px); }
.cv-gen:disabled { opacity: .45; cursor: not-allowed; }
.cv-gen-spin { width: 20px; height: 20px; border: 2.5px solid rgba(20, 21, 26, .3); border-top-color: #14151a; border-radius: 50%; animation: cv-rot .7s linear infinite; }
@keyframes cv-rot { to { transform: rotate(360deg); } }
.cv-warn { margin: 8px 0 0; min-height: 16px; font-size: 12px; color: #e5837d; text-align: center; }
.cv-warn--ok { color: #53c546; }

/* ── Khu chính phải ── */
.cv-main { flex: 1 1 auto; min-width: 0; align-self: stretch; display: flex; flex-direction: column; margin-left: 8px;
  border: 1px solid #ffffff1a; border-radius: 20px; overflow: hidden; padding: 0 16px 16px; }
.cv-maintabs { display: flex; align-items: center; gap: 4px; padding: 8px 0 12px; min-height: 56px; flex: 0 0 auto; }
.cv-mtab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 4px 8px; font-size: 12px; font-weight: 600;
  color: #898a8b; background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.cv-mtab--on { color: #fff; background: #ffffff0d; border-color: #ffffff1a; box-shadow: inset 0 1px 2px #ffffff12; }
.cv-mtab-badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px;
  font-weight: 700; color: #14151a; background: #f0ba2e; border-radius: 999px; }
.cv-main-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.cv-empty { margin: 80px auto 0; text-align: center; color: #898a8b; font-size: 14px; line-height: 1.6; }
#log { height: 100%; overflow: auto; background: #0b0b0f; color: #d6ffd6; padding: 10px; border-radius: 12px; font: 11px/1.5 ui-monospace, monospace; }
[hidden] { display: none !important; }

/* Not tall: the decorative banner goes and the empty reference tray, the prompt box and the gaps shrink: the composer needs every pixel
   for its settings. */
@media (max-height: 1100px) {
  .cv-mcard, .cv-subtabs { display: none; }
  .cv-scroll { gap: 6px; }
  .cv-ref-tray { min-height: 52px; padding: 8px 12px; }
  .cv-reference-orb { display: none; }
  .cv-prompt-ta { min-height: 56px; }
}

/* The line under the button takes no room while it has nothing to say. */
.cv-warn:empty { display: none; }

/* ── "Hãy mở bằng app" (app.js, a browser without the app) ── */
.fs-gate { height: 100vh; display: grid; place-content: center; gap: 12px; padding: 32px; max-width: 520px; margin: 0 auto; text-align: center; }
.fs-gate h1 { margin: 0; font-size: 22px; color: #f0ba2e; }
.fs-gate p { margin: 0; font-size: 14px; line-height: 1.5; color: #898a8b; }
