:root {
  --bg: #070707;
  --panel: #12110e;
  --card: #1a1814;
  --ink: #f6f1e6;
  --muted: #cfc6b6;
  --gold: #e4c56a;
  --line: rgba(228, 197, 106, 0.28);
  --serif: "Cormorant Garamond", Palatino, serif;
  --sans: Outfit, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

h1, h2, p { margin: 0; }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-card, .editor-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
}

.gate-card {
  width: min(420px, 100%);
  padding: 28px;
}

.eyebrow {
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.03em;
}

h1 { font-size: 2.8rem; margin: 8px 0 10px; }
h2 { font-size: 1.8rem; }

.hint, .status, .field span, .check { color: var(--muted); }

.hint { margin-bottom: 18px; line-height: 1.5; }

.field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.field span { font-size: 0.86rem; }

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d0d0b;
}

textarea { min-height: 96px; resize: vertical; }

.actions, .row-actions, .topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions { margin-top: 16px; }

.btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
}

.btn-gold {
  border: 0;
  background: linear-gradient(180deg, #f0d78c, #c6a24b);
  color: #1a1408;
  font-weight: 600;
}

.btn-quiet { color: var(--muted); border-color: rgba(255, 255, 255, 0.12); }

.btn:disabled { opacity: 0.55; cursor: wait; }

.error { color: #ffb4b4; min-height: 1.2em; margin-top: 10px; }

.app { display: none; min-height: 100vh; }

.app.is-on { display: grid; grid-template-columns: 240px 1fr; }

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  border-right: 1px solid rgba(228, 197, 106, 0.16);
  background: #0c0c0a;
  overflow: auto;
}

.side h1 { font-size: 2rem; }

.side nav { display: grid; gap: 4px; margin-top: 18px; }

.side button {
  text-align: left;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.side button.is-on { background: rgba(228, 197, 106, 0.14); color: var(--gold); }

.main { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 22px;
  background: rgba(7, 7, 7, 0.92);
  border-bottom: 1px solid rgba(228, 197, 106, 0.16);
}

.panel { padding: 22px; display: grid; gap: 14px; }

.editor-card { padding: 16px; }

.editor-card header, .image-row, .split {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.split { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }

.image-row { align-items: end; margin-top: 8px; }

.image-row .field { flex: 1; margin-top: 0; }

.preview {
  width: 92px;
  height: 64px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d0d0b;
}

.file input { display: none; }

.check { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

@media (max-width: 860px) {
  .app.is-on { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .split, .image-row, .topbar { grid-template-columns: 1fr; display: grid; }
}
