/* ── Reset ─────────────────────────────────────────────────────────────── */
  *, *::before, *::after { box-sizing: border-box; }
  body { margin: 0; overflow: hidden; background: #1e1e1e;
         font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
         font-size: 0.75rem; color: #fff; }
  button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
  button { border: none; background: none; cursor: pointer; }
  input[type=number] { -moz-appearance: textfield; appearance: textfield; }
  input[type=number]::-webkit-outer-spin-button,
  input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

  /* ── Layout ─────────────────────────────────────────────────────────────── */
  .flex       { display: flex; }
  .flex-col   { flex-direction: column; }
  .flex-wrap  { flex-wrap: wrap; }
  .flex-1     { flex: 1 1 0%; }
  .shrink-0   { flex-shrink: 0; }
  .items-center   { align-items: center; }
  .justify-between{ justify-content: space-between; }
  .grid         { display: grid; }
  .grid-cols-2  { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-cols-3  { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid-cols-4  { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .col-span-2   { grid-column: span 2 / span 2; }
  .hidden       { display: none; }
  .overflow-y-auto { overflow-y: auto; }

  /* ── Sizing ─────────────────────────────────────────────────────────────── */
  .h-screen { height: 100vh; }
  .min-h-0  { min-height: 0; }
  #shortcuts-overlay:not(.hidden) { display: flex; }
  #canvas { touch-action: none; } /* touch/pen handled in JS (draw, pinch zoom) */
  .h-7      { height: 1.75rem; }
  .w-full   { width: 100%; }
  .w-12     { width: 3rem; }
  .w-14     { width: 3.5rem; }
  .w-52     { width: 13rem; }

  /* ── Spacing ─────────────────────────────────────────────────────────────── */
  .gap-1  { gap: 0.25rem; }
  .gap-2  { gap: 0.5rem; }
  .gap-3  { gap: 0.75rem; }
  .p-0    { padding: 0; }
  .p-3    { padding: 0.75rem; }
  .px-1   { padding-left: 0.25rem;  padding-right: 0.25rem; }
  .px-2   { padding-left: 0.5rem;   padding-right: 0.5rem; }
  .py-1   { padding-top: 0.25rem;   padding-bottom: 0.25rem; }
  .py-1\.5{ padding-top: 0.375rem;  padding-bottom: 0.375rem; }
  .mt-1   { margin-top: 0.25rem; }
  .mb-1   { margin-bottom: 0.25rem; }
  .mt-auto{ margin-top: auto; }
  .space-y-0\.5 > * + * { margin-top: 0.125rem; }

  /* ── Color ─────────────────────────────────────────────────────────────── */
  .bg-black    { background-color: #000; }
  .bg-gray-700 { background-color: #374151; }
  .bg-gray-800 { background-color: #1f2937; }
  .bg-gray-900 { background-color: #111827; }
  .text-white  { color: #fff; }
  .text-gray-300 { color: #d1d5db; }
  .text-gray-400 { color: #9ca3af; }
  .text-gray-500 { color: #6b7280; }
  .text-gray-600 { color: #4b5563; }

  /* ── Typography ─────────────────────────────────────────────────────────── */
  .text-xs  { font-size: 0.75rem;  line-height: 1rem; }
  .text-sm  { font-size: 0.875rem; line-height: 1.25rem; }
  .font-bold   { font-weight: 700; }
  .font-mono   { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
  .text-center { text-align: center; }
  .text-right  { text-align: right; }
  .uppercase   { text-transform: uppercase; }
  .tracking-wider  { letter-spacing: 0.05em; }
  .tracking-widest { letter-spacing: 0.1em; }
  .leading-relaxed { line-height: 1.625; }

  /* ── Borders ─────────────────────────────────────────────────────────────── */
  .rounded      { border-radius: 0.25rem; }
  .border-0     { border-width: 0; }
  .border-r     { border-right: 1px solid; }
  .border-gray-800 { border-color: #1f2937; }
  .outline-none { outline: none; }

  /* ── Interaction ─────────────────────────────────────────────────────────── */
  .cursor-pointer { cursor: pointer; }
  .select-none    { user-select: none; -webkit-user-select: none; }
  .resize-none    { resize: none; }
  .accent-blue-500 { accent-color: #3b82f6; }
  .transition-colors { transition: color 150ms, background-color 150ms, border-color 150ms; }

  /* ── Hover states ─────────────────────────────────────────────────────────── */
  .hover\:bg-gray-600:hover  { background-color: #4b5563; }
  .hover\:bg-indigo-700:hover{ background-color: #4338ca; }
  .hover\:bg-indigo-900:hover{ background-color: #312e81; }
  .hover\:bg-red-900:hover   { background-color: #7f1d1d; }

  /* ── Focus / disabled ─────────────────────────────────────────────────────── */
  .focus\:ring-1:focus,
  .focus\:ring-blue-500:focus { outline: none; box-shadow: 0 0 0 1px #3b82f6; }
  .disabled\:opacity-30:disabled { opacity: 0.3; }

  /* ── Sidebar resize handle ───────────────────────────────────────────────── */
  #sidebar-resize {
    width: 4px; flex-shrink: 0; cursor: col-resize; background: transparent;
    transition: background 150ms;
  }
  #sidebar-resize:hover, #sidebar-resize.dragging { background: #3b82f6; }

  /* ── Tool buttons ────────────────────────────────────────────────────────── */
  .tbn { border-radius: 0.25rem; padding: 0.25rem 0; background-color: #374151;
         color: #fff; font-size: 0.75rem; transition: color 150ms, background-color 150ms; }
  .tbn.active { background-color: #2563eb;
                box-shadow: 0 0 0 2px #93c5fd, inset 0 1px 0 rgba(255,255,255,0.15);
                font-weight: 600; }
  .tbn:not(.active):hover { background-color: #4b5563; }

  /* ── Flash-style compact tool palette ───────────────────────────────────────── */
  .toolgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
  .tool { height: 27px; display: flex; align-items: center; justify-content: center;
          border-radius: 3px; background: #2b323c; color: #d8dee8; font-size: 0.95rem;
          line-height: 1; transition: background 120ms; }
  /* Compact sidebar property rows so a selected object's controls fit without scroll */
  #sidebar p { margin-bottom: 2px; }
  #sidebar input[type=range] { height: 15px; margin: 0; }
  #sidebar > div > p.uppercase:first-child { line-height: 1.1; }
  .tool:not(.active):hover { background: #3b4452; color: #fff; }
  .tool.active { background: #2563eb; color: #fff; box-shadow: inset 0 0 0 1px #93c5fd; }
  .toolsep { grid-column: 1 / -1; height: 1px; background: #1f2937; margin: 2px 0; }
  /* compact swatches for the Colors block */
  .swatch { width: 1.5rem; height: 1.5rem; border-radius: 3px; border: 1px solid #4b5563; padding: 0; cursor: pointer; }
  .saved-swatches-title {
    display: flex; align-items: center; justify-content: space-between;
    color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em;
    font-size: 0.75rem; font-weight: 700; margin-bottom: 3px;
  }
  .paint-target-label {
    display: inline-flex; align-items: center; margin-left: 4px; padding: 1px 5px;
    border-radius: 999px; background: #1f2937; color: #bfdbfe; letter-spacing: 0;
    text-transform: none; font-size: 0.65rem; font-weight: 700;
  }
  .saved-swatches-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
    min-height: 22px;
  }
  .saved-swatch {
    position: relative; height: 22px; border-radius: 4px; border: 1px solid #4b5563;
    cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
  }
  .saved-swatch:hover { border-color: #93c5fd; box-shadow: 0 0 0 1px #2563eb; }
  .saved-swatch::before {
    content: attr(data-kind); position: absolute; left: 3px; top: 2px;
    padding: 0 3px; border-radius: 3px; background: rgba(2,6,23,0.55);
    color: rgba(255,255,255,0.86); font-size: 8px; font-weight: 800; line-height: 1.15;
  }
  .saved-swatch.is-gradient::after {
    content: ''; position: absolute; right: 3px; bottom: 3px;
    width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.85);
  }
  .saved-swatch-add { width: 24px; padding: 1px 0; }
  .miniBtn { border-radius: 3px; background: #2b323c; color: #d8dee8; font-size: 0.8rem; padding: 2px 0; }
  .miniBtn:hover { background: #3b4452; color: #fff; }
  .miniBtn.active { background: #2563eb; color: #fff; box-shadow: inset 0 0 0 1px #93c5fd; }

  /* Compact gradient editor for the narrow Flash-style sidebar */
  .gradient-panel { color: #e5e7eb; }
  .grad-title {
    display: flex; align-items: baseline; justify-content: space-between;
    color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em;
    font-weight: 700; margin-bottom: 3px;
  }
  .grad-title-sub { font-size: 0.62rem; color: #4b5563; }
  .grad-card {
    background: #111827; border: 1px solid #334155; border-radius: 7px;
    padding: 6px; margin-bottom: 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  }
  .grad-type-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; margin-bottom: 6px; }
  .grad-icon-btn, .grad-mini-btn {
    border-radius: 5px; background: #2b3443; color: #d8dee8;
    font-size: 0.68rem; line-height: 1; min-height: 24px; padding: 4px 5px;
  }
  .grad-icon-btn:hover, .grad-mini-btn:hover { background: #3b4452; color: #fff; }
  .grad-icon-btn.active { background: #2563eb; color: #fff; box-shadow: inset 0 0 0 1px #93c5fd; }
  .grad-icon-btn.muted { opacity: 0.45; cursor: default; }
  .grad-ramp {
    position: relative; height: 24px; border-radius: 6px; border: 1px solid #64748b;
    margin: 2px 2px 7px; cursor: crosshair; overflow: visible;
  }
  .grad-ramp-marker {
    position: absolute; bottom: -7px; width: 17px; height: 17px; border-radius: 999px;
    border: 1px solid #111827; transform: translateX(-50%);
    cursor: grab; padding: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.6);
  }
  .grad-ramp-marker:active { cursor: grabbing; }
  .grad-action-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 4px; }
  .grad-mini-btn.primary { background: #334155; font-weight: 700; }
  .grad-mini-btn.danger:hover { background: #991b1b; }
  .grad-section-toggle {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    color: #d1d5db; text-transform: uppercase; letter-spacing: 0.04em;
    font-weight: 800; padding: 0 0 5px; cursor: default;
  }
  .grad-sv {
    position: relative; height: 92px; border-radius: 6px; border: 1px solid #64748b;
    cursor: crosshair; overflow: hidden; margin-bottom: 6px;
  }
  .grad-sv-cursor {
    position: absolute; width: 14px; height: 14px; border-radius: 999px;
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.65);
    pointer-events: none;
  }
  .grad-slider-row { display: grid; grid-template-columns: 36px minmax(0,1fr) 36px; align-items: center; gap: 5px; margin-bottom: 5px; }
  .grad-row-label { color: #9ca3af; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.04em; }
  .grad-range { width: 100%; min-width: 0; height: 16px; margin: 0; accent-color: #3b82f6; }
  .grad-color-swatch {
    width: 28px; height: 24px; border: 1px solid #cbd5e1; border-radius: 4px;
    background: transparent; padding: 0; cursor: pointer;
  }
  .grad-percent-input {
    width: 36px; height: 24px; border: 0; border-radius: 4px; outline: none;
    background: #374151; color: #fff; text-align: right; padding: 0 4px;
  }
  .grad-field-grid { display: grid; grid-template-columns: 1.65fr repeat(4, minmax(0,1fr)); gap: 4px; }
  .grad-field {
    min-width: 0; display: flex; flex-direction: column; gap: 2px;
    color: #9ca3af; font-size: 0.58rem; text-align: center; text-transform: uppercase;
  }
  .grad-field input {
    width: 100%; min-width: 0; height: 24px; border: 0; border-radius: 4px;
    outline: none; background: #374151; color: #fff; text-align: center;
    padding: 0 2px; font-size: 0.7rem;
  }
  .grad-field input:focus, .grad-percent-input:focus { box-shadow: 0 0 0 1px #3b82f6; }
  .grad-stops-list { display: flex; flex-direction: column; gap: 3px; max-height: 86px; overflow-y: auto; margin-bottom: 4px; }
  .grad-stop-row {
    display: grid; grid-template-columns: 26px minmax(0,1fr) 42px 18px;
    align-items: center; gap: 4px; border-radius: 5px; padding: 3px;
    background: rgba(17,24,39,0.72);
  }
  .grad-stop-row.active { background: #374151; }
  .grad-stop-color {
    width: 26px; height: 22px; border: 0; border-radius: 4px;
    background: transparent; cursor: pointer; padding: 0;
  }
  .grad-stop-range { width: 100%; min-width: 0; height: 15px; margin: 0; accent-color: #3b82f6; }
  .grad-stop-value { color: #9ca3af; font-size: 0.62rem; text-align: right; white-space: nowrap; }
  .grad-stop-delete {
    color: #9ca3af; font-size: 0.68rem; border-radius: 4px; min-height: 20px; padding: 0;
  }
  .grad-stop-delete:hover { color: #fecaca; background: #7f1d1d; }

/* ── Landing Page Overlay ──────────────────────────────────────────────── */
.landing-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 20%, #0d2b1f 0%, #0b1612 100%);
  background-color: #0b1612;
  font-family: 'Outfit', sans-serif;
  overflow-y: auto;
  overflow-x: hidden;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
  color: #f0fdf4;
}

.landing-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.landing-overlay.fade-out .landing-content {
  transform: translateY(-20px) scale(0.98);
  opacity: 0;
}

.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.landing-logo-icon {
  background: #113828;
  color: #a7f3d0;
  font-weight: 800;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.landing-logo-text {
  font-size: 1.1rem;
  font-weight: 400;
  color: #a7f3d0;
}

.landing-btn-launch {
  background: #113828;
  color: #f0fdf4;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  border: 1px solid #1c4a37;
  transition: all 0.2s ease;
}

.landing-btn-launch:hover {
  background: #1c4a37;
  transform: translateY(-1px);
}

.landing-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 3rem 6rem;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s;
}

.landing-hero {
  display: flex;
  align-items: center;
  gap: 4rem;
  margin-top: 3rem;
  margin-bottom: 6rem;
}

.landing-hero-left {
  flex: 1;
}

.landing-tag {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-tag::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fbbf24;
}

.landing-title {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
  color: #f0fdf4;
}

.landing-gradient-text {
  background: linear-gradient(90deg, #34d399 0%, #fef08a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-subtitle {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #a7f3d0;
  max-width: 500px;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.landing-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.landing-btn-primary {
  background: #104e38;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem 1.75rem;
  border-radius: 999px;
  border: 1px solid #1a6f50;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-btn-primary:hover {
  background: #1a6f50;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.landing-btn-secondary {
  color: #a7f3d0;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 1rem 1.75rem;
  border-radius: 999px;
  border: 1px solid #1c4a37;
  background: rgba(17, 56, 40, 0.3);
  transition: all 0.2s ease;
}

.landing-btn-secondary:hover {
  background: rgba(17, 56, 40, 0.8);
  color: #fff;
}

.landing-hero-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.landing-mockup {
  background: #11281e;
  border: 1px solid #1c4a37;
  border-radius: 24px;
  width: 320px;
  height: 580px;
  padding: 1rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.mockup-header {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.mockup-dot {
  width: 40px;
  height: 4px;
  background: #23523c;
  border-radius: 4px;
}

.mockup-dot:first-child {
  background: #34d399;
}

.mockup-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 1rem;
}

.mockup-svg {
  width: 100%;
  height: auto;
  color: #34d399;
  margin-bottom: auto;
  opacity: 0.6;
}

.mockup-text h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.mockup-text p {
  font-size: 0.85rem;
  color: #a7f3d0;
  margin: 0 0 1.5rem;
  line-height: 1.4;
}

.mockup-btn {
  width: 100%;
  background: transparent;
  color: #fff;
  border: 1px solid #34d399;
  padding: 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  transition: all 0.2s ease;
}

.mockup-btn:hover {
  background: #34d399;
  color: #0b1612;
}

.landing-features-section {
  border-top: 1px solid #1a3326;
  padding-top: 4rem;
}

.features-heading {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #2e664b;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: #111e18;
  border: 1px solid #1a3326;
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: #2e664b;
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: #162a22;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  border: 1px solid #1c3b2d;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: #a7f3d0;
  line-height: 1.5;
  margin: 0;
  opacity: 0.8;
}

@media (max-width: 1024px) {
  .landing-hero { flex-direction: column; text-align: center; gap: 3rem; }
  .landing-hero-left { display: flex; flex-direction: column; align-items: center; }
  .landing-actions { justify-content: center; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-mockup { width: 100%; max-width: 360px; }
}

@media (max-width: 640px) {
  .landing-title { font-size: 3rem; }
  .features-grid { grid-template-columns: 1fr; }
  .landing-header { padding: 1.5rem; flex-direction: column; gap: 1rem; }
  .landing-content { padding: 1.5rem 1.5rem 4rem; }
}

.m-chrome { display: none; }
.m-sheet { display: none; }

@media (max-width: 768px) {
  #topbar, #sidebar, #sidebar-resize { display: none !important; }
  body.mobile #m-topbar,
  body.mobile #m-ctx,
  body.mobile #m-dock { display: flex; }
  body.mobile #m-scrim { display: none; }
  body.mobile #m-scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }

  #m-topbar { align-items: center; gap: 10px; background: #111827; color: #cdd3df;
    padding: calc(env(safe-area-inset-top) + 6px) 12px 6px; position: fixed; top: 0; left: 0; right: 0; z-index: 30; }
  #m-zoom { margin-left: auto; font: 500 13px monospace; }
  .m-btn { background: transparent; border: none; color: #cdd3df; font-size: 18px; padding: 6px; }

  #m-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; align-items: center; gap: 8px;
    background: #1b2029; padding: 8px 10px calc(env(safe-area-inset-bottom) + 8px); }
  #m-dock-tools { display: flex; gap: 8px; overflow-x: auto; flex: 1; scrollbar-width: none; }
  #m-dock-tools::-webkit-scrollbar { display: none; }
  #m-dock-tools .toolgrid { display: flex; gap: 8px; grid-template-columns: none; }
  #m-dock-tools .tool { width: 40px; height: 40px; flex: 0 0 auto; font-size: 18px; }
  #m-dock-fixed { display: flex; align-items: center; gap: 8px; }
  .m-dot { width: 26px; height: 26px; border-radius: 50%; background: #3b82f6; border: 2px solid #fff; }

  #m-ctx { position: fixed; left: 0; right: 0; z-index: 29; align-items: center; gap: 10px;
    background: #232838; color: #aeb6c6; font-size: 13px; padding: 7px 12px; display: flex;
    bottom: calc(env(safe-area-inset-bottom) + 56px); }
  #m-ctx-label { flex: 1; }
  #m-ctx #m-ctx-more { margin-left: auto; }

  .m-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-height: 70vh; overflow-y: auto;
    background: #12161d; color: #e5e7eb; border-radius: 16px 16px 0 0;
    padding: 8px 14px calc(env(safe-area-inset-bottom) + 16px);
    transform: translateY(100%); transition: transform .18s ease; }
  .m-sheet.open { display: block; transform: translateY(0); }
  .m-grab { width: 34px; height: 4px; border-radius: 2px; background: #48505f; margin: 4px auto 8px; }
  .m-sheet #sec-colors, .m-sheet #sec-layers { padding: 4px 0 8px; }
  .m-sheet .swatch { width: 34px; height: 34px; }
  .m-sheet #layers-list { gap: 6px; }
  .m-sheet #m-sheet-options > div, .m-sheet [id^="row-"] { margin-bottom: 10px; }

  body.mobile #m-sheet-menu #topbar { display: flex !important; flex-wrap: wrap; }

  #m-shapes-pop { display: none; position: fixed; z-index: 45;
    bottom: calc(env(safe-area-inset-bottom) + 108px); left: 10px;
    background: #1b2029; border-radius: 12px; padding: 8px; gap: 8px; }
  #m-shapes-pop.open { display: flex; }
  #m-dock-tools, .m-sheet { -webkit-overflow-scrolling: touch; }
  #m-dock-tools { touch-action: pan-x; }
  .m-sheet { touch-action: pan-y; }

  #canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; touch-action: none; }
}
