@font-face {
  font-family: 'Nunito';
  src: url('font/Nunito-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('font/Nunito-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root,
:root[data-theme="lavender"] {
  --bg: #15121f;
  --surface: #1f1a2e;
  --raised: #2a2340;
  --line: #3a3150;
  --text: #f1ecfa;
  --muted: #b3a9c9;
  --faint: #8a80a3;
  --accent: #c084fc;
  --accent-2: #a855f7;
  --on-accent: #1a0b2e;
  --accent-rgb: 192 132 252;
}

:root[data-theme="mint"] {
  --bg: #0c1214;
  --surface: #141c1f;
  --raised: #1c272a;
  --line: #2a3a3d;
  --text: #e9f5f0;
  --muted: #a3bab2;
  --faint: #77908a;
  --accent: #6ee7b7;
  --accent-2: #34d399;
  --on-accent: #052e1f;
  --accent-rgb: 110 231 183;
}

:root[data-theme="sunset"] {
  --bg: #15110e;
  --surface: #1f1915;
  --raised: #2a221c;
  --line: #42362c;
  --text: #f7efe6;
  --muted: #c2b2a0;
  --faint: #92826f;
  --accent: #fbbf24;
  --accent-2: #f59e0b;
  --on-accent: #2a1a02;
  --accent-rgb: 251 191 36;
}

:root {
  --accent-soft: rgb(var(--accent-rgb) / 0.12);
  --accent-line: rgb(var(--accent-rgb) / 0.45);
  --field: rgb(0 0 0 / 0.22);
  --error: #fca5a5;
  --ok: #86efac;
  --warn: #fcd34d;

  --card: var(--surface);
  --card-border: var(--line);
  --text-muted: var(--muted);
  --accent-strong: var(--accent-2);
  --bg-accent: var(--raised);

  --font-display: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 18px;
  --shadow: 0 30px 80px -24px rgb(0 0 0 / 0.65), 0 2px 8px rgb(0 0 0 / 0.25);
  --w-app: 1200px;
  --w-prose: 680px;
  --gutter: 24px;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.875rem, 2vw + 1rem, 2.5rem);
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.125rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-line);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

strong {
  font-weight: 700;
  color: var(--text);
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* layout */

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--w-app) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 16px var(--gutter) 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.page--prose {
  max-width: calc(var(--w-prose) + var(--gutter) * 2);
}

/* top line on inner pages */

.topline:has(+ .page--prose) {
  max-width: calc(var(--w-prose) + var(--gutter) * 2);
}

.topline:has(+ .page--editor) {
  max-width: calc(1440px + var(--gutter) * 2);
}

.topline {
  width: 100%;
  max-width: calc(var(--w-app) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 20px var(--gutter) 0;
  font-weight: 700;
}

.topline a {
  color: var(--muted);
  text-decoration: none;
}

.topline a:hover {
  color: var(--text);
}

.topline span {
  color: var(--faint);
  margin-left: 4px;
}

.topline [aria-current] {
  color: var(--text);
}

.theme-dots {
  display: flex;
  align-items: center;
  gap: 2px;
}

.theme-dot {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.theme-dot::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px transparent;
  transition: box-shadow 0.15s ease;
}

.theme-dot[aria-pressed="true"]::before {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

.theme-dot[data-theme-pick="lavender"] {
  --dot: #c084fc;
}

.theme-dot[data-theme-pick="mint"] {
  --dot: #6ee7b7;
}

.theme-dot[data-theme-pick="sunset"] {
  --dot: #fbbf24;
}

/* footer */

.site-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: calc(var(--w-app) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter) 32px;
  font-size: 0.875rem;
  color: var(--faint);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
}

.stats-page {
  gap: 24px;
}

.stats-page__head {
  align-items: center;
  padding-top: 24px;
}

.stats-page__head p {
  margin: 0;
  color: var(--muted);
}

.stats-period {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
}

.stats-period button {
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.stats-period button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.stats-message {
  min-height: 1.5em;
  margin: -12px 0 0;
  color: var(--faint);
  font-size: 0.875rem;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stats-summary__card,
.stats-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.stats-summary__card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 116px;
  padding: 20px 24px;
}

.stats-summary__card strong {
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.1;
  text-overflow: ellipsis;
}

.stats-summary__card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.875rem;
}

.stats-panel {
  padding: 22px 24px;
}

.stats-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.stats-panel__head h2 {
  margin: 0 0 4px;
  font-size: 1.125rem;
}

.stats-panel__head p,
.stats-panel__hint {
  margin: 0;
  color: var(--faint);
  font-size: 0.8125rem;
}

.stats-chart-wrap {
  width: 100%;
  overflow: hidden;
}

.stats-chart {
  display: block;
  width: 100%;
  height: clamp(150px, 24vw, 240px);
  overflow: visible;
}

.stats-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stats-list {
  display: grid;
  gap: 14px;
}

.stats-list__row {
  display: grid;
  gap: 7px;
}

.stats-list__label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 0.9rem;
}

.stats-list__label span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-list__label strong {
  flex: 0 0 auto;
  font-size: 0.875rem;
}

.stats-list__track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--raised);
}

.stats-list__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.stats-list__empty {
  margin: 0;
  color: var(--faint);
  font-size: 0.875rem;
}

.stats-privacy-note {
  margin: 0;
  color: var(--faint);
  font-size: 0.75rem;
}

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

  .stats-summary__card {
    min-height: 90px;
  }

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

  .stats-panel {
    padding: 18px;
  }

  .stats-page__head {
    align-items: flex-start;
  }

  .stats-period {
    width: 100%;
  }

  .stats-period button {
    flex: 1;
    padding-inline: 8px;
  }
}

.status-message a {
  color: inherit;
}

.error {
  color: var(--error);
  font-size: 0.875rem;
}

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--on-accent);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--raised);
  border-color: var(--line);
  color: var(--faint);
  cursor: not-allowed;
  transform: none;
}

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

.btn--ghost:hover,
.btn--secondary:hover {
  background: var(--raised);
  border-color: var(--faint);
  color: var(--text);
}

.btn--ghost:disabled,
.btn--ghost[aria-disabled="true"] {
  background: transparent;
}

.btn--block {
  width: 100%;
}

.btn--lg {
  min-height: 52px;
  font-size: 1.0625rem;
  border-radius: 12px;
}

.text-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

/* forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.label,
.form__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--faint);
  line-height: 1.5;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--faint);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--error);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 9l5.5 5 5.5-5' fill='none' stroke='%23a59cb8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select option,
select optgroup {
  background: var(--surface);
  color: var(--text);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  cursor: pointer;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  font-size: 0.9375rem;
  cursor: pointer;
}

.check.is-disabled {
  color: var(--faint);
  cursor: not-allowed;
}

.status-message {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--raised);
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.status-message.error {
  background: rgb(252 165 165 / 0.08);
  color: var(--error);
  border: 1px solid rgb(252 165 165 / 0.25);
}

/* home: studio */

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  grid-template-areas:
    "controls poster"
    "aside poster";
  grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 6vw, 88px);
  row-gap: 24px;
  align-items: start;
}

.studio__controls {
  grid-area: controls;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 600px;
}

.studio__poster {
  grid-area: poster;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.studio__aside {
  grid-area: aside;
  max-width: 600px;
}

.intro {
  padding-top: 32px;
}

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

.intro h1 {
  margin: 0;
}

.intro p {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 12px;
}

.intro .intro__meta {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--faint);
}

.intro__meta a {
  color: var(--muted);
}

.intro__meta a:hover {
  color: var(--text);
}

.intro__meta .counter {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.intro__meta .counter-line:not(.is-ready) {
  display: none;
}

.generator {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--field);
  border: 1px solid var(--line);
}

.segmented__opt {
  position: relative;
  display: block;
  cursor: pointer;
}

.segmented__opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.segmented__opt > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease;
}

.segmented__opt:hover > span {
  color: var(--text);
}

.segmented__opt input:checked + span {
  background: var(--raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgb(0 0 0 / 0.3);
}

.segmented__opt input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.segmented__opt input:disabled + span {
  opacity: 0.55;
  cursor: not-allowed;
}

.tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  line-height: 1.5;
}

.service-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.service-fields .field--wide,
.service-fields .hint {
  grid-column: 1 / -1;
}

.period-specific {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: -4px;
}

.period-specific .hint {
  grid-column: 1 / -1;
}

.form__turnstile {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.turnstile-container {
  min-height: 65px;
}

.turnstile-status {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.turnstile-status[data-tone="success"] {
  color: var(--ok);
}

.turnstile-status[data-tone="warning"] {
  color: var(--warn);
}

.turnstile-status[data-tone="error"] {
  color: var(--error);
}

/* poster */

.poster {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  aspect-ratio: 9 / 16;
}

.poster canvas {
  display: block;
  width: 100%;
  height: 100%;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.poster__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
}

.poster__busy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  color: #fff;
  font-weight: 600;
  background: rgb(10 8 16 / 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.poster__busy::before {
  content: "";
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--accent) 0 16%, transparent 17%),
    repeating-radial-gradient(circle, #0b0910 0 2px, #221d2d 2px 3px);
  animation: spin 1.6s linear infinite;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.5);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result__download {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result__note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--faint);
  text-align: center;
}

.result__note.error {
  color: var(--error);
}

.panel {
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

details.panel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  min-height: 52px;
  font-weight: 600;
  border-radius: 14px;
}

details.panel > summary::-webkit-details-marker {
  display: none;
}

details.panel > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--faint);
  border-bottom: 2px solid var(--faint);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.15s ease;
  flex: 0 0 auto;
}

details.panel[open] > summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

details.panel > summary:hover {
  background: var(--raised);
}

.summary__hint {
  margin-left: auto;
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--faint);
}

.panel__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 16px 16px;
}

/* badge */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-chip {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.badge-chip:hover {
  color: var(--text);
  border-color: var(--faint);
}

.badge-chip.is-active,
.badge-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.swatches {
  display: flex;
  gap: 4px;
}

.badge-swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.badge-swatch::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent;
}

.badge-swatch.is-active::before,
.badge-swatch[aria-pressed="true"]::before {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
}

.badge-panel__preview {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: var(--r);
  background: var(--field);
  border: 1px dashed var(--line);
  overflow-x: auto;
}

.badge-panel__preview img {
  display: block;
  max-width: 100%;
  height: auto;
}

.badge-panel__status {
  font-size: 0.875rem;
  color: var(--faint);
}

/* artwork */

.artwork-controls__buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.artwork-controls__buttons .btn {
  flex: 1 1 140px;
}

.artwork-source {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
}

.artwork-source legend {
  margin-bottom: 4px;
}

.artwork-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r);
  background: var(--field);
}

.artwork-editor__control {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* home: below the fold */

.ad-slot {
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
}

.ad-cta {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

[data-devmatei-ad]:empty {
  display: none;
}

.about {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px clamp(32px, 6vw, 88px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.about h2 {
  font-size: 1.125rem;
  color: var(--text);
  margin: 0 0 8px;
}

.about p {
  margin: 0 0 16px;
  max-width: 60ch;
}

.about p + h2 {
  margin-top: 8px;
}

/* legal dialog */

.legal-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.legal-dialog::backdrop {
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
}

.legal-dialog__body {
  padding: 28px;
}

.legal-dialog h2 {
  font-size: 2rem;
  color: var(--accent);
}

.legal-dialog p {
  color: var(--muted);
}

.legal-dialog__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.legal-dialog__close:hover {
  color: var(--text);
  background: var(--raised);
}

.legal-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

/* prose pages */

.prose h1 {
  margin-bottom: 20px;
}

.prose .lede {
  font-size: 1.1875rem;
  color: var(--muted);
}

.prose h2 {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose .cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 28px 0 8px;
}

.prose .cta .hint {
  flex-basis: 100%;
}

.example-poster {
  margin: 32px 0 8px;
}

.example-poster img {
  display: block;
  width: min(100%, 280px);
  height: auto;
  border-radius: 8px;
}

.example-poster figcaption {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.prose .qa p {
  margin-bottom: 1.25em;
}

.steps {
  list-style: none;
  padding: 0 !important;
  margin: 8px 0 16px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 16px 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.steps li:last-child {
  border-bottom: 1px solid var(--line);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

/* 404 */

.not-found {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  padding: 48px 0;
}

.not-found__code {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4.5rem, 12vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--accent);
  margin-bottom: 16px;
}

.not-found .error-message {
  color: inherit;
}

.not-found__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.not-found__art {
  display: flex;
  justify-content: center;
}

.vinyl {
  width: min(320px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle, transparent 0 31%, rgb(255 255 255 / 0.05) 31.5% 32%, transparent 32.5%),
    conic-gradient(from 30deg, transparent 0 10%, rgb(255 255 255 / 0.06) 14%, transparent 18% 60%, rgb(255 255 255 / 0.05) 64%, transparent 68%),
    repeating-radial-gradient(circle, #0b0910 0 2px, #17131f 2px 3px);
  box-shadow: var(--shadow);
}

.vinyl::after {
  content: "";
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bg) 0 8%, var(--accent) 9% 100%);
}

/* responsive (home and shared) */

@media (max-width: 960px) {
  .studio {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "controls"
      "poster"
      "aside";
    grid-template-rows: none;
  }

  .studio__controls,
  .studio__aside {
    max-width: none;
  }

  .studio__poster {
    position: static;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    scroll-margin-top: 16px;
  }

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

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .page {
    gap: 24px;
    padding-bottom: 48px;
  }

  .intro {
    padding-top: 12px;
  }

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

  .field-row,
  .service-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .not-found {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 16px 0 32px;
  }

  .not-found__art {
    order: -1;
  }

  .vinyl {
    width: min(200px, 55vw);
  }
}

/* shared header used by library, editor and review pages */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding-top: 16px;
}

.page-head h1 {
  margin-bottom: 8px;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

.page-head__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.beta-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent);
  background: var(--accent-soft);
}

/* template library */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.toolbar__search {
  flex: 1 1 280px;
  max-width: 420px;
}

.toolbar__search input {
  padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='6.5' fill='none' stroke='%23a59cb8' stroke-width='2'/%3E%3Cpath d='M16 16l4 4' stroke='%23a59cb8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.marketplace-toolbar__sorts,
.marketplace-toolbar__categories {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.marketplace-toolbar__categories {
  flex-basis: 100%;
}

.marketplace-toolbar__categories:empty {
  display: none;
}

.marketplace-tab,
.marketplace-category {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.marketplace-tab:hover,
.marketplace-category:hover {
  color: var(--text);
  border-color: var(--faint);
}

.marketplace-tab.is-active,
.marketplace-tab[aria-pressed="true"],
.marketplace-category.is-active,
.marketplace-category[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px 20px;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.template-card__preview {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 16px 40px -16px rgb(0 0 0 / 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.template-card:hover .template-card__preview {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -16px rgb(0 0 0 / 0.7);
}

.template-card__preview canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.template-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.template-card__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.template-card__name {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-card__badge {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  color: var(--muted);
  background: var(--raised);
}

.template-card__badge--featured,
.template-card__badge--official {
  color: var(--accent);
  background: var(--accent-soft);
}

.template-card__byline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.template-card__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--raised);
  color: var(--text);
  font-weight: 700;
  font-size: 0.75rem;
  flex: 0 0 auto;
}

.template-card__who {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.template-card__creator {
  font-size: 0.875rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-card__id {
  display: none;
}

.template-card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--faint);
}

.template-card__category::after {
  content: "·";
  margin-left: 8px;
}

.template-card__category:last-child::after {
  content: none;
}

.template-card__use {
  margin-top: auto;
  width: 100%;
  min-height: 36px;
}

.template-card--skeleton .template-card__preview,
.template-card--skeleton .template-card__body > * {
  background: linear-gradient(100deg, var(--surface) 30%, var(--raised) 50%, var(--surface) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.template-card--skeleton .template-card__body > * {
  height: 14px;
  border-radius: var(--r-sm);
}

.template-card--skeleton .template-card__body > *:last-child {
  width: 60%;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: 0 0;
  }
}

.marketplace-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 48px 16px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r);
}

.marketplace-empty__text {
  margin: 0;
}

.template-card__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.marketplace-footer {
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: center;
}

/* template editor */

.page--editor {
  max-width: 1440px;
}

.editor-header__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.editor-header__tools {
  display: flex;
  gap: 4px;
  align-items: center;
  padding-right: 8px;
  margin-right: 4px;
  border-right: 1px solid var(--line);
}

.editor-header__tools .btn {
  min-height: 40px;
  padding: 8px 12px;
  border-color: transparent;
}

.editor-header__tools .btn:hover {
  border-color: var(--line);
}

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

.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 32px);
  position: sticky;
  top: 16px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.editor-editor,
.editor-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.editor-editor__title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-editor__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

.editor-editor__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.editor-editor__name[type="text"] {
  min-height: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: transparent;
  border: 1px solid transparent;
  padding: 2px 6px;
  margin-left: -6px;
}

.editor-editor__name[type="text"]:hover {
  border-color: var(--line);
}

.editor-editor__slug {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.editor-editor__slug input[type="text"] {
  min-height: 0;
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: inherit;
  padding: 2px 4px;
}

.editor-editor__slug input[type="text"]:hover {
  border-color: var(--line);
}

.editor-editor__tags {
  display: flex;
  gap: 8px;
}

.editor-editor__tags input {
  flex: 1;
}

.editor-editor__tags select {
  width: auto;
  flex: 0 0 auto;
}

.editor-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-panel__title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}

.editor-panel__hint {
  margin: 0;
  color: var(--faint);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.editor-layer-add {
  display: flex;
  gap: 4px;
}

.editor-layer-add button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.editor-layer-add button:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

.editor-layer-add button span {
  font-weight: 800;
  font-size: 1rem;
}

.editor-element-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.editor-element-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 6px 4px 10px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--field);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.editor-element-row:hover {
  border-color: var(--line);
}

.editor-element-row.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.editor-element-row__swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.35);
  flex: 0 0 auto;
}

.editor-element-row__label:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.editor-element-row__label {
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.editor-element-row__type {
  font-size: 0.75rem;
  color: var(--faint);
  flex: 0 0 auto;
}

.editor-element-row__controls {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
}

.editor-element-row__controls button {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
}

.editor-element-row__controls button:hover {
  color: var(--text);
  background: var(--raised);
}

.editor-element-row__controls button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: transparent;
}

.editor-element-row--art {
  border-style: dashed;
  border-color: var(--line);
  background: transparent;
}

.editor-element-row--art .editor-element-row__label {
  color: var(--muted);
}

.editor-element-row--art.is-selected {
  border-style: solid;
  border-color: var(--accent);
}

.editor-element-row--art.is-selected .editor-element-row__label {
  color: var(--text);
}

.editor-properties {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-properties__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-toggle {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  cursor: pointer;
  font-size: 0.9375rem;
}

.editor-toggle--quiet {
  font-size: 0.875rem;
  color: var(--muted);
}

.editor-designtwo,
.editor-palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.editor-colorfield,
.editor-sliderfield {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-colorfield input[type="color"],
.editor-swatches input[type="color"],
.editor-color input[type="color"] {
  height: 40px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  cursor: pointer;
}

.editor-colorfield input[type="color"] {
  width: 100%;
}

.editor-colorfield span:not(.form__label) {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--faint);
}

.editor-artgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.editor-number {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.editor-number span {
  font-size: 0.8125rem;
  color: var(--faint);
}

.editor-number input {
  min-width: 0;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.editor-uploadbtn {
  width: 100%;
}

.editor-swatches {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.editor-swatches input[type="color"] {
  width: 40px;
}

.editor-swatch-add {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 1.125rem;
  cursor: pointer;
}

.editor-swatch-add:hover {
  border-color: var(--accent);
  color: var(--text);
}

.editor-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--field);
  border: 1px solid var(--line);
}

.editor-seg__btn {
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

.editor-seg__btn:hover {
  color: var(--text);
}

.editor-seg__btn.is-active,
.editor-seg__btn[aria-pressed="true"] {
  background: var(--raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.editor-samples {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.editor-sample {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--field);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.editor-sample:hover {
  border-color: var(--line);
}

.editor-sample.is-active,
.editor-sample[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.editor-sample__name {
  font-weight: 600;
  font-size: 0.875rem;
}

.editor-sample__desc {
  color: var(--faint);
  font-size: 0.8125rem;
}

.editor-color {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.editor-color__token {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
}

.editor-color__token.is-active,
.editor-color__token[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.editor-color input[type="color"] {
  width: 40px;
  margin-left: auto;
}

.editor-stage {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.editor-stage__canvas-wrap {
  width: min(100%, calc((100vh - 96px) * 9 / 16));
  max-width: 560px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.editor-stage__canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  cursor: move;
  touch-action: none;
}

.editor-stages-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--faint);
  font-size: 0.8125rem;
}

.editor-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 0.9375rem;
  z-index: 50;
  max-width: calc(100vw - 32px);
}

.editor-toast[data-tone="error"] {
  border-color: rgb(252 165 165 / 0.5);
  color: var(--error);
}

.editor-toast[data-tone="success"] {
  border-color: rgb(134 239 172 / 0.5);
  color: var(--ok);
}

.editor-toast__action {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.editor-turnstile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

/* review desk */

.admin-connect {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
}

.admin-connect__row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-connect__row input {
  flex: 1 1 260px;
}

.admin-connect__status {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.admin-connect__status[data-tone="error"] {
  color: var(--error);
}

.admin-connect__status[data-tone="success"] {
  color: var(--ok);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-empty {
  margin: 0;
  color: var(--muted);
}

.admin-card {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  align-items: start;
}

.admin-card__preview {
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow: hidden;
  background: var(--field);
}

.admin-card__preview canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.admin-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.admin-card__name {
  margin: 0;
  font-size: 1.25rem;
}

.admin-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.admin-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .editor-sidebar {
    order: 2;
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .editor-stage {
    order: 1;
    top: 0;
    z-index: 5;
    padding: 8px 0;
    background: var(--bg);
  }

  .editor-stage__canvas-wrap {
    width: auto;
    height: 46vh;
    aspect-ratio: 9 / 16;
  }

  .editor-stage__canvas-wrap canvas {
    height: 100% !important;
  }

  .admin-card {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .marketplace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }

  .template-card__footer {
    display: none;
  }

  .toolbar__search {
    max-width: none;
  }

  .editor-header__tools {
    border-right: 0;
    padding-right: 0;
    margin-right: 0;
  }
}

.result__discord a,
.result__support a,
.intro__meta a.intro__support {
  color: var(--accent);
}
