/* Content Dashboard: dark, video-first (Instagram / Frame.io). Design brief: .impeccable.md */
@font-face { font-family: "Bricolage"; src: url("/fonts/bricolage-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument"; src: url("/fonts/instrument-sans-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: oklch(0.155 0.006 80);
  --col: oklch(0.183 0.007 80);
  --panel: oklch(0.2 0.008 80);
  --raise: oklch(0.245 0.009 80);
  --hover: oklch(0.27 0.01 80);
  --line: oklch(0.3 0.009 80);
  --line-soft: oklch(0.27 0.008 80);
  --text: oklch(0.965 0.008 95);
  --text-2: oklch(0.83 0.01 90);
  --muted: oklch(0.67 0.012 88);
  --faint: oklch(0.52 0.012 85);
  --yellow: oklch(0.875 0.165 91);
  --yellow-ink: oklch(0.21 0.04 90);
  --yellow-soft: oklch(0.875 0.165 91 / 0.14);
  --green: oklch(0.8 0.15 152);
  --green-soft: oklch(0.8 0.15 152 / 0.14);
  --red: oklch(0.71 0.17 27);
  --red-soft: oklch(0.71 0.17 27 / 0.14);
  --display: "Bricolage", "Instrument", ui-sans-serif, system-ui, sans-serif;
  --ui: "Instrument", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r: 10px;
  --tap: 44px;
  --panel-w: min(600px, 46vw);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--ui); font-size: 15px; line-height: 1.45; min-height: 100dvh; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px clamp(14px, 2vw, 28px); background: oklch(0.155 0.006 80 / 0.86); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line-soft); }
.mark { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 750; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; }
.mark i { width: 22px; height: 22px; border-radius: 6px; background: var(--yellow); display: grid; place-items: center; }
.mark i::after { content: ""; border-left: 8px solid var(--yellow-ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-left: 2px; }
.search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search input { width: 100%; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); padding: 0 12px 0 34px; color: var(--text); }
.search input::placeholder { color: var(--faint); }
.search::before { content: ""; position: absolute; left: 12px; top: 12px; width: 11px; height: 11px; border: 2px solid var(--faint); border-radius: 50%; }
.search::after { content: ""; position: absolute; left: 23px; top: 24px; width: 6px; height: 2px; background: var(--faint); transform: rotate(45deg); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--raise); color: var(--text); box-shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset; }
.seg button b { font-weight: 700; color: var(--text-2); margin-left: 4px; }
.seg button.on b { color: var(--text); }

/* ---------- buttons ---------- */
.btn { height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--raise); color: var(--text); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease); }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(0.98); }
.btn.y { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); }
.btn.y:hover { background: oklch(0.9 0.16 91); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--raise); }
.btn.line { background: transparent; }
.btn.danger { color: var(--red); }
.btn.big { height: 48px; font-size: 15px; padding: 0 18px; border-radius: 11px; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.iconbtn { width: 38px; height: 38px; padding: 0; }

/* ---------- board (laptop) ---------- */
.board { display: grid; grid-template-columns: minmax(250px, 0.8fr) minmax(330px, 1.15fr) minmax(300px, 1fr); gap: 14px; padding: 16px clamp(14px, 2vw, 28px) 40px; align-items: start; transition: padding-right 0.35s var(--ease); }
body.panel-open .board { padding-right: calc(var(--panel-w) + 28px); }
.colm { background: var(--col); border: 1px solid var(--line-soft); border-radius: 14px; min-height: 60vh; }
.colm header { position: sticky; top: 63px; z-index: 2; display: flex; align-items: baseline; gap: 8px; padding: 14px 16px 10px; background: var(--col); border-radius: 14px 14px 0 0; }
.colm h2 { margin: 0; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.colm header .n { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.colm header .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); align-self: center; }
.colm.ready header .dot { background: var(--yellow); box-shadow: 0 0 0 4px var(--yellow-soft); }
.colm.posted header .dot { background: var(--green); }
.colm.making header .dot { background: transparent; border: 1.5px dashed var(--muted); }
.colm .list { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.colm .more { margin: 2px 10px 12px; width: calc(100% - 20px); }

/* Reel card: a filmstrip of its versions in this column + title */
.rcard { border-radius: 12px; padding: 10px; background: var(--panel); border: 1px solid var(--line-soft); transition: border-color 0.15s, background 0.15s; animation: rise 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 28ms); }
.rcard:hover { border-color: var(--line); }
.rcard.sel { border-color: var(--text-2); }
.rcard .t { display: flex; align-items: baseline; gap: 8px; margin: 10px 2px 2px; }
.rcard h3 { margin: 0; flex: 1; font-family: var(--display); font-weight: 650; font-size: 15px; line-height: 1.25; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .meta { color: var(--muted); font-size: 12.5px; margin: 0 2px; font-variant-numeric: tabular-nums; }
.strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; scroll-snap-type: x proximity; }
.strip::-webkit-scrollbar { display: none; }
.vt { flex: none; width: 76px; scroll-snap-align: start; }
.vt .lab { margin-top: 5px; font-size: 11.5px; line-height: 1.25; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vt.on .lab { color: var(--text); font-weight: 600; }

/* ---------- covers ---------- */
.cover { position: relative; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: var(--raise); isolation: isolate; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s var(--ease); }
a:hover > .cover img, button:hover > .cover img { transform: scale(1.035); }
.cover.ph { display: flex; align-items: flex-end; padding: 8px; background: repeating-linear-gradient(135deg, oklch(0.24 0.009 80) 0 10px, oklch(0.225 0.008 80) 10px 20px); }
.cover.ph span { font-family: var(--display); font-weight: 650; font-size: 10.5px; line-height: 1.2; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cover.making img { filter: grayscale(0.65) brightness(0.8); }
.cover .ring { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.07); }
.cover.ready .ring { box-shadow: inset 0 0 0 2px var(--yellow); }
.vt.on .cover .ring, .vtl.on .cover .ring { box-shadow: inset 0 0 0 2.5px var(--text); }
.badge { position: absolute; left: 6px; top: 6px; z-index: 1; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; padding: 2px 6px; border-radius: 5px; background: oklch(0.15 0.006 80 / 0.78); backdrop-filter: blur(6px); color: var(--text); }
.badge.live { color: var(--green); } .badge.bad { color: var(--red); } .badge.ready { background: var(--yellow); color: var(--yellow-ink); }
.pip { position: absolute; right: 6px; top: 6px; z-index: 1; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px oklch(0.15 0.006 80 / 0.8); }
.pip.live { background: var(--green); } .pip.bad { background: var(--red); } .pip.wait { background: var(--yellow); }

/* ---------- side panel / page ---------- */
.scrim { display: none; }
.panel { position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; width: var(--panel-w); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -24px 0 60px oklch(0 0 0 / 0.35); overflow-y: auto; transform: translateX(104%); transition: transform 0.38s var(--ease); overscroll-behavior: contain; }
body.panel-open .panel { transform: none; }
.phead { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: oklch(0.2 0.008 80 / 0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
.phead .crumb { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbody { padding: 18px 20px 120px; }
.rtitle { font-family: var(--display); font-weight: 750; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.12; letter-spacing: -0.025em; margin: 2px 0 6px; }
.rmeta { color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.rmeta b { color: var(--text-2); font-weight: 600; }
.vstrip { display: flex; gap: 10px; overflow-x: auto; padding: 16px 0 6px; margin: 0 -20px; padding-left: 20px; padding-right: 20px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.vstrip::-webkit-scrollbar { display: none; }
.vtl { flex: none; width: 92px; scroll-snap-align: start; background: none; border: 0; padding: 0; text-align: left; }
.vtl .lab { margin-top: 6px; font-size: 12px; line-height: 1.25; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vtl.on .lab { color: var(--text); font-weight: 600; }
.vtl.add .cover { display: grid; place-items: center; border: 1.5px dashed var(--line); background: transparent; color: var(--muted); font-size: 26px; font-weight: 300; }

.vhead { display: flex; align-items: center; gap: 10px; margin: 18px 0 4px; }
.vhead h2 { margin: 0; flex: 1; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.015em; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--raise); color: var(--text-2); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.ready { background: var(--yellow-soft); color: var(--yellow); }
.status.posted { background: var(--green-soft); color: var(--green); }
.status.making { color: var(--muted); }
.status.dropped { color: var(--faint); }
.sub { color: var(--muted); font-size: 13px; }

.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 6px; }
.acts .wide { grid-column: 1 / -1; }
.acts a.btn { width: 100%; }

/* posting block (inline, no modal) */
.postbox { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--yellow-soft); border: 1px solid oklch(0.875 0.165 91 / 0.35); display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s var(--ease); }
.postbox.open { grid-template-rows: 1fr; }
.postbox > div { overflow: hidden; }
.postbox h4 { margin: 0 0 4px; font-family: var(--display); font-size: 16px; }
.postbox .row { display: flex; gap: 8px; margin: 10px 0; }
.input { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px; color: var(--text); }
textarea.input { height: auto; min-height: 130px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }

/* auto-DM state */
.dm { margin-top: 12px; border-radius: 12px; padding: 12px 14px; background: var(--raise); display: flex; gap: 12px; align-items: flex-start; }
.dm .ic { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--faint); }
.dm.live .ic { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.dm.bad { background: var(--red-soft); } .dm.bad .ic { background: var(--red); }
.dm.wait .ic { background: var(--yellow); }
.dm .txt { flex: 1; min-width: 0; }
.dm b { display: block; font-size: 14.5px; }
.dm p { margin: 2px 0 0; color: var(--text-2); font-size: 13.5px; }
.dm .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dm .btns .btn { height: 32px; font-size: 13px; }

/* tabs */
.tabs { display: flex; gap: 2px; margin: 22px 0 0; border-bottom: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; border: 0; background: none; padding: 10px 12px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--text); }
.tabpane { padding: 16px 0; animation: fade 0.25s var(--ease) both; }
.text { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.6; color: var(--text); }
.text.script { font-size: 14.5px; color: var(--text-2); }
.copyline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.k { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; } .kv dd a { color: var(--yellow); }
.warn { color: var(--red); font-weight: 600; font-size: 14px; }
.note { color: var(--muted); font-size: 13.5px; }

/* DM chat preview */
.chat { display: flex; flex-direction: column; gap: 6px; max-width: 360px; }
.chat .step { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 8px; }
.bub { align-self: flex-start; max-width: 100%; padding: 9px 12px; border-radius: 18px 18px 18px 6px; background: var(--raise); white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.bub .bt { display: block; margin-top: 8px; padding: 7px 10px; border-radius: 10px; background: oklch(0.32 0.01 80); text-align: center; font-weight: 600; font-size: 13px; }
.bub.miss { background: var(--red-soft); color: var(--red); }

/* forms */
.form { display: grid; gap: 14px; }
.form label > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--yellow); }
fieldset { border: 0; padding: 0; margin: 6px 0 0; display: grid; gap: 14px; }
legend { font-family: var(--display); font-weight: 700; font-size: 15px; margin-bottom: 4px; }

/* gate */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate .box { width: min(380px, 100%); }
.gate h1 { font-family: var(--display); font-weight: 780; font-size: 34px; letter-spacing: -0.03em; line-height: 1.05; margin: 18px 0 8px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; animation: rise 0.3s var(--ease) both; }
.empty { padding: 26px 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.empty b { display: block; color: var(--text-2); font-family: var(--display); font-size: 15px; margin-bottom: 2px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid oklch(1 0 0 / 0.2); border-top-color: currentColor; animation: s 0.8s linear infinite; display: inline-block; }

@keyframes s { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- phone & tablet ---------- */
.mtabs { display: none; }
.grid { display: none; }
.mbar { display: none; }

@media (max-width: 999px) {
  :root { --panel-w: 100vw; }
  .bar .search { display: none; }
  .bar .seg.made { display: none; }
  .bar.has-search .search { display: block; position: absolute; left: 12px; right: 12px; top: 8px; max-width: none; z-index: 2; }
  .board { display: none; }
  body.panel-open .board { padding-right: 0; }
  .mtabs { display: flex; position: sticky; top: 63px; z-index: 9; padding: 10px 14px; background: oklch(0.155 0.006 80 / 0.9); backdrop-filter: blur(14px); }
  .mtabs .seg { width: 100%; }
  .mtabs .seg button { flex: 1; padding: 8px 6px; font-size: 13.5px; }
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; padding: 4px 14px calc(40px + env(safe-area-inset-bottom)); }
  .tile { display: block; animation: rise 0.4s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms); }
  .tile .stack { position: relative; }
  .tile .stack.multi::before, .tile .stack.multi::after { content: ""; position: absolute; left: 7%; right: 7%; top: -6px; height: 20px; border-radius: 8px 8px 0 0; background: oklch(0.3 0.009 80); z-index: -1; }
  .tile .stack.multi::after { left: 14%; right: 14%; top: -11px; background: oklch(0.25 0.008 80); z-index: -2; }
  .tile .stack { margin-top: 12px; isolation: isolate; }
  .tile h3 { margin: 8px 2px 0; font-family: var(--display); font-weight: 650; font-size: 14px; line-height: 1.25; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tile .meta { margin: 2px 2px 0; color: var(--muted); font-size: 12px; }
  .panel { border-left: 0; box-shadow: none; transform: translateX(100%); }
  .pbody { padding: 14px 16px calc(110px + env(safe-area-inset-bottom)); }
  .vstrip { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .vtl { width: 104px; }
  .mbar { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: oklch(0.2 0.008 80 / 0.94); backdrop-filter: blur(16px); border-top: 1px solid var(--line-soft); transform: translateY(110%); transition: transform 0.3s var(--ease); }
  body.panel-open .mbar.show { transform: none; }
  .mbar .btn { flex: 1; height: 50px; font-size: 15.5px; border-radius: 12px; }
  .acts .hide-m { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 10px; }
  .form .two { grid-template-columns: 1fr; }
}
@media (min-width: 1000px) { .phone-only { display: none !important; } }
@media (max-width: 420px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.k.sp { display: block; margin: 20px 0 6px; }
.postbox:not(.open) { padding: 0; margin: 0; border-width: 0; }
.vt { width: 84px; }

.mag { width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 50%; position: relative; display: inline-block; }
.mag::after { content: ""; position: absolute; width: 6px; height: 2px; background: currentColor; right: -5px; bottom: -3px; transform: rotate(45deg); }
@media (max-width: 999px) {
  .mark { font-size: 16px; flex: 1; }
  .newbtn .lbl { display: none; }
  .newbtn { width: 38px; padding: 0; font-size: 20px; }
  .bar.has-search > :not(.search) { visibility: hidden; }
}
.vstrip, .strip { scroll-padding-inline: 20px; }
@media (max-width: 999px) { .vstrip { scroll-padding-inline: 16px; } }
@media (max-width: 999px) { .postbox .row { flex-wrap: wrap; } .postbox .row .input { flex: 1 1 100%; } .postbox .row .btn { flex: 1; height: 44px; } }
