:root { --pink: #e91e8c; --orange: #FF4D00; --ink: #1d1d1f; --muted: #6b6b70; --line: #ececf0; --bg: #ffffff; --soft: #fff3f9; --soft2: #fff1ea; --green: #1b8a4c; --amber: #b7791f; --red: #c0392b; --blue: #2c6fcf; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif; }
a { color: var(--pink); }
button { font: inherit; cursor: pointer; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 8px 14px; }
.btn:hover { border-color: var(--pink); }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; background: #fff; color: var(--ink); }
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--pink); outline-offset: 0; border-color: var(--pink); }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

.top { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); }
.top .in { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--pink); position: relative; }
.brand .dot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px var(--orange); }
.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tabs button { border: 0; background: transparent; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--soft); color: var(--pink); }
.top .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: #fff; white-space: nowrap; }
.pill.dry { background: var(--soft2); color: var(--orange); border-color: #ffd3bf; }
.pill.live { background: #e8f7ee; color: var(--green); border-color: #bfe8cd; }
.pill.ok { color: var(--green); } .pill.no { color: var(--red); }

main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 60px; }
h1 { font-size: 22px; margin: 6px 0 14px; letter-spacing: -.02em; }
h2 { font-size: 17px; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fff; }

.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; }
.stat .v.ph { color: var(--muted); font-weight: 500; font-size: 15px; }
.stat .s { font-size: 12px; color: var(--muted); }

.calhead { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; flex-wrap: wrap; }
.calhead .month { font-size: 18px; font-weight: 700; min-width: 170px; }
.legend { display: flex; gap: 10px; margin-left: auto; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c); }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dow { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0; }
.day { min-height: 108px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }
.day.out { background: #fafafa; opacity: .7; }
.day.today { border-color: var(--pink); box-shadow: 0 0 0 2px var(--soft); }
.day .n { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.day.today .n { color: var(--pink); font-weight: 700; }
.ev { border-left: 3px solid var(--c, var(--pink)); background: #fff; border-radius: 6px; padding: 3px 6px; margin-bottom: 4px; font-size: 12px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px; align-items: start; }
.ev:hover { background: var(--soft); }
.ev .t { color: var(--muted); font-size: 11px; }
.ev .c { grid-column: 1 / -1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev.draft { opacity: .6; border-style: dashed; }
/* post status (2026-10-23): green scheduled, blue published, red failed, orange draft */
.ps { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-top: 3px; flex: none; }
.ps.sch, .legend .sch::before { background: #1b8a4c; } .ps.pub, .legend .pub::before { background: #2563eb; } .ps.fail, .legend .fail::before { background: #c0392b; } .ps.drf, .legend .drf::before { background: #FF8A00; }
.legend .sch::before, .legend .pub::before, .legend .fail::before, .legend .drf::before { border-radius: 50%; }
.ev .why { grid-column: 1 / -1; color: #c0392b; font-size: 11px; font-weight: 600; }
.pstat { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.pstat.sch { color: #1b8a4c; background: #e8f7ee; } .pstat.pub { color: #1d4ed8; background: #e8effd; } .pstat.fail { color: #c0392b; background: #fdecea; white-space: normal; } .pstat.drf { color: #b45309; background: #fff3e0; }
.dotst { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-top: 3px; background: var(--muted); }
.dotst.up { background: var(--green); } .dotst.ready { background: var(--orange); } .dotst.missing { background: var(--red); } .dotst.na, .dotst.unmatched { background: #c9c9cf; } .dotst.scheduled { background: #d0d0d6; } .dotst.error { background: var(--red); }

.list .item { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; align-items: center; }
.list .item:hover { background: var(--soft); }
.chan { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; display: inline-block; color: #fff; background: var(--c, var(--muted)); }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.badge.up { color: var(--green); background: #e8f7ee; border-color: #bfe8cd; }
.badge.ready { color: var(--orange); background: var(--soft2); border-color: #ffd3bf; }
.badge.missing, .badge.error { color: var(--red); background: #fdecea; border-color: #f5c2bd; }
.badge.na, .badge.unmatched, .badge.skipped, .badge.unknown, .badge.scheduled, .badge.draft { color: var(--muted); background: #f6f6f8; }

.drawer-bg { position: fixed; inset: 0; background: rgba(20,20,30,.35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #fff; z-index: 21; overflow: auto; padding: 18px 20px 40px; box-shadow: -10px 0 40px rgba(0,0,0,.12); }
.drawer h2 { margin-top: 0; }
.drawer .close { position: absolute; top: 12px; right: 14px; }
pre.cap { white-space: pre-wrap; overflow-wrap: anywhere; background: #fafafa; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; margin: 6px 0; }
.thumb { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
td.txt { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 520px; }
.kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: var(--soft); color: var(--pink); }
.kind.academy { background: var(--soft2); color: var(--orange); } .kind.none { background: #f3f3f5; color: var(--muted); } .kind.notes { background: #eaf1fb; color: var(--blue); }

.log .l { display: grid; grid-template-columns: 150px 90px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.log .l .lv { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.lv.posted { color: var(--green); } .lv.dry-run { color: var(--orange); } .lv.warn { color: var(--amber); } .lv.error { color: var(--red); } .lv.info { color: var(--muted); }
.log .d { white-space: pre-wrap; color: var(--muted); font-size: 13px; margin-top: 3px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch .tr { width: 46px; height: 26px; border-radius: 999px; background: #d9d9de; position: relative; transition: .2s; }
.switch .tr::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on .tr { background: var(--orange); } .switch.on .tr::after { left: 23px; }

.login { max-width: 380px; margin: 12vh auto; }
.login .brand { margin-bottom: 18px; font-size: 20px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--green); color: #fff; padding: 14px 22px; border-radius: 12px; z-index: 50; font-size: 17px; font-weight: 600; max-width: 90%; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }
.notice { margin: 8px 0 2px; padding: 10px 14px; border-radius: 10px; font-size: 15px; font-weight: 600; }
.notice.ok { background: #e8f7ee; color: var(--green); border: 1px solid #bfe8cd; }
.notice.err { background: #fdecea; color: var(--red); border: 1px solid #f3c4bd; }
.pill.ok { background: #e8f7ee; color: var(--green); font-weight: 700; }
.err { color: var(--red); }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } .dow { display: none; } .day { min-height: 0; } .day.out:empty, .day.out { display: none; } .list .item { grid-template-columns: 1fr; } .log .l { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- phase 2 ---------- */
.tabs button .n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 11px; margin-left: 5px; text-align: center; }
.split { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.side { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.side .it { padding: 10px 12px; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.side .it:first-child { border-top: 0; }
.side .it:hover { background: var(--soft); } .side .it.on { background: var(--soft); color: var(--pink); font-weight: 600; }
.side .cat { padding: 8px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafafa; border-top: 1px solid var(--line); }
.thread { display: flex; flex-direction: column; gap: 12px; min-height: 40vh; }
.msg { max-width: 820px; padding: 12px 16px; border-radius: 16px; line-height: 1.5; white-space: normal; }
.msg.user { align-self: flex-end; background: var(--soft); border: 1px solid #ffd3ea; }
.msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; } .msg ul, .msg ol { margin: 4px 0 8px 20px; padding: 0; } .msg li { margin: 2px 0; }
.msg h1, .msg h2, .msg h3 { font-size: 15px; margin: 10px 0 4px; }
.msg code { background: #f6f6f8; padding: 1px 4px; border-radius: 4px; font-size: 13px; }
.tool { align-self: flex-start; font-size: 12px; color: var(--muted); padding: 2px 10px; border-left: 2px solid var(--orange); }
.composer { position: sticky; bottom: 0; background: #fff; padding: 12px 0 4px; border-top: 1px solid var(--line); margin-top: 16px; }
.composer textarea { min-height: 64px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chip { font-size: 13px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; background: #fff; cursor: pointer; }
.chip:hover { border-color: var(--pink); color: var(--pink); }
.draft { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.draft.held { border-color: #ffd3bf; background: #fffaf7; } .draft.approved { border-color: #bfe8cd; } .draft.rejected { opacity: .6; } .draft.scheduled { border-color: #bfe8cd; background: #f3fbf6; }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.tag { font-size: 12px; background: #f3f3f5; border-radius: 6px; padding: 2px 8px; color: var(--muted); } .tag b { color: var(--ink); font-weight: 600; }
.tag.winner { background: #e8f7ee; } .tag.variation { background: #eaf1fb; } .tag.experiment { background: var(--soft2); }
.checks { margin: 8px 0; font-size: 13px; } .checks .h { color: var(--red); } .checks .s { color: var(--amber); } .checks .ok { color: var(--green); }
.answer { border: 2px solid var(--pink); border-radius: 16px; padding: 16px 18px; background: var(--soft); font-size: 17px; line-height: 1.5; margin-bottom: 14px; }
.answer .q { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--pink); font-weight: 700; margin-bottom: 4px; }
.conf { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.conf.measured { background: #e8f7ee; color: var(--green); } .conf.early { background: var(--soft2); color: var(--orange); }
.bar { height: 6px; background: #f0f0f3; border-radius: 3px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--pink); }
.editor textarea { min-height: 60vh; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.versions .v { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.inbox-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; background: #fff; }
.inbox-item.done { opacity: .55; } .inbox-item.report { border-color: #ffd3ea; }
.md p { margin: 0 0 8px; } .md ul, .md ol { margin: 4px 0 8px 20px; padding: 0; }
.kpi { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .editor textarea { min-height: 40vh; } }

/* ---------- phase 3: the Inbox ---------- */
.inb.carrie { border-color: #ffd3bf; background: #fffaf7; } .inb.hold { border-color: #ffe3f0; } .inb.flagged { border-color: #f5c2bd; background: #fff7f6; }
.act.held { border-color: #ffd3bf; } .act.waiting { border-color: #f5c2bd; } .act.sent, .act.done { border-color: #bfe8cd; } .act.dry-run { border-color: #ffd3bf; background: #fffaf7; } .act.stopped, .act.skipped { opacity: .6; }

/* phase 4: visuals and the Preview page */
.slides { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0; }
.slides img { height: 190px; width: auto; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.visual { margin: 8px 0; }
.pv { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; background: #fff; }
.pv.approved, .pv.scheduled { border-color: #bfe8cd; } .pv.held { border-color: #ffd3bf; background: #fffaf7; } .pv.failing { border-color: #f3c4bd; } .pv.skipped, .pv.rejected { opacity: .55; }
.pv .cap { margin: 6px 0; }

/* phase 5: video */
.vid video { width: 100%; max-width: 300px; aspect-ratio: 9 / 16; border-radius: 12px; border: 1px solid var(--line); background: #000; display: block; }
.render .bar { height: 8px; border-radius: 999px; background: #f0f0f3; overflow: hidden; margin: 6px 0 4px; max-width: 420px; }
.render .bar span { display: block; height: 100%; background: var(--orange); transition: width .6s; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 8px 0; }
.mcard { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: grid; grid-template-columns: 120px 1fr; }
.mcard.review { border-color: #ffd3bf; } .mcard.approved { border-color: #bfe8cd; } .mcard.failed { border-color: #f3c4bd; }
.mcard .poster { width: 120px; aspect-ratio: 9 / 16; background: #111 center / cover no-repeat; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; }
.mcard .poster.empty { background: #f3f3f5; color: var(--muted); font-size: 12px; cursor: default; }
.mcard .poster .play { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--orange); display: flex; align-items: center; justify-content: center; font-size: 16px; padding-left: 3px; }
.mcard video { width: 120px; aspect-ratio: 9 / 16; background: #000; display: block; }
.mcard .mbody { padding: 10px 12px; min-width: 0; }
.mcard .mbody pre.cap { max-height: 160px; overflow: auto; }

/* ---------- phase 6: Awaiting approval ---------- */
.more-settings > summary { list-style: none; } .more-settings > summary::-webkit-details-marker { display: none; }
.more-settings > summary::before { content: "▸ "; color: var(--pink); } .more-settings[open] > summary::before { content: "▾ "; }
.tabs { flex-wrap: wrap; }
