    :root {
      color-scheme: dark;
      --page: #080b0f;
      --surface: #10151d;
      --surface-2: #151c26;
      --surface-3: #1a2330;
      --border: #293444;
      --border-strong: #3b4a5e;
      --text: #f4f7fb;
      --muted: #aab6c6;
      --subtle: #77869a;
      --accent: #f7bd45;
      --accent-hover: #ffcb61;
      --accent-ink: #171006;
      --success: #43d98b;
      --focus: #78aefc;
      --danger: #ff7184;
      --facebook: #1877f2;
      --facebook-hover: #3986f5;
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 16px;
      --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    html {
      min-width: 320px;
      background: var(--page);
      scroll-behavior: smooth;
    }

    body {
      min-width: 320px;
      min-height: 100vh;
      min-height: 100dvh;
      margin: 0;
      background:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        var(--page);
      background-size: 100% 48px;
      color: var(--text);
      font-size: 16px;
      line-height: 1.5;
    }

    button,
    input,
    textarea,
    select {
      font: inherit;
    }

    button,
    select {
      cursor: pointer;
    }

    button,
    input,
    textarea,
    select,
    summary {
      -webkit-tap-highlight-color: transparent;
    }

    button:focus-visible,
    input:focus-visible,
    textarea:focus-visible,
    select:focus-visible,
    summary:focus-visible {
      outline: 3px solid var(--focus);
      outline-offset: 2px;
    }

    .skip-link {
      position: fixed;
      top: 10px;
      left: 10px;
      z-index: 100;
      padding: 10px 14px;
      border-radius: var(--radius-sm);
      background: var(--text);
      color: var(--page);
      font-weight: 800;
      transform: translateY(-160%);
    }

    .skip-link:focus {
      transform: translateY(0);
    }

    .site-header {
      border-bottom: 1px solid var(--border);
      background: rgba(8, 11, 15, 0.94);
    }

    .site-header__inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      width: min(100% - 32px, 1440px);
      min-height: 72px;
      margin: 0 auto;
    }

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

    .brand__mark {
      flex: 0 0 40px;
      width: 40px;
      height: 40px;
      border: 1px solid rgba(247, 189, 69, 0.46);
      border-radius: 10px;
      object-fit: cover;
      object-position: center;
    }

    .brand__name {
      display: block;
      margin: 0;
      font-size: 16px;
      font-weight: 850;
      line-height: 1.2;
      letter-spacing: -0.02em;
    }

    .brand__tagline {
      margin-top: 1px;
      color: var(--subtle);
      font-size: 12px;
    }

    .privacy-note {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 650;
      white-space: nowrap;
    }

    .privacy-note::before {
      width: 8px;
      height: 8px;
      border-radius: 99px;
      background: var(--success);
      content: "";
      box-shadow: 0 0 0 4px rgba(67, 217, 139, 0.1);
    }

    main {
      width: min(100% - 32px, 1440px);
      margin: 0 auto;
      padding: 40px 0 56px;
    }

    .intro {
      display: grid;
      gap: 12px;
      max-width: 760px;
      margin-bottom: 16px;
    }

    .eyebrow {
      color: var(--accent);
      font-size: 12px;
      font-weight: 850;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }

    h1,
    h2,
    h3,
    p {
      margin-top: 0;
    }

    h1 {
      margin-bottom: 0;
      font-size: clamp(32px, 5vw, 52px);
      font-weight: 850;
      line-height: 1.05;
      letter-spacing: -0.045em;
      text-wrap: balance;
    }

    .intro p {
      max-width: 650px;
      margin-bottom: 0;
      color: var(--muted);
      font-size: 16px;
    }

    .steps {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 4px;
    }

    .step {
      display: inline-flex;
      align-items: center;
      min-height: 32px;
      padding: 5px 10px;
      border: 1px solid var(--border);
      border-radius: 99px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    .step b {
      margin-right: 6px;
      color: var(--accent);
    }

    .promo-card {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      gap: 18px;
      margin-bottom: 24px;
      padding: 18px;
      border: 1px solid rgba(24, 119, 242, 0.58);
      border-left: 4px solid var(--facebook);
      border-radius: var(--radius-lg);
      background: #101a28;
      box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
    }

    .promo-card__image {
      width: 64px;
      height: 64px;
      border: 2px solid rgba(255, 255, 255, 0.9);
      border-radius: 14px;
      object-fit: cover;
      object-position: center;
      box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.22);
    }

    .promo-card__content {
      min-width: 0;
    }

    .promo-card__meta {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin-bottom: 5px;
    }

    .promo-card__label,
    .promo-card__availability {
      display: inline-flex;
      min-height: 24px;
      align-items: center;
      padding: 3px 8px;
      border-radius: 99px;
      font-size: 10px;
      font-weight: 850;
      line-height: 1.2;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }

    .promo-card__label {
      background: var(--facebook);
      color: #ffffff;
    }

    .promo-card__availability {
      gap: 6px;
      border: 1px solid rgba(67, 217, 139, 0.36);
      background: rgba(67, 217, 139, 0.08);
      color: #8ef0ba;
    }

    .promo-card__availability::before {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--success);
      content: "";
    }

    .promo-card__title {
      margin: 0;
      color: var(--text);
      font-size: 20px;
      font-weight: 850;
      line-height: 1.2;
      letter-spacing: -0.025em;
      text-wrap: balance;
    }

    .promo-card__description {
      max-width: 680px;
      margin: 5px 0 0;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.5;
    }

    .promo-card__cta {
      display: inline-flex;
      min-height: 48px;
      align-items: center;
      justify-content: center;
      gap: 9px;
      padding: 11px 16px;
      border: 1px solid var(--facebook);
      border-radius: 10px;
      background: var(--facebook);
      color: #ffffff;
      font-size: 14px;
      font-weight: 800;
      line-height: 1.2;
      text-align: center;
      text-decoration: none;
      white-space: nowrap;
      touch-action: manipulation;
      transition: background-color 140ms ease, border-color 140ms ease;
    }

    .promo-card__cta:hover {
      border-color: var(--facebook-hover);
      background: var(--facebook-hover);
    }

    .promo-card__cta:active {
      border-color: #0f65d8;
      background: #0f65d8;
    }

    .promo-card__cta:focus-visible {
      outline: 3px solid var(--focus);
      outline-offset: 3px;
    }

    .promo-card__cta svg {
      width: 20px;
      height: 20px;
      flex: 0 0 20px;
    }

    .workspace {
      display: grid;
      grid-template-columns: minmax(0, 0.88fr) minmax(440px, 1.12fr);
      align-items: start;
      gap: 24px;
    }

    .panel {
      min-width: 0;
      overflow: hidden;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .panel__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      min-height: 68px;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
    }

    .panel__title {
      margin: 0;
      font-size: 16px;
      font-weight: 800;
      letter-spacing: -0.015em;
    }

    .panel__description {
      margin: 2px 0 0;
      color: var(--subtle);
      font-size: 12px;
    }

    .editor-form {
      padding: 20px;
    }

    fieldset {
      min-width: 0;
      margin: 0;
      padding: 0;
      border: 0;
    }

    fieldset + fieldset {
      margin-top: 28px;
      padding-top: 24px;
      border-top: 1px solid var(--border);
    }

    legend {
      width: 100%;
      margin-bottom: 4px;
      padding: 0;
      color: var(--text);
      font-size: 14px;
      font-weight: 800;
    }

    .fieldset-help {
      margin: 0 0 16px;
      color: var(--subtle);
      font-size: 12px;
    }

    .fields {
      display: grid;
      gap: 16px;
    }

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

    .field {
      min-width: 0;
    }

    .field label {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 7px;
      color: #dce4ef;
      font-size: 13px;
      font-weight: 700;
    }

    .optional {
      color: var(--subtle);
      font-size: 11px;
      font-weight: 600;
    }

    .field input,
    .field textarea,
    .field select {
      display: block;
      width: 100%;
      min-height: 46px;
      border: 1px solid var(--border-strong);
      border-radius: var(--radius-sm);
      background: #0c1118;
      color: var(--text);
      transition: border-color 140ms ease, box-shadow 140ms ease;
    }

    .field input,
    .field select {
      padding: 0 12px;
    }

    .field textarea {
      min-height: 78px;
      padding: 11px 12px;
      line-height: 1.5;
      resize: vertical;
    }

    .field input:hover,
    .field textarea:hover,
    .field select:hover {
      border-color: #53647a;
    }

    .field input:focus,
    .field textarea:focus,
    .field select:focus {
      border-color: var(--focus);
      box-shadow: 0 0 0 3px rgba(120, 174, 252, 0.14);
    }

    .field input[aria-invalid="true"] {
      border-color: var(--danger);
      box-shadow: 0 0 0 3px rgba(255, 113, 132, 0.12);
    }

    .field-help {
      margin: 6px 0 0;
      color: var(--subtle);
      font-size: 11px;
    }

    .color-input {
      display: grid;
      grid-template-columns: 46px minmax(0, 1fr);
      gap: 8px;
    }

    .color-input input[type="color"] {
      min-width: 46px;
      padding: 4px;
    }

    .actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 28px;
    }

    .button {
      display: inline-flex;
      min-height: 48px;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 10px 16px;
      border: 1px solid transparent;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 800;
      line-height: 1.2;
      text-align: center;
      touch-action: manipulation;
      transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
    }

    .button svg {
      width: 18px;
      height: 18px;
    }

    .button--primary {
      background: var(--accent);
      color: var(--accent-ink);
    }

    .button--primary:hover {
      background: var(--accent-hover);
    }

    .button--primary:active {
      background: #e5a92d;
    }

    .button--secondary {
      border-color: var(--border-strong);
      background: var(--surface-2);
      color: var(--text);
    }

    .button--secondary:hover {
      border-color: #5c6e86;
      background: var(--surface-3);
    }

    .button--quiet {
      min-height: 40px;
      padding: 8px 12px;
      border-color: var(--border);
      background: transparent;
      color: var(--muted);
      font-size: 12px;
    }

    .button--quiet:hover {
      background: var(--surface-2);
      color: var(--text);
    }

    .form-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 14px;
    }

    .autosave {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: var(--subtle);
      font-size: 11px;
    }

    .autosave::before {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--success);
      content: "";
    }

    .preview-panel {
      position: sticky;
      top: 20px;
    }

    .preview-toolbar {
      display: inline-flex;
      padding: 3px;
      border: 1px solid var(--border);
      border-radius: 9px;
      background: #0c1118;
    }

    .view-button {
      display: grid;
      width: 38px;
      height: 36px;
      place-items: center;
      padding: 0;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--subtle);
    }

    .view-button:hover {
      color: var(--text);
    }

    .view-button[aria-pressed="true"] {
      background: var(--surface-3);
      color: var(--accent);
    }

    .view-button svg {
      width: 18px;
      height: 18px;
    }

    .preview-stage {
      display: grid;
      min-height: 610px;
      place-items: center;
      padding: 28px;
      overflow: auto;
      background:
        radial-gradient(circle at center, rgba(36, 48, 65, 0.55), transparent 58%),
        #06090d;
    }

    .preview-viewport {
      display: grid;
      width: min(100%, 420px);
      min-height: 560px;
      place-items: center;
      padding: 12px;
      border: 1px solid #202a38;
      border-radius: 18px;
      background: #080c11;
      transition: width 180ms ease;
    }

    .preview-stage[data-view="wide"] .preview-viewport {
      width: min(100%, 680px);
    }

    .notice-preview {
      --notice-accent: #f7bd45;
      --notice-accent-soft: rgba(247, 189, 69, 0.1);
      --notice-accent-border: rgba(247, 189, 69, 0.52);
      --notice-button-ink: #171006;
      display: flex;
      width: min(100%, 440px);
      max-height: 540px;
      flex-direction: column;
      overflow: hidden;
      border: 1px solid #2b3746;
      border-radius: 14px;
      background: #111720;
      color: #f4f7fb;
      box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    }

    .notice-preview__header {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 12px;
      padding: 18px 22px;
      border-bottom: 1px solid #2b3746;
    }

    .notice-preview__icon {
      display: grid;
      flex: 0 0 44px;
      width: 44px;
      height: 44px;
      place-items: center;
      border: 1px solid var(--notice-accent-border);
      border-radius: 12px;
      background: var(--notice-accent-soft);
      font-size: 22px;
    }

    .notice-preview__heading {
      min-width: 0;
      text-align: left;
    }

    .notice-preview__eyebrow {
      margin-bottom: 3px;
      color: var(--notice-accent);
      font-size: 10px;
      font-weight: 900;
      line-height: 1.4;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }

    .notice-preview__brand {
      overflow-wrap: anywhere;
      font-size: 20px;
      font-weight: 850;
      line-height: 1.2;
      letter-spacing: -0.02em;
    }

    .notice-preview__body {
      padding: 20px 24px 18px;
      overflow: auto;
      text-align: center;
    }

    .notice-preview__badge {
      display: inline-flex;
      min-height: 28px;
      align-items: center;
      margin-bottom: 12px;
      padding: 5px 10px;
      border: 1px solid var(--notice-accent-border);
      border-radius: 99px;
      background: var(--notice-accent-soft);
      color: var(--notice-accent);
      font-size: 10px;
      font-weight: 900;
      line-height: 1.2;
      letter-spacing: 0.08em;
    }

    .notice-preview__title {
      max-width: 350px;
      margin: 0 auto 10px;
      font-size: clamp(21px, 4vw, 26px);
      font-weight: 900;
      line-height: 1.18;
      letter-spacing: -0.03em;
      overflow-wrap: anywhere;
      text-wrap: balance;
    }

    .notice-preview__message {
      max-width: 360px;
      margin: 0 auto;
      color: #b5c0cf;
      font-size: 14px;
      line-height: 1.6;
      overflow-wrap: anywhere;
    }

    .notice-preview__message + .notice-preview__message {
      margin-top: 11px;
    }

    .notice-preview__highlight {
      color: var(--notice-accent);
      font-weight: 850;
    }

    .notice-preview__closing {
      max-width: 360px;
      margin: 16px auto 0;
      font-size: 14px;
      font-weight: 800;
      line-height: 1.4;
      overflow-wrap: anywhere;
    }

    .notice-preview__button {
      display: flex;
      min-height: 48px;
      align-items: center;
      justify-content: center;
      margin: 0 22px 20px;
      padding: 12px 18px;
      border: 1px solid var(--notice-accent);
      border-radius: 10px;
      background: var(--notice-accent);
      color: var(--notice-button-ink);
      font-size: 14px;
      font-weight: 900;
      line-height: 1.2;
      text-align: center;
    }

    .code-panel {
      border-top: 1px solid var(--border);
    }

    .code-panel summary {
      display: flex;
      min-height: 52px;
      align-items: center;
      justify-content: space-between;
      padding: 12px 20px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 750;
      cursor: pointer;
      list-style: none;
    }

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

    .code-panel summary::after {
      width: 8px;
      height: 8px;
      border-right: 2px solid currentColor;
      border-bottom: 2px solid currentColor;
      content: "";
      transform: rotate(45deg) translateY(-2px);
      transition: transform 140ms ease;
    }

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

    .code-wrap {
      padding: 0 20px 20px;
    }

    #generatedCode {
      display: block;
      width: 100%;
      min-height: 260px;
      padding: 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: #070a0e;
      color: #cbd6e5;
      font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
      font-size: 12px;
      line-height: 1.55;
      resize: vertical;
      white-space: pre;
    }

    .toast-region {
      position: fixed;
      right: 16px;
      bottom: 16px;
      left: 16px;
      z-index: 50;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      pointer-events: none;
    }

    .toast {
      max-width: min(100%, 360px);
      padding: 10px 14px;
      border: 1px solid #39506a;
      border-radius: 9px;
      background: #111923;
      color: #edf4fc;
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
      font-size: 13px;
      font-weight: 700;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 160ms ease, transform 160ms ease;
    }

    .toast.is-visible {
      opacity: 1;
      transform: translateY(0);
    }

    .site-footer {
      width: min(100% - 32px, 1440px);
      margin: 0 auto;
      padding: 0 0 32px;
      color: var(--subtle);
      font-size: 12px;
      text-align: center;
    }

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

      .preview-panel {
        position: static;
      }
    }

    @media (max-width: 640px) {
      .site-header__inner,
      main,
      .site-footer {
        width: min(100% - 24px, 1440px);
      }

      .site-header__inner {
        min-height: 64px;
      }

      .privacy-note {
        display: none;
      }

      .brand__tagline {
        display: none;
      }

      main {
        padding-top: 28px;
      }

      .intro {
        margin-bottom: 20px;
      }

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

      .promo-card__image {
        width: 52px;
        height: 52px;
        border-radius: 12px;
      }

      .promo-card__title {
        font-size: 18px;
      }

      .promo-card__description {
        grid-column: 1 / -1;
      }

      .promo-card__cta {
        grid-column: 1 / -1;
        width: 100%;
      }

      h1 {
        font-size: clamp(30px, 10vw, 42px);
      }

      .panel__header,
      .editor-form {
        padding-right: 16px;
        padding-left: 16px;
      }

      .field-row,
      .actions {
        grid-template-columns: 1fr;
      }

      .preview-stage {
        min-height: 540px;
        padding: 12px;
      }

      .preview-viewport {
        min-height: 510px;
        padding: 8px;
      }

      .notice-preview__header {
        gap: 10px;
        padding: 14px 16px;
      }

      .notice-preview__icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        border-radius: 9px;
        font-size: 19px;
      }

      .notice-preview__brand {
        font-size: 18px;
      }

      .notice-preview__body {
        padding: 16px;
      }

      .notice-preview__button {
        margin-right: 16px;
        margin-bottom: 14px;
        margin-left: 16px;
      }

      .code-panel summary,
      .code-wrap {
        padding-right: 16px;
        padding-left: 16px;
      }
    }

    @media (max-height: 720px) and (orientation: landscape) {
      .preview-stage {
        min-height: 470px;
      }

      .preview-viewport {
        min-height: 430px;
      }
    }

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

      *,
      *::before,
      *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
      }
    }

/* Shared two-tool navigation overrides the former single-row header. */
.site-header__inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
}

@media (max-width: 900px) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 72px;
  }
}

@media (max-width: 640px) {
  .site-header__inner {
    min-height: 72px;
  }
}
