:root {
    --ink: #172033;
    --muted: #687386;
    --paper: #f5f6f8;
    --panel: #ffffff;
    --line: #dfe3e8;
    --brand: #a3232b;
    --brand-dark: #78161d;
    --rail: #253147;
    --success: #186a3b;
    --warning: #8a5600;
    --danger: #a11c2f;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--brand-dark); }
.topbar { background: var(--rail); color: white; border-bottom: 4px solid var(--brand); }
.topbar-inner { max-width: 1240px; margin: 0 auto; min-height: 68px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.wordmark { color: white; text-decoration: none; font-weight: 750; font-size: 18px; letter-spacing: .01em; white-space: nowrap; }
.wordmark span { color: #ffb3b7; font-weight: 550; }
.nav { display: flex; align-items: center; gap: 6px; flex: 1; }
.nav a, .nav button { border: 0; background: transparent; color: #e7ebf2; font: inherit; padding: 9px 11px; border-radius: 6px; text-decoration: none; cursor: pointer; }
.nav a:hover, .nav a.active, .nav button:hover { background: rgba(255,255,255,.12); color: white; }
.nav form { margin-left: auto; }
.container { max-width: 1240px; margin: 0 auto; padding: 30px 24px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.eyebrow { margin: 0 0 5px; color: var(--brand); text-transform: uppercase; font-size: 12px; letter-spacing: .1em; font-weight: 750; }
.muted { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; box-shadow: 0 2px 8px rgba(23,32,51,.04); margin-bottom: 20px; }
.panel h2, .panel h3 { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { border-left: 4px solid var(--brand); }
.metric strong { display: block; font-size: 30px; line-height: 1.1; }
.metric span { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label, legend { font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #bcc4cf; border-radius: 6px; padding: 10px 11px; background: white; color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(163,35,43,.15); border-color: var(--brand); }
textarea { min-height: 110px; resize: vertical; }
.hint { color: var(--muted); font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 16px; }
.checks label { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.checks input { width: auto; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--brand); background: var(--brand); color: white; border-radius: 6px; padding: 9px 14px; text-decoration: none; font: inherit; font-weight: 650; cursor: pointer; }
.button:hover { background: var(--brand-dark); color: white; }
.button.secondary { background: white; border-color: #aab2be; color: var(--ink); }
.button.small { padding: 6px 10px; font-size: 13px; }
.alert { border-radius: 7px; padding: 12px 14px; margin-bottom: 18px; }
.alert.success { background: #e8f5ed; border: 1px solid #acd8bd; color: var(--success); }
.alert.error { background: #fff0f1; border: 1px solid #e5adb4; color: var(--danger); }
.alert ul { margin: 5px 0 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-block; padding: 3px 8px; background: #e8ebef; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.review { color: var(--warning); background: #fff3d6; }
.badge.published { color: var(--success); background: #e5f5eb; }
.badge.failed, .badge.cancelled { color: var(--danger); background: #fde9ec; }
.definition { display: grid; grid-template-columns: 180px 1fr; margin: 0; }
.definition dt, .definition dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
.definition dt { color: var(--muted); font-weight: 650; }
.prose { white-space: pre-wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.media-card { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 15px; min-width: 0; }
.media-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview { max-width: 100%; max-height: 560px; border: 1px solid var(--line); background: #111; }
.timeline { list-style: none; padding: 0; }
.timeline li { border-left: 3px solid var(--line); padding: 2px 0 18px 16px; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; color: var(--muted); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #192337, #303d55); }
.login-card { width: min(430px, 100%); background: white; border-radius: 12px; padding: 32px; box-shadow: 0 18px 55px rgba(0,0,0,.28); }
.login-card h1 { margin: 0; }
.login-card .button { width: 100%; }
code { background: #edf0f3; border-radius: 4px; padding: 2px 5px; }
@media (max-width: 800px) {
    .topbar-inner, .nav { flex-wrap: wrap; }
    .topbar-inner { padding: 14px 18px; gap: 10px; }
    .nav form { margin-left: 0; }
    .grid-2, .grid-4, .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .definition { grid-template-columns: 1fr; }
    .definition dt { border-bottom: 0; padding-bottom: 0; }
    .page-head { flex-direction: column; }
    table { display: block; overflow-x: auto; }
}
