@font-face { font-family: "Playfair Display"; src: url("/fonts/PlayfairDisplay-Variable.ttf"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk-Variable.ttf"); font-weight: 300 700; font-display: swap; }

:root {
  --green: #12322B; --green-2: #1B4038; --paper: #EFE6D2; --paper-2: #E3D6B6;
  --gold: #C9A45C; --ink: #12322B; --muted: #6B6352; --red: #B5503C; --ok: #2E7D4F;
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--green); color: var(--ink); font: 16px/1.5 "Space Grotesk", system-ui, sans-serif; }
a { color: var(--green-2); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
main > p, .note { color: var(--paper); }
main > p a, .back { color: var(--paper); }
img, video { max-width: 100%; }
h1, h2 { font-family: "Playfair Display", Georgia, serif; font-weight: 800; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: 30px; } h2 { font-size: 22px; }
em { font-style: normal; color: var(--gold); }
.muted { color: var(--muted); } .small { font-size: 14px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; color: var(--paper); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; font-family: "Playfair Display", serif; font-weight: 800; font-size: 20px; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.top nav { display: flex; align-items: center; gap: 18px; }
.top nav a { color: var(--paper); font-weight: 600; text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
button.link { min-height: 0; padding: 0;
  background: none; border: 0; color: var(--paper); font: inherit; cursor: pointer; text-decoration: underline; }

section, .case-head { background: var(--paper); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.case { display: inline-block; font-weight: 700; letter-spacing: .08em; color: var(--red); margin-right: 6px; }
.case-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }

button { font: inherit; font-weight: 600; border-radius: 10px; padding: 12px 18px; border: 2px solid var(--ink); cursor: pointer; min-height: 48px; }
button.primary { background: var(--ok); border-color: var(--ok); color: #fff; }
button.secondary { background: var(--paper); color: var(--ink); }
button.danger { background: var(--paper); color: var(--red); border-color: var(--red); }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions + .note { margin: -6px 4px 16px; opacity: .85; }
.actions form { flex: 1 1 200px; } .actions button { width: 100%; }

.flash { background: var(--paper); color: var(--ink); font-weight: 600; border-left: 6px solid var(--gold); padding: 12px 16px; border-radius: 8px; margin: 0 0 12px; }
.flash.error { border-color: var(--red); }
.jobs { padding: 12px 18px; }
.job { padding: 4px 0; } .job .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); margin-right: 6px; }
.job-done .dot { background: var(--ok); } .job-failed .dot { background: var(--red); }
.job-running .dot, .job-queued .dot { animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .2; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { display: block; background: #fff; border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.tile img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; }
.tile-body { padding: 10px 12px; display: grid; gap: 2px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--paper-2); }
.list li:last-child { border-bottom: 0; }
.empty { color: var(--muted); margin: 0; }

.badge { white-space: nowrap; font-size: 14px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: var(--paper-2); }
.badge-video_ready { background: var(--gold); } .badge-approved, .badge-scheduled { background: #CFE3D6; }
.badge-published, .badge-solution_published { background: var(--ok); color: #fff; }
.badge-rejected, .badge-discarded { background: #F1D3CB; color: var(--red); }

.media { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.media figure { margin: 0; display: grid; gap: 10px; }
.media figcaption { font-weight: 700; }
.media img, .media video { width: 100%; border-radius: 10px; background: #000; }
.placeholder { aspect-ratio: 9 / 16; display: grid; place-items: center; background: var(--paper-2); border-radius: 10px; color: var(--muted); }
.facts p { margin: 0 0 10px; }
.caption { white-space: pre-wrap; background: #fff; padding: 12px; border-radius: 8px; font: 14px/1.5 "Space Grotesk", sans-serif; }
details { margin: 8px 0; } summary { cursor: pointer; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--paper-2); vertical-align: top; }

body.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--paper); border-radius: var(--radius); padding: 28px; width: min(380px, 100%); display: grid; gap: 14px; text-align: center; }
.login-card img { margin: 0 auto; border-radius: 50%; }
.login-card label { display: grid; gap: 6px; text-align: left; font-weight: 600; }
.login-card input { font: inherit; padding: 12px; border-radius: 10px; border: 2px solid var(--ink); }

@media (max-width: 640px) {
  .media { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  .case-head { flex-direction: column; }
}

.schedule { display: grid; gap: 10px; }
.slot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px; background: #fff; border-radius: 10px; }
.slot > div, .slot label { display: grid; gap: 2px; flex: 1 1 260px; }
.slot input { font: inherit; padding: 10px; border-radius: 8px; border: 2px solid var(--ink); margin-top: 6px; max-width: 260px; }
.slot button { flex: 0 0 auto; min-width: 200px; }

.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.day { background: #fff; border-radius: 10px; padding: 10px 14px; }
.day.today { outline: 3px solid var(--gold); }
.day.past { opacity: .6; }
.day-name { font-weight: 700; text-transform: capitalize; margin-bottom: 4px; }
.entry { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; padding: 6px 0; color: inherit; text-decoration: none; border-top: 1px solid var(--paper-2); }
.entry:hover { background: var(--paper); }
.entry .time { font-weight: 700; }
.entry-solution .time { color: var(--muted); }
.free { color: var(--red); font-weight: 600; font-size: 14px; }

.banner { background: #F6E3A6; color: var(--ink); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; font-weight: 500; }
.totals { display: grid; gap: 8px; }
.total { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.total strong { min-width: 90px; text-transform: capitalize; }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--paper-2); white-space: nowrap; }
.pill-published { background: var(--ok); color: #fff; }
.pill-failed { background: var(--red); color: #fff; }
.pill-publishing { background: var(--gold); }
.pill-skipped, .pill-cancelled { background: #ddd; color: #555; }
.table-wrap { overflow-x: auto; }
.log td, .log th { white-space: nowrap; }
.log td:last-child { white-space: normal; min-width: 200px; }
.error-text { color: var(--red); }

.produce { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.produce label { display: grid; gap: 4px; font-weight: 600; }
.produce select { font: inherit; padding: 10px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; min-height: 48px; }

a.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 600; border-radius: 10px; padding: 12px 18px; border: 2px solid var(--ink); min-height: 48px; color: var(--ink); background: var(--paper); flex: 1 1 220px; }
.copy { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.copy pre { flex: 1; margin: 0; }
.copy button { flex: 0 0 auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: #fff; border-radius: 10px; padding: 12px; display: grid; gap: 2px; }
.stat strong { font-family: "Playfair Display", serif; font-size: 32px; line-height: 1.1; }
.up { color: var(--ok); font-weight: 700; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
h3 { font-size: 17px; margin: 8px 0; }

/* Reviewer login: every change is refused server-side; hide the controls too. */
.read-only main form[method="post"] { display: none; }
