:root{
  --bg:#fff8ef;
  --ink:#171321;
  --muted:#736b7d;
  --card:#ffffff;
  --main:#7c3aed;
  --main2:#ff4fa3;
  --lime:#b6ff4d;
  --border:rgba(23,19,33,.1);
}
*{box-sizing:border-box}
body{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink);padding-bottom:76px}
.shop-header{background:rgba(255,248,239,.86);backdrop-filter:blur(14px);border-bottom:1px solid var(--border)}
.brand{text-decoration:none;color:var(--ink);font-weight:900;font-size:1.25rem;display:flex;align-items:center;gap:.5rem;letter-spacing:-.03em}.brand-dot{display:grid;place-items:center;width:34px;height:34px;border-radius:14px;background:var(--lime);box-shadow:0 10px 22px rgba(0,0,0,.08)}
.search-input{border:0;border-radius:18px;padding:.9rem 1rem;background:#fff;box-shadow:0 10px 24px rgba(70,43,120,.08)}
.btn-cart{border:0;border-radius:18px;background:#fff;box-shadow:0 10px 24px rgba(70,43,120,.08);font-weight:800;padding:.8rem 1rem}.hero{padding:34px 0 20px}.hero-card{border-radius:34px;padding:34px;background:linear-gradient(135deg,#fff 0%,#ffe0f0 45%,#dcfce7 100%);box-shadow:0 20px 50px rgba(70,43,120,.12);overflow:hidden}.hero h1{font-size:clamp(2.2rem,6vw,5rem);line-height:.94;letter-spacing:-.07em;font-weight:950;margin:0 0 18px}.hero p{font-size:1.15rem;color:var(--muted);max-width:640px}.badge-soft{display:inline-flex;border-radius:999px;background:#fff;padding:.5rem .8rem;font-weight:800;color:var(--main);box-shadow:0 10px 24px rgba(70,43,120,.08)}.btn-main{border:0;background:var(--ink);color:#fff;border-radius:18px;font-weight:900;padding:.9rem 1.2rem}.btn-main:hover{background:var(--main);color:#fff}.btn-light-main{border:0;background:#fff;color:var(--ink);border-radius:18px;font-weight:900;padding:.9rem 1.2rem}.hero-bubbles{display:flex;flex-wrap:wrap;gap:14px;justify-content:center}.hero-bubbles span{display:inline-flex;align-items:center;justify-content:center;min-height:72px;border-radius:28px;padding:0 22px;background:#fff;font-weight:900;font-size:1.05rem;box-shadow:0 16px 32px rgba(70,43,120,.11);transform:rotate(var(--r, -2deg))}.hero-bubbles span:nth-child(2){--r:3deg;background:#fef3c7}.hero-bubbles span:nth-child(3){--r:-4deg;background:#dcfce7}.hero-bubbles span:nth-child(4){--r:4deg;background:#fce7f3}.catalog-section{padding:24px 0 90px}.section-title{font-weight:950;letter-spacing:-.05em}.category-tabs{gap:10px;flex-wrap:wrap}.cat-btn{border:0;border-radius:999px;background:#fff;padding:.72rem 1rem;font-weight:900;box-shadow:0 10px 22px rgba(70,43,120,.07)}.cat-btn.active{background:var(--main);color:#fff}.category-mobile-list{display:grid;gap:10px}.product-card{height:100%;border:0;border-radius:26px;background:#fff;box-shadow:0 14px 30px rgba(70,43,120,.08);overflow:hidden;transition:.18s transform,.18s box-shadow}.product-card:hover{transform:translateY(-3px);box-shadow:0 20px 42px rgba(70,43,120,.13)}.product-img{height:190px;background:linear-gradient(135deg,#f5f3ff,#fce7f3);display:grid;place-items:center;cursor:pointer}.product-img img{width:100%;height:100%;object-fit:cover}.product-emoji{font-size:4rem}.product-body{padding:16px}.product-title{font-weight:950;font-size:1.05rem;line-height:1.12;cursor:pointer}.product-price{font-weight:950;font-size:1.25rem}.old-price{text-decoration:line-through;color:#a1a1aa;font-weight:700}.badge-mini{display:inline-flex;border-radius:999px;padding:.25rem .55rem;background:#f5f3ff;color:var(--main);font-weight:900;font-size:.75rem}.badge-mini.pink{background:#fce7f3;color:#be185d}.badge-mini.gray{background:#f4f4f5;color:#52525b}.btn-want{width:100%;border:0;border-radius:16px;background:var(--lime);font-weight:950;padding:.75rem}.btn-want:disabled{background:#eee;color:#aaa}.modal-soft{border:0;border-radius:28px;overflow:hidden}.search-hint{background:#fff;border-radius:18px;padding:12px 16px;box-shadow:0 10px 22px rgba(70,43,120,.07);font-weight:800}.empty-state{text-align:center;padding:42px;background:#fff;border-radius:28px;font-weight:900;color:var(--muted)}.cart-line{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--border)}.cart-line-title{font-weight:900}.qty-btn{border:0;width:34px;height:34px;border-radius:12px;background:#f4f4f5;font-weight:900}.cart-total{text-align:right;font-size:1.2rem}.mobile-cart-bar{position:fixed;left:12px;right:12px;bottom:12px;z-index:1020;background:var(--ink);color:#fff;border-radius:20px;padding:16px 18px;text-align:center;font-weight:950;box-shadow:0 18px 40px rgba(0,0,0,.25)}
.admin-body{background:#f6f3ff;padding-bottom:0}.admin-shell{max-width:1180px;margin:0 auto;padding:24px}.admin-card{background:#fff;border-radius:24px;border:0;box-shadow:0 12px 30px rgba(30,20,70,.08)}.stat-card{background:#fff;border-radius:22px;padding:18px;box-shadow:0 12px 30px rgba(30,20,70,.08)}.stat-label{color:var(--muted);font-weight:800}.stat-value{font-weight:950;font-size:1.8rem;letter-spacing:-.04em}.accordion-button{font-weight:950}.admin-list-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--border)}.admin-list-title{font-weight:900}.small-muted{color:var(--muted);font-size:.9rem}.table-soft{background:#fff;border-radius:20px;overflow:hidden}
@media(max-width:767px){.hero-card{padding:24px;border-radius:28px}.product-img{height:160px}.admin-shell{padding:14px}}

/* UI polish patch: safe images, child-friendly admin previews */
html, body{max-width:100%;overflow-x:hidden}
img, svg{max-width:100%}
.product-card{display:flex;flex-direction:column;min-width:0}
.product-card .product-img{flex:0 0 auto}
.product-img{position:relative;overflow:hidden;min-width:0;border-radius:26px 26px 0 0}
.product-img img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain!important;object-position:center;padding:12px;min-width:0;min-height:0}
.product-body{display:flex;flex-direction:column;flex:1;min-width:0}
.product-title{min-height:2.35em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word;hyphens:auto}
.product-price-wrap{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;min-height:34px;min-width:0}
.product-price{white-space:nowrap;line-height:1.1}.old-price{white-space:nowrap;font-size:.9rem;line-height:1.1}
.product-body .btn-want{margin-top:auto}
.product-modal-image{height:min(58vh,360px);background:linear-gradient(135deg,#f5f3ff,#fce7f3);border-radius:24px;overflow:hidden;display:grid;place-items:center;position:relative}
.product-modal-image img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center;padding:14px}
.product-modal-image .product-emoji{font-size:5rem}.modal-body{overflow-x:hidden}.modal-soft{max-width:100%}
.fw-black{font-weight:950}.text-break-soft{overflow-wrap:anywhere;word-break:break-word}
.admin-list-item{min-width:0}.admin-entity-main{display:flex;align-items:center;gap:12px;min-width:0}.admin-list-meta{min-width:0;overflow:hidden}.admin-list-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-list-actions{flex:0 0 auto}.admin-thumb{width:58px;height:58px;flex:0 0 58px;border-radius:18px;overflow:hidden;background:linear-gradient(135deg,#f5f3ff,#fce7f3);display:grid;place-items:center;box-shadow:0 8px 18px rgba(30,20,70,.07)}.admin-thumb img{width:100%;height:100%;object-fit:contain;padding:5px}.admin-thumb-empty{font-size:1.55rem;font-weight:900}.admin-image-preview{min-height:92px;border:1px dashed rgba(23,19,33,.18);border-radius:18px;background:#fff;display:flex;align-items:center;justify-content:center;padding:10px;color:var(--muted);font-weight:800;overflow:hidden}.admin-image-preview img{display:block;max-width:100%;max-height:170px;object-fit:contain;border-radius:14px}.modal .row{min-width:0}.modal input,.modal textarea,.modal select{min-width:0}
@media(max-width:767px){body{padding-bottom:86px}.product-img{height:150px}.product-img img{padding:10px}.product-body{padding:13px}.product-title{font-size:1rem}.product-price{font-size:1.12rem}.old-price{font-size:.82rem}.product-modal-image{height:310px;border-radius:22px}.product-modal-image img{padding:10px}.modal-dialog{margin:.5rem}.admin-list-item{align-items:flex-start;flex-wrap:wrap}.admin-list-actions{width:100%;display:flex}.admin-list-actions .btn,.admin-list-actions.btn-group .btn{flex:1}.admin-thumb{width:54px;height:54px;flex-basis:54px}.admin-list-title{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.stat-value{font-size:1.45rem}.mobile-cart-bar{bottom:10px}}

/* Stage 4-7: notifications, AIDA, safer admin/order UX, zoomer polish */
.btn-main,.btn-light-main,.btn-want,.cat-btn,.mobile-cart-bar{transition:transform .16s ease, box-shadow .16s ease, background .16s ease}.btn-main:active,.btn-light-main:active,.btn-want:active,.cat-btn:active,.mobile-cart-bar:active{transform:scale(.97)}.btn-want:not(:disabled):hover{box-shadow:0 12px 24px rgba(182,255,77,.28);transform:translateY(-1px)}.qty-btn:disabled{opacity:.35;cursor:not-allowed}.mobile-cart-bar.cart-empty{background:#fff;color:var(--ink);border:1px solid var(--border);box-shadow:0 12px 26px rgba(70,43,120,.10)}.toast{border:0;border-radius:18px;box-shadow:0 18px 40px rgba(0,0,0,.18);font-weight:850}.search-hint button{border-radius:999px}.stat-card{position:relative;overflow:hidden}.stat-emoji{position:absolute;right:12px;top:8px;font-size:1.55rem;opacity:.18}.order-admin-card{align-items:center}.order-admin-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.order-status{display:inline-flex;align-items:center;border-radius:999px;padding:.36rem .65rem;font-weight:900;font-size:.78rem;background:#f4f4f5;color:#52525b}.status-new{background:#fef3c7;color:#92400e}.status-confirmed{background:#dbeafe;color:#1d4ed8}.status-packing{background:#f5f3ff;color:#6d28d9}.status-ready{background:#dcfce7;color:#166534}.status-done{background:#dcfce7;color:#166534}.status-cancelled{background:#fee2e2;color:#b91c1c}.aida-box{border:1px solid rgba(124,58,237,.18);background:linear-gradient(135deg,#fff,#f5f3ff);border-radius:22px;padding:14px;box-shadow:0 12px 24px rgba(30,20,70,.06)}.aida-title{font-weight:950;letter-spacing:-.03em;color:var(--main)}.aida-result{display:grid;gap:8px}.aida-score{display:flex;justify-content:space-between;align-items:center;background:#fff;border-radius:16px;padding:10px 12px;color:var(--ink);box-shadow:0 8px 18px rgba(30,20,70,.05)}.aida-score span{font-weight:950;color:var(--main)}.aida-check{display:grid;grid-template-columns:24px 100px 1fr;gap:8px;align-items:center;background:#fff;border-radius:14px;padding:9px 10px;color:var(--ink)}.aida-check span{width:22px;height:22px;border-radius:9px;display:grid;place-items:center;font-weight:950}.aida-check.ok span{background:#dcfce7;color:#166534}.aida-check.bad span{background:#fee2e2;color:#b91c1c}.aida-check b{font-weight:900}.aida-check em{font-style:normal;color:var(--muted)}.aida-variants{display:flex;gap:7px;flex-wrap:wrap;align-items:center}.aida-variants b{margin-right:2px}.aida-variants button{border:0;border-radius:999px;background:#fff;color:var(--main);font-weight:850;padding:.35rem .62rem;box-shadow:0 8px 16px rgba(30,20,70,.06)}
@media(max-width:767px){.order-admin-actions{width:100%;justify-content:flex-start}.aida-check{grid-template-columns:24px 1fr}.aida-check em{grid-column:2}.aida-box{padding:12px}}


/* === EVI patch: safe images + bubble toast + AIDA widget === */
html, body { max-width: 100%; overflow-x: hidden; }
.product-card { display: flex; flex-direction: column; }
.product-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.product-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.35em;
  word-break: break-word;
}
.product-price-wrap { min-height: 52px; }
.product-body .btn-want { margin-top: auto; }
.product-img {
  overflow: hidden;
  contain: paint;
}
.product-img img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  padding: 8px;
}
.product-modal-image {
  width: 100%;
  height: min(58vh, 380px);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg,#f5f3ff,#fce7f3);
  contain: paint;
}
.product-modal-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  padding: 10px;
}
.product-modal-image .product-emoji { font-size: 5rem; }
.text-break-soft { overflow-wrap: anywhere; word-break: break-word; }

.bubble-toast {
  position: fixed;
  right: 16px;
  bottom: 154px;
  z-index: 1070;
  max-width: min(250px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 20px 20px 6px 20px;
  background: #171321;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  line-height: 1.25;
  box-shadow: 0 14px 34px rgba(0,0,0,.23);
  cursor: pointer;
  animation: bubbleIn .18s ease-out;
}
.bubble-toast:after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: #171321;
  transform: rotate(45deg);
  border-radius: 2px;
}
@keyframes bubbleIn {
  from { transform: translateY(8px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.aida-widget {
  position: fixed;
  right: 16px;
  bottom: 92px;
  z-index: 1060;
}
.aida-fab {
  border: 0;
  border-radius: 999px;
  padding: 13px 16px;
  background: var(--lime);
  color: var(--ink);
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform .14s ease, box-shadow .14s ease;
}
.aida-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0,0,0,.22); }
.aida-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  display: inline-block;
  box-shadow: 0 0 0 5px rgba(23,19,33,.08);
}
.aida-panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  width: min(340px, calc(100vw - 28px));
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 64px rgba(0,0,0,.26);
  border: 3px solid var(--ink);
}
.aida-head {
  padding: 14px 16px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.aida-head strong { font-weight: 950; letter-spacing: -.02em; }
.aida-head small {
  display: block;
  opacity: .72;
  font-size: 11px;
  margin-top: 1px;
}
.aida-head button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  padding: 0 2px;
}
.aida-messages {
  padding: 14px;
  max-height: 290px;
  overflow-y: auto;
  background: #fff8ef;
}
.aida-msg {
  width: fit-content;
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 18px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.aida-msg.bot {
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(23,19,33,.08);
}
.aida-msg.user {
  margin-left: auto;
  background: var(--lime);
  color: var(--ink);
  font-weight: 800;
}
.aida-quick {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid rgba(23,19,33,.07);
}
.aida-quick button {
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  background: #f3eaff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}
.aida-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid rgba(23,19,33,.08);
}
.aida-form input {
  flex: 1;
  min-width: 0;
  border: 2px solid #eee;
  border-radius: 999px;
  padding: 10px 12px;
  outline: none;
}
.aida-form input:focus { border-color: var(--lime); }
.aida-form button {
  border: 0;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 950;
}

@media (max-width: 767px) {
  body { padding-bottom: 86px; }
  .bubble-toast {
    right: 14px;
    bottom: 158px;
  }
  .aida-widget {
    right: 14px;
    bottom: 96px;
  }
  .aida-panel { bottom: 58px; }
  .product-img { height: 176px; }
  .product-modal-image { height: min(48vh, 330px); }
}


/* AIDA product action cards */
.aida-products {
  display: grid;
  gap: 8px;
  margin: 2px 0 10px;
}

.aida-product-row {
  background: #fff;
  border: 1px solid rgba(23,19,33,.10);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(23,19,33,.06);
}

.aida-product-link {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: #171321;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.aida-product-actions {
  display: flex;
  gap: 7px;
  margin-top: 8px;
}

.aida-product-actions button {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  background: #f3eaff;
  color: #171321;
}

.aida-product-actions button:last-child {
  background: #a6ff3d;
}

.aida-product-actions button:disabled {
  opacity: .45;
}
