:root {
  --bg: #f4eee3;
  --paper: rgba(255, 251, 244, 0.8);
  --ink: #15211c;
  --muted: #56645c;
  --line: rgba(21, 33, 28, 0.12);
  --accent: #ef5a29;
  --accent-alt: #2f7f6d;
  --danger: #b4382f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(239, 90, 41, 0.12), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(47, 127, 109, 0.14), transparent 22%),
    linear-gradient(160deg, #efe5d4 0%, #f7f3ec 40%, #f0e9df 100%);
}

body.is-busy {
  overflow: hidden;
}

a { color: inherit; }

code {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(21, 33, 28, 0.07);
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 24px auto;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(38, 31, 18, 0.13);
  backdrop-filter: blur(12px);
}

.topbar,
.hero-grid,
.dashboard-head,
.page-grid,
.form-wrap,
.empty-state {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.55s ease forwards;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.nav a,
.link-button {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.97rem;
}

.link-button {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
  padding: 26px 0 8px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(239, 90, 41, 0.08);
  color: #8e3618;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.lead {
  max-width: 40rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.lead.compact {
  font-size: 1rem;
}

.actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.actions {
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--ink);
  color: #fffdfa;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(21, 33, 28, 0.18);
}

.button.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.button.wide {
  width: 100%;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}

.button.danger {
  background: var(--danger);
}

.card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.note-card {
  color: var(--muted);
  line-height: 1.64;
}

.plain-list {
  margin: 12px 0 0;
  padding-left: 18px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.flash {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.flash-success {
  background: rgba(47, 127, 109, 0.1);
}

.flash-error {
  background: rgba(180, 56, 47, 0.12);
}

.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(239, 90, 41, 0.14), transparent 28%),
    radial-gradient(circle at 78% 22%, rgba(47, 127, 109, 0.16), transparent 24%),
    rgba(20, 24, 20, 0.46);
  backdrop-filter: blur(12px);
}

.progress-overlay[hidden] {
  display: none;
}

.progress-card {
  width: min(540px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 251, 244, 0.92);
  box-shadow: 0 28px 80px rgba(16, 22, 18, 0.24);
}

.progress-track {
  width: 100%;
  height: 14px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(21, 33, 28, 0.1);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-alt) 100%);
  box-shadow: 0 10px 28px rgba(47, 127, 109, 0.24);
  transition: width 0.24s ease-out;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.is-disabled {
  cursor: wait;
  opacity: 0.72;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 26px 0 12px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 16px;
}

.editor-grid,
.split-grid {
  display: grid;
  gap: 16px;
}

.editor-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  padding-top: 16px;
}

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

.section-editor {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.block-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

.block-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 12px;
  align-items: end;
}

.block-card {
  display: grid;
  gap: 14px;
}

.nested-editor {
  background: rgba(255, 255, 255, 0.72);
}

.publish-card {
  margin-top: 16px;
}

.subdomain-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.domain-suffix {
  padding: 0 14px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  border-radius: 16px;
  border: 1px solid rgba(21, 33, 28, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.page-card p {
  color: var(--muted);
  line-height: 1.62;
  min-height: 82px;
}

.form-wrap {
  display: flex;
  justify-content: center;
  padding-top: 28px;
}

.form-wrap.wide .form-card {
  width: min(780px, 100%);
}

.form-card {
  width: min(520px, 100%);
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.stack-form label {
  display: grid;
  gap: 8px;
}

.stack-form span {
  font-size: 0.94rem;
  color: var(--muted);
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.danger-toggle span {
  color: var(--danger);
}

.editor-note {
  display: grid;
  align-content: end;
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(21, 33, 28, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
}

.tox-tinymce {
  border-radius: 16px !important;
  border: 1px solid rgba(21, 33, 28, 0.14) !important;
  box-shadow: none !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__primary,
.tox .tox-edit-area::before {
  border-color: rgba(21, 33, 28, 0.12) !important;
}

.tox .tox-edit-area__iframe {
  background: rgba(255, 255, 255, 0.98);
}

.editor-error {
  margin: 0 0 8px;
  color: var(--danger);
}

.variant-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.note-line {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.56;
}

.empty-state {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin-top: 24px;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .shell {
    width: min(100vw - 16px, 1120px);
    margin: 8px auto;
    padding: 18px;
  }

  .topbar,
  .dashboard-head,
  .hero-grid,
  .page-grid,
  .editor-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .dashboard-head {
    align-items: start;
    flex-direction: column;
  }

  .page-grid {
    display: grid;
  }

  .variant-grid {
    grid-template-columns: 1fr;
  }

  .block-editor-head {
    flex-direction: column;
    align-items: start;
  }
}
