:root {
  --bg: #07080c;
  --panel: #12141c;
  --panel-2: #0c0e14;
  --line: #2a3142;
  --text: #e8e4d8;
  --muted: #8b93a7;
  --accent: #c43c3c;
  --accent2: #e8b86d;
  --ok: #b6f0c2;
  --err: #ffb4b4;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: Outfit, "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1100px 480px at 50% -12%, #3a1515 0%, transparent 58%),
    var(--bg);
  color: var(--text);
}
a { color: var(--accent2); }
img { max-width: 100%; }

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 0 22px;
  background: rgba(7, 8, 12, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand {
  font-family: Cinzel, Georgia, serif;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .08em;
  font-weight: 700;
  white-space: nowrap;
}
.tabs { display: flex; align-items: center; gap: 4px; flex: 1; }
.tabs a, .drop > a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .92rem;
}
.tabs a.on, .tabs a:hover, .drop > a.on, .drop > a:hover {
  color: var(--text);
  background: rgba(232, 184, 109, .08);
}
.drop { position: relative; }
.drop-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
.drop:hover .drop-menu, .drop:focus-within .drop-menu { display: block; }
.drop-menu a { display: block; }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { color: var(--accent2); font-size: .8rem; letter-spacing: .06em; }
.admin-btn, button, .btn {
  border: 1px solid var(--accent2);
  background: transparent;
  color: var(--accent2);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.admin-btn:hover, button:hover, .btn:hover { background: rgba(232, 184, 109, .12); }
.nav-toggle, .nav-burger { display: none; }

.flash-wrap { max-width: 880px; margin: 18px auto 0; padding: 0 16px; }
.msg { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: .92rem; }
.error { background: #3a1518; color: var(--err); }
.success { background: #14301c; color: var(--ok); }
.edit-bar {
  max-width: 880px;
  margin: 16px auto 0;
  padding: 10px 14px;
  border: 1px solid rgba(232, 184, 109, .4);
  border-radius: 8px;
  color: var(--accent2);
  background: rgba(232, 184, 109, .06);
}

.hero {
  position: relative;
  min-height: 460px;
  margin: 22px auto 0;
  max-width: 1120px;
  border-radius: 16px;
  overflow: hidden;
  background: #10080c center/cover no-repeat;
  border: 1px solid var(--line);
}
.hero-shade {
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 42px;
  background: linear-gradient(180deg, rgba(7,8,12,.15), rgba(7,8,12,.88));
}
.tag, .kicker {
  letter-spacing: .28em;
  font-size: .72rem;
  color: var(--accent2);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.hero h1, .sheet h1, .card h1 {
  font-family: Cinzel, Georgia, serif;
  font-weight: 700;
  margin: 0;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.lede, .summary { color: var(--muted); max-width: 640px; line-height: 1.55; }
.hero-actions, .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn-solid, button.solid {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn-solid:hover, button.solid:hover { filter: brightness(1.08); background: var(--accent); }

.wrap { max-width: 880px; margin: 28px auto 40px; padding: 0 16px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.tile, .card, .sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.tile { padding: 18px; text-decoration: none; color: inherit; }
.tile strong { display: block; margin-bottom: 6px; color: var(--accent2); }
.tile span { color: var(--muted); font-size: .92rem; }
.sheet { padding: 28px 28px 36px; }
.sheet h1 { font-size: 2.1rem; }
.block { margin-top: 26px; }
.block h2, .prose h2, .prose h3 {
  font-family: Cinzel, Georgia, serif;
  font-weight: 600;
}
.prose { font-family: Georgia, "Iowan Old Style", serif; font-size: 1.08rem; line-height: 1.7; }
.prose a { color: var(--accent2); }
.card { max-width: 460px; margin: 8vh auto; padding: 22px 22px 26px; }
.card label, dialog label, .field label {
  display: block;
  margin-top: 14px;
  font-weight: 600;
  font-size: .92rem;
}
input[type=text], input[type=password], input[type=url], textarea, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0b0d13;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.hint { margin-top: 5px; font-size: .8rem; color: var(--muted); }
.card button, .btn-dl {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  text-align: center;
}
.card button { background: var(--accent); border-color: var(--accent); color: #fff; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 28px 16px 40px; }

dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 22px;
  width: min(420px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0,0,0,.62); }
dialog h2 { font-family: Cinzel, Georgia, serif; margin: 0 0 8px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 16px; }
.dialog-actions button { flex: 1; }
button.ghost { border-color: var(--line); color: var(--muted); }

.editor-app { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.side, .main { padding: 16px; }
.side { border-right: 1px solid var(--line); background: rgba(0,0,0,.2); }
.side button, .tool button, .row-actions button { width: auto; margin: 0; padding: 7px 10px; font-size: .82rem; }
.page-list { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; }
.page-list button {
  text-align: left;
  border-color: transparent;
  color: var(--text);
  background: transparent;
}
.page-list button.on { border-color: var(--accent2); color: var(--accent2); }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.section-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 12px; background: var(--panel-2); }
.rte {
  min-height: 140px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0b0d13;
  line-height: 1.55;
}
.rte:focus { outline: 1px solid var(--accent); }
.src {
  width: 100%;
  min-height: 140px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.grow { flex: 1; }
.status { color: var(--muted); font-size: .85rem; }
.preview { margin-top: 18px; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 600; }
.check input { width: auto; margin: 0; }
@media (max-width: 900px) {
  .grid, .split, .editor-app { grid-template-columns: 1fr; }
  .hero, .hero-shade { min-height: 320px; }
  .hero-shade { padding: 22px; }
  .nav-burger {
    display: inline-block;
    margin-left: auto;
    color: var(--accent2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 10px;
  }
  .tabs {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #0d0f16;
    border-bottom: 1px solid var(--line);
    padding: 8px;
  }
  .nav-toggle:checked ~ .tabs { display: flex; }
  .drop-menu { position: static; box-shadow: none; }
  .nav-end { position: absolute; right: 84px; }
}
