:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #15211d;
  --muted: #61706a;
  --line: #d9ded7;
  --panel: #ffffff;
  --accent: #0f7b63;
  --accent-strong: #075d4a;
  --warn: #b86b00;
  --danger: #a63a3a;
  --shadow: 0 10px 30px rgba(21, 33, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(20px, 4vw, 56px) 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(15, 123, 99, 0.14), transparent 46%),
    linear-gradient(0deg, #ffffff, #ffffff);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.status-pill {
  max-width: 340px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 0.9rem;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.control-band,
.toolbar,
.pipeline-band,
.summary-strip {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.control-band {
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 320px) 112px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
}

.toolbar {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.filters,
.toolbar-actions,
.pipeline-band {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  padding: 0 14px;
}

.filter-button.active,
#saveSettingsButton,
.pipeline-band button {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.pipeline-band {
  padding: 14px 0 20px;
  border-bottom: 1px solid var(--line);
}

.summary-strip {
  grid-template-columns: repeat(4, 1fr);
}

.summary-strip div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-strip strong {
  display: block;
  font-size: 1.55rem;
}

.summary-strip span {
  color: var(--muted);
  font-size: 0.9rem;
}

.draft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.draft-card {
  display: grid;
  gap: 14px;
  min-height: 360px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.draft-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.draft-type {
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.draft-card h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.32;
}

.label-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #e6f2ee;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.draft-body {
  white-space: pre-wrap;
  color: #26352f;
  line-height: 1.58;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.source {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-self: end;
}

.card-actions button {
  min-width: 0;
  padding: 0 8px;
}

.card-actions [data-action="approve"] {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.card-actions [data-action="reject"] {
  border-color: rgba(166, 58, 58, 0.34);
  color: var(--danger);
}

.card-actions [data-action="mark_published"] {
  border-color: rgba(184, 107, 0, 0.42);
  color: var(--warn);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 42px 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .topbar {
    display: grid;
    align-items: start;
  }

  .control-band,
  .toolbar,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 120px;
  }

  .card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
