/* Fallbacks mirror public/brand.js. Edit brand.js to recolor the admin UI. */
:root {
  --paper: #ffffff;
  --ink: #111111;
  --muted: #5c5c5c;
  --line: #e6e6e6;
  --surface: #ffffff;
  --accent: #ED112D;
  --accent-ink: #ffffff;
  --good: #157a42;
  --good-ink: #f3fff7;
  --danger: #9f1239;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, .chip { touch-action: manipulation; }
img, video { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.shell {
  width: min(440px, 100%);
  margin: 0 auto;
}

.boot {
  padding: 48px 20px;
  color: var(--muted);
}

.logo {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  flex: none;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-family: var(--serif);
  letter-spacing: -0.04em;
}

.logo-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: none;
  display: block;
}

.logo-lockup {
  width: min(300px, 100%);
  height: auto;
  display: block;
}

.bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.product { font-weight: 700; letter-spacing: -0.02em; }
.agency { color: var(--muted); font-size: 12px; }

.text-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 650;
  font-size: 15px;
  min-height: 44px;
  padding: 0 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.meter {
  height: 6px;
  margin: 4px 16px 12px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.progress-label {
  padding: 0 16px;
  font-size: 15px;
}

.progress-label span { color: var(--muted); font-weight: 500; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 16px 8px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 4px 2px;
  min-height: 44px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.toggle .switch {
  width: 40px;
  height: 24px;
  border-radius: 99px;
  background: var(--line);
  position: relative;
  flex: none;
}

.toggle .switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.toggle.on .switch {
  background: var(--ink);
}

.toggle.on .switch::after {
  left: 18px;
}

.queue, .review-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.review-page {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.review-page .review-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.review-page .actions {
  position: static;
  margin-top: 0;
  grid-template-columns: 1fr 1fr;
}

.queue-main, .review-main { flex: 1 0 auto; }

.group { padding: 6px 16px 8px; }
.group h2 {
  margin: 12px 0 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.group h3 { margin: 8px 0; font-size: 16px; }

.stories-label {
  margin: 10px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.stack { display: grid; gap: 8px; }

.card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.client-card {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px 16px;
}

.pending-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.pending-count.zero {
  background: var(--line);
  color: var(--muted);
}

.thumb {
  width: 64px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
  position: relative;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}

.play::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 7px;
  border-style: solid;
  border-width: 6px 0 6px 9px;
  border-color: transparent transparent transparent var(--ink);
}

.card-top, .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  font-weight: 700;
  line-height: 1.3;
  margin: 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta, .when { color: var(--muted); font-size: 13px; }

.pill {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
  background: color-mix(in srgb, var(--ink) 8%, white);
  color: var(--muted);
}

.pill.approved {
  background: color-mix(in srgb, var(--good) 16%, white);
  color: var(--good);
}

.pill.needs_changes {
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--accent);
}

.dock, .actions {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.btn {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 14px;
  min-height: 52px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 17px;
  text-align: center;
  text-decoration: none;
  display: grid;
  place-items: center;
}

.btn-go { background: var(--accent); color: var(--accent-ink); }
.btn-approve { background: var(--good); color: white; }
.btn-changes { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn:disabled { opacity: 0.55; }

.caughtup, .empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
}

.empty h2 { color: var(--ink); margin-bottom: 4px; }

.preview {
  margin: 0 8px;
}

.stage {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  grid-template-areas: "prev media next";
  column-gap: 4px;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
}

.stage .media {
  grid-area: media;
  justify-self: center;
  min-width: 0;
}

.media {
  --max-h: 52dvh;
  width: min(100%, calc(var(--max-h) * var(--ar)));
  aspect-ratio: var(--ar);
  max-height: var(--max-h);
  margin: 0 auto;
  background: #111;
  position: relative;
  overflow: hidden;
  user-select: none;
  border-radius: 16px;
}

.track {
  display: flex;
  height: 100%;
  transition: transform 0.28s ease;
}

.slide { flex: 0 0 100%; height: 100%; min-width: 0; }

.slide img, .slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
  display: block;
}

.media-missing {
  height: 100%;
  display: grid;
  place-items: center;
  color: #ddd;
  font-size: 14px;
  padding: 16px;
  text-align: center;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.counter {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  text-align: center;
}

.chev {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  justify-self: center;
}

.chev svg {
  display: block;
  flex: none;
}

.chev.prev { grid-area: prev; }
.chev.next { grid-area: next; }
.chev[hidden] { visibility: hidden; pointer-events: none; }

.dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
}

.dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: #d5d5d5;
}

.dots button.on { background: #222; }

.caption-block { margin: 0 0 12px; }
.caption-block h3 {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.caption {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.media.caption-view { background: var(--paper); }
.media.caption-view .slide:not(.caption-card) { visibility: hidden; }

.caption-card {
  box-sizing: border-box;
  height: 100%;
  padding: 48px 52px 24px;
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.caption-card h3 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.caption-card .caption {
  flex: 1 1 auto;
  font-size: 16px;
  line-height: 1.5;
}

.btn-approve:disabled {
  font-size: 15px;
}

.review-main { padding-bottom: 8px; }
.review-copy { padding: 12px 16px 0; }

.meta { margin: 0 0 8px; color: var(--muted); font-size: 14px; }

.resubmit {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.internal {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 0 0 12px;
}

.internal span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 2px;
}

.thread h3 { margin: 0 0 4px; font-size: 14px; }
.thread ul { list-style: none; margin: 0; padding: 0; }
.thread li { padding: 8px 0; border-top: 1px solid var(--line); }
.thread li.off { opacity: 0.45; }
.thread p { margin: 2px 0; }
.thread time { color: var(--muted); font-size: 12px; }

.tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.review-who { text-align: right; }
.review-who strong { display: block; }
.review-who span { color: var(--muted); font-size: 12px; }

.banner {
  margin: 0 16px 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.banner.bad {
  background: color-mix(in srgb, var(--danger) 12%, white);
  color: var(--danger);
}

.banner.good {
  background: color-mix(in srgb, var(--good) 12%, white);
  color: var(--good);
}

.login { padding: 4vh 24px 32px; }

.login h1 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 44px;
  letter-spacing: -0.03em;
  margin: 8px 0;
}

.eyebrow {
  margin: 16px 0 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.lede { margin: 0 0 20px; color: var(--muted); }

.field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }

input[type="password"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
}

textarea { min-height: 120px; resize: vertical; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 8px 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.form-error { min-height: 1.2em; color: var(--danger); font-size: 14px; margin: 8px 0 0; }

.sheet-back {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: var(--keyboard-inset, 0px);
  background: rgba(20, 27, 39, 0.45);
  display: grid;
  align-items: end;
  z-index: 20;
}

.sheet {
  width: min(440px, 100%);
  margin: 0 auto;
  max-height: min(90dvh, calc(100dvh - var(--keyboard-inset, 0px)));
  overflow: auto;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(20, 27, 39, 0.16);
}

.sheet h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -0.02em; }

.note-scope {
  margin: -4px 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.slide-ref {
  font-weight: 700;
}

.sheet-actions {
  position: static;
  margin-top: 12px;
  padding: 12px 0 0;
  border: 0;
  background: transparent;
  grid-template-columns: 1fr;
}

.sheet .text-btn { width: 100%; justify-content: center; }

.done {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 1;
}

.done h1 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 42px;
  letter-spacing: -0.03em;
  margin: 10px 0 0;
}

.done .lede, .done .score, .done .outside { margin: 6px 0; }
.done .outside { color: var(--muted); }

.done-actions {
  display: grid;
  gap: 8px;
  width: min(320px, 100%);
  margin-top: 18px;
}

.done-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--good);
  color: white;
  display: grid;
  place-items: center;
  font-size: 34px;
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.confetti i {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.95;
  animation: fall 1.5s ease-in forwards;
}

@keyframes fall {
  to { transform: translateY(105dvh) rotate(220deg); }
}

body.lock { overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (min-width: 760px) {
  body { padding: 32px 16px 48px; }
  .review-page { height: auto; max-height: none; overflow: visible; }
  .review-page .review-main { overflow: visible; }
  .preview { margin: 0 auto; max-width: 520px; }
  .login {
    margin-top: 6vh;
    padding: 36px 28px 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
  }
  .queue, .home, .review-page, .done { min-height: auto; }
  .chips { flex-wrap: wrap; overflow: visible; }
}

@media (hover: hover) {
  .card:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
}

@media (prefers-reduced-motion: reduce) {
  .track { transition: none; }
  .confetti { display: none; }
}

.review-steps {
  margin: 0 16px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.review-steps { flex: none; }
.review-steps .step-done { color: var(--good); }

.caption-screen {
  margin: 4px 16px 0;
  padding: 24px 20px 28px;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
  max-height: 62dvh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.caption-screen h3 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

/* BKN client review view only. Admin UI is unchanged. */
body.client-view {
  --gold: #C79A3B;
}

body.client-view::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--gold, #C79A3B);
}

body.client-view .logo-lockup {
  width: auto;
  max-width: min(260px, 70vw);
  height: auto;
  max-height: 72px;
}

body.client-view .bar-head .logo-lockup {
  max-width: min(180px, 55vw);
  max-height: 44px;
}

body.client-view .welcome {
  margin: 4px 16px 10px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
}

body.client-view .client-login {
  padding-top: 8vh;
}

body.client-view .client-login .eyebrow {
  color: var(--ink);
  font-weight: 650;
}

.review-actors {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.release-btn {
  margin: 0 0 10px;
  width: auto;
  min-width: 0;
  padding: 0 16px;
  min-height: 44px;
  font-size: 15px;
}

.release-btn:disabled {
  opacity: 0.55;
}

.release-state {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

.pill.not-sent {
  background: var(--surface);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}

.pill.client-stage {
  font-weight: 650;
}

.card-top {
  flex-wrap: wrap;
}

.client-view .done-mark {
  background: #0B1F35;
  color: #C79A3B;
  box-shadow: inset 0 0 0 2px #C79A3B;
}

.client-view .done h1 {
  color: #0B1F35;
}

.reward-toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 100px);
  bottom: auto;
  transform: translateX(-50%);
  z-index: 8;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: #0B1F35;
  color: #F3F6FA;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 28px rgba(11, 31, 53, 0.28);
  border: 1px solid #C79A3B;
  pointer-events: none;
  animation: toast-in 0.22s ease-out;
}

.reward-toast.out {
  animation: toast-out 0.22s ease-in forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .reward-toast, .reward-toast.out { animation: none; }
}

.revision-eyebrow {
  margin: 0 16px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.revision-notes {
  margin: 8px 16px 0;
  display: grid;
  gap: 8px;
}

.revision-note {
  margin: 8px 16px 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.revision-notes .revision-note { margin: 0; }

.revision-note span {
  color: var(--muted);
  font-weight: 650;
}

.revision-toggle {
  margin: 4px 16px 8px;
  width: auto;
  min-height: 36px;
  padding: 0;
  font-size: 13px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
