/* SmartSquare Avatar Bank Native — scoped frontend styles */
body.ssab-scroll-lock { overflow: hidden; }
.ssab-modal, .ssab-modal * { box-sizing: border-box; }
.ssab-modal {
  position: fixed; inset: 0; z-index: 11000; display: grid; place-items: center;
  padding: 18px; background: rgba(11, 18, 28, .76); backdrop-filter: blur(5px);
  color: #1e293b; font: 400 14px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.ssab-dialog { width: min(960px, 100%); max-height: min(860px, 94vh); display: flex; flex-direction: column; min-height: 0;
  border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; background: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .30); }
.ssab-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding: 20px 24px 16px; border-bottom: 1px solid #e2e8f0; }
.ssab-brand { font-weight: 800; letter-spacing: .12em; font-size: 11px; color: #2563eb; }
.ssab-brand span { color: #64748b; font-weight: 600; }
.ssab-title { font: 700 25px/1.2 system-ui, sans-serif; margin: 6px 0 4px; color: #0f172a; }
.ssab-user { font-size: 12px; color: #64748b; margin: 0; }
.ssab-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #e2e8f0;
  border-radius: 10px; background: #f8fafc; font-size: 26px; line-height: 1; color: #64748b; cursor: pointer; }
.ssab-main { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 0; flex: 1; }
.ssab-sidebar { padding: 17px; background: #f8fafc; border-right: 1px solid #e2e8f0; min-height: 0; overflow: auto; }
.ssab-search-label { display: block; font-weight: 700; margin: 0 0 8px; color: #475569; }
.ssab-search { width: 100%; max-width: 100%; padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px solid #cbd5e1; color: #0f172a; font: inherit; outline-offset: 2px; }
.ssab-folders { display: grid; gap: 5px; margin-top: 16px; }
.ssab-folder { display: flex; align-items: center; justify-content: space-between; width: 100%; min-width: 0;
  gap: 8px; padding: 10px 12px; border: 1px solid transparent; background: transparent; border-radius: 9px;
  cursor: pointer; text-align: left; font: inherit; color: #334155; overflow-wrap: anywhere; }
.ssab-folder:hover, .ssab-folder.is-active { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.ssab-folder-count { border-radius: 999px; background: #e2e8f0; padding: 1px 8px; color: #475569; font-size: 12px; }
.ssab-content { overflow: auto; min-height: 0; padding: 18px 22px; }
.ssab-gallery-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.ssab-gallery-title { font-size: 15px; color: #0f172a; }
.ssab-gallery-count { font-size: 12px; color: #64748b; }
.ssab-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.ssab-avatar { aspect-ratio: 1; overflow: hidden; display: flex; padding: 5px; align-items: center; justify-content: center;
  border: 2px solid #e2e8f0; background: #fff; border-radius: 13px; cursor: pointer; transition: border-color .15s, transform .15s; }
.ssab-avatar:hover { border-color: #93c5fd; transform: translateY(-2px); }
.ssab-avatar.is-selected { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.ssab-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.ssab-empty { grid-column: 1 / -1; padding: 22px; color: #64748b; text-align: center; }
.ssab-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 22px; border-top: 1px solid #e2e8f0; background: #fff; }
.ssab-status { flex: 1 1 190px; min-width: 0; font-size: 12px; color: #475569; overflow-wrap: anywhere; }
.ssab-status-error { color: #b91c1c; }
.ssab-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ssab-btn { border-radius: 9px; border: 1px solid #cbd5e1; padding: 9px 14px; background: #fff;
  font: 600 13px/1.25 system-ui, sans-serif; color: #334155; cursor: pointer; }
.ssab-btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.ssab-btn-primary:hover { background: #1d4ed8; }
.ssab-btn-muted:hover { background: #f1f5f9; }
.ssab-btn-danger { color: #b91c1c; border-color: #fecaca; }
.ssab-btn-danger:hover { background: #fef2f2; }
.ssab-btn[hidden] { display: none; }
.ssab-modal :focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
@media (max-width: 760px) {
  .ssab-modal { padding: 0; }
  .ssab-dialog { border-radius: 0; max-height: 100dvh; height: 100dvh; }
  .ssab-header { padding: 16px; }
  .ssab-title { font-size: 21px; }
  .ssab-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .ssab-sidebar { overflow: visible; border-right: 0; border-bottom: 1px solid #e2e8f0; padding: 12px 16px; }
  .ssab-folders { display: flex; gap: 7px; overflow-x: auto; padding: 4px 0; margin-top: 10px; }
  .ssab-folder { width: auto; flex: 0 0 auto; white-space: nowrap; }
  .ssab-content { padding: 14px 16px; }
  .ssab-gallery { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 9px; }
  .ssab-footer { padding: 12px 16px; }
  .ssab-actions { width: 100%; justify-content: stretch; }
  .ssab-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ssab-avatar { transition: none; }
}
