:root {
  color-scheme: dark;
  --ink: #e8f3f4;
  --muted: #9baeb2;
  --canvas: #071319;
  --panel: #0d2028;
  --panel-soft: #102931;
  --line: #24414a;
  --cyan: #39c7e6;
  --amber: #f0b556;
  --red: #e76e70;
  --green: #58d69a;
  --radius: 18px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 70% -10%, #123a44 0, var(--canvas) 35%); color: var(--ink); }
button, input, select { font: inherit; }
button:disabled { cursor: not-allowed; opacity: .45; transform: none !important; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 64px; }
.topbar, .section-heading, .list-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(30px, 4vw, 46px); margin-bottom: 12px; letter-spacing: -0.04em; }
h2 { font-size: 20px; margin-bottom: 4px; }
.lede, .form-note { color: var(--muted); line-height: 1.7; max-width: 700px; }
.eyebrow { color: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: .12em; margin-bottom: 8px; }
.panel { background: linear-gradient(145deg, rgba(16,41,49,.96), rgba(10,26,33,.96)); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 14px 32px rgba(0,0,0,.16); }
.auth-panel { display: grid; grid-template-columns: 1fr minmax(220px, 320px) auto; gap: 18px; align-items: end; margin: 26px 0; }
.auth-panel p { color: var(--muted); margin-bottom: 0; }
.owner-strip { display: flex; align-items: center; gap: 9px; padding: 11px 14px; margin-top: 18px; border: 1px solid rgba(88,214,154,.32); border-radius: 12px; color: #c7f1de; background: rgba(88,214,154,.08); font-size: 13px; font-weight: 750; }
.owner-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(88,214,154,.13); }
.text-button { margin-inline-start: auto; cursor: pointer; border: 0; background: transparent; color: var(--cyan); font-weight: 800; }
.text-button:hover { color: var(--ink); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select { min-height: 46px; padding: 10px 12px; color: var(--ink); background: #08171d; border: 1px solid var(--line); border-radius: 10px; outline: none; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(57,199,230,.16); }
.button { cursor: pointer; border: 0; border-radius: 10px; min-height: 46px; padding: 0 18px; background: var(--cyan); color: #062028; font-weight: 850; transition: transform .15s ease, filter .15s ease; }
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button.secondary { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0; }
.stats article { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(13,32,40,.74); }
.stats span { display: block; font-weight: 900; font-size: 30px; color: var(--cyan); }
.stats small { color: var(--muted); }
.grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 20px; }
.fields .wide { grid-column: span 2; }
.toggle { margin: 18px 0; display: flex; align-items: center; gap: 8px; }
.toggle input { min-height: auto; width: 18px; height: 18px; accent-color: var(--cyan); }
.status { padding: 6px 9px; font-size: 12px; font-weight: 800; border-radius: 999px; white-space: nowrap; }
.status.draft { color: var(--amber); background: rgba(240,181,86,.13); }
.status.review { color: var(--cyan); background: rgba(57,199,230,.13); }
.status.published { color: var(--green); background: rgba(88,214,154,.13); }
.status.paused { color: var(--red); background: rgba(231,110,112,.13); }
.status.archived { color: #b1b9bb; background: rgba(177,185,187,.13); }
.checklist ol { padding-right: 20px; color: var(--muted); line-height: 2; }
.warning { border-right: 3px solid var(--amber); padding: 10px 12px; background: rgba(240,181,86,.08); color: #ffd991; line-height: 1.7; }
.list-panel { margin-top: 18px; }
.list-toolbar { align-items: center; margin-bottom: 18px; }
.toolbar-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.toolbar-controls input { width: min(290px, 100%); }
.toolbar-controls select { width: 160px; }
.channel-list { display: grid; gap: 10px; }
.channel-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #091a20; }
.channel-mark { width: 42px; height: 42px; display: grid; place-items: center; background: #12313a; color: var(--cyan); border-radius: 12px; font-weight: 900; }
.channel-summary { min-width: 0; }
.channel-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.channel-row h3 { margin: 0 0 3px; font-size: 16px; }
.channel-row p { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.readiness { margin-top: 6px !important; font-weight: 700; }
.readiness.ready { color: var(--green); }
.readiness.blocked { color: #ffd991; }
.readiness.caution { color: #7ed9ee; }
.check-summary { color: #8bb9c8 !important; font-size: 12px !important; }
.featured-tag { color: #062028; background: var(--amber); padding: 3px 7px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.row-actions { display: grid; justify-items: end; gap: 8px; }
.row-buttons { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.small-button { cursor: pointer; min-height: 34px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 12px; font-weight: 750; }
.small-button:hover { border-color: var(--cyan); }
.small-button.publish { color: var(--green); border-color: rgba(88,214,154,.45); }
.small-button.pause { color: #ff9a9b; border-color: rgba(231,110,112,.45); }
.small-button.reference { color: var(--amber); }
.small-button.order { color: var(--cyan); min-width: 34px; }
.feedback { min-height: 24px; color: var(--muted); }
.feedback.error { color: #ff9a9b; }
.empty { color: var(--muted); text-align: center; padding: 28px; border: 1px dashed var(--line); border-radius: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 780px) {
  .shell { width: min(100% - 24px, 680px); padding-top: 24px; }
  .topbar, .section-heading, .list-toolbar { flex-direction: column; }
  .topbar .button, .toolbar-controls, .toolbar-controls input, .toolbar-controls select { width: 100%; }
  .toolbar-controls { justify-content: stretch; }
  .auth-panel, .grid { grid-template-columns: 1fr; }
  .owner-strip { flex-wrap: wrap; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .fields { grid-template-columns: 1fr; }
  .fields .wide { grid-column: span 1; }
  .channel-row { grid-template-columns: auto minmax(0, 1fr); }
  .row-actions { grid-column: 1 / -1; justify-items: stretch; }
  .row-buttons { justify-content: stretch; }
  .row-buttons .small-button { flex: 1 1 auto; }
}

.audit-panel { margin-top: 18px; }
.audit-list { display: grid; gap: 8px; margin-top: 14px; }
.audit-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(140px, 1fr) minmax(220px, 1.6fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 29, 37, 0.52);
}
.audit-row strong { color: var(--amber); }
.audit-row span { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.audit-row small { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .audit-row { grid-template-columns: 1fr; gap: 4px; }
}
