:root {
  --bg: #0e0f13;
  --panel: #16181e;
  --panel-2: #1d2028;
  --line: #2a2e38;
  --text: #ecedf1;
  --muted: #8b90a0;
  --accent: #ff6a3d;
  --accent-2: #ffb547;
  --ok: #3ddc97;
  --warn: #ffc857;
  --bad: #ff5c5c;
  --radius: 12px;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #07080a; color: var(--text); font-family: var(--font); font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.fill { fill: currentColor; stroke: none; }

/* ---------- Window shell ---------- */
.window { display: grid; grid-template-rows: 44px 1fr; height: 100vh; background: var(--bg); }
.titlebar { display: flex; align-items: center; gap: 14px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #0b0c0f; }
.dots { display: flex; gap: 7px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #3a3d46; display: block; }
.dots i:nth-child(1) { background: #ff5f57; } .dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.brand { font-family: var(--display); font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.brand b { color: var(--accent); }
.workspace { margin-left: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 13px; }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.pill.lic { color: var(--accent-2); border-color: #4a3a1c; }

.body { display: grid; grid-template-columns: 216px 1fr; min-height: 0; }

/* ---- A · Sidebar tenang ---- */
.sidebar { border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; background: #0c0d10; }
.nav-group { font-size: 12px; font-weight: 500; color: #5f6472; margin: 16px 10px 4px; }
.nav { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 7px; color: #9ba0ae; text-decoration: none; cursor: pointer; font-size: 13.5px; font-weight: 500; transition: background .12s, color .12s; }
.nav .icon { width: 16px; height: 16px; stroke-width: 1.75; color: #6c7180; transition: color .12s; }
.nav:hover { background: #15171c; color: #d9dbe2; }
.nav:hover .icon { color: #b4b8c4; }
.nav.active { background: #1b1d23; color: #f4f5f8; }
.nav.active .icon { color: var(--accent); }
.nav .sub { margin-left: auto; font: 500 11px 'JetBrains Mono', monospace; color: #5f6472; }
.nav.active .sub { color: #9ba0ae; }
.side-foot { margin-top: auto; padding: 12px 10px 4px; font-size: 11.5px; line-height: 1.5; color: #5f6472; }

/* toggle A/B */
.seg { display: inline-flex; background: #15171c; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.seg button.on { background: #262932; color: #fff; }

/* ---- B · Rail ikon ---- */
body.rail .body { grid-template-columns: 76px 1fr; }
body.rail .sidebar { padding: 10px 6px; gap: 2px; align-items: stretch; }
body.rail .nav-group { height: 1px; background: var(--line); margin: 8px 12px; font-size: 0; }
body.rail .side-foot { display: none; }
body.rail .nav { flex-direction: column; justify-content: center; height: auto; gap: 4px; padding: 6px 2px; background: transparent; font-size: 10.5px; font-weight: 500; letter-spacing: .1px; text-align: center; }
body.rail .nav .lbl { line-height: 1.15; max-width: 68px; }
body.rail .nav .sub { display: none; }
body.rail .nav .icon { width: 36px; height: 30px; padding: 6px 9px; border-radius: 9px; box-sizing: border-box; stroke-width: 1.75; }
body.rail .nav:hover { background: transparent; }
body.rail .nav:hover .icon { background: #17191f; }
body.rail .nav.active { background: transparent; color: #fff; }
body.rail .nav.active .icon { background: #2a1912; color: var(--accent); box-shadow: inset 0 0 0 1px #4a2618; }

main { overflow-y: auto; min-height: 0; }
.view { display: none; padding: 26px 30px 40px; max-width: 1280px; }
.view.active { display: block; }
.view.full { max-width: none; padding: 0; height: 100%; }
h1 { font-family: var(--display); font-size: 26px; margin: 0 0 4px; }
h2 { font-family: var(--display); font-size: 17px; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 22px; }

/* ---------- Common ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #3c4150; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0d06; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.tag { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: #c9ccd6; }
.tag.orange { color: var(--accent); border-color: #5a2b1b; background: #26150f; }
.tag.green { color: var(--ok); border-color: #1e4a37; background: #0f2219; }
.tag.yellow { color: var(--warn); border-color: #4d3f1a; background: #221c0d; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: #fff; border-color: var(--accent); }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input[type=text], textarea, select { width: 100%; background: #0f1015; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; outline: none; }
input[type=text]:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch i { width: 34px; height: 20px; border-radius: 999px; background: #2c303a; position: relative; transition: .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on i { background: var(--accent); }
.switch.on i::after { left: 17px; }
.progress { height: 8px; background: #23262f; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }

/* ---------- Setup ---------- */
.steps { display: grid; gap: 12px; max-width: 720px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; flex: none; }
.step.done .num { background: #11291d; border-color: #1e4a37; color: var(--ok); }
.code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: #0a0b0e; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: #b7f5dc; overflow-x: auto; }

/* ---------- Home ---------- */
.quick { display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: .15s; }
.quick:hover { border-color: var(--accent); transform: translateY(-2px); }
.quick .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #26150f; color: var(--accent); }
/* ---- Kalender konten ---- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.day-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 6px; border-bottom: 1px solid var(--line); }
.dname { font-size: 12px; color: var(--muted); font-weight: 500; }
.dnum { font-family: var(--display); font-size: 20px; font-weight: 700; color: #d6d8df; line-height: 1; }
.dcount { margin-left: auto; font: 500 11px 'JetBrains Mono', monospace; color: #5f6472; }
.day.today .day-head { border-color: var(--accent); }
.day.today .dnum { color: #1a0d06; background: var(--accent); border-radius: 7px; padding: 3px 6px; font-size: 17px; }
.day.today .dname { color: var(--accent); }
.day.past { opacity: .62; }

/* status: dipakai kartu & legenda */
.st-ide { --st: #8b90a0; --st-bg: #1c1e24; }
.st-naskah { --st: #ffc857; --st-bg: #261f0e; }
.st-produksi { --st: #ff6a3d; --st-bg: #2a1912; }
.st-siap { --st: #3ddc97; --st-bg: #0f2419; }
.st-terbit { --st: #6aa9ff; --st-bg: #0f1c2e; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--st); background: var(--st-bg); padding: 3px 8px 3px 6px; border-radius: 99px; white-space: nowrap; }
.st i { width: 6px; height: 6px; border-radius: 50%; background: var(--st); }
.legend { display: inline-flex; }

.post { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: #15171c; border: 1px solid #23262e; text-decoration: none; color: inherit; transition: border-color .12s, transform .12s; }
.post:hover { border-color: #3a3e49; transform: translateY(-1px); }
.post-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.post-time { font: 500 11px 'JetBrains Mono', monospace; color: #6c7180; }
.post-body { display: flex; gap: 8px; align-items: flex-start; }
.post-title { flex: 1; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: #eef0f4; }
.post-thumb { width: 30px; height: 46px; border-radius: 5px; background: #000 center/cover; flex: none; box-shadow: 0 0 0 1px #2a2e38; }
.post-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 10.5px; color: #7d8291; }
.post-meta .pillar { color: #b4b8c4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.pipe i { height: 3px; border-radius: 2px; background: #262931; }
.pipe i.on { background: var(--st); }
.st-terbit .post-meta span:last-child { color: var(--st); font-weight: 600; }
.slot { flex: 1; min-height: 70px; border: 1px dashed #2f333d; border-radius: 10px; background: transparent; color: #6c7180; font-size: 12px; cursor: pointer; }
.slot:hover { border-color: var(--accent); color: var(--accent); }
.proj { overflow: hidden; padding: 0; }
.proj .thumb { aspect-ratio: 9/12; background: #000 center/cover no-repeat; }
.proj .meta { padding: 12px; }

/* ---------- Ideas / hooks ---------- */
.idea { display: flex; gap: 12px; align-items: flex-start; }
.idea .n { font-family: var(--display); color: var(--muted); width: 22px; flex: none; }
.idea .t { font-weight: 600; margin-bottom: 4px; }
.hook { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #121319; }
.hook.sel { border-color: var(--accent); background: #1b130f; }
.hook .radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #4a4f5c; flex: none; margin-top: 2px; }
.hook.sel .radio { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.hook q { quotes: none; font-size: 16px; font-weight: 600; display: block; margin-bottom: 6px; }
.map { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.map ul { margin: 0; padding-left: 18px; line-height: 1.8; }

/* ---------- AI log ---------- */
.ailog { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: #0a0b0e; border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 120px; max-height: 220px; overflow-y: auto; line-height: 1.8; color: #c8cbd6; }
.ailog .ok { color: var(--ok); } .ailog .run { color: var(--accent-2); }

/* ---------- Script editor ---------- */
.beat { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.beat .lbl { font-family: var(--display); font-weight: 700; }
.beat .lbl small { display: block; font-family: var(--font); font-weight: 400; color: var(--muted); font-size: 11px; margin-top: 2px; }
.meter { display: flex; gap: 18px; align-items: center; }
.meter b { font-family: var(--display); font-size: 22px; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: 280px 1fr 300px; grid-template-rows: 52px 1fr 190px; height: 100%; min-height: 640px; }
.ed-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #111217; }
.ed-left, .ed-right { border-right: 1px solid var(--line); overflow-y: auto; background: #111217; }
.ed-right { border-right: 0; border-left: 1px solid var(--line); padding: 14px; }
.ed-left .tabs { margin: 0; padding: 0 6px; }
.ed-left .pane { padding: 12px; }
.assets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.asset { background: #0c0d11; border: 1px solid var(--line); border-radius: 8px; aspect-ratio: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 6px; font-size: 11px; cursor: grab; position: relative; overflow: hidden; background-size: cover; background-position: center; }
.asset span { position: relative; background: rgba(0,0,0,.55); padding: 2px 5px; border-radius: 4px; align-self: flex-start; }
.asset.sel { outline: 2px solid var(--accent); }
.drop { border: 1.5px dashed #3a3f4c; border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); margin-bottom: 12px; }
.sfx { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; background: #0c0d11; cursor: pointer; }
.sfx .wave { flex: 1; height: 18px; background: repeating-linear-gradient(90deg, #3a3f4c 0 2px, transparent 2px 5px); mask: linear-gradient(90deg, #000, #000); opacity: .8; }
.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: radial-gradient(ellipse at center, #191b22, #0b0c0f); position: relative; min-height: 0; }
.phone { height: min(100%, 560px); aspect-ratio: 9/16; background: #000; border-radius: 14px; overflow: hidden; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.6); border: 1px solid #2a2e38; }
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; display: block; }
.safe { position: absolute; inset: 0; pointer-events: none; display: none; }
.safe.on { display: block; }
.safe i { position: absolute; background: rgba(255,60,60,.28); }
.controls { display: flex; align-items: center; gap: 10px; }
.timecode { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.timeline { grid-column: 1 / -1; border-top: 1px solid var(--line); background: #0f1014; padding: 10px 14px; overflow-x: auto; position: relative; }
.track { display: flex; align-items: center; gap: 0; height: 40px; margin-bottom: 6px; min-width: 760px; position: relative; }
.track .tl { width: 70px; flex: none; font-size: 11px; color: var(--muted); }
.lane { flex: 1; position: relative; height: 100%; background: #14161b; border-radius: 6px; }
.clip { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; padding: 4px 8px; font-size: 11px; overflow: hidden; white-space: nowrap; cursor: pointer; border: 1px solid rgba(255,255,255,.08); }
.clip.scene { background: #2b3446; }
.clip.scene.sel { outline: 2px solid var(--accent); background: #3a2a22; }
.clip.vo { background: #1d3a30; }
.mark { position: absolute; top: 6px; bottom: 6px; width: 16px; border-radius: 4px; background: #4a3b1d; color: var(--accent-2); font-size: 9px; display: grid; place-items: center; }
.clip.gif { background: #3b2546; }
.playhead { position: absolute; top: 6px; bottom: 6px; width: 2px; background: var(--accent); left: 84px; pointer-events: none; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.swatch.sel { border-color: #fff; }
.toggles { display: grid; gap: 8px; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 18px 0 10px; }

/* chat drawer */
.chat { position: absolute; right: 14px; bottom: 14px; width: 340px; background: #14161c; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.5); display: none; flex-direction: column; max-height: 70%; z-index: 5; }
.chat.open { display: flex; }
.chat header { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.msgs { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.msg { padding: 9px 12px; border-radius: 10px; max-width: 88%; line-height: 1.45; font-size: 13px; }
.msg.me { background: #2a1a12; align-self: flex-end; }
.msg.ai { background: var(--panel-2); }
.chat form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; place-items: center; z-index: 20; padding: 16px; }
.modal.open { display: grid; }
.modal .card { width: min(520px, 100%); }

/* style gallery */
.style-card { padding: 0; overflow: hidden; cursor: pointer; }
.style-card video, .style-card .ph { width: 100%; aspect-ratio: 9/14; object-fit: cover; display: block; background: #000; }
.style-card .ph { display: grid; place-items: center; color: var(--muted); font-size: 13px; background: repeating-linear-gradient(45deg, #15171d 0 10px, #121318 10px 20px); }
.style-card .meta { padding: 12px; }
.style-card.cur { outline: 2px solid var(--accent); }

/* analysis */
.kpi b { font-family: var(--display); font-size: 26px; display: block; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars div { flex: 1; background: linear-gradient(to top, var(--accent), var(--accent-2)); border-radius: 4px 4px 0 0; position: relative; }
.bars div span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }
.insight { border-left: 3px solid var(--accent); }

/* plans */
.plan.cur { border-color: var(--accent); }
.plan .price { font-family: var(--display); font-size: 24px; margin: 6px 0 10px; }
.plan ul { padding-left: 18px; margin: 0; line-height: 1.9; color: #c9ccd6; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .editor { grid-template-columns: 240px 1fr; grid-template-rows: 52px 1fr auto 190px; }
  .ed-right { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .g4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .titlebar .workspace, .titlebar .pill.lic, .dots { display: none; }
  .body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar { order: 2; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 6px; overflow-x: auto; }
  .nav-group, .side-foot, .nav .sub { display: none; }
  .nav, body.rail .nav { flex-direction: column; justify-content: center; height: auto; gap: 3px; font-size: 10px; padding: 4px 4px; min-width: 62px; background: transparent; }
  .nav .icon, body.rail .nav .icon { width: 34px; height: 28px; padding: 5px 8px; border-radius: 9px; box-sizing: border-box; }
  .nav.active, body.rail .nav.active { background: transparent; }
  .nav.active .icon, body.rail .nav.active .icon { background: #2a1912; color: var(--accent); }
  body.rail .body { grid-template-columns: 1fr; }
  body.rail .nav-group { display: none; }
  .titlebar .pill.claude { display: none; }
  .view { padding: 18px 16px 30px; }
  .g2, .g3, .g4, .map { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(7, 158px); overflow-x: auto; padding-bottom: 6px; }
  .beat { grid-template-columns: 1fr; }
  .editor { display: flex; flex-direction: column; height: auto; }
  .ed-top { flex-wrap: wrap; padding: 10px; }
  .stage { order: -1; min-height: 520px; }
  .phone { height: 480px; }
  .chat { position: fixed; left: 10px; right: 10px; width: auto; bottom: 70px; }
}

/* fixes */
a.card, a.quick, a.proj { text-decoration: none; color: inherit; }
.titlebar select.workspace { width: auto; max-width: 260px; }
