:root {
  --bg: #0e1116;
  --bg-2: #161b22;
  --ink: #e8e2d4;
  --muted: #9a917f;
  --line: #2a261c;
  --gold: #d4a24a;
  --gold-2: #f0d08a;
  --danger: #e07060;
  --ok: #7dba7a;
  --font: "Segoe UI", "Iowan Old Style", Georgia, serif;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #243018 0%, transparent 50%),
              radial-gradient(900px 500px at 110% 10%, #3a2a12 0%, transparent 45%),
              var(--bg);
  color: var(--ink);
  letter-spacing: 0.01em;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.6rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; gap: 0.75rem; align-items: center; }
.mark {
  width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--gold-2); font-weight: 700;
  letter-spacing: 0.08em;
}
.brand strong { display: block; font-size: 1.05rem; }
.sub { color: var(--muted); font-size: 0.8rem; }

.mode { display: flex; border: 1px solid var(--line); }
.mode button {
  background: transparent; color: var(--muted); border: 0;
  padding: 0.55rem 0.9rem; cursor: pointer; font: inherit;
}
.mode button.on { background: var(--gold); color: #1a1408; }

main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.4rem 7rem; }
.kicker { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; color: var(--gold); margin: 0 0 0.5rem; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 0.6rem; font-weight: 600; }
.lede { max-width: 40rem; color: var(--muted); line-height: 1.5; }
code { font-family: var(--mono); font-size: 0.86em; color: var(--gold-2); }

.banners { display: grid; grid-template-columns: 1fr 220px; gap: 0.8rem; margin: 1.8rem 0; }
.slot {
  border: 1px dashed #3d382c; min-height: 90px;
  display: grid; place-items: center; color: #5c5648; letter-spacing: 0.12em;
  text-transform: uppercase; font-size: 0.72rem;
}
.slot.slim { min-height: 120px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1.2rem 1.2rem 1.4rem;
}
.panel h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; line-height: 1.4; }
.stack { display: flex; flex-direction: column; gap: 0.7rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
input {
  font: inherit; color: var(--ink); background: #0c0f13;
  border: 1px solid var(--line); padding: 0.55rem 0.65rem;
}
button {
  font: inherit; cursor: pointer;
  border: 1px solid var(--line); background: #1c2128; color: var(--ink);
  padding: 0.55rem 0.9rem;
}
button.primary { background: var(--gold); color: #1a1408; border-color: var(--gold); font-weight: 600; }
button.ghost { background: transparent; }
button.tiny { font-size: 0.8rem; padding: 0.25rem 0.55rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.hidden { display: none !important; }
.meta { display: grid; gap: 0.45rem; margin: 0; }
.meta div { display: grid; grid-template-columns: 9rem 1fr; gap: 0.4rem; }
dt { color: var(--muted); font-size: 0.8rem; }
dd { margin: 0; }
.mono { font-family: var(--mono); font-size: 0.82rem; word-break: break-all; }
.muted { color: var(--muted); font-size: 0.8rem; }
.status { min-height: 1.3rem; margin: 0.8rem 0 0; font-size: 0.9rem; }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

.editors section { margin-bottom: 1rem; }
.ed-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.ed-head h3 { margin: 0 0 0.4rem; font-size: 0.95rem; color: var(--gold-2); }
.kv { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.kv th, .kv td { border-bottom: 1px solid var(--line); padding: 0.25rem 0.2rem; text-align: left; }
.kv input { width: 100%; }
.kv .del { padding: 0.2rem 0.45rem; }

.consent {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.9rem 1.4rem;
  background: #1a160e; border-top: 1px solid var(--gold);
  z-index: 8;
}
.consent p { margin: 0; color: var(--ink); }

@media (max-width: 860px) {
  .grid, .banners { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
  .meta div { grid-template-columns: 1fr; }
}
