/* ShortsBot – light theme, aligned with the VUNETRA app (paper #FAF7F8, ink #141113) and Xigi burgundy. */

@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/static/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/static/fonts/schibsted-grotesk-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* palette – change these to retheme everything */
  --paper: #FAF7F8;      /* VUNETRA app background */
  --surface: #FFFFFF;
  --ink: #141113;        /* VUNETRA ink */
  --ink-2: #4A4245;
  --muted: #7A6F73;
  --line: #EAE2E5;
  --line-strong: #D9CDD1;
  --brand: #82323A;      /* Xigi burgundy */
  --brand-ink: #6A272E;
  --brand-tint: #F5E9EB;
  --brand-ring: rgba(130, 50, 58, .22);

  --ok: #2E6B4A;   --ok-bg: #E6F1EA;
  --wait: #8A5A12; --wait-bg: #FBF0DC;
  --busy: #3E4F6B; --busy-bg: #E9EDF4;
  --bad: #A3302A;  --bad-bg: #FBE8E6;

  --r-sm: 8px; --r: 10px; --r-lg: 16px; --r-tile: 14px; --r-phone: 34px;
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-ink); }
:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.nav .count, .tabs .n { font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── app shell ───────── */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  align-self: start;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); padding: 22px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 0 8px 22px; }
.brand svg { flex: none; }
.brand b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-weight: 500;
  position: relative;
}
.nav a:hover { background: var(--paper); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-ink); font-weight: 650; }
.nav .count {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; display: inline-grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
}
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; font-size: 13px; }
.side-foot a { color: var(--ink-2); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; }
.side-foot a:hover { color: var(--ink); }
.linkbtn { background: none; border: 0; padding: 0; margin-top: 6px; font: inherit; color: var(--muted); cursor: pointer; }
.linkbtn:hover { color: var(--brand); }

.main { min-width: 0; padding: 34px 40px 60px; }
.wrap { max-width: 1180px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.back { display: inline-block; margin-bottom: 14px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--brand); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 14px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .brand b { display: none; }
  .nav { flex-direction: row; }
  .nav a { white-space: nowrap; padding: 8px 10px; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; gap: 12px; align-items: center; white-space: nowrap; }
  .side-foot a { display: none; }
  .linkbtn { margin: 0; }
  .main { padding: 22px 16px 48px; }
  h1 { font-size: 25px; }
}

/* ───────── surfaces ───────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 20px; }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section { padding: 22px 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; padding-top: 0; }
.section > h3 { margin-bottom: 4px; }
.section > .muted { margin-bottom: 12px; font-size: 14px; }

.alert { padding: 12px 16px; border-radius: var(--r); margin-bottom: 18px; border: 1px solid; font-size: 14px; }
.alert.ok { background: var(--ok-bg); border-color: #C5E0CF; color: #1F4D35; }
.alert.err { background: var(--bad-bg); border-color: #F0C7C2; color: #7A211C; }
.alert.info { background: var(--wait-bg); border-color: #EFD9B0; color: #5E3D0A; }
.alert div + div { margin-top: 4px; }

/* ───────── buttons ───────── */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--r); border: 1px solid transparent; font: 600 14px/1 var(--font); cursor: pointer;
  text-decoration: none; white-space: nowrap; background: var(--brand); color: #fff;
}
.btn:hover, button:hover { background: var(--brand-ink); color: #fff; }
.btn.ghost, button.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover, button.ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--ink-2); }
button.danger { background: var(--surface); color: var(--bad); border-color: #EBC3BF; }
button.danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn.sm, button.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn.lg, button.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { display: contents; }

/* ───────── forms ───────── */
label.field { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 6px; }
label.field:first-child { margin-top: 0; }
.hint { display: block; color: var(--muted); font-weight: 400; font-size: 13px; margin-top: 2px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: 400 15px/1.45 var(--font);
}
textarea { min-height: 104px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #A89DA1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
input[type=number] { width: 120px; }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237A6F73' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; }

/* toggle pills (checkbox / radio) */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-opt { position: relative; }
.pill-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill-opt span {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-weight: 550; font-size: 14px;
  user-select: none;
}
.pill-opt input:hover + span { border-color: var(--ink-2); }
.pill-opt input:checked + span { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-ink); font-weight: 650; }
.pill-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-ring); }
.pills.days .pill-opt span { width: 46px; justify-content: center; padding: 0; }

/* segmented control (radio) */
.seg { display: inline-flex; padding: 3px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; gap: 2px; flex-wrap: wrap; }
.seg .pill-opt span { border: 0; height: 34px; border-radius: 9px; background: transparent; }
.seg .pill-opt input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,17,19,.12), 0 0 0 1px var(--line); }

.checkline { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.checkline input { width: 18px; height: 18px; accent-color: var(--brand); }

.form-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 36px; }
@media (max-width: 980px) { .form-grid { grid-template-columns: 1fr; } }
.form-foot { display: flex; gap: 8px; align-items: center; padding-top: 18px; border-top: 1px solid var(--line); margin-top: 6px; }

/* ───────── status chips ───────── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 650; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ready { background: var(--wait-bg); color: var(--wait); }
.chip.published { background: var(--ok-bg); color: var(--ok); }
.chip.error, .chip.failed { background: var(--bad-bg); color: var(--bad); }
.chip.partial { background: #FCEBDD; color: #8E4A14; }
.chip.queued, .chip.generating, .chip.approved, .chip.publishing { background: var(--busy-bg); color: var(--busy); }
.chip.rejected { background: #EFEAEC; color: var(--muted); }
.chip.active { background: var(--ok-bg); color: var(--ok); }
.chip.paused { background: #EFEAEC; color: var(--muted); }
.chip.plain::before { display: none; }

/* ───────── video wall (the 9:16 tiles) ───────── */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 12px; margin-bottom: -1px; color: var(--muted); text-decoration: none; font-weight: 550;
  border-bottom: 2px solid transparent; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.tabs .n { font-size: 12px; color: var(--muted); font-weight: 600; }

.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 26px 18px; }
@media (max-width: 600px) { .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; } .tile .poster .chip { top: 8px; left: 8px; } }
.tile { color: var(--ink); text-decoration: none; display: block; min-width: 0; }
.tile .poster {
  position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-tile); overflow: hidden;
  background: #2A2326; outline: 1px solid rgba(20,17,19,.06); outline-offset: -1px;
}
.tile .poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover .poster { outline: 2px solid var(--brand); outline-offset: 2px; }
.tile .poster .chip { position: absolute; top: 10px; left: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.tile .poster .empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; text-align: center;
  color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.4;
  background: linear-gradient(160deg, #3A2E32, #1E191B 70%); }
.tile .poster .empty.working { background: linear-gradient(160deg, #4A3A40, #221C1F 70%); }
.tile .poster .empty.working::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 22px; height: 3px;
  border-radius: 3px; background: linear-gradient(90deg, transparent, var(--brand), transparent); background-size: 200% 100%;
  animation: sweep 1.6s linear infinite; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.tile .meta { padding: 10px 2px 0; }
.tile .title { font-weight: 650; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.tile .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.plats { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.plat { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: #F0EAEC; color: var(--ink-2); }
.plat.ok { background: var(--ok-bg); color: var(--ok); }
.plat.bad { background: var(--bad-bg); color: var(--bad); }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--wait);
  margin-bottom: 22px; }

.empty-state { text-align: center; padding: 56px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--muted); }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; font-size: 17px; }

/* composer: shown via #compose:target – no JavaScript */
.compose { display: none; }
.compose:target, .compose.show { display: block; }
.compose-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0 28px; }
@media (max-width: 860px) { .compose-grid { grid-template-columns: 1fr; } }

/* ───────── job detail ───────── */
.job { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 980px) { .job { grid-template-columns: 1fr; } }
.phone { position: sticky; top: 24px; width: 100%; max-width: 340px; aspect-ratio: 9 / 16; border-radius: var(--r-phone);
  background: var(--ink); padding: 9px; box-shadow: 0 24px 48px -20px rgba(20,17,19,.45); }
.phone video, .phone .empty { width: 100%; height: 100%; border-radius: 26px; display: block; object-fit: cover; background: #000; }
.phone .empty { display: grid; place-items: center; color: rgba(255,255,255,.7); text-align: center; padding: 24px; font-size: 14px;
  background: linear-gradient(160deg, #3A2E32, #1E191B 70%); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.scenes { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.scenes li { display: grid; grid-template-columns: 30px 1fr; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.scenes li:first-child { border-top: 0; }
.scenes li::before { counter-increment: s; content: counter(s); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.scenes .src { font-size: 12.5px; color: var(--muted); }

.results { list-style: none; padding: 0; margin: 0; }
.results li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.results li:first-child { border-top: 0; }
.results b { width: 84px; flex: none; }
.results .err { color: var(--bad); }

/* ───────── themes ───────── */
.ruler { position: relative; height: 64px; margin: 6px 0 4px; }
.ruler .track { position: absolute; left: 0; right: 0; top: 26px; height: 2px; background: var(--line-strong); }
.ruler .tick { position: absolute; top: 20px; width: 1px; height: 14px; background: var(--line-strong); }
.ruler .tick span { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ruler .tick.midnight { background: var(--ink-2); height: 18px; top: 18px; }
.ruler .now { position: absolute; top: 12px; width: 2px; height: 30px; background: var(--brand); border-radius: 2px; }
.ruler .run { position: absolute; top: 19px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand); }
.ruler .run.auto { background: var(--brand); }
.upcoming { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); margin-top: 10px; }
.upcoming b { font-weight: 650; color: var(--ink); }
.legend { display: inline-flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--brand); margin-right: 5px; vertical-align: -1px; }
.legend i.auto { background: var(--brand); }

.themes { list-style: none; margin: 0; padding: 0; }
.theme-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(150px, .9fr) minmax(230px, 1.1fr) auto; gap: 18px; align-items: center;
  padding: 18px 0; border-top: 1px solid var(--line); }
.theme-row:first-child { border-top: 0; padding-top: 4px; }
.theme-row .name { font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; }
.theme-row .name:hover { color: var(--brand); }
.theme-row .desc { color: var(--muted); font-size: 13.5px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.theme-row .when { font-size: 14px; }
.theme-row .when .times { font-weight: 650; font-variant-numeric: tabular-nums; }
.theme-row .when .muted { font-size: 13px; }
.theme-row.paused .name, .theme-row.paused .when { opacity: .55; }
@media (max-width: 980px) { .theme-row { grid-template-columns: 1fr; gap: 8px; } }

/* ───────── platforms ───────── */
.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.platform { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.platform .top { display: flex; justify-content: space-between; align-items: center; }
.platform h2 { font-size: 17px; }
.platform code, .panel code { font-size: 12.5px; background: var(--paper); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.platform .foot { margin-top: auto; padding-top: 6px; }

/* ───────── auth pages ───────── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 26px; color: var(--ink); }
.auth-brand b { font-size: 20px; font-weight: 800; }
.auth .panel { padding: 28px; }
.auth h1 { font-size: 24px; margin-bottom: 6px; }
.auth .lead { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.auth .row-between { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 12px; }
.auth .below { text-align: center; margin-top: 16px; font-size: 14px; }
.code-input { font-size: 22px !important; letter-spacing: .4em; text-align: center; font-weight: 650; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
