.ac-app{
  display:grid;
  grid-template-columns: 380px 1fr;
  gap:18px;
  padding:18px;
  border-radius:18px;
  background: linear-gradient(135deg, #fff7f0 0%, #f3f6ff 100%);
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

/* ✅ MOBILE: 1 colonne + preview d’abord */
@media (max-width: 980px){
  .ac-app{
    grid-template-columns: 1fr;
    gap:14px;
    padding:14px;
  }
  .ac-right{ order: 1; }
  .ac-left{ order: 2; }
}

.ac-panel{
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(15,23,42,.08);
  border-radius:16px;
  padding:14px;
}

.ac-panel-header{ margin-bottom:12px; }
.ac-title{ font-weight:900; color:#0f172a; font-size:16px; }
.ac-subtitle{
  margin-top:4px;
  color: rgba(15,23,42,.72);
  font-size:12px;
  font-weight:700;
}

.ac-cats{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height: 170px;
  overflow:auto;
  padding:10px;
  border-radius:14px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(15,23,42,.08);
}

.ac-cat-title{
  font-weight:900;
  color:#0f172a;
  cursor:pointer;
  padding:10px 10px;
  border-radius:12px;
  transition: background .12s ease;
}
.ac-cat-title:hover{ background: rgba(37,99,235,.08); }
.ac-cat-title.is-active{ background: rgba(37,99,235,.14); }

.ac-items{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(15,23,42,.08);
  min-height: 260px;
  max-height: 420px;
  overflow:auto;
}

/* ✅ La grille s’adapte */
.ac-grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap:10px;
}
@media (max-width: 720px){
  .ac-grid{ grid-template-columns: repeat(5, 1fr); }
  .ac-items{ max-height: 340px; }
}
@media (max-width: 480px){
  .ac-grid{ grid-template-columns: repeat(4, 1fr); }
}

.ac-item{
  width:46px;
  height:46px;
  border-radius:14px;
  background: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  position:relative;
  border:1px solid rgba(15,23,42,.10);
  box-shadow: 0 8px 16px rgba(15,23,42,.06);
  transition: transform .08s ease, box-shadow .08s ease;
}
.ac-item:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgba(15,23,42,.10);
}
.ac-item img{
  width:42px;
  height:42px;
  object-fit:contain;
}

@media (max-width: 480px){
  .ac-item{ width:52px; height:52px; }
  .ac-item img{ width:48px; height:48px; }
}

.ac-price-tag{
  position:absolute;
  bottom:-10px;
  left:50%;
  transform:translateX(-50%);
  font-size:12px;
  color:#1d4ed8;
  font-weight:900;
  background:#fff;
  border:1px solid rgba(15,23,42,.10);
  border-radius:999px;
  padding:2px 8px;
  white-space:nowrap;
}
@media (max-width: 480px){
  .ac-price-tag{ font-size:11px; bottom:-12px; }
}

.ac-actions{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.ac-actions-row{
  display:flex;
  gap:10px;
}
@media (max-width: 980px){
  .ac-actions-row{ flex-direction: column; }
}

.ac-btn{
  border:none;
  padding:12px 12px;
  border-radius:14px;
  font-weight:900;
  cursor:pointer;
  transition: transform .08s ease, opacity .08s ease;
}
.ac-btn:hover{ transform: translateY(-1px); }
.ac-btn.is-disabled{ opacity:.55; cursor:not-allowed; transform:none !important; }

.ac-btn-primary{ background:#c67a5b; color:#fff; }
.ac-btn-secondary{ background:#8b5e3c; color:#fff; }
.ac-btn-success{ background:#9dbd88; color:#fff; }
.ac-btn-ghost{ background:#f3e9e2; color:#6a4b3b; }

@media (max-width: 480px){
  .ac-btn{ width:100%; }
}

/* ✅ Support AC + PC */
#acMamBtn.is-on,
#pcMamBtn.is-on{
  box-shadow: 0 0 0 2px rgba(22,163,74,.35) inset;
}

.ac-hint{
  font-size:12px;
  color:#b91c1c;
  font-weight:900;
  margin-top:-4px;
}

.ac-preview-head{
  display:flex;
  gap:10px;
  justify-content:center;
  align-items:center;
  margin-bottom:10px;
}

.ac-badge{
  background: rgba(37,99,235,.12);
  color:#0f172a;
  border-radius:999px;
  padding:8px 14px;
  font-weight:900;
  font-size:12px;
}
.ac-badge-soft{
  background: rgba(15,23,42,.06);
  color:#0f172a;
  border-radius:999px;
  padding:8px 14px;
  font-weight:900;
  font-size:12px;
}

/* ✅ Stage */
.ac-stage-wrap{
  border-radius:16px;
  background: rgba(255,255,255,.6);
  border: 1px dashed rgba(15,23,42,.16);
  padding:14px;
  display:flex;
  justify-content:center;
  align-items:center;
  min-height: 260px;
  position:relative;
}

/* ✅ Konva container fluide (AC + PC) */
#acStage,
#pcStage{
  width: 100% !important;
  max-width: 100% !important;
}

/* ✅ Konva canvas */
#acStage canvas,
#pcStage canvas{
  max-width: 100% !important;
  height: auto !important;
}

@media (max-width: 720px){
  .ac-stage-wrap{ padding:10px; min-height: 220px; }
}
@media (max-width: 480px){
  .ac-stage-wrap{ min-height: 200px; }
}

.ac-stage-empty{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:20px;
  color:#0f172a;
  font-weight:900;
  opacity:.85;
}

.ac-summary{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(15,23,42,.08);
}

.ac-summary-title{ font-weight:900; color:#0f172a; }
.ac-summary-text{
  margin-top:6px;
  color: rgba(15,23,42,.75);
  font-weight:800;
  font-size:12px;
  line-height:1.35;
}
.ac-summary-sub{
  margin-top:8px;
  color:#0f172a;
  font-weight:900;
  font-size:12px;
}

/* Thread colors */
.ac-thread{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(15,23,42,.08);
}

.ac-thread-title{
  font-weight:900;
  color:#0f172a;
  font-size:12px;
  margin-bottom:10px;
}

.ac-thread-colors{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.ac-thread-pill{
  width:22px;
  height:22px;
  border-radius:999px;
  border:2px solid rgba(15,23,42,.12);
  cursor:pointer;
  padding:0;
  box-shadow: 0 0 0 1px rgba(0,0,0,.10) inset;
}

.ac-thread-pill.is-active{
  border-color:#1d4ed8;
  box-shadow: 0 0 0 3px rgba(29,78,216,.18);
}
