:root {
  --bg: #f3f1ec;
  --surface: #fffdf8;
  --ink: #1c1a16;
  --muted: #6b655c;
  --line: #ddd6c8;
  --accent: #1f4b3a;
  --accent-hover: #16382c;
  --danger: #8b2e2e;
  --ok: #1f4b3a;
  --shadow: 0 10px 30px rgba(28, 26, 22, 0.06);
  --radius: 14px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31, 75, 58, 0.08), transparent 40%),
    linear-gradient(180deg, #efece4 0%, var(--bg) 100%);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.topbar nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.25rem;
}

.card.narrow {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

h1, h2 {
  margin: 0 0 0.6rem;
  line-height: 1.25;
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.stack {
  display: grid;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
}

label.full,
.actions.full {
  grid-column: 1 / -1;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
}

button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.2rem;
  font-weight: 650;
  cursor: pointer;
}

button:hover { background: var(--accent-hover); }

button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

button.secondary:hover {
  background: rgba(31, 75, 58, 0.08);
}

.actions {
  display: flex;
  gap: 0.75rem;
  align-items: end;
}

.brand-summary {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(31, 75, 58, 0.03);
}

.brand-summary h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.brand-summary dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.brand-summary dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.brand-summary dd {
  margin: 0.2rem 0 0;
  font-weight: 600;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.section-head h2 { margin: 0; }

.preview-frame {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  background: #fff;
  overflow-x: auto;
}

.flash-list {
  margin-bottom: 1rem;
  display: grid;
  gap: 0.5rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.flash-error {
  border-color: #e3b4b4;
  background: #fff5f5;
  color: var(--danger);
}

.flash-success {
  border-color: #b9d2c6;
  background: #f2faf6;
  color: var(--ok);
}

.howto {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
  color: var(--ink);
  line-height: 1.55;
}

.howto li + li {
  margin-top: 0.35rem;
}

@media (max-width: 720px) {
  .form-grid,
  .brand-summary dl {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
