* { box-sizing: border-box; margin: 0; padding: 0; }

/* Verhindert Doppel-Tap-Zoom auf Mobilgeräten (Safari/Chrome), ohne Pinch-Zoom
   oder Scrollen zu beeinträchtigen. */
html { touch-action: manipulation; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #16213e;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid #0f3460;
  flex-shrink: 0;
}

header h1 {
  font-size: 1.3rem;
  color: #e94560;
  letter-spacing: 1px;
  white-space: nowrap;
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

.subtitle {
  font-size: 0.8rem;
  color: #888;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-toggle-group {
  display: flex;
  gap: 4px;
  background: #0f3460;
  border-radius: 8px;
  padding: 3px;
  margin-left: auto; /* Desktop: schiebt Toggle + header-right nach rechts */
}
/* header-right direkt nach mode-toggle-group: kein extra margin-left nötig */
.mode-toggle-group + .header-right { margin-left: 0; }

.mode-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.mode-btn.active {
  background: #e94560;
  color: #fff;
  font-weight: 600;
}
.mode-btn:not(.active):hover { color: #ddd; background: #1a4a80; }

.btn {
  background: #0f3460;
  color: #e0e0e0;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { background: #1a4a80; }

.lang-toggle {
  display: flex;
  gap: 2px;
  background: #0f3460;
  border-radius: 8px;
  padding: 3px;
}
.lang-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: background 0.15s, color 0.15s;
}
.lang-btn.active { background: #e94560; color: #fff; }
.lang-btn:hover:not(.active) { color: #e0e0e0; }

.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ─── SIDEBAR ────────────────────────────────── */
.sidebar {
  width: 210px;
  background: #16213e;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid #0f3460;
  flex-shrink: 0;
  overflow-y: auto;
}

.section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #666;
  margin-bottom: 6px;
}

.size-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.size-btn {
  width: 28px; height: 28px;
  background: #0f3460;
  border: 1px solid #1a4a80;
  color: #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  touch-action: manipulation;
}
.size-btn:hover { background: #1a5a9a; }

#size-display {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: bold;
  color: #e94560;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  grid-template-rows: repeat(3, 28px);
  gap: 3px;
  margin: 0 auto;
  width: fit-content;
}

.dpad-btn {
  width: 28px; height: 28px;
  background: #0f3460;
  border: 1px solid #1a4a80;
  color: #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  user-select: none;
}
.dpad-btn:hover { background: #1a5a9a; }
.dpad-btn:active { background: #e94560; border-color: #e94560; }
.dpad-empty { width: 28px; height: 28px; }

/* only show shift controls in single mode */
.shift-section { display: flex; flex-direction: column; gap: 6px; }

.palette {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.color-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
  position: relative;
}
.color-btn:hover { transform: scale(1.08); }
.color-btn.active { border-color: #fff; transform: scale(1.12); }
.color-btn .color-name {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  white-space: nowrap;
  color: #aaa;
  display: none;
}
.color-btn:hover .color-name { display: block; }

.tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.tool-btn {
  padding: 6px 4px;
  background: #0f3460;
  border: 1px solid #1a4a80;
  color: #ccc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  text-align: center;
  transition: background 0.15s;
}
.tool-btn:hover { background: #1a5a9a; color: #fff; }
.tool-btn.active { background: #e94560; border-color: #e94560; color: #fff; }

.actions { display: flex; flex-direction: column; gap: 5px; }

.action-btn {
  padding: 7px 8px;
  background: #0f3460;
  border: 1px solid #1a4a80;
  color: #ccc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  text-align: center;
  transition: background 0.15s;
}
.action-btn:hover { background: #1a5a9a; color: #fff; }
.action-btn.danger { border-color: #6a1a2a; }
.action-btn.danger:hover { background: #e94560; border-color: #e94560; color: #fff; }
.action-btn.submit-design-btn { background: #7a1020; border-color: #c41e3a; color: #fff; }
.action-btn.submit-design-btn:hover:not(:disabled) { background: #c41e3a; border-color: #e94560; }
.action-btn:disabled, .action-btn.submit-design-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.kbd-hints {
  font-size: 0.62rem;
  color: #555;
  line-height: 1.8;
}
kbd {
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.62rem;
  color: #aaa;
}

/* ─── SINGLE MODE ────────────────────────────── */
#single-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.grid-wrapper { position: relative; }

#pixel-grid {
  display: grid;
  border: 2px solid #444;
  cursor: crosshair;
  user-select: none;
  box-shadow: 0 0 30px rgba(233,69,96,0.15);
}
#pixel-grid.panning { cursor: grab; }
#pixel-grid.panning-active { cursor: grabbing; }

.pixel {
  border: 1px solid rgba(0,0,0,0.18);
  transition: filter 0.05s;
  position: relative;
}
.pixel:hover { filter: brightness(1.3); z-index: 1; }
.pixel.center-marker::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 35%; height: 35%;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
  pointer-events: none;
}

/* ─── MULTI MODE ────────────────────────────── */
#multi-area {
  display: none;
  flex: 1;
  overflow: auto;
  gap: 0;
}
#multi-area.visible {
  display: flex;
  position: relative;
}

.net-scroll {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}

.net-grid {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  grid-template-rows: repeat(3, max-content);
  gap: 6px;
}

.face-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.face-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
}

.face-canvas-wrap {
  border: 2px solid #333;
  border-radius: 2px;
  line-height: 0;
  cursor: crosshair;
  transition: border-color 0.15s;
}
.face-canvas-wrap.active-face { border-color: #e94560; box-shadow: 0 0 10px rgba(233,69,96,0.4); }
.face-canvas-wrap:hover { border-color: #555; }
.face-canvas-wrap.active-face:hover { border-color: #e94560; }

/* net positions */
.face-wrap-top    { grid-column: 2; grid-row: 1; }
.face-wrap-left   { grid-column: 1; grid-row: 2; }
.face-wrap-front  { grid-column: 2; grid-row: 2; }
.face-wrap-right  { grid-column: 3; grid-row: 2; }
.face-wrap-back   { grid-column: 4; grid-row: 2; }
.face-wrap-bottom { grid-column: 2; grid-row: 3; }

/* ─── ISO PREVIEW PANEL ─────────────────────── */
.iso-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  background: #16213e;
  border-left: 1px solid #0f3460;
  border-bottom: 1px solid #0f3460;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  gap: 12px;
  overflow: hidden;
  z-index: 10;
}

/* Resize-Handle (Ecke unten-links) */
.iso-resize-corner {
  position: absolute;
  z-index: 20;
  bottom: 0; left: 0;
  width: 20px; height: 20px;
  cursor: nesw-resize;
  touch-action: none;
  /* Dreieck zeigt in die Ecke unten-links */
  background: linear-gradient(45deg, #e9456066 50%, transparent 50%);
  transition: background 0.15s;
}
.iso-resize-corner:hover,
.iso-resize-corner.dragging {
  background: linear-gradient(45deg, #e94560bb 50%, transparent 50%);
}

.iso-panel-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #666;
  width: 100%;
}

#iso-canvas {
  image-rendering: pixelated;
}

.iso-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.iso-arrow {
  width: 32px; height: 32px;
  background: #0f3460;
  border: 1px solid #1a4a80;
  color: #ccc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.iso-arrow:hover { background: #1a5a9a; color: #fff; }

.iso-view-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  flex: 1;
}
.iso-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
  transition: background 0.15s;
}
.iso-dot.active { background: #e94560; }
.iso-dot:hover { background: #888; }

#iso-label {
  font-size: 0.7rem;
  color: #888;
  text-align: center;
  width: 100%;
}

.iso-preview-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-height: 0;
  justify-content: center;
}
.iso-vert-arrows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.iso-arrow.disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* ─── RIGHT PANEL ────────────────────────────── */
.right-panel {
  width: 240px;
  background: #16213e;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-left: 1px solid #0f3460;
  flex-shrink: 0;
  overflow-y: auto;
}

.right-panel textarea {
  width: 100%;
  background: #0f1f3d;
  border: 1px solid #1a4a80;
  color: #e0e0e0;
  border-radius: 6px;
  padding: 8px;
  font-size: 0.78rem;
  resize: vertical;
  font-family: inherit;
}
.right-panel textarea::placeholder { color: #556; }

.copy-grid-btn, .import-btn {
  margin-top: 5px;
  padding: 7px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  width: 100%;
  transition: background 0.15s;
  font-family: inherit;
}
.copy-grid-btn {
  background: #1a4a80; border: 1px solid #2a5a90; color: #e0e0e0;
}
.copy-grid-btn:hover { background: #2a6ab0; }

.import-btn {
  background: #0f6a30; border: 1px solid #1a8a40; color: #e0e0e0;
}
.import-btn:hover { background: #1a8a40; }

.stats {
  background: #0f1f3d;
  border-radius: 6px;
  padding: 10px;
  font-size: 0.73rem;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
}
.stat-swatch {
  width: 11px; height: 11px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  vertical-align: middle;
}

/* ─── MODAL (mobile Options-Sheet nutzt .modal-close) ──── */
.modal-close {
  padding: 8px;
  background: transparent;
  border: 1px solid #1a4a80;
  color: #888;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s;
}
.modal-close:hover { background: #0f3460; color: #ccc; }

/* ─── CONSTRAINT BADGE ──────────────────────── */
.constraint-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-top: 6px;
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
}
.constraint-badge.valid {
  background: #0a3320;
  border: 1px solid #1a6a40;
  color: #4ade80;
}
.constraint-badge.invalid {
  background: #3a2000;
  border: 1px solid #8a4a00;
  color: #fb923c;
}
.stat-delta {
  font-size: 0.68rem;
  font-weight: 600;
  margin-left: 3px;
}
.stat-delta.over  { color: #f87171; }
.stat-delta.under { color: #fb923c; }
.stat-target { color: #445; font-size: 0.68rem; margin-left: 2px; }
.constraint-badge.invalid { cursor: pointer; }
.constraint-badge.invalid:hover { filter: brightness(1.15); }
#constraint-detail {
  margin-top: 4px; padding: 6px 10px;
  background: #1e1a14; border: 1px solid #8a4a00; border-radius: 6px;
  font-size: 0.72rem; color: #fb923c; line-height: 1.7;
}
.orbit-error-link {
  cursor: pointer;
  text-decoration: underline dotted;
  border-radius: 3px;
  padding: 1px 3px;
  transition: background 0.15s;
}
.orbit-error-link:hover { background: rgba(255,200,0,0.18); }
.orbit-error-link.active { background: rgba(255,220,0,0.28); font-weight: bold; }

/* ─── TOAST ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  opacity: 0;
  background: #e94560;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1000;
  max-width: min(480px, calc(100vw - 32px));
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: #1a8a40; }

/* ═══════════════════════════════════════════════════════
   MOBILE  (≤ 768 px)
   ═══════════════════════════════════════════════════════ */

/* Desktop-only: hide mobile elements */
.mobile-main-face-wrap { display: none; }
.mobile-face-strip     { display: none; }
#mobile-toolbar        { display: none; }
#mobile-sheet-backdrop { display: none;  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 300; align-items: flex-end; }
#mobile-sheet-backdrop.open { display: flex; }

#mobile-errors-panel {
  display: none;
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom)); left: 0; right: 0;
  background: #16213e;
  border-top: 1px solid #0f3460;
  padding: 12px 16px;
  z-index: 200;
  max-height: 50vh;
  overflow-y: auto;
  font-size: 0.82rem;
  transform: translateY(100%);
  transition: transform 0.25s;
}
#mobile-errors-panel.open {
  display: block;
  transform: translateY(0);
}
/* Roter Punkt auf dem Fehler-Button wenn Fehler vorhanden */
.m-btn-errors-btn.has-errors { color: #e94560; }
.m-btn-errors-btn.no-errors  { color: #27ae60; }

@media (max-width: 768px) {
  /* ── Grundlayout ─────────────────────────── */
  html { height: -webkit-fill-available; }
  body {
    height: 100dvh;
    min-height: -webkit-fill-available; /* iOS Safari Fallback */
    overflow: hidden;
  }

  header {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
  }
  header h1 { font-size: 1rem; }
  .subtitle { display: none; }
  .mode-toggle-group { margin-left: auto; } /* Zeile 1: Toggle rechts neben Titel */
  .header-right { width: 100%; margin-left: 0; gap: 6px; justify-content: flex-end; }
  .btn      { padding: 5px 10px; font-size: 0.78rem; }
  .mode-btn { padding: 5px 9px;  font-size: 0.78rem; }
  .lang-btn { padding: 3px 7px;  font-size: 0.78rem; }

  .main {
    flex: 1;
    overflow: hidden;
    min-height: 0;
  }

  .sidebar     { display: none !important; }
  .right-panel { display: none !important; }

  /* ── Single-Mode ─────────────────────────── */
  #single-area {
    flex: 1;
    padding: 12px 10px;
    overflow: auto;
  }
  /* Während des Zeichnens/Pannens per JS gesetzt: unterbindet, dass iOS/Android
     senkrechte Touch-Drags auf dem Grid als Seiten-Scroll interpretieren
     (siehe setupGridPointerEvents in app.js). */
  #single-area.no-scroll { overflow: hidden; touch-action: none; }

  /* ── Multi-Mode ──────────────────────────── */
  #multi-area.visible {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .net-scroll { display: none !important; }
  .iso-panel  { display: none; }
  .iso-resize-corner { display: none; }

  /* ISO-Vorschau als Toggle auf Mobile */
  #multi-area.iso-active .iso-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    background: transparent;
    border-left: none;
    border-top: 1px solid #0f3460;
  }
  #multi-area.iso-active .mobile-main-face-wrap { display: none; }
  #multi-area.iso-active .mobile-face-strip     { display: none; }
  #multi-area.iso-active #iso-canvas {
    max-width: calc(100vw - 48px);
    max-height: calc(100vw - 48px);
    width: auto; height: auto;
  }

  .mobile-main-face-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 10px;
  }
  /* Während des Zeichnens per JS gesetzt (siehe setupMobileMainFaceTouchEvents) */
  .mobile-main-face-wrap.no-scroll { overflow: hidden; touch-action: none; }
  #canvas-mobile-main { image-rendering: pixelated; touch-action: none; }

  .mobile-face-strip {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    background: #0f1f3d;
    border-top: 1px solid #0f3460;
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-face-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 3px;
    transition: border-color 0.15s;
    flex-shrink: 0;
    cursor: pointer;
  }
  .mobile-face-thumb.active { border-color: #e94560; }
  .mobile-face-thumb canvas { display: block; image-rendering: pixelated; }
  .mobile-face-thumb-label {
    font-size: 0.5rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* ── Mobile-Toolbar ──────────────────────── */
  #mobile-toolbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #16213e;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) 10px;
    border-top: 1px solid #0f3460;
    z-index: 100;
  }
  /* Platz für die fixe Toolbar freihalten */
  body { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .mobile-palette {
    display: flex;
    gap: 5px;
    justify-content: center;
  }
  .mobile-color-btn {
    flex: 1;
    max-width: 48px;
    aspect-ratio: 1;
    border-radius: 6px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: border-color 0.1s, transform 0.1s;
  }
  .mobile-color-btn.active {
    border-color: #fff;
    transform: scale(1.1);
  }
  .mobile-tools {
    display: flex;
    gap: 4px;
    align-items: stretch;
  }
  .m-tool-btn {
    flex: 1;
    padding: 9px 2px;
    background: #0f3460;
    border: 1px solid #1a4a80;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    line-height: 1;
    transition: background 0.15s;
    min-width: 0;
    font-family: inherit;
  }
  .m-tool-btn.active {
    background: #e94560;
    border-color: #e94560;
    color: #fff;
  }
  .m-tool-btn:active { opacity: 0.75; }
  .m-tool-btn.green {
    background: #0f6a30;
    border-color: #1a8a40;
    color: #fff;
  }
  .m-tool-btn.green:active { opacity: 0.75; }

  /* ── Options-Sheet (slide-up) ────────────── */
  #mobile-sheet {
    background: #16213e;
    border-top: 1px solid #0f3460;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 80dvh;
    overflow-y: auto;
  }
  .mobile-sheet-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #1a4a80;
  }
  .mobile-sheet-footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #1a4a80;
  }
  .mobile-sheet-footer-link {
    color: #ccc;
    text-decoration: none;
    font-size: 0.75rem;
    padding: 2px 6px;
  }
  .mobile-sheet-footer-link:hover { color: #fff; }
  .mobile-sheet-footer-link.disabled { color: #555; pointer-events: none; }
  .mobile-sheet-footer-sep { color: #444; font-size: 0.75rem; line-height: 1.8; }
  /* Footer im Editor auf Mobile ausblenden (Links sind im ⋯-Sheet) */
  #mobile-toolbar ~ footer.site-footer { display: none; }
  .mobile-sheet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    gap: 12px;
  }
  .size-controls-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  #m-size-display {
    width: 52px;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    color: #e94560;
  }

  /* Toast über Toolbar positionieren, damit er vollständig verschwindet */
  .toast {
    bottom: 110px;
    transform: translateX(-50%) translateY(160px);
  }

  /* Modal breiter auf Mobile */
  .modal {
    width: calc(100vw - 32px);
    max-height: 80dvh;
  }

  /* Touch-Cursor für Grid */
  #pixel-grid { touch-action: none; }
}

/* Face-Canvases: touch-action wird per JS gesetzt (setupFaceCanvas) */
/* Explizit auch für den Desktop-Multi-Modus auf Touch-Geräten: */

/* Footer-Styles werden von footer.js injiziert */
.face-canvas-wrap canvas { touch-action: none; }
