:root {
  --bg: #0e0f13;
  --surface: #171922;
  --surface-2: #1e2130;
  --line: #2a2e3f;
  --text: #e7e9f0;
  --muted: #8b90a3;
  --accent: #6c8cff;
  --accent-soft: rgba(108, 140, 255, .14);
  --ok: #3ecf8e;
  --warn: #f7b955;
  --err: #ff6b6b;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px; height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 650; letter-spacing: .2px; color: var(--text); }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 18px; margin-left: 8px; }
.top nav a { color: var(--muted); font-size: 14px; }
.top nav a.on, .top nav a:hover { color: var(--text); text-decoration: none; }
.top .spacer { flex: 1; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 26px 22px 70px; }
.wrap.narrow { max-width: 760px; }

h1 { font-size: 22px; margin: 0 0 4px; font-weight: 620; }
h2 { font-size: 16px; margin: 26px 0 12px; font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number],
textarea, select {
  width: 100%; padding: 10px 12px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 9px; color: var(--text);
  font: inherit; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 84px; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit;
  cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b0d14; font-weight: 600; }
.btn.danger { border-color: #4a2630; color: var(--err); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tile {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  background: var(--surface-2); cursor: pointer; display: block;
}
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.tile small { color: var(--muted); font-size: 12px; line-height: 1.4; display: block; }
.tile:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; border: 1px solid var(--line); color: var(--muted);
}
.pill.queued { color: var(--warn); border-color: #4a3c1e; }
.pill.running { color: var(--accent); border-color: #2c3766; }
.pill.done { color: var(--ok); border-color: #1f4736; }
.pill.failed, .pill.cancelled { color: var(--err); border-color: #4a2630; }

.note {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 11px 14px; border-radius: 0 9px 9px 0; font-size: 14px; margin: 0 0 18px;
}
.note.warn { border-color: var(--warn); background: rgba(247,185,85,.1); }
.note.err  { border-color: var(--err);  background: rgba(255,107,107,.1); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 13px; }

video { width: 100%; border-radius: 9px; background: #000; display: block; }
.thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; background: var(--surface-2); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.right { text-align: right; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }

.badge-live {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(62,207,142,.18); }
.dot.busy { background: var(--warn); box-shadow: 0 0 0 3px rgba(247,185,85,.18); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.bar { height: 5px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* --- tabs --------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font: inherit; padding: 9px 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.tag {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.hidden { display: none !important; }

/* --- asset tiles -------------------------------------------------------- */
.tilewrap { position: relative; }
.tilewrap .del { position: absolute; top: 6px; right: 6px; margin: 0; opacity: 0; transition: opacity .12s; }
.tilewrap:hover .del { opacity: 1; }
.tilewrap .del button { padding: 2px 8px; line-height: 1.2; background: rgba(14,15,19,.85); }
.thumb.none {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); color: var(--muted); font-size: 13px;
}

/* --- shot list ---------------------------------------------------------- */
.shot { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface-2); }
.shot + .shot { margin-top: 12px; }
.shot header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.shot header b { flex: 1; }
.shotno {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
details.prompt-preview { margin-top: 10px; }
details.prompt-preview summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* --- mode switch -------------------------------------------------------- */
.modebtn {
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  font: inherit; font-size: 15px; padding: 10px 30px; cursor: pointer;
}
.modebtn:first-child { border-radius: 10px 0 0 10px; }
.modebtn:last-child { border-radius: 0 10px 10px 0; border-left: none; }
.modebtn:hover { color: var(--text); }
.modebtn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 600; }
.tile.pick input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.tile.pick:has(input:disabled) { opacity: .4; }
.tilewrap .usebtn {
  position: absolute; left: 6px; bottom: 34px; opacity: 0; transition: opacity .12s;
  background: rgba(14,15,19,.88);
}
.tilewrap:hover .usebtn { opacity: 1; }

/* --- studio layout ------------------------------------------------------ */
.studio { max-width: 820px; margin-left: auto; margin-right: auto; }

.step {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
}
.step h2 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.step .num {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.step textarea { margin-top: 10px; }

/* --- reference roles ---------------------------------------------------- */
.roles { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.rolehead { display: flex; align-items: baseline; gap: 9px; margin-bottom: 8px; flex-wrap: wrap; }
.rolehead b { font-size: 14px; }
/* One horizontal strip per role: scanning left to right beats a grid when you
   are choosing one thing from a handful. */
.rolepick {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px;
  scrollbar-width: thin;
}
.rolepick .tile {
  flex: 0 0 auto; width: 78px; height: 78px; padding: 0; overflow: hidden;
  border-radius: 10px; display: grid; place-items: center; position: relative;
}
.rolepick .tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rolepick .tile.empty { border-style: dashed; color: var(--muted); font-size: 12px; }
.rolepick .tile:has(input:checked) {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft);
}
.rolepick .tile:has(input:checked)::after {
  content: "✓"; position: absolute; top: 3px; right: 5px;
  color: var(--accent); font-size: 13px; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

/* --- prompt suggestion chips -------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.chip {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--text); }

/* --- publishing formats ------------------------------------------------- */
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.plat {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 12px;
  background: var(--surface-2); cursor: pointer; text-align: center; display: block;
}
.plat input { position: absolute; opacity: 0; pointer-events: none; }
.plat b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.plat small { color: var(--muted); font-size: 11.5px; }
.plat:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
/* A small proxy of the real frame shape, so the choice is legible at a glance. */
.frame {
  display: block; margin: 0 auto 10px; border: 2px solid var(--muted); border-radius: 3px;
}
.plat:has(input:checked) .frame { border-color: var(--accent); }
.frame.r9-16 { width: 24px; height: 42px; }
.frame.r1-1  { width: 34px; height: 34px; }
.frame.r3-4  { width: 30px; height: 40px; }
.frame.r16-9 { width: 46px; height: 26px; }

/* --- quality tiers ------------------------------------------------------ */
.quals { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 8px; }
.qual {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  background: var(--surface-2); cursor: pointer; display: block;
}
.qual input { position: absolute; opacity: 0; pointer-events: none; }
.qual b { display: block; font-size: 14px; margin-bottom: 2px; }
.qual small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.qual:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ========================================================================
   Responsive
   Bu dosyada hiç medya sorgusu yoktu; masaüstü için yazılmış sabit
   genişlikler telefonda ekrandan taşıyordu. Aşağısı o katman.
   ======================================================================== */

/* Hiçbir şey yatay kaydırmaya yol açmasın. Uzun URL ve prompt metinleri
   kırılmadığında tek başlarına sayfayı genişletiyordu. */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, table { max-width: 100%; }
.mono, .small, p, td, th, summary { overflow-wrap: anywhere; }

/* Tablolar mobilde en sık taşan öğe: kendi içinde kaysınlar. */
.card:has(> table) { overflow-x: auto; }
table { min-width: 460px; }

@media (max-width: 900px) {
  .wrap { padding: 18px 14px 60px; }
  .grid.c2, .grid.c3 { grid-template-columns: 1fr; }
  .studio { max-width: 100%; }
  .step { padding: 16px 14px; }
  .platforms { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .quals { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

@media (max-width: 640px) {
  /* Başlık çubuğu: tek satıra sığmıyordu. Yükseklik serbest, gezinme kendi
     satırında yatay kayan bir şerit oluyor. */
  .top {
    height: auto; flex-wrap: wrap; gap: 10px; padding: 10px 14px;
    align-items: center;
  }
  .top nav {
    order: 3; width: 100%; margin: 0; gap: 4px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
  }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
  .top nav a.on { background: var(--accent-soft); color: var(--text); }
  .top .spacer { display: none; }
  .badge-live { order: 2; margin-left: auto; font-size: 12px; padding: 4px 9px; }
  .top .muted.small { display: none; }   /* isim; yer kalmıyor */

  .wrap { padding: 16px 12px 56px; }
  h1 { font-size: 19px; }

  /* Form satırları alt alta. flex-basis 160px telefonda iki sütun deneyip
     taşmaya yol açıyordu. */
  .row { flex-direction: column; gap: 12px; }
  .row > * { flex: 1 1 auto !important; width: 100%; max-width: none !important; }

  /* Sabit genişlikli satır içi stiller mobilde geçersiz kılınıyor. */
  input[type=text], input[type=number], select, textarea { width: 100% !important; }

  .between { flex-direction: column; align-items: stretch; gap: 10px; }
  .between .right, .between.keep-row { text-align: left; }
  .between.keep-row { flex-direction: row; align-items: center; }

  .platforms { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .rolepick .tile { width: 66px; height: 66px; }
  .modebtn { flex: 1; padding: 10px 12px; font-size: 14px; }
  .btn { padding: 10px 14px; }

  /* Dokunma hedefi olarak yeterli boyut; hover'a bağlı gizli düğmeler
     telefonda hiç görünmüyordu. */
  .tilewrap .del, .tilewrap .usebtn { opacity: 1; }
  .tilewrap .usebtn { position: static; display: block; margin-top: 6px; text-align: center; }
}

@media (max-width: 380px) {
  .platforms { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}

/* --- render time ------------------------------------------------------- */
.rendertime {
  margin-top: 9px; padding: 7px 11px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
}
.rendertime b { color: var(--text); }
.qual small.warn { display: block; margin-top: 5px; color: var(--warn); }
.qual.risky:has(input:checked) { border-color: var(--warn); background: rgba(247,185,85,.1); }

/* --- numbered reference picker ------------------------------------------ */
.tile.numbered { position: relative; }
.tile.numbered .badge {
  position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px;
  border-radius: 50%; background: var(--accent); color: #0b0d14;
  font-size: 12px; font-weight: 700; display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.tile.numbered.on .badge { display: flex; }
.tile.numbered.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tile.numbered:has(input:disabled) { opacity: .4; }

/* --- project bar -------------------------------------------------------- */
.projbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px;
}
.projbar select { width: auto; min-width: 180px; flex: 1 1 180px; }
@media (max-width: 640px) { .projbar { padding: 10px; } .projbar select { min-width: 0; } }
.tilewrap .movebar { position: absolute; left: 6px; right: 6px; bottom: 34px; margin: 0; opacity: 0; transition: opacity .12s; }
.tilewrap:hover .movebar { opacity: 1; }
.tilewrap .movebar select {
  width: 100%; padding: 3px 6px; font-size: 11px; background: rgba(14,15,19,.92);
  border-radius: 6px;
}
@media (max-width: 640px) { .tilewrap .movebar { position: static; opacity: 1; margin-top: 6px; } }
.swatch { width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--line); display: inline-block; }
