body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--page);
  background-size: 100% 48px;
}

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

.footer-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

.footer-intro h1,
.panel-heading h2,
.preview-heading h2 {
  margin: 0;
  color: var(--text);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.footer-intro h1 {
  margin-top: 5px;
  font-size: clamp(30px, 4vw, 46px);
  text-wrap: balance;
}

.footer-intro p {
  max-width: 690px;
  margin: 8px 0 0;
  color: var(--muted);
}

.section-kicker {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.compatibility-note {
  display: flex;
  max-width: 430px;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(120, 174, 252, 0.34);
  border-radius: 12px;
  background: rgba(120, 174, 252, 0.07);
  color: var(--muted);
  font-size: 12px;
}

.compatibility-note svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--focus); }
.compatibility-note strong { color: var(--text); }

.footer-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

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

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

.panel-heading,
.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h2,
.preview-heading h2 { margin-top: 3px; font-size: 20px; }

.quiet-button,
.compact-button,
.order-button,
.button-row__action,
.primary-button,
.secondary-button,
.mobile-tab,
.device-toolbar button {
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.quiet-button { padding: 9px 14px; background: transparent; color: var(--muted); }
.quiet-button:hover { border-color: var(--danger); color: var(--danger); }
.compact-button:hover,
.order-button:hover,
.button-row__action:hover { border-color: var(--focus); background: var(--surface-3); }

.footer-form > fieldset {
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.footer-form > fieldset > legend {
  float: left;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.footer-form > fieldset > legend + * { clear: both; }

.fieldset-heading legend {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.field-help,
.allowlist-warning {
  margin: 5px 0 14px;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.5;
}

.footer-preset-grid,
.two-column,
.toggle-grid,
.color-grid,
.range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.footer-preset-grid label { position: relative; cursor: pointer; }
.footer-preset-grid input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.footer-preset-grid label > span {
  display: flex;
  min-height: 64px;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  transition: border-color 150ms ease, background-color 150ms ease;
}
.footer-preset-grid label:hover > span { border-color: var(--border-strong); }
.footer-preset-grid b { color: var(--text); font-size: 12px; }
.footer-preset-grid small { margin-top: 2px; overflow: hidden; color: var(--subtle); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.footer-preset-grid input:checked + span { border-color: var(--accent); background: rgba(247, 189, 69, .08); }
.footer-preset-grid input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.content-fields { display: grid; gap: 10px; }
.content-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.content-block__heading { display: flex; align-items: center; justify-content: space-between; }

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea,
.button-field input,
.button-field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0c1118;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.button-field input:hover,
.button-field select:hover { border-color: var(--border-strong); }

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

.field textarea { min-height: 86px; resize: vertical; line-height: 1.5; }

.toggle {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.toggle input { width: 18px; height: 18px; accent-color: var(--success); }
.toggle span { min-width: 0; overflow-wrap: anywhere; }
.toggle:has(input:checked) { border-color: rgba(67, 217, 139, .38); color: var(--text); }
.toggle--feature { margin-bottom: 12px; }

.block-order { display: grid; gap: 8px; }
.block-order__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 4px 4px 4px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
.order-button { width: 44px; padding: 0; font-size: 18px; }
.order-button:disabled { opacity: .35; cursor: not-allowed; }

.fieldset-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fieldset-heading .field-help { margin-bottom: 10px; }
.compact-button { flex: 0 0 auto; padding: 0 14px; }

.button-list { display: grid; gap: 12px; }
.button-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.button-row__title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.button-row__title strong { color: var(--text); font-size: 12px; }
.button-row__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.button-field { display: grid; min-width: 0; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.button-field--wide { grid-column: 1 / -1; }
.button-row__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.button-row__action { padding: 0 12px; }
.button-row__action--remove { margin-left: auto; border-color: rgba(255, 99, 121, .48); color: #ff8295; }
.button-error { min-height: 18px; margin: 6px 0 0; color: #ff8c9d; font-size: 11px; line-height: 1.4; }
.empty-message { margin: 0; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--muted); text-align: center; font-size: 12px; }
.allowlist-warning { padding: 12px; border-left: 3px solid var(--accent); background: rgba(247, 189, 69, .06); }
.allowlist-warning strong { color: var(--text); }

.range-grid { margin-top: 14px; }
.range-field { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.range-field > span { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.range-field b { color: var(--text); }
.range-field input { width: 100%; min-height: 30px; accent-color: var(--accent); }
.range-field output { color: var(--accent); font: 11px ui-monospace, "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }

.color-grid { margin-top: 14px; }
.color-field { display: grid; min-height: 56px; gap: 6px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 750; }
.color-control { display: flex; align-items: center; gap: 7px; }
.color-control input { width: 36px; height: 30px; flex: 0 0 36px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 7px; background: transparent; }
.color-control output { min-width: 0; overflow: hidden; color: var(--text); font: 11px ui-monospace, "SFMono-Regular", Consolas, monospace; text-overflow: ellipsis; }

.validation-message { margin: 18px 20px 0; padding: 12px 14px; border: 1px solid rgba(255, 99, 121, .48); border-radius: 10px; background: rgba(255, 99, 121, .08); color: #ffb2bd; font-size: 12px; line-height: 1.5; }
.export-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px 20px 10px; }
.primary-button,
.secondary-button {
  display: inline-flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.primary-button { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.primary-button:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.secondary-button { background: var(--surface-2); color: var(--text); }
.secondary-button:hover { border-color: var(--focus); background: var(--surface-3); }
.primary-button svg,
.secondary-button svg { width: 18px; height: 18px; flex: 0 0 18px; }
.export-actions button:disabled { opacity: .42; cursor: not-allowed; }
.save-status { display: flex; justify-content: space-between; gap: 12px; padding: 0 20px 18px; color: var(--subtle); font-size: 10px; }

.preview-heading { flex-wrap: wrap; }
.device-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.device-toolbar button { min-width: 48px; padding: 7px 9px; background: var(--surface-2); color: var(--muted); font: 11px ui-monospace, "SFMono-Regular", Consolas, monospace; }
.device-toolbar button:hover { color: var(--text); }
.device-toolbar button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: rgba(247, 189, 69, .1); }
.preview-stage { position: relative; display: grid; min-height: 520px; overflow: auto; place-items: start center; padding: 20px; background: linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%), linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%), #090d12; background-position: 0 0, 12px 12px; background-size: 24px 24px; scrollbar-color: var(--border-strong) transparent; }
.preview-scale-shell { position: relative; flex: 0 0 auto; }
#footerPreview { display: block; width: 390px; height: 500px; border: 1px solid var(--border-strong); background: #080b10; transform-origin: top left; }
.preview-note { padding: 13px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.code-panel { border-top: 1px solid var(--border); }
.code-panel summary { min-height: 48px; padding: 15px 18px; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.code-panel__body { padding: 0 18px 18px; }
.code-panel textarea { width: 100%; min-height: 240px; padding: 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--page); color: var(--text); font: 11px/1.55 ui-monospace, monospace; resize: vertical; }
.mobile-workspace-tabs { display: none; }

body > .site-footer {
  padding: 0 16px 28px;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.65;
  text-align: center;
}

body > .site-footer .developer-credit { text-align: center; }

@media (max-width: 1160px) {
  .footer-workspace { grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); }
  .preview-heading { align-items: flex-start; }
  .device-toolbar { width: 100%; justify-content: flex-start; }
}

@media (max-width: 900px) {
  .footer-maker { padding-top: 24px; }
  .footer-intro { align-items: stretch; }
  .footer-workspace { grid-template-columns: minmax(0, 1fr); }
  .footer-preview-panel { position: static; }
}

@media (max-width: 720px) {
  .footer-intro { flex-direction: column; gap: 14px; }
  .compatibility-note { max-width: none; }
  .mobile-workspace-tabs { position: sticky; z-index: 30; top: 132px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: rgba(8, 11, 15, .96); }
  .mobile-tab { background: transparent; color: var(--muted); }
  .mobile-tab.is-active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
  .footer-workspace[data-mobile-panel="editor"] .footer-preview-panel,
  .footer-workspace[data-mobile-panel="preview"] .footer-editor { display: none; }
}

@media (max-width: 480px) {
  .footer-maker { width: min(100% - 32px, 1440px); padding-top: 18px; }
  .footer-intro h1 { font-size: 30px; }
  .footer-preset-grid, .two-column, .toggle-grid, .color-grid, .range-grid, .export-actions, .button-row__grid { grid-template-columns: 1fr; }
  .button-field--wide { grid-column: auto; }
  .footer-form > fieldset, .panel-heading, .preview-heading { padding-right: 14px; padding-left: 14px; }
  .validation-message { margin-right: 14px; margin-left: 14px; }
  .export-actions, .save-status { padding-right: 14px; padding-left: 14px; }
  .save-status { flex-direction: column; }
  .device-toolbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
  .device-toolbar button { min-width: 0; padding-inline: 4px; font-size: 10px; }
  .preview-stage { min-height: 500px; padding: 12px; }
}

@media (max-height: 720px) and (orientation: landscape) {
  .footer-preview-panel { position: static; }
  .preview-stage { min-height: 480px; }
}

@media (prefers-reduced-motion: reduce) {
  .footer-maker *, .footer-maker *::before, .footer-maker *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
