:root,
[data-theme="dark"] {
  --bg: #0f1412;
  --surface: #1a221f;
  --surface-2: #222c28;
  --border: #2e3a35;
  --ink: #f2f5f3;
  --muted: #9aaba3;
  --accent: #1fc992;
  --accent-ink: #062419;
  --danger: #ff6b5e;
  --header: #121a17;
  --footer: #0c100e;
  --radius: 14px;
  --font: "Urbanist", system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eef3f0;
  --border: #d5e0da;
  --ink: #14201b;
  --muted: #5d6f67;
  --accent: #0f9f73;
  --accent-ink: #ffffff;
  --header: #ffffff;
  --footer: #e8efeb;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  background: var(--header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.nav {
  display: flex;
  gap: 1.2rem;
  color: var(--muted);
  font-weight: 500;
}

.nav a:hover,
.nav a.is-active { color: var(--accent); }

.theme-toggle,
.menu-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
}

.hero {
  padding: 3rem 0 2.75rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 70% at 85% 40%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 54ch;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.hero-actions .primary,
.hero-actions .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-actions .ghost {
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.hero-actions .ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-visual {
  position: relative;
  min-height: 340px;
  --mx: 50%;
  --my: 50%;
  --rx: 0deg;
  --ry: 0deg;
}

.mouse-glow {
  display: none !important;
}

.hero-stage {
  position: relative;
  width: min(100%, 440px);
  margin-inline: auto;
  aspect-ratio: 5 / 4;
  z-index: 1;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.12s ease-out;
}

.toolkit {
  position: absolute;
  inset: 0;
}

.toolkit-frame {
  position: absolute;
  inset: 10% 12% 14% 12%;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 24px 50px color-mix(in srgb, var(--ink) 12%, transparent);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}

.toolkit-modes {
  position: relative;
  min-height: 0;
}

.mode {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.mode.is-active {
  opacity: 1;
  transform: scale(1);
}

.mode-art {
  position: absolute;
  inset: 12% 14% 18% 14%;
  border-radius: 16px;
}

.mode-art--photo {
  background: linear-gradient(145deg, #6ec3ff, #9ae0b8 45%, #f2d27a);
}

.mode-art--compress {
  background: linear-gradient(145deg, #6ec3ff, #9ae0b8 45%, #f2d27a);
  filter: contrast(0.92) saturate(0.85);
  box-shadow: inset 0 0 0 0 transparent;
  animation: compressPulse 2.4s ease-in-out infinite;
}

.mode-art--convert {
  background:
    linear-gradient(135deg, transparent 48%, #0f9f73 48% 52%, transparent 52%),
    linear-gradient(145deg, #89c4ff, #f0d48a);
  display: grid;
  place-items: center;
}

.mode-art--convert::after {
  content: "WebP";
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.mode-art--edit {
  background: linear-gradient(145deg, #6ec3ff, #9ae0b8 45%, #f2d27a);
  clip-path: inset(12% 18% 20% 10%);
  transform: rotate(-6deg);
  transform-origin: center;
}

.mode-art--effects {
  background: linear-gradient(145deg, #6ec3ff, #9ae0b8 45%, #f2d27a);
  filter: grayscale(1) contrast(1.05);
}

.mode-art--pdf {
  position: relative;
  background:
    linear-gradient(#fff 0 0) center / 62% 78% no-repeat,
    linear-gradient(145deg, #dfe8e3, #c5d4cc);
  border-radius: 10px;
}

.mode-art--pdf::before {
  content: "PDF";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: 800;
  color: #c0392b;
  letter-spacing: 0.08em;
}

.mode-badge {
  position: absolute;
  left: 0.85rem;
  bottom: 0.75rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.toolkit-caption {
  padding: 0.55rem 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

.orbit-chip {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--ink) 10%, transparent);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  animation: chipFloat 4.5s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.35s);
  --ox: 0px;
  --oy: 0px;
  transform: translate(var(--ox), var(--oy));
  will-change: transform;
}

.orbit-chip.is-active,
.orbit-chip.is-near {
  border-color: var(--accent);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 22%, transparent);
  transform: translate(var(--ox), var(--oy)) scale(1.07);
  animation: none;
}

.orbit-chip:nth-child(2) { top: 2%; left: 8%; }
.orbit-chip:nth-child(3) { top: 6%; right: 2%; }
.orbit-chip:nth-child(4) { top: 42%; left: -4%; }
.orbit-chip:nth-child(5) { top: 46%; right: -2%; }
.orbit-chip:nth-child(6) { bottom: 4%; left: 10%; }
.orbit-chip:nth-child(7) { bottom: 2%; right: 6%; }

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes compressPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.92); }
}

.how-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.how-grid .steps {
  grid-template-columns: 1fr;
}

.section-alt {
  position: relative;
  --mx: 50%;
  --my: 50%;
  background: var(--surface-2);
  border-block: 1px solid var(--border);
  overflow: hidden;
}

.section-alt > .mouse-glow {
  inset: 0;
}

.flow-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-height: 180px;
  position: relative;
  z-index: 1;
}

.flow-card {
  width: 118px;
  min-height: 136px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  gap: 0.3rem;
  padding: 0.7rem 0.55rem;
  position: relative;
  overflow: hidden;
  --ox: 0px;
  --oy: 0px;
  transform: translate(var(--ox), var(--oy));
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.flow-card.is-near {
  border-color: var(--accent);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: translate(var(--ox), var(--oy)) scale(1.05);
}

.flow-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: center;
}

.flow-sub {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.25;
}

.flow-pic {
  width: 52px;
  height: 52px;
  border-radius: 12px;
}

.flow-pic--multi {
  background:
    linear-gradient(145deg, #7ec8ff, #8fd4a8 55%, #f0d48a),
    linear-gradient(145deg, #c9b6ff, #8fd4a8);
  box-shadow:
    6px 6px 0 color-mix(in srgb, var(--accent) 25%, var(--surface-2)),
    12px 12px 0 color-mix(in srgb, var(--border) 80%, transparent);
  animation: softPulse 2.8s ease-in-out infinite;
}

.flow-pic--result {
  background:
    conic-gradient(from 210deg, #7ec8ff, #8fd4a8, #f0d48a, #7ec8ff);
  display: grid;
  place-items: center;
  animation: softPulse 2.8s ease-in-out infinite 0.4s;
}

.flow-pic--result::after {
  content: "✓";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.75rem;
}

.flow-card--process {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.flow-pulse {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-top-color: var(--accent);
  animation: spin 1.1s linear infinite;
}

.flow-arrow {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.2rem;
  animation: nudge 1.6s ease-in-out infinite;
}

@keyframes softPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); opacity: 0.7; }
  50% { transform: translateX(4px); opacity: 1; }
}

@media (max-width: 900px) {
  .hero-grid,
  .how-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 300px;
  }

  .hero-stage {
    width: min(100%, 380px);
  }

  .orbit-chip:nth-child(4),
  .orbit-chip:nth-child(5) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-stage,
  .orbit-chip,
  .flow-card,
  .mode,
  .flow-pulse,
  .flow-arrow,
  .flow-pic {
    animation: none !important;
    transition: none !important;
  }
}

.brand-kicker {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.section {
  padding: 2.5rem 0;
}

.section h2 {
  margin: 0 0 0.4rem;
  letter-spacing: -0.03em;
}

.section-lede {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  gap: 0.35rem;
  padding-top: 0.25rem;
}

.steps li::before {
  content: counter(step);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.steps strong {
  letter-spacing: -0.02em;
}

.steps span {
  color: var(--muted);
  font-size: 0.95rem;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 720px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.85rem 1.1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  letter-spacing: -0.02em;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 0.65rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 800px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.cat-title {
  margin: 2rem 0 0.9rem;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.tool-card {
  display: grid;
  gap: 0.45rem;
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  min-width: 0;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--ink) 8%, transparent);
}

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.tool-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.tool-card strong {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.tool-card > span:not(.tool-icon) {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 1000px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .tools-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .tool-card {
    padding: 1rem;
  }

  .tool-card:hover {
    transform: none;
  }
}

.site-footer {
  background: var(--footer);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-inner {
  display: grid;
  gap: 1.2rem;
}

.footer-brand p {
  color: var(--muted);
  margin: 0.6rem 0 0;
  max-width: 42ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
  font-weight: 500;
}

.footer-links a:hover { color: var(--accent); }

.copyright {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
}

.cookie-bar {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.cookie-bar[hidden],
.cookie-bar.is-hidden {
  display: none !important;
}

.cookie-bar p { margin: 0; color: var(--muted); flex: 1; }
.cookie-bar a { color: var(--accent); }

button, .primary {
  font: inherit;
  cursor: pointer;
  border: 0;
}

.primary {
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ghost {
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 600;
}

/* Tool workspace */
.tool-hero {
  padding: 2rem 0 1rem;
}

.tool-hero h1 {
  margin: 0 0 0.4rem;
  letter-spacing: -0.03em;
}

.tool-hero p {
  margin: 0;
  color: var(--muted);
}

.workspace {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  margin: 1rem 0 2rem;
  overflow: hidden;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 2rem 1rem;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--accent);
}

.dropzone strong { display: block; margin-bottom: 0.35rem; }
.dropzone span { color: var(--muted); font-size: 0.92rem; }

.file-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface-2);
  border-radius: 12px;
  font-size: 0.92rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.controls input[type="number"],
.controls input[type="text"],
.controls select {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
}

.status {
  margin-top: 0.85rem;
  color: var(--muted);
  min-height: 1.3em;
}

.status.error { color: var(--danger); }
.status.ok { color: var(--accent); }

.preview-wrap {
  margin-top: 1rem;
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  padding: 0.75rem;
}

.preview-wrap canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}

.field-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.field-toolbar button {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}

.field-toolbar button.is-on {
  border-color: var(--accent);
  color: var(--accent);
}

.legal-page {
  max-width: 760px;
  padding: 2rem 0 3rem;
}

.legal-page h1 { margin-top: 0; letter-spacing: -0.03em; }
.legal-page h2 { margin-top: 1.75rem; font-size: 1.15rem; color: var(--ink); }
.legal-page h3 { margin-top: 1.1rem; font-size: 1rem; color: var(--ink); }
.legal-page p, .legal-page li { color: var(--muted); line-height: 1.65; }
.legal-page ul { padding-left: 1.2rem; }
.legal-page a { color: var(--accent); font-weight: 600; }

.contact-form {
  display: grid;
  gap: 0.9rem;
  max-width: 520px;
  margin-top: 1.25rem;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}

.ad-box {
  display: none; /* ads hidden until AdSense is enabled */
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--surface);
  margin: 1rem 0;
}

.preview-panel {
  margin-top: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.preview-head h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 280px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding: 1.25rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 70%, transparent), var(--bg));
}

.preview-image {
  display: block;
  max-width: min(100%, 720px);
  max-height: min(50vh, 480px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 10%, transparent);
  background: var(--surface);
}

.preview-image.is-checkered {
  background:
    linear-gradient(45deg, #d5ddd9 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #d5ddd9 25%, transparent 25%) 0 8px / 16px 16px,
    linear-gradient(45deg, transparent 75%, #d5ddd9 75%) 8px -8px / 16px 16px,
    linear-gradient(-45deg, transparent 75%, #d5ddd9 75%) -8px 0 / 16px 16px;
  background-color: #eef3f0;
}

.preview-svg {
  width: min(100%, 720px);
  max-height: min(50vh, 480px);
  overflow: auto;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #d5ddd9 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #d5ddd9 25%, transparent 25%) 0 8px / 16px 16px,
    #eef3f0;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 10%, transparent);
  padding: 0.75rem;
}

.preview-svg svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.preview-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
  margin-top: 1rem;
}

.actions-bar .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.preview-panel img,
.preview-panel canvas {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.preview-panel img.preview-check {
  background:
    linear-gradient(45deg, #cfd6d3 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #cfd6d3 25%, transparent 25%) 0 8px / 16px 16px,
    linear-gradient(45deg, transparent 75%, #cfd6d3 75%) 8px -8px / 16px 16px,
    linear-gradient(-45deg, transparent 75%, #cfd6d3 75%) -8px 0 / 16px 16px;
  background-color: #eef2f0;
}

.bg-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.bg-picker-label {
  font-weight: 700;
  font-size: 0.9rem;
}

.bg-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.bg-swatch {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.bg-swatch.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

.bg-swatch-fill {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  background:
    linear-gradient(45deg, #cfd6d3 25%, transparent 25%) 0 0 / 10px 10px,
    linear-gradient(-45deg, #cfd6d3 25%, transparent 25%) 0 5px / 10px 10px,
    #fff;
}

.bg-swatch--custom {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.bg-swatch--custom .bg-plus {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--accent);
  pointer-events: none;
  z-index: 1;
}

.bg-swatch--custom input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
  z-index: 2;
}

.bg-swatch--custom::after {
  content: none;
}

.blur-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  width: 100%;
}

.mode-tabs {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.mode-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}

.mode-tab:has(input:checked) {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 12%, transparent);
}

.mode-tab input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.blur-amount-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}

.blur-amount-label select {
  min-width: 5.5rem;
  font-weight: 700;
  color: var(--ink);
}

.brush-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 180px;
  flex: 1 1 180px;
}

.brush-wrap input[type="range"] {
  flex: 1;
  min-width: 120px;
}

.editor-hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.blur-editor {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  max-height: 60vh;
}

.blur-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

.note {
  display: none;
}

/* Custom cursor: dot + trailing ring */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  will-change: transform, width, height, opacity;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 50%, transparent);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 75%, transparent);
  background: transparent;
  transition: width 0.18s ease, height 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9998;
  opacity: 0.75;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.cursor-trail.is-fading {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
}

html.has-custom-cursor,
html.has-custom-cursor body {
  cursor: none;
}

html.has-custom-cursor a,
html.has-custom-cursor button,
html.has-custom-cursor .tool-card,
html.has-custom-cursor .primary,
html.has-custom-cursor .ghost,
html.has-custom-cursor .mode-tab,
html.has-custom-cursor .bg-swatch,
html.has-custom-cursor .dropzone,
html.has-custom-cursor label,
html.has-custom-cursor summary {
  cursor: none;
}

html.has-custom-cursor input,
html.has-custom-cursor textarea,
html.has-custom-cursor select,
html.has-custom-cursor .blur-canvas {
  cursor: auto;
}

html.has-custom-cursor.is-hover .cursor-ring {
  width: 48px;
  height: 48px;
  border-color: var(--accent);
  background: transparent;
}

html.has-custom-cursor.cursor-down .cursor-dot {
  transform: translate(-50%, -50%) scale(0.7);
}

html.has-custom-cursor.cursor-down .cursor-ring {
  width: 28px;
  height: 28px;
}

@media (max-width: 900px), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-dot,
  .cursor-ring,
  .cursor-trail {
    display: none !important;
  }

  html.has-custom-cursor,
  html.has-custom-cursor body,
  html.has-custom-cursor a,
  html.has-custom-cursor button {
    cursor: auto;
  }
}

@media (max-width: 800px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    inset: 64px 0 auto 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem;
    background: var(--header);
    border-bottom: 1px solid var(--border);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.85rem 1rem; border-radius: 12px; }
}
