/* EZ-PNG2SVG — styles
   Light professional theme. App shell: everything fits one viewport on
   desktop (no page scroll); rails scroll internally only if needed. */

:root {
  /* palette — light, neutral, single teal accent */
  --c-bg: #f4f5f7;
  --c-surface: #ffffff;
  --c-surface-2: #f1f3f6;
  --c-surface-3: #e7eaf0;
  --c-border: #dfe3ea;
  --c-text: #191c22;
  --c-text-dim: #4d5563;
  --c-text-faint: #8a92a3;
  --c-accent: #0f9d8f;
  --c-accent-hover: #12b2a2;
  --c-accent-soft: #e4f5f2;
  --c-accent-ink: #ffffff;
  --c-danger: #d64545;
  --c-ok: #2e9e5b;

  /* transparency checker */
  --checker-light: #e9ebee;
  --checker-dark: #dfe3e8;

  /* elevation */
  --shadow-s: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-m: 0 6px 20px rgba(16, 24, 40, 0.08);

  /* shape */
  --radius-s: 6px;
  --radius-m: 10px;

  /* type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* motion */
  --fast: 120ms ease;
  --med: 240ms ease;

  /* app chrome — --chrome-h is measured at runtime (JS) from the real
     header + footer bar heights, so the tool shell always meets the
     bottom bar exactly, even when a taller ad unit loads */
  --header-h: 56px;
  --footer-h: 106px;   /* footer min-height fallback before JS runs */
}

* { box-sizing: border-box; }

/* author display values must not defeat the hidden attribute */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--c-text);
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

button { font: inherit; color: inherit; }

/* ---------------------------------------------------------------- *
 *  Top bar — sticky, doubles as the page H1
 * ---------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 16px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-s);
}

.brand {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.brand .logo { width: 20px; height: 20px; }

.brand-dot { color: var(--c-accent); }

.brand .tag {
  font-size: 12px;
  font-weight: 400;
  color: var(--c-text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- *
 *  Ad slots — designated, integrated, labeled.
 *  Styled as regular surface cards with a small "Sponsored" disclosure;
 *  .ad-inner:empty keeps the reserved placeholder until code is pasted.
 * ---------------------------------------------------------------- */

.ad-slot {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  padding: 22px 10px 10px;
}

.ad-slot::before {
  content: "Sponsored";
  position: absolute;
  top: 7px;
  left: 10px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--c-text-faint);
}

.ad-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-s);
  color: var(--c-text-faint);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  user-select: none;
}

.ad-inner:empty::after { content: "ad space"; }
.ad-inner:not(:empty) { border-style: solid; }

/* size hints on the empty placeholders */
.ad-tile .ad-inner:empty::after { content: "ad space · 300×250 / 336×280"; }
.ad-footer-leaderboard .ad-inner:empty::after { content: "ad space · 728×90 / 970×90"; }

/* right rail: IAB Medium Rectangle 300×250 and Large Rectangle 336×280 */
.ad-tile .ad-inner { min-height: 280px; max-width: 336px; }

/* left rail: text/link unit */
.ad-strip .ad-inner { min-height: 60px; }
.ad-strip::before { content: "Sponsored links"; }

/* footer leaderboard: IAB Leaderboard 728×90 and Super Leaderboard 970×90.
   The bar grows automatically for taller creatives; for a 970×250
   Billboard add class "billboard" to <body>. */
.ad-footer-leaderboard {
  flex: 1;
  max-width: 970px;
  margin-left: auto;
  padding: 8px;
}
.ad-footer-leaderboard .ad-inner { min-height: 90px; }

/* ---------------------------------------------------------------- *
 *  Buttons
 * ---------------------------------------------------------------- */

.btn {
  appearance: none;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  padding: 7px 14px;
  border-radius: var(--radius-s);
  cursor: pointer;
  box-shadow: var(--shadow-s);
  transition: background var(--fast), border-color var(--fast), transform var(--fast);
}

.btn:hover { background: var(--c-surface-2); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: var(--c-accent);
  border-color: transparent;
  color: var(--c-accent-ink);
  font-weight: 600;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn.block { width: 100%; }

.btn:focus-visible,
.range-btn:focus-visible,
select:focus-visible,
.slider:focus-visible,
.chip:focus-visible,
.zoom-btn:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- *
 *  App shell — the tool fills the first viewport exactly; the SEO
 *  guide flows below it. 56px header + 84px footer bar.
 * ---------------------------------------------------------------- */

.app {
  flex: none;
  height: calc(100dvh - var(--chrome-h, 142px));
  min-height: 480px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 290px;
  gap: 12px;
  padding: 12px;
}

.rail {
  min-height: 0;
  overflow: hidden;            /* rails never scroll — data sections do */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* scrollable data region of the left rail (controls + palette) */
.rail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  padding-right: 2px;
}

.rail-left .ad-strip { flex: none; margin: 0; }

.rail-group {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  padding: 12px 14px 14px;
  flex: none;
}

.rail-group > h2 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--c-text-faint);
}

.rail-hint {
  margin: -4px 0 10px;
  font-size: 11px;
  color: var(--c-text-faint);
}

.rail-note {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--c-text-dim);
  flex: none;
}

.rail-note strong { color: var(--c-text); }

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.control-row:last-child { margin-bottom: 0; }

.control-label { color: var(--c-text-dim); }

/* steppers */
.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.range-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-s);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--fast);
}

.range-btn:hover { background: var(--c-surface-2); }

.stepper .value {
  min-width: 34px;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-s);
  padding: 4px 6px;
}

select {
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-s);
  padding: 6px 8px;
  font: inherit;
}

/* sliders */
.slider-row { margin-bottom: 10px; }
.slider-row:last-of-type { margin-bottom: 4px; }

.slider-row .slider-head {
  display: flex;
  justify-content: space-between;
  color: var(--c-text-dim);
  margin-bottom: 2px;
}

.slider-row output {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--c-text-faint);
}

.slider {
  width: 100%;
  accent-color: var(--c-accent);
  margin: 0;
}

.adjustments { margin-top: 10px; }

.adjustments summary {
  cursor: pointer;
  color: var(--c-text-dim);
  font-size: 13px;
  user-select: none;
  padding: 4px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.adjustments summary::before {
  content: "▸";
  transition: transform var(--fast);
  color: var(--c-text-faint);
}

.adjustments[open] summary::before { transform: rotate(90deg); }

.adjustments .adjust-body { padding-top: 10px; }

.reset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.reset-row .btn { padding: 4px 10px; font-size: 12px; }

.rail > .btn.block { flex: none; }

/* anchor the sponsored strip at the rail bottom (layout, not margin) */
.rail-left .rail-scroll + .ad-strip { margin-top: 0; }

/* palette chips: scroll internally so the merge block stays visible */
#palettePanel .chips {
  max-height: 176px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.rail .hint {
  color: var(--c-text-faint);
  font-size: 12px;
  text-align: center;
  margin: 0;
}

/* ---------------------------------------------------------------- *
 *  Palette rail group
 * ---------------------------------------------------------------- */

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

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 3px 8px 3px 5px;
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast), opacity var(--fast);
  color: var(--c-text-dim);
  font-size: 12px;
  font-family: var(--mono);
}

.chip:hover { background: var(--c-surface-2); }

.chip .swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: none;
}

.chip .hex {
  padding: 1px 2px;
  border-radius: 4px;
  transition: background var(--fast), color var(--fast);
}

.chip .hex:hover {
  background: var(--c-surface-3);
  color: var(--c-text);
}

.chip .pct { color: var(--c-text-faint); }

.chip.selected-from {
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
  box-shadow: 0 0 0 1px var(--c-accent);
}

.chip.selected-to {
  border-color: var(--c-ok);
  background: #eaf6ef;
  box-shadow: 0 0 0 1px var(--c-ok);
}

.chip.off { opacity: 0.4; }

.chip .knock {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--c-text-faint);
  cursor: pointer;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1;
  border-radius: 50%;
}

.chip .knock:hover { color: var(--c-danger); }

/* custom merge-target chip with color input */
.chip.custom-to {
  padding: 3px 6px;
  gap: 4px;
  border-style: dashed;
}

.chip.custom-to input[type="color"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  padding: 0;
  background: none;
  cursor: pointer;
}

.chip.custom-to input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.chip.custom-to input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }
.chip.custom-to input[type="color"]::-moz-color-swatch { border: none; border-radius: 50%; }

.chip.custom-to .custom-plus {
  font-size: 12px;
  color: var(--c-text-faint);
  line-height: 1;
}

.chip.custom-to.selected-to {
  border-style: solid;
  border-color: var(--c-ok);
}

/* merge block inside rail */
.merge-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.merge-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.merge-line .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.merge-line .chips:empty::after {
  content: "none picked";
  color: var(--c-text-faint);
  font-size: 11px;
  font-style: italic;
  font-family: var(--font);
}

.group-label {
  color: var(--c-text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  min-width: 72px;
}

.merge-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.merge-actions .btn { padding: 5px 14px; font-size: 12px; }

.merge-note {
  color: var(--c-text-faint);
  font-size: 11px;
}

/* ---------------------------------------------------------------- *
 *  Stage — single pane: before/after split + zoom/pan
 * ---------------------------------------------------------------- */

.stage-col {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pane {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.pane > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--c-text-faint);
  border-bottom: 1px solid var(--c-border);
  flex: none;
}

.pane .pane-note {
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  color: var(--c-text-faint);
}

/* zoomable viewport */
.viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background-image:
    linear-gradient(45deg, var(--checker-dark) 25%, transparent 25%,
      transparent 75%, var(--checker-dark) 75%),
    linear-gradient(45deg, var(--checker-dark) 25%, transparent 25%,
      transparent 75%, var(--checker-dark) 75%);
  background-color: var(--checker-light);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
}

.viewport.panning { cursor: grabbing; }

.zoom-layer {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.layer-before {
  clip-path: inset(0 calc(100% - var(--split-layer, 0%)) 0 0);
}

/* comparison divider — viewport space */
.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 0%);
  width: 0;
  cursor: ew-resize;
  touch-action: none;
}

.divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1.5px;
  width: 3px;
  background: var(--c-accent);
  opacity: 0.9;
}

.divider:focus-visible::before,
.divider:focus::before {
  opacity: 1;
  width: 5px;
  left: -2.5px;
}

.divider .grip {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c-accent);
  color: var(--c-accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 1px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.35);
  cursor: ew-resize;
}

.divider:focus-visible .grip,
.divider:focus .grip {
  outline: 3px solid var(--c-accent-hover);
  outline-offset: 2px;
}

/* corner tags */
.stage-tag {
  position: absolute;
  top: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--c-text-dim);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 3px 10px;
  pointer-events: none;
  z-index: 3;
}

.tag-before { left: 10px; }
.tag-after { right: 10px; }

/* zoom controls */
.zoom-controls {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-s);
  padding: 4px;
  box-shadow: var(--shadow-m);
  z-index: 3;
}

.zoom-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--c-text);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.zoom-btn:hover { background: var(--c-surface-2); }

.zoom-level {
  min-width: 44px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--c-text-dim);
}

/* loading overlay — purely visual */
.load-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(1px);
  pointer-events: none;
  z-index: 4;
  font-size: 13px;
  color: var(--c-text-dim);
}

.load-overlay.active { display: flex; }

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-accent);
  animation: spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.6s; }
}

/* empty / dropzone state */
.empty {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--c-surface);
  border: 2px dashed var(--c-border);
  border-radius: var(--radius-m);
  color: var(--c-text-dim);
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}

.empty:hover, .empty:focus-visible {
  border-color: var(--c-accent);
  background: var(--c-surface-2);
}

.empty .big {
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text);
}

.empty svg { opacity: 0.5; }

/* ---------------------------------------------------------------- *
 *  Stats strip
 * ---------------------------------------------------------------- */

.statsbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px 14px;
  flex-wrap: wrap;
  min-height: 34px;
  padding: 6px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  color: var(--c-text-dim);
  font-size: 12px;
  font-family: var(--mono);
}

.statsbar:empty { display: none; }

.statsbar .dot { opacity: 0.5; }

/* ---------------------------------------------------------------- *
 *  Layers rail (right)
 * ---------------------------------------------------------------- */

.rail-right {
  flex: none;
  overflow: hidden;
}

#layersPanel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.layer-list {
  flex: 1 1 auto;
  min-height: 60px;
  overflow-y: auto;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layer-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-s);
  padding: 6px 8px;
}

.layer-card .swatch {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-s);
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex: none;
}

.layer-card .meta {
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--c-text-dim);
  line-height: 1.3;
  min-width: 0;
}

.layer-card .meta .hex { color: var(--c-text); }

.layer-card .btn {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 11px;
}

/* ---------------------------------------------------------------- *
 *  Footer bar — brand line + leaderboard, sticky so the ad unit
 *  stays on screen across the whole page
 * ---------------------------------------------------------------- */

.footerbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--footer-h);
  padding: 8px 16px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -1px 2px rgba(16, 24, 40, 0.05);
}

.footer-identity {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--c-text-dim);
  white-space: nowrap;
  flex: none;
}

.footer-identity strong { color: var(--c-accent); }

/* slim text/link slot beside the site mark */
.ad-brandstrip {
  flex: 0 1 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}

.ad-brandstrip::before {
  content: "Ad";
  position: static;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--c-text-faint);
  flex: none;
}

.ad-brandstrip .ad-inner {
  flex: 1;
  min-height: 30px;
  border: 0;
}

.ad-brandstrip .ad-inner:empty::after {
  content: "text ad — your message here";
  letter-spacing: 0;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-s);
  padding: 4px 10px;
}

.ad-brandstrip .ad-inner:not(:empty) {
  border: 0;
}

/* footer leaderboard: IAB Leaderboard 728×90 and Super Leaderboard 970×90.
   The bar grows automatically for taller creatives (e.g. a 970×250
   Billboard) — the tool shell re-measures its height via JS. */
.ad-footer-leaderboard {
  flex: 1;
  max-width: 970px;
  margin-left: auto;
  padding: 8px;
}
.ad-footer-leaderboard .ad-inner { min-height: 90px; }

/* ---------------------------------------------------------------- *
 *  SEO guide content (below the tool)
 * ---------------------------------------------------------------- */

.seo {
  max-width: 880px;
  margin: 26px auto 42px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.seo-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  padding: 22px 26px;
}

.seo-card h2 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.3;
}

.seo-card p { margin: 0 0 10px; color: var(--c-text-dim); }
.seo-card p strong, .seo-card li strong { color: var(--c-text); }
.seo-card ul, .seo-card ol { margin: 0 0 6px; padding-left: 22px; color: var(--c-text-dim); }
.seo-card li { margin: 6px 0; }

.steps li { margin: 9px 0; }

.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.format-card {
  display: block;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--c-text);
  transition: border-color var(--fast), background var(--fast), transform var(--fast);
}

.format-card:hover {
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
  transform: translateY(-1px);
}

.format-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--c-accent);
}

.format-card p {
  margin: 0;
  font-size: 13px;
  color: var(--c-text-dim);
}

.seo details {
  border-bottom: 1px solid var(--c-border);
  padding: 2px 0;
}

.seo details:last-child { border-bottom: 0; }

.seo summary {
  cursor: pointer;
  font-weight: 600;
  padding: 9px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

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

.seo summary::before {
  content: "▸";
  color: var(--c-accent);
  transition: transform var(--fast);
}

.seo details[open] summary::before { transform: rotate(90deg); }

.seo details p { margin: 0 0 12px; }

/* ---------------------------------------------------------------- *
 *  Drop overlay + toast
 * ---------------------------------------------------------------- */

.drop-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(244, 245, 247, 0.85);
  z-index: 50;
  font-size: 20px;
  font-weight: 600;
  color: var(--c-accent);
  pointer-events: none;
  border: 3px dashed var(--c-accent);
}

.drop-overlay.active { display: flex; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #23272f;
  color: #ffffff;
  border-radius: var(--radius-s);
  padding: 10px 16px;
  font-size: 13px;
  opacity: 0;
  transition: opacity var(--med), transform var(--med);
  pointer-events: none;
  z-index: 60;
  max-width: min(90vw, 480px);
  box-shadow: var(--shadow-m);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error { background: var(--c-danger); }

/* ---------------------------------------------------------------- *
 *  Responsive — small screens reflow and allow page scroll
 * ---------------------------------------------------------------- */

@media (max-width: 1180px) {
  body { overflow: auto; height: auto; min-height: 100dvh; }
  .app {
    height: auto;
    min-height: calc(100dvh - 140px);
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "stage stage"
      "left right";
  }
  .stage-col { grid-area: stage; }
  .rail-left { grid-area: left; overflow: visible; }
  .rail-right { grid-area: right; overflow: visible; }
  .rail-scroll { overflow: visible; }
  .layer-list { flex: none; max-height: 340px; }
  .viewport { min-height: 380px; }
}

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "stage" "left" "right"; height: auto; }
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; }
  .brand .tag { display: none; }
  .viewport { min-height: 320px; }
  .footerbar { flex-direction: column; gap: 8px; }
  .footer-identity { white-space: normal; text-align: center; justify-content: center; }
  .ad-brandstrip { flex: 1 1 auto; }
  /* mobile: IAB Mobile Leaderboard 320×50 / Large Mobile Banner 320×100 */
  .ad-footer-leaderboard { width: 100%; max-width: 640px; }
  .ad-footer-leaderboard .ad-inner { min-height: 100px; }
  .ad-tile .ad-inner { min-height: 250px; }
}
