:root {
  --bg: #f3efe7;
  --bg-accent: radial-gradient(circle at top left, rgba(255,255,255,0.9), rgba(243,239,231,0.4) 40%), linear-gradient(180deg, #efe4d2 0%, #f6f2ec 48%, #efe7dc 100%);
  --panel: rgba(255, 255, 255, 0.75);
  --line: rgba(84, 62, 44, 0.12);
  --text: #2d241d;
  --muted: #6b5d50;
  --accent: #b5642a;
  --accent-dark: #8f4d1f;
  --good: #2f7d4f;
  --bad: #a33d32;
  --shadow: 0 18px 50px rgba(93, 67, 44, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--bg-accent);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar, .row-head, .actions, .meta, .inline-form, .hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 28px;
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
}

.stack {
  display: grid;
  gap: 18px;
}

.tight {
  gap: 10px;
}

.hero {
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.95;
  max-width: 10ch;
}

.hero p {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.panel, .card {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.form-grid, label {
  display: grid;
  gap: 8px;
}

input, textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.75);
  padding: 14px 16px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.danger {
  background: #a14234;
}

.danger:hover {
  background: #813226;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(181, 100, 42, 0.12);
  color: var(--accent-dark);
  font-weight: 700;
}

.list-grid {
  display: grid;
  gap: 16px;
}

.insight-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  padding: 16px;
}

.row-actions {
  justify-content: flex-start;
}

.row-actions form {
  margin: 0;
}

.thumb-wrap {
  width: 112px;
  height: 112px;
}

.thumb, .placeholder {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff7ef, #efe8de);
}

.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 20px;
}

.preview-frame {
  display: grid;
  place-items: center;
  min-height: 360px;
  border-radius: 24px;
  background:
    linear-gradient(45deg, rgba(181,100,42,0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(181,100,42,0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(181,100,42,0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(181,100,42,0.08) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.preview-frame img {
  max-height: 320px;
  object-fit: contain;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.badge-draft, .badge-reviewed {
  background: rgba(181,100,42,0.12);
  color: var(--accent-dark);
}

.badge-published {
  background: rgba(47,125,79,0.14);
  color: var(--good);
}

.badge-failed {
  background: rgba(163,61,50,0.14);
  color: var(--bad);
}

.meta, .link {
  color: var(--muted);
}

.json-block pre {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 18px;
  border-radius: 18px;
  background: #221c18;
  color: #f6efe7;
  overflow: auto;
}

.error {
  color: var(--bad);
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 960px) {
  .hero, .detail-layout {
    grid-template-columns: 1fr;
    display: grid;
  }
}
