:root {
  color-scheme: dark;
  --mf-bg: #0b0f19;
  --mf-panel: #111827;
  --mf-panel-soft: #151c2e;
  --mf-text: #ffffff;
  --mf-muted: #aab2c5;
  --mf-line: rgba(255, 255, 255, 0.12);
  --mf-accent: #7c3aed;
}

html {
  scroll-behavior: smooth;
}

[x-cloak] {
  display: none !important;
}

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

body {
  background: var(--mf-bg);
  color: var(--mf-text);
  letter-spacing: 0;
}

a,
button,
input,
textarea {
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.mf-shell {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.mf-card {
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
}

.mf-card:hover {
  border-color: rgba(124, 58, 237, 0.8);
  transform: translateY(-2px);
}

.mf-muted {
  color: var(--mf-muted);
}

.mf-accent {
  color: var(--mf-accent);
}

.mf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--mf-accent);
  color: #fff;
  font-weight: 700;
  padding: 0 18px;
}

.mf-button:hover {
  background: #6d28d9;
}

.mf-button-secondary {
  border: 1px solid var(--mf-line);
  background: rgba(255, 255, 255, 0.04);
}

.mf-button-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ad-placeholder,
.embed-slot,
.meme-placeholder,
.newsletter-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(255, 255, 255, 0.035)),
    var(--mf-panel);
  color: #d8d9ff;
  text-align: center;
}

.ad-placeholder {
  min-height: 96px;
  font-size: 0.92rem;
}

.meme-placeholder {
  min-height: 260px;
  font-size: 1.15rem;
  font-weight: 800;
}

.embed-slot {
  min-height: 150px;
  margin: 18px 0;
  font-size: 0.92rem;
}

.live-embed {
  align-content: center;
  justify-items: stretch;
  padding: 16px;
}

.live-embed .reddit-embed-bq {
  margin: 0;
  width: 100%;
}

.live-embed .reddit-embed-bq a,
.meme-embed {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 16px;
  text-align: left;
}

.live-embed .reddit-embed-bq a:hover,
.meme-embed:hover {
  background: rgba(124, 58, 237, 0.22);
}

.meme-embed span {
  display: block;
  margin-top: 8px;
  color: var(--mf-muted);
  font-size: 0.82rem;
}

.data-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--mf-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #d6dbea;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 800;
}

.source-meta {
  color: var(--mf-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.maker-workbench {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.maker-panel,
.maker-stage {
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.maker-panel {
  padding: 16px;
}

.maker-stage {
  padding: 12px;
}

.maker-panel-title {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.maker-canvas-wrap {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #050816;
}

.maker-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #111827;
  cursor: grab;
  touch-action: none;
}

.maker-canvas:active {
  cursor: grabbing;
}

.maker-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.maker-output {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border-top: 1px solid var(--mf-line);
  padding-top: 18px;
}

.maker-chip,
.maker-tool-button,
.maker-upload,
.maker-mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #e6e9f5;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.maker-chip:hover,
.maker-tool-button:hover,
.maker-upload:hover,
.maker-mini-button:hover {
  border-color: rgba(124, 58, 237, 0.8);
  background: rgba(124, 58, 237, 0.18);
}

.maker-chip-active,
.maker-tool-button-active {
  border-color: rgba(167, 139, 250, 0.95);
  background: rgba(124, 58, 237, 0.32);
  color: #fff;
}

.maker-tool-button,
.maker-upload {
  width: 100%;
  min-height: 44px;
}

.maker-mini-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.76rem;
}

.maker-danger {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.maker-danger:hover {
  border-color: rgba(248, 113, 113, 0.9);
  background: rgba(127, 29, 29, 0.35);
}

.maker-layer {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: #d6dbea;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: left;
}

.maker-layer span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maker-layer span:last-child {
  color: #9aa4b8;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.maker-layer-active {
  border-color: rgba(167, 139, 250, 0.95);
  background: rgba(124, 58, 237, 0.24);
  color: #fff;
}

.maker-input {
  width: 100%;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: #fff;
  outline: 0;
  padding: 11px 12px;
}

.maker-input:focus {
  border-color: rgba(124, 58, 237, 0.92);
}

.maker-input::placeholder {
  color: #737c91;
}

.maker-color {
  width: 100%;
  height: 44px;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  padding: 5px;
}

.control-label {
  color: #d6dbea;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.newsletter-placeholder {
  min-height: 170px;
}

.prose-dark {
  color: #d6dbea;
}

.prose-dark p {
  margin-top: 1rem;
  line-height: 1.8;
}

.prose-dark h2 {
  margin-top: 2.4rem;
  margin-bottom: 0.7rem;
  color: #fff;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.prose-dark h3 {
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
}

.faq-item {
  border-bottom: 1px solid var(--mf-line);
  padding: 18px 0;
}

.faq-item summary {
  cursor: pointer;
  color: #fff;
  font-weight: 700;
}

.faq-item p {
  margin-top: 12px;
  color: var(--mf-muted);
  line-height: 1.7;
}

.breadcrumb a {
  color: #c4b5fd;
}

.breadcrumb a:hover {
  color: #fff;
}

@media (max-width: 720px) {
  .mf-shell {
    width: min(100% - 24px, 1120px);
  }

  .maker-workbench {
    grid-template-columns: 1fr;
  }

  .maker-panel {
    padding: 14px;
  }

  .maker-action-bar .mf-button {
    width: 100%;
  }

  .meme-placeholder {
    min-height: 220px;
  }
}
