:root {
  --bg: #0e0f13; --panel: #171920; --panel2: #1f222b; --line: #2b2f3a;
  --text: #e8e9ee; --muted: #9298a8; --accent: #7c5cff; --accent2: #a48bff;
  --ok: #2fbf71; --err: #ff5c6c; --warn: #f0b429; --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent2); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 5px; }
.btn { background: var(--accent); border: 0; border-radius: 8px; padding: 9px 16px;
  cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--accent2); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); font-weight: 500; }
.btn.ghost:hover { border-color: var(--accent); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: wait; }

/* Düzen */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
aside { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px; }
.brand { font-weight: 800; font-size: 18px; padding: 0 10px 18px; letter-spacing: -.3px; }
.brand span { color: var(--accent2); }
.nav { display: block; padding: 9px 12px; border-radius: 8px; color: var(--muted);
  text-decoration: none; cursor: pointer; }
.nav:hover { background: var(--panel2); color: var(--text); }
.nav.active { background: var(--panel2); color: var(--text); font-weight: 600; }
aside .spacer { flex: 1; }
main { padding: 28px 36px; max-width: 1100px; width: 100%; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.4px; }
.sub { color: var(--muted); margin: 0 0 24px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 16px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.card .hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.grid .full { grid-column: 1 / -1; }
.row { display: flex; gap: 8px; align-items: center; }
.row > input, .row > select { flex: 1; }

.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.badge.err { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.badge.opt { color: var(--warn); }
.result { font-size: 13px; margin-top: 10px; min-height: 1em; }
.result.ok { color: var(--ok); } .result.err { color: var(--err); }

.voices { display: grid; gap: 6px; max-height: 260px; overflow: auto; margin-top: 10px; }
.voice { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  background: var(--panel2); border: 1px solid transparent; cursor: pointer; }
.voice.sel { border-color: var(--accent); }
.voice small { color: var(--muted); }
.voice .name { flex: 1; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty b { color: var(--text); display: block; font-size: 18px; margin-bottom: 6px; }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--panel2); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 8px; opacity: 0; transform: translateY(10px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }

/* Giriş */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 360px; }
.login .brand { padding: 0 0 16px; text-align: center; font-size: 22px; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  aside { flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .brand { width: 100%; padding-bottom: 6px; }
  aside .spacer { display: none; }
  main { padding: 18px; }
  .grid { grid-template-columns: 1fr; }
}

/* Projeler */
textarea { resize: vertical; }
.back { color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.plist { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  cursor: pointer; transition: border-color .15s; }
.pcard:hover { border-color: var(--accent); }
.pcard .th { aspect-ratio: 9/16; background: var(--panel2) center/cover; display: grid; place-items: center; color: var(--muted); font-size: 32px; }
.pcard .meta { padding: 10px 12px; }
.pcard .meta b { display: block; font-size: 14px; line-height: 1.3; }
.pcard .meta small { color: var(--muted); }

.phead { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.phead h1 input { font-size: 22px; font-weight: 700; background: transparent; border-color: transparent; padding: 4px 6px; margin-left: -6px; }
.phead h1 input:hover, .phead h1 input:focus { border-color: var(--line); }
.status { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; margin: 12px 0 18px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.status.err { background: color-mix(in srgb, var(--err) 10%, transparent); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent2); border-radius: 50%; animation: sp 0.8s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }

.chars { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.char { display: grid; grid-template-columns: 90px 1fr; gap: 12px; background: var(--panel2); border-radius: 10px; padding: 10px; }
.char .im { aspect-ratio: 3/4; border-radius: 8px; background: var(--bg) center/cover; display: grid; place-items: center; }
.char input { margin-bottom: 6px; }
.char textarea { font-size: 13px; }

.scenes { display: grid; gap: 14px; }
.scene { display: grid; grid-template-columns: 150px 1fr; gap: 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; }
.scene .im { aspect-ratio: 9/16; border-radius: 8px; background: var(--panel2) center/cover; position: relative;
  display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; overflow: hidden; cursor: zoom-in; }
.scene .im .spin { position: absolute; }
.scene .num { font-weight: 700; color: var(--accent2); }
.scene .fields { display: grid; gap: 10px; align-content: start; }
.scene .tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.scene .tools select { width: auto; padding: 5px 8px; font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); cursor: pointer; color: var(--muted); user-select: none; }
.chip.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.err-text { color: var(--err); font-size: 12px; }
.wc { color: var(--muted); font-size: 12px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 50; cursor: zoom-out; }
.lightbox img { max-height: 94vh; max-width: 94vw; border-radius: 10px; }
.danger { color: var(--err) !important; }
@media (max-width: 760px) { .scene { grid-template-columns: 110px 1fr; } }

/* Video */
.bar { height: 6px; background: var(--panel2); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .5s; }
.video-card { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.video-card video { width: 100%; aspect-ratio: 9/16; border-radius: 10px; background: #000; }
@media (max-width: 760px) { .video-card { grid-template-columns: 1fr; } .video-card video { max-width: 280px; } }
