@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/literata-400.woff2") format("woff2");
}
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/literata-600.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/dmsans-400.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/dmsans-500.woff2") format("woff2");
}

.suggest {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0 12px;
  max-height: 200px;
  overflow: auto;
}
.suggest-item {
  text-align: left;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}
.suggest-item:hover {
  border-color: var(--warm);
}
.gate-banner {
  background: color-mix(in srgb, var(--warm) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--warm) 40%, transparent);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.legal-doc .legal-body { font-size: 0.95rem; line-height: 1.55; }
.legal-doc .legal-body h1 { font-family: var(--display); font-size: 1.35rem; }
.legal-doc .legal-body h2 { font-size: 1.1rem; margin-top: 1.25rem; }
.legal-doc .legal-body h3 { font-size: 1rem; margin-top: 1rem; }
.legal-doc .legal-body ul { padding-left: 1.2rem; }
.legal-doc .legal-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

:root {
  --bg: #0f1115;
  --bg2: #171a21;
  --panel: #1c212b;
  --line: #2a3140;
  --text: #ece7df;
  --muted: #9a948a;
  --warm: #e8a45a;
  --warm2: #f0c48a;
  --danger: #e07070;
  --ok: #7cbc8a;
  --radius: 12px;
  --font: "DM Sans", "Segoe UI", sans-serif;
  --display: Literata, Georgia, serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4efe6;
    --bg2: #ebe4d8;
    --panel: #fffaf3;
    --line: #d9d0c2;
    --text: #1c1814;
    --muted: #6b645a;
    --warm: #c47a2c;
    --warm2: #a86218;
    --danger: #c04040;
    --ok: #2f7a45;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(232, 164, 90, 0.14), transparent 55%),
    radial-gradient(900px 500px at 0% 100%, rgba(80, 100, 140, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: var(--warm); }
a:hover { color: var(--warm2); }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg2) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}
.top nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.top nav a:hover { color: var(--text); }

main { max-width: 1180px; margin: 0 auto; padding: 1.25rem; min-height: 60vh; }
.foot {
  max-width: 1180px;
  margin: 2rem auto 0;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.foot a { color: var(--muted); }
.cookie {
  position: fixed; bottom: 1rem; left: 1rem; right: 1rem; max-width: 420px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1rem; z-index: 40; box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.cookie.hidden { display: none; }
.hidden { display: none !important; }

.hero { padding: 2.5rem 0 1rem; max-width: 36rem; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0.4rem 0 0.75rem;
}
.eyebrow { color: var(--warm); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 0; }
.muted { color: var(--muted); }
.err { color: var(--danger); font-size: 0.92rem; }
.ok { color: var(--ok); }

.btn, .cta, button.cta, button.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  padding: 0.65rem 1.15rem; font: 500 0.95rem var(--font); cursor: pointer;
  text-decoration: none; margin: 0.25rem 0.35rem 0.25rem 0;
  border: 1px solid transparent;
}
.btn-primary, .cta, button.cta {
  background: var(--warm); color: #1a1208; border-color: var(--warm);
}
.btn-secondary, .cta.secondary, button.secondary {
  background: transparent; color: var(--text); border-color: var(--line);
}
.btn-ghost {
  background: transparent; color: var(--muted); border-color: transparent;
}
.btn-ghost:hover { color: var(--text); }
.btn-danger, .cta.danger {
  background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}
.cta:disabled, button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }

.wizard-steps {
  display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 0.85rem;
}
.wizard-step {
  flex: 1 1 auto; min-width: 3.2rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.4rem 0.25rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  font: 600 0.85rem var(--font); cursor: pointer;
}
.wizard-step span { font-weight: 400; font-size: 0.68rem; }
.wizard-step.active { border-color: var(--warm); color: var(--warm); background: color-mix(in srgb, var(--warm) 12%, var(--panel)); }
.wizard-step.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.wizard-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--line);
}
.wizard-body { min-height: 12rem; }
.adv {
  margin-top: 0.85rem; padding: 0.55rem 0.65rem;
  border: 1px dashed var(--line); border-radius: 8px;
}
.adv summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0.75rem 0;
}
.card h2, .card h3 { font-family: var(--display); margin-top: 0; }
label { display: block; margin: 0.7rem 0 0.25rem; color: var(--muted); font-size: 0.86rem; }
input, select, textarea {
  width: 100%; padding: 0.55rem 0.65rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit;
}
input[type="range"] { padding: 0; }
input[type="checkbox"] { width: auto; }
.check { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.6rem 0; color: var(--text); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 720px) { .row { grid-template-columns: 1fr; } }
.status {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  background: color-mix(in srgb, var(--warm) 22%, transparent); color: var(--warm2); font-size: 0.82rem;
}

/* Editor layout */
.ed {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .ed { grid-template-columns: 1fr; }
}
.ed-side {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
}
.ed-main {
  display: grid;
  gap: 0.75rem;
}
.ed-viewbar { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ed-viewbar button.active { background: var(--warm); color: #1a1208; border-color: var(--warm); }
.ed-canvas-wrap {
  position: relative;
  background: #0a0b0e;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 360px;
  aspect-ratio: 4/3;
  overflow: hidden;
}
@media (prefers-color-scheme: light) {
  .ed-canvas-wrap { background: #1a1c22; }
}
.ed-canvas-wrap canvas { width: 100% !important; height: 100% !important; display: block; }
.ed-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  font-size: 0.85rem;
}
.ed-stats div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}
.ed-stats b { display: block; font-family: var(--display); font-size: 1.05rem; color: var(--text); }

.sec { margin: 0.9rem 0 0.35rem; font-weight: 500; color: var(--text); font-size: 0.92rem; }
.sec:first-child { margin-top: 0; }
.drop {
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}
.drop.drag { border-color: var(--warm); color: var(--warm); }
.range-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: center; }
.range-row output { color: var(--muted); font-size: 0.8rem; min-width: 3.2rem; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chips button {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 0.35rem 0.7rem; cursor: pointer; font: inherit; font-size: 0.85rem;
}
.chips button.active { border-color: var(--warm); color: var(--warm); }

.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  max-width: 920px; width: 100%; max-height: 92vh; overflow: auto; padding: 1rem;
}
.cv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 700px) { .cv-grid { grid-template-columns: 1fr; } }
.cv-grid canvas {
  width: 100%; background: #111; border-radius: 8px; border: 1px solid var(--line);
}
.busy {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); color: #fff; font-weight: 500;
}
.gate-banner {
  background: color-mix(in srgb, var(--warm) 15%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--warm) 40%, var(--line));
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
