:root {
  --bg: #0a0a0a;
  --bg-elevated: #121412;
  --surface: #171a17;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --text-secondary: #b8c0b6;
  --text-tertiary: #8a9388;
  --neon: #7cff6f;
  --neon-ink: #0a0a0a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font-display: "Bricolage Grotesque", Geist, Inter, sans-serif;
  --font-sans: Geist, Inter, system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 255, 111, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 255, 255, 0.05), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.45;
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  border-radius: 10px;
}

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.site-link {
  color: var(--neon);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.site-link:hover {
  text-decoration: underline;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.panel,
.preview-wrap,
.post-wrap {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel {
  padding: 28px 26px 30px;
}

.preview-column {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 18px;
}

.preview-wrap,
.post-wrap {
  padding: 20px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--neon);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 0 4px rgba(124, 255, 111, 0.15);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.3vw, 2.05rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.lede {
  margin: 12px 0 22px;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 220px;
  line-height: 1.5;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(124, 255, 111, 0.18);
}

.template-grid,
.option-grid {
  display: grid;
  gap: 10px;
}

.template-grid {
  grid-template-columns: 1fr 1fr;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.template-card,
.option-card,
.photo-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.template-card input,
.option-card input,
.photo-card input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.template-card__body,
.option-card__body {
  display: block;
  padding: 12px 12px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.template-card__body strong,
.option-card__body strong {
  display: block;
  font-family: var(--font-display);
  margin-bottom: 3px;
  font-size: 0.95rem;
}

.template-card__body small,
.option-card__body small {
  color: var(--text-tertiary);
  font-size: 0.8rem;
  line-height: 1.35;
}

.template-card input:checked + .template-card__body,
.option-card input:checked + .option-card__body,
.photo-card input:checked + .photo-card__thumb {
  border-color: var(--neon);
  background: rgba(124, 255, 111, 0.08);
  box-shadow: 0 0 0 1px var(--neon);
}

.photo-card__thumb {
  display: block;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.lang-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.lang-head .field-label {
  margin-bottom: 8px;
}

.count {
  color: var(--neon);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lang-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.suggestions button {
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.suggestions button:hover {
  color: var(--neon);
  border-color: var(--neon);
}

.lang-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  min-height: 44px;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(124, 255, 111, 0.45);
  background: rgba(124, 255, 111, 0.08);
  color: var(--neon);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: grab;
  user-select: none;
}

.lang-chip.dragging {
  opacity: 0.45;
}

.lang-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.75;
}

.hint {
  margin: 12px 0 0;
  color: var(--text-tertiary);
  font-size: 0.84rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 12px 18px;
}

.btn-compact {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--neon);
  color: var(--neon-ink);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text);
}

.status {
  color: var(--neon);
  font-size: 0.88rem;
  font-weight: 600;
}

.preview-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.preview-meta h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.preview-meta span {
  color: var(--text-tertiary);
  font-size: 0.82rem;
}

.canvas-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  aspect-ratio: 1;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 1100px) {
  .template-grid {
    grid-template-columns: 1fr;
  }
}

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

  .preview-column {
    position: static;
    order: -1;
  }

  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 560px) {
  .page {
    padding: 18px 14px 48px;
  }

  .panel {
    padding: 22px 18px 24px;
  }

  .lang-add {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
