:root {
  --bg: #0E1726; --panel: #16223A; --panel2: #1D2B47; --line: #2A3B5C;
  --text: #E8EEF7; --muted: #93A3BE; --mint: #BFF5E6; --orange: #FF9F43; --pink: #FF4D8D; --red: #FF6B6B;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif; }
button { font: inherit; background: var(--mint); color: var(--bg); border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 600; cursor: pointer; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.warn { background: var(--orange); }
button:disabled { opacity: .45; cursor: default; }
input, textarea { font: inherit; width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
textarea { resize: vertical; }
h1, h2, h3 { margin: 0 0 8px; }
h2 { font-size: 16px; } h3 { font-size: 14px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.row.end { justify-content: flex-end; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(340px, 100%); display: grid; gap: 12px; text-align: center; }
.logo { font: 700 72px/1 Georgia, serif; color: var(--orange); }

header { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 16px; background: rgba(14,23,38,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { font-weight: 700; } .logo-s { color: var(--orange); font: 700 22px Georgia, serif; }
.pc { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--panel2); color: var(--muted); }
.pc.on { color: var(--bg); background: var(--mint); } .pc.off { color: var(--bg); background: var(--orange); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tabs button { background: var(--panel); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; font-weight: 500; }
.tabs button.on { background: var(--text); color: var(--bg); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.card .thumb { aspect-ratio: 9 / 12; background: var(--panel2) center / cover no-repeat; position: relative; }
.card .thumb.wide { aspect-ratio: 16 / 9; }
.card .info { padding: 10px; display: grid; gap: 4px; }
.card .name { font-weight: 600; font-size: 14px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--panel2); color: var(--muted); }
.badge.review { background: var(--mint); color: var(--bg); } .badge.revise { background: var(--orange); color: var(--bg); }
.badge.approved { background: #7BD88F; color: var(--bg); } .badge.posted { background: #6C8CFF; color: var(--bg); }
.badge.plan, .badge.making { background: var(--pink); color: var(--bg); }
.empty { color: var(--muted); padding: 24px; text-align: center; grid-column: 1 / -1; }

.item { border-top: 1px solid var(--line); padding: 8px 0; font-size: 14px; }
.item:first-child { border-top: 0; }
.item .when { color: var(--muted); font-size: 12px; }
.item pre { white-space: pre-wrap; margin: 6px 0 0; font: 13px/1.5 inherit; color: var(--text); background: var(--bg); padding: 8px; border-radius: 8px; }
.state { font-size: 12px; font-weight: 700; }
.state.waiting { color: var(--muted); } .state.running { color: var(--orange); } .state.done { color: #7BD88F; } .state.failed { color: var(--red); }

.detail { position: fixed; inset: 0; z-index: 10; background: var(--bg); overflow-y: auto; }
.detail-head { position: sticky; top: 0; display: flex; gap: 10px; align-items: center; padding: 10px 16px; background: rgba(14,23,38,.95); border-bottom: 1px solid var(--line); z-index: 2; }
.d-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-body { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .detail-body { grid-template-columns: 380px minmax(0, 1fr); align-items: start; } .media { position: sticky; top: 70px; } }
.media { display: grid; gap: 10px; }
.media video, .media img { width: 100%; border-radius: 12px; background: #000; display: block; }
.media video.tall { max-height: 70vh; object-fit: contain; }
.field { display: grid; gap: 4px; margin-top: 10px; }
.field label { font-size: 13px; color: var(--muted); }
.ptabs { display: flex; gap: 6px; margin-bottom: 4px; }
.ptabs button { background: var(--panel2); color: var(--muted); font-weight: 500; padding: 6px 12px; }
.ptabs button.on { background: var(--text); color: var(--bg); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: calc(100% - 32px); }
