/* ═══════════════════════════════════════════════════════════
   DRAWISLAND — style1.css
   Layout : header | editor (sidebar | canvas | ctx) | ad | footer
   Mobile : header | editor | toolbar | ad | footer
═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --accent:        #2563eb;
  --accent-h:      #1d4ed8;
  --accent-light:  #eff6ff;
  --danger:        #ef4444;
  --success:       #22c55e;

  --bg:            #f0efe9;
  --surface:       #ffffff;
  --surface-2:     #f4f3ef;
  --surface-3:     #eae9e3;
  --border:        #e2e1db;
  --border-2:      #ccc9c2;

  --text-1:        #1a1917;
  --text-2:        #57534e;
  --text-3:        #a8a29e;

  --header-h:      48px;
  --panel-w:       160px;
  --ad-h:          66px;
  /*--ad-h-real:     90px;*/
  
  --ad-h-real:     110px;
  
  --mobile-tb:     54px;

  --radius:        8px;
  --radius-lg:     14px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.07);
  --shadow-md:     0 4px 14px rgba(0,0,0,.10);
  --shadow-lg:     0 16px 48px rgba(0,0,0,.15);

  --font:          'DM Sans', system-ui, sans-serif;
  --font-mono:     'DM Mono', monospace;
  --trans:         150ms cubic-bezier(.4,0,.2,1);
}

/*@media (min-height: 780px) {
  :root { --ad-h-real: 110px; }
}*/

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-tap-highlight-color: transparent; }
/*body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-1);
  background: var(--bg);
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}*/
body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-1);
  background: var(--bg);
  min-height: 100vh; /* ← était 100%, passe à 100vh */
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}




button  { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; font-size: 12px; }
svg  { display: block; flex-shrink: 0; }
a    { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ── Header ────────────────────────────────────────────── */
#app-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 200;
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.3px;
  margin-right: 8px;
  flex-shrink: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.btn-ghost {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: background var(--trans), color var(--trans);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-1); }
.auth-slot { margin-left: 4px; display: flex; gap: 4px; align-items: center; }
.btn-login {
  padding: 5px 10px; border-radius: var(--radius);
  font-size: 12px; font-weight: 500;
  color: var(--text-2);
  transition: background var(--trans);
}
.btn-login:hover { background: var(--surface-2); }
.btn-signup {
  padding: 5px 12px; border-radius: var(--radius);
  font-size: 12px; font-weight: 600;
  background: var(--accent); color: #fff;
  transition: background var(--trans);
}
.btn-signup:hover { background: var(--accent-h); }
@media (max-width: 500px) {
  .btn-ghost .lbl { display: none; }
}


@media (max-width: 650px) {
  .no650 { display: none; }
}
@media (max-width: 700px) {
  .no700 { display: none; }
}
/* ════════════════════════════════════════════════════════
   SIDEBAR GAUCHE
════════════════════════════════════════════════════════ */
#sidebar {
  width: var(--panel-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
  z-index: 10;
  /*min-height:625px;*/
}
#sidebar::-webkit-scrollbar { width: 3px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

.sb-group {
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-group-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-3);
  padding: 4px 4px 2px;
}
.tool-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  transition: background var(--trans), color var(--trans), box-shadow var(--trans);
  white-space: nowrap;
  overflow: hidden;
}
.tool-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.tool-btn:hover  { background: var(--surface-2); color: var(--text-1); }
.tool-btn.active {
  background: var(--accent-light);
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.sb-sep { height: 1px; background: var(--border); margin: 3px 0; }
.tool-btn .cdot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.15);
  flex-shrink: 0;
  margin-left: auto;
}
.sb-size-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
}
.sb-size-row input[type=range] { flex: 1; }
.sb-size-num {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-3);
  min-width: 20px;
  text-align: right;
}
.sb-palette {
  padding: 4px 8px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ════════════════════════════════════════════════════════
   CANVAS AREA
════════════════════════════════════════════════════════ */
#canvas-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
  background:
    linear-gradient(rgba(99,102,241,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.025) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: var(--bg);
  padding: 10px;
}
#canvas-wrap {
  position: relative;
  line-height: 0;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  border-radius: 2px;
  flex-shrink: 0;
}
#drawing-canvas { display: block; }

#zoom-bar {
  position: absolute;
  bottom: 10px; right: 10px;
  display: flex;
  align-items: center;
  gap: 1px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}
.zoom-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 15px; font-weight: 500; line-height: 1;
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans);
}
.zoom-btn:hover { background: var(--surface-2); }
.zoom-level {
  padding: 0 8px;
  font-size: 11px; font-family: var(--font-mono);
  color: var(--text-2); cursor: pointer;
  border-radius: 10px; height: 24px;
  display: flex; align-items: center;
  transition: background var(--trans);
  white-space: nowrap;
}
.zoom-level:hover { background: var(--surface-2); }
#canvas-info-bar {
  position: absolute;
  bottom: 10px; left: 10px;
  font-size: 10px; font-family: var(--font-mono);
  color: var(--text-3);
  background: rgba(255,255,255,.85);
  padding: 2px 8px; border-radius: 10px;
  pointer-events: none; z-index: 10;
}

/* ════════════════════════════════════════════════════════
   CTX PANEL DROIT
════════════════════════════════════════════════════════ */
#ctx-panel {
  width: var(--panel-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
  z-index: 10;
}
#ctx-panel::-webkit-scrollbar { width: 3px; }
#ctx-panel::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

.ctx-group {
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ctx-group-label {
  font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-3);
  padding: 2px 2px 0;
}
.prop-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.prop-lbl {
  font-size: 10px;
  color: var(--text-3);
  flex-shrink: 0;
  width: 42px;
}
.prop-row input[type=range] { flex: 1; min-width: 0; }
.prop-row input[type=color] {
  width: 26px; height: 26px;
  border-radius: 5px;
  border: 1px solid var(--border-2);
  cursor: pointer; padding: 1px;
  flex-shrink: 0;
}
.prop-row select {
  flex: 1;
  padding: 4px 5px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-1);
  font-size: 11px;
}
.ctx-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px 8px 8px;
}
.ctx-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 4px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-2);
  color: var(--text-2);
  font-size: 9px;
  font-weight: 500;
  transition: all var(--trans);
  cursor: pointer;
}
.ctx-btn svg { width: 15px; height: 15px; }
.ctx-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.ctx-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }
.ctx-empty {
  padding: 16px 10px;
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════
   AD BAR
════════════════════════════════════════════════════════ */

#app-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - var(--header-h) - var(--ad-h-real) );
  max-height: calc(100vh - var(--header-h) - var(--ad-h-real) );
}

#editor-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  overflow: hidden;
}

#ad-bar {
  height: var(--ad-h-real);
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  width: 100%;
  padding: 1em 0;
  text-align: center;
}


#ad-bar ins {
  display: block !important;
  width: 100%;
  max-width: 1200px;
  max-height: var(--ad-h-real);
  margin: 0 auto;
}



/* ════════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════════ */


/* Augmenter la taille du footer */
#app-footer {
  font-size: 1em;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1em 0.5em 1em 0.5em;  /* Augmenté de 1em à 1.5em */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
 /* min-height: 80px;*/  
  margin-top:10em;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;  /* Plus d'espace entre les éléments */
  font-size: 12px;  /* Texte légèrement plus grand */
  color: var(--text-3);
  width: auto;
}
.footer-inner a {
  color: var(--text-3);
  transition: color var(--trans);
}

.footer-inner a:hover {
  color: var(--accent);
}

.footer-sep {
  color: var(--border-2);
}

/* ════════════════════════════════════════════════════════
   PALETTES, BOUTONS, RANGE
════════════════════════════════════════════════════════ */
.pal-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--c, #ccc);
  border: 1.5px solid rgba(0,0,0,.1);
  cursor: pointer;
  transition: transform var(--trans), box-shadow var(--trans);
  flex-shrink: 0;
}
.pal-dot:hover  { transform: scale(1.2); box-shadow: 0 0 0 2px var(--accent); }
.pal-dot.on     { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--accent); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 14px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius);
  font-size: 12px; font-weight: 600;
  transition: background var(--trans), transform var(--trans);
  cursor: pointer; border: none;
}
.btn-primary:hover  { background: var(--accent-h); }
.btn-primary:active { transform: scale(.97); }
.btn-primary.full-w { width: 100%; }
.btn-primary.red    { background: var(--danger); }
.btn-primary.red:hover { background: #dc2626; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--border-2);
  border-radius: 2px; outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); cursor: pointer;
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; cursor: pointer;
}

/* ════════════════════════════════════════════════════════
   MODALS
════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.38);
  display: flex; align-items: center; justify-content: center;
  z-index: 900; padding: 12px;
  animation: ov-in 110ms ease;
}
@keyframes ov-in { from { opacity:0 } to { opacity:1 } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 360px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: m-up 170ms cubic-bezier(.34,1.3,.64,1);
  overflow: hidden;
}
@keyframes m-up { from { transform:translateY(14px);opacity:0 } to { transform:none;opacity:1 } }
.modal-lg { max-width: 440px; }
.modal-sm { max-width: 300px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 14px; font-weight: 600; color: var(--text-1);
  display: flex; align-items: center; gap: 7px;
}
.modal-title svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.modal-close {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-2);
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  transition: background var(--trans); flex-shrink: 0;
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 13px; }
.msec  { display: flex; flex-direction: column; gap: 8px; }
.msec-lbl {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-3);
}
.size-row { display: flex; align-items: center; gap: 10px; }
.size-row input[type=range] { flex: 1; }
.sz-dot { background: var(--text-1); border-radius: 50%; flex-shrink: 0; transition: width .08s, height .08s; }
.sz-num { font-size: 11px; font-family: var(--font-mono); color: var(--text-3); min-width: 24px; text-align: right; }
.color-row-main { display: flex; align-items: center; gap: 10px; }
.color-big {
  width: 46px; height: 46px;
  border-radius: var(--radius); border: 2px solid var(--border-2);
  cursor: pointer; overflow: hidden; flex-shrink: 0; position: relative;
  transition: border-color var(--trans);
}
.color-big:hover { border-color: var(--accent); }
.color-big input[type=color] { opacity:0; position:absolute; inset:0; width:100%; height:100%; cursor:pointer; }
.opacity-col { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.opa-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); }
.opa-labels span { font-family: var(--font-mono); }
.palette-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.brush-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.brush-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 5px 4px 4px; cursor: pointer; text-align: center;
  transition: all var(--trans);
}
.brush-card:hover, .brush-card.active { border-color: var(--accent); background: var(--accent-light); }
.brush-card canvas { width:100%; height:32px; display:block; border-radius:3px; margin-bottom:3px; background:var(--surface-2); }
.brush-card .bc-nm { font-size: 9px; color: var(--text-2); }
.brush-card.active .bc-nm { color: var(--accent); font-weight: 600; }
.size-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 5px 11px; border-radius: 20px;
  border: 1.5px solid var(--border-2);
  font-size: 11px; font-family: var(--font-mono);
  color: var(--text-2); transition: all var(--trans); cursor: pointer;
}
.pill:hover  { border-color: var(--accent); color: var(--accent); }
.pill.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent); font-weight: 600; }
.dl-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }

/* ── Crop ───────────────────────────────────────────────── */
#crop-overlay {
  position: absolute; border: 2px dashed #22c55e;
  box-sizing: border-box; pointer-events: none; z-index: 50;
}
.crop-handle {
  position: absolute; width: 14px; height: 14px;
  background: #22c55e; border: 2px solid white; border-radius: 50%;
  pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.crop-move-area { position:absolute; inset:0; bottom:48px; pointer-events:auto; cursor:move; }
.crop-controls {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; pointer-events: auto;
}
.crop-btn {
  padding: 6px 18px; border-radius: var(--radius);
  font-size: 12px; font-weight: 600; color: white; border: none; cursor: pointer;
}
.crop-cancel { background: var(--danger); }
.crop-apply  { background: var(--success); }

/* ════════════════════════════════════════════════════════
   IMAGE LIBRARY
════════════════════════════════════════════════════════ */
.imglib-thumb {
  width: 100px; height: 100px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--trans), transform var(--trans);
  background: var(--surface-2);
  flex-shrink: 0;
}
.imglib-thumb:hover { border-color: var(--accent); transform: scale(1.04); }
.imglib-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
#imglib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}

/* ════════════════════════════════════════════════════════
   MOBILE TOOLBAR
════════════════════════════════════════════════════════ */
#mobile-toolbar {
  display: none;
  height: var(--mobile-tb);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 5px;
  align-items: center;
  gap: 1px;
  overflow-x: auto; overflow-y: hidden;
  flex-shrink: 0; z-index: 100;
  scrollbar-width: none;
}
#mobile-toolbar::-webkit-scrollbar { display: none; }
.m-tool {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  width: 44px; height: 46px;
  border-radius: var(--radius);
  color: var(--text-2); flex-shrink: 0; font-size: 8px;
  transition: background var(--trans), color var(--trans);
}
.m-tool svg { width: 20px; height: 20px; }
.m-tool:hover  { background: var(--surface-2); }
.m-tool.active { background: var(--accent-light); color: var(--accent); }
.m-tool[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }
.m-color-wrap {
  position: relative; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; width: 44px; height: 44px;
}
.m-color-wrap input[type=color] { opacity:0; position:absolute; width:1px; height:1px; }
#m-color-dot { width:28px; height:28px; border-radius:50%; border:2.5px solid var(--border-2); display:block; }
.m-size-ctrl { display:flex; align-items:center; gap:3px; flex-shrink:0; padding:0 2px; }
.m-sz-btn {
  width:22px; height:22px; border-radius:50%;
  background:var(--surface-2); font-size:15px; font-weight:600;
  display:flex; align-items:center; justify-content:center;
  color:var(--text-2); transition:background var(--trans);
}
.m-sz-btn:hover { background:var(--border); }
#m-sz-val { font-size:11px; font-family:var(--font-mono); color:var(--text-2); min-width:20px; text-align:center; }
#mobile-extra { background:var(--surface); border-top:1px solid var(--border); padding:8px 10px; flex-shrink:0; z-index:99; }
.m-extra-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:5px; }
.m-extra-grid .m-tool { width:100%; height:54px; font-size:9px; }
.m-extra-grid .m-tool span { color:var(--text-3); }

/* ════════════════════════════════════════════════════════
   PROJECTS
════════════════════════════════════════════════════════ */
.project-item { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1.5px solid var(--border); border-radius:var(--radius); background:var(--surface); transition:border-color var(--trans); }
.project-item:hover { border-color: var(--border-2); }
.project-item-name { flex:1; font-size:12px; font-weight:500; color:var(--text-1); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.project-item-date { font-size:10px; color:var(--text-3); font-family:var(--font-mono); flex-shrink:0; }
.project-item-load { padding:4px 8px; border-radius:5px; font-size:11px; font-weight:500; background:var(--accent-light); color:var(--accent); border:none; cursor:pointer; flex-shrink:0; transition:background var(--trans); }
.project-item-load:hover { background:#dbeafe; }
.project-item-del { width:24px; height:24px; border-radius:50%; background:none; border:none; color:var(--text-3); font-size:14px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all var(--trans); flex-shrink:0; }
.project-item-del:hover { background:#fef2f2; color:var(--danger); }

/* ── Shape buttons ──────────────────────────────────────── */
.shape-btn {
  padding: 10px 6px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 18px; cursor: pointer;
  transition: all var(--trans);
  background: var(--surface); color: var(--text-1);
}
.shape-btn:hover { border-color: var(--accent); background: var(--accent-light); }

/* ── SEO ────────────────────────────────────────────────── */
.seo-text { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }



/* ── Canvas size pills ──────────────────────────────────── */
#size-pills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pill-canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 6px 8px;
  height: 90px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--trans);
}
.pill-canvas:hover  { border-color: var(--accent); background: var(--accent-light); }
.pill-canvas.active { border-color: var(--accent); background: var(--accent-light); }

.pill-preview {
  border: 2px solid var(--text-3);
  border-radius: 2px;
  background: var(--surface-2);
  transition: border-color var(--trans), background var(--trans);
  /* taille injectée dynamiquement par JS */
}
.pill-canvas:hover .pill-preview,
.pill-canvas.active .pill-preview {
  border-color: var(--accent);
  background: #dbeafe;
}
.pill-label {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}
.pill-canvas.active .pill-label { color: var(--accent); font-weight: 600; }

.pill-clipped { opacity: 0.5; }
.pill-clipped:hover { border-color: var(--danger) !important; background: #fef2f2 !important; }
.pill-clipped .pill-preview { border-color: var(--danger) !important; background: #fef2f2 !important; }
.pill-clipped .pill-label { color: var(--danger) !important; }

@media (max-width: 900px) and (min-width: 769px) {
  :root { --panel-w: 120px; }
  .tool-btn { font-size: 10px; padding: 6px 6px; }
}
/* ════════════════════════════════════════════════════════
   MOBILE ≤ 768px
════════════════════════════════════════════════════════ */
#zoom-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--text-1);
  color: #fff;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 20px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none; /* désactivé par défaut */
  transition: opacity 200ms, transform 200ms;
  white-space: nowrap;
  cursor: pointer;
}
#zoom-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto; /* ← cliquable seulement quand visible */
}
 
@media (max-width: 768px) {
  #sidebar         { display: none; }
  #ctx-panel       { display: none; }
  #mobile-toolbar  { display: flex; }
  #canvas-area     { padding: 5px; align-items: flex-start; justify-content: flex-start; }
  #zoom-bar        { bottom: 5px; right: 5px; }
  #canvas-info-bar { display: none; }

 #ad-bar{
 display:none;
 }

  #app-body {
    /* Plus de -60px, juste header + toolbar + petite marge */
    max-height: calc(100vh - var(--header-h) - var(--mobile-tb));
  }

  #app-footer {
   margin-top: 10px;
    margin-bottom: 0px;
  }
}

