:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #5b6472;
  --line: #e5e7eb;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --danger: #b91c1c;
  --warn: #92400e;
  --ok: #166534;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px 32px;
  background: #0a0a0a;
  color: white;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: #cbd5e1;
}

.topnav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.topnav a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
}

.topnav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 86px);
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brandmark {
  font-weight: 800;
  letter-spacing: 2px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.sidebar a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 700;
}

.sidebar a.active,
.sidebar a:hover {
  color: var(--ink);
  background: #eef6f5;
}

.workspace {
  padding: 28px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  align-items: start;
  margin-bottom: 20px;
}

.page-head h2 {
  font-size: 30px;
  margin: 4px 0 8px;
  letter-spacing: 0;
}

.page-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 8px;
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  font-size: 26px;
  line-height: 1.1;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  margin-bottom: 20px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: center;
}

.hero h2,
.panel h1,
.panel h3 {
  margin: 4px 0 8px;
  letter-spacing: 0;
}

.hero p,
.panel p {
  color: var(--muted);
  margin: 0 0 14px;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 6px;
  background: #f8fafc;
}

.status span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.status.ok strong {
  color: var(--ok);
}

.status.warn strong {
  color: var(--warn);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.step {
  position: relative;
  min-height: 220px;
}

.stepnum {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--brand);
  font-weight: 700;
  margin-bottom: 12px;
}

.button,
button {
  appearance: none;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.button.primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.button.primary:hover {
  background: var(--brand-dark);
}

button:disabled,
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 700;
}

.panel .ghost {
  color: var(--brand);
  border-color: var(--line);
}

.danger {
  color: var(--danger);
}

.hint {
  font-size: 13px;
  color: var(--muted);
}

.success {
  color: var(--ok) !important;
}

code {
  background: #f3f4f6;
  padding: 2px 5px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.publish-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

textarea,
select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: white;
}

.checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checks label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
}

.checks input {
  width: auto;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
}

.events {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.events li {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.events span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 13px;
}

.table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 140px minmax(240px, 1fr) 120px 180px 120px;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-head {
  background: #f8fafc;
  font-weight: 800;
  color: var(--muted);
}

.table-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

mark {
  display: inline-flex;
  width: fit-content;
  background: #eef6f5;
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 700;
}

.queue {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.queue-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 8px;
  background: #fbfdfe;
}

.queue-item span {
  color: var(--muted);
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .grid,
  .section-head,
  .checks,
  .app-shell,
  .page-head,
  .metric-grid,
  .queue {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    padding: 18px;
  }

  .topnav {
    flex-wrap: wrap;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 18px;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
