/* ===== PLANTILLA CREADOR v1.0 ===== */
/* create.cratoora.com/assets/styles/plantilla.css */

/* ══════════════════════════════════
   LAYOUT
══════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  height: 100vh;
  overflow: hidden;
}

.plantilla-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════
   HEADER
══════════════════════════════════ */
.plantilla-header {
  height: 56px;
  background: #111111;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1rem;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo-wordmark {
  height: 32px;
  width: auto;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-back:hover {
  background: rgba(255,255,255,0.07);
  color: #ffffff;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: #8B5CF6;
  color: #ffffff;
}

.btn-primary:hover  { background: #7C3AED; }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.12);
}

.btn-secondary:hover  { background: rgba(255,255,255,0.13); }
.btn-secondary:active { transform: scale(0.97); }

.btn-small {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0;
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-link:hover { color: #ffffff; }

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-icon:hover { background: rgba(255,255,255,0.08); color: #ffffff; }

.btn-icon-small {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 6px;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-icon-small:hover { background: rgba(255,255,255,0.15); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-ai {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-ai[data-active="true"] {
  background: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-premium {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: #F59E0B;
  font-weight: 600;
}

/* ══════════════════════════════════
   WORKSPACE
══════════════════════════════════ */
.plantilla-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ══════════════════════════════════
   LEFT TOOLBAR
══════════════════════════════════ */
.toolbar-left {
  width: 52px;
  background: #111111;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.75rem 0;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.toolbar-left::-webkit-scrollbar { display: none; }

.tool-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
}

.tool-group.bottom {
  margin-top: 0.5rem;
}

.tool-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.tool-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.tool-btn.active {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

.tool-divider {
  width: 28px;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 0.25rem 0;
}

/* ══════════════════════════════════
   CANVAS AREA
══════════════════════════════════ */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  overflow: hidden;
  position: relative;
}

.canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 2rem;
  position: relative;
}

#plantilla-canvas {
  background: #0a0a0a;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 8px 40px rgba(0,0,0,0.6);
  border-radius: 2px;
  max-width: 100%;
  max-height: 100%;
}

/* Canvas Status Bar */
.canvas-status {
  height: 32px;
  background: #111111;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  flex-shrink: 0;
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
}

.canvas-status .divider {
  opacity: 0.3;
}

.canvas-status .badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.25);
}

/* ══════════════════════════════════
   TEMPLATE GALLERY OVERLAY
══════════════════════════════════ */
.template-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;
}

.template-gallery-overlay.hidden { display: none; }

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.gallery-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.template-card {
  background: #1a1a1a;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.template-card:hover {
  border-color: #8B5CF6;
  transform: translateY(-2px);
}

.template-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #222;
}

.template-card span {
  display: block;
  padding: 0.5rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}

.template-card.blank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-style: dashed;
}

/* Template image missing — styled placeholder with icon + name */
.template-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f23 100%);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow behind icon */
.template-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, var(--tpl-glow, rgba(139,92,246,0.18)) 0%, transparent 70%);
  pointer-events: none;
}

.template-placeholder-icon {
  font-size: 2rem;
  line-height: 1;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 12px var(--tpl-shadow, rgba(139,92,246,0.6)));
}

.template-placeholder-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Per-template colour themes */
.template-placeholder[data-tpl="album-dark"] {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0a2e 100%);
  --tpl-glow: rgba(139,92,246,0.22);
  --tpl-shadow: rgba(139,92,246,0.7);
}
.template-placeholder[data-tpl="album-neon"] {
  background: linear-gradient(135deg, #0a0a1a 0%, #001a2e 100%);
  --tpl-glow: rgba(0,212,255,0.2);
  --tpl-shadow: rgba(0,212,255,0.7);
}
.template-placeholder[data-tpl="flyer-club"] {
  background: linear-gradient(135deg, #1a0000 0%, #2e0a00 100%);
  --tpl-glow: rgba(255,60,0,0.2);
  --tpl-shadow: rgba(255,100,0,0.7);
}
.template-placeholder[data-tpl="social-square"] {
  background: linear-gradient(135deg, #001a0a 0%, #0a2e1a 100%);
  --tpl-glow: rgba(16,185,129,0.2);
  --tpl-shadow: rgba(16,185,129,0.7);
}
.template-placeholder[data-tpl="merch-tshirt"] {
  background: linear-gradient(135deg, #1a1000 0%, #2e200a 100%);
  --tpl-glow: rgba(251,191,36,0.2);
  --tpl-shadow: rgba(251,191,36,0.7);
}

.blank-icon {
  font-size: 2rem;
  color: rgba(255,255,255,0.3);
  margin-bottom: 0.5rem;
}

/* ══════════════════════════════════
   RIGHT PROPERTIES PANEL
══════════════════════════════════ */
.properties-panel {
  width: 240px;
  background: #111111;
  border-left: 1px solid rgba(255,255,255,0.08);
  overflow-y: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.properties-panel::-webkit-scrollbar { width: 4px; }
.properties-panel::-webkit-scrollbar-track { background: transparent; }
.properties-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.panel-section {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.panel-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0.25rem;
  gap: 0.5rem;
}

/* Left group: badge + Ready status */
.panel-ai-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.panel-ai-status {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  white-space: nowrap;
}

/* X close button — right side of panel header */
.panel-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.panel-close-btn:hover {
  background: rgba(255,255,255,0.14);
  color: #ffffff;
}

.panel-section h3 {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-header h3 { margin-bottom: 0; }

/* ── Property Groups ── */
.property-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.property-group label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}

.input-unit {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
}

.input-unit input {
  flex: 1;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  outline: none;
  min-width: 0;
}

.input-unit span {
  padding: 0 0.6rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.04);
  align-self: stretch;
  display: flex;
  align-items: center;
  border-left: 1px solid rgba(255,255,255,0.08);
}

.color-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-input-group input[type="color"] {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}

.color-input-group input[type="text"] {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  outline: none;
  font-family: monospace;
}

.color-input-group input[type="text"]:focus {
  border-color: #8B5CF6;
}

/* ── Layers ── */
.layers-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.layer-item:hover {
  background: rgba(255,255,255,0.05);
}

.layer-item.active {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.25);
}

.layer-visibility,
.layer-lock {
  font-size: 0.75rem;
  opacity: 0.5;
  flex-shrink: 0;
  cursor: pointer;
}

.layer-name {
  flex: 1;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── AI Card ── */
.ai-card {
  display: flex;
  gap: 0.6rem;
  padding: 0.75rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  margin-bottom: 0.75rem;
}

.ai-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.ai-content strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
}

.ai-content p {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.4;
}

.ai-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ── Export Section ── */
.export-section { border-bottom: none; }

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  padding: 0.25rem 0;
}

.radio-label input[type="radio"] {
  accent-color: #8B5CF6;
  cursor: pointer;
}

.radio-label.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.export-note {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.6rem;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.export-note small {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.4;
}

.note-icon { font-size: 0.8rem; flex-shrink: 0; }

/* ══════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: auto;
  animation: toast-in 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  max-width: 280px;
}

.toast.success { border-color: rgba(52, 211, 153, 0.3); }
.toast.error   { border-color: rgba(248, 113, 113, 0.3); }
.toast.warning { border-color: rgba(251, 191, 36, 0.3); }

.toast.fade-out {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(4px); }
}

/* ══════════════════════════════════
   UTILITY
══════════════════════════════════ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */

/* ── Burger hidden everywhere ≥ 384px ──
   Plantilla has no nav drawer —
   the gear button handles the panel.     */
#menu-btn { display: none; }

/* ── DESKTOP (> 1024px) ── */
@media (min-width: 1025px) {
  .properties-panel {
    width: 240px;
    transform: none;
    transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.25s ease;
    opacity: 1;
  }

  /* Collapsed state on desktop */
  .properties-panel.collapsed {
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
  }
}

/* ── TABLET (601px – 1024px) ── */
@media (min-width: 601px) and (max-width: 1024px) {

  /* Tighten header */
  .header-container { padding: 0 0.75rem; gap: 0.5rem; }

  .properties-panel {
    width: 200px;
    transform: none;
    transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.25s ease;
    opacity: 1;
  }

  /* Collapsed state on tablet */
  .properties-panel.collapsed {
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .panel-section { padding: 0.75rem; }

  /* Template grid — 2 columns on tablet */
  .template-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── MOBILE (≤600px) ── */
@media (max-width: 600px) {

  /* ── Header: single scrollable row ── */
  .plantilla-header { height: auto; min-height: 52px; }

  .header-container {
    padding: 0.4rem 0.6rem;
    gap: 0.4rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .header-container::-webkit-scrollbar { display: none; }

  /* Logo — hide on mobile */
  .logo-wordmark { display: none; }

  /* Back to dashboard — show "← Dashboard" on portrait */
  .btn-back {
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .btn-back .back-label  { display: inline; }
  .btn-back .back-prefix { display: none; }

  /* Shrink header buttons */
  .btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .badge-ai {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    flex-shrink: 0;
  }

  .header-left  { gap: 0.35rem; flex-shrink: 0; }
  .header-right { gap: 0.3rem;  flex-shrink: 0; }

  /* ── Left toolbar — narrower, scrollable ── */
  .toolbar-left {
    width: 42px;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 0.5rem 0;
  }

  .toolbar-left::-webkit-scrollbar { display: none; }

  .tool-group { padding: 0 0.3rem; gap: 0.2rem; }

  .tool-btn {
    width: 32px;
    height: 32px;
  }

  /* ── Right panel — hidden by default, slides in as drawer ── */
  .properties-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    z-index: 500;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: -8px 0 32px rgba(0,0,0,0.6);
  }

  .properties-panel.open {
    transform: translateX(0);
  }

  /* Panel backdrop */
  .panel-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 499;
    background: rgba(0,0,0,0.5);
  }

  .panel-backdrop.visible { display: block; }

  /* btn-windows always visible — no mobile override needed */

  /* ── Template gallery — 2 columns on mobile ── */
  .template-gallery-overlay {
    padding: 1rem;
  }

  .template-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .template-card img {
    aspect-ratio: 1;
  }

  .template-placeholder {
    aspect-ratio: 1;
  }

  /* ── Canvas status bar — smaller text ── */
  .canvas-status { padding: 0 0.6rem; }
  .status-left, .status-right { font-size: 0.68rem; gap: 0.35rem; }

  /* ── Toast — full width on mobile ── */
  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 1rem;
  }

  .toast { max-width: 100%; }

  /* ── Export note — smaller ── */
  .export-note small { font-size: 0.68rem; }
}

/* ── Panels button — always visible, all sizes ── */
.btn-windows {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.42rem 0.75rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-windows:hover {
  background: rgba(139,92,246,0.18);
  border-color: rgba(139,92,246,0.4);
  color: #c4b5fd;
}

.btn-windows.active {
  background: rgba(139,92,246,0.22);
  border-color: rgba(139,92,246,0.5);
  color: #c4b5fd;
}