/* iTiles AI Visualizer v7.0 — Desktop Redesign */

/* ================================================================
   Root & Reset
   ================================================================ */
.tai-app *,
.tai-app *::before,
.tai-app *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.tai-app {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 560px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
  font-size: 13px;
  color: #111827;
  background: #F0F2F5;
  overflow: hidden;
  position: relative;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.tai-sidebar {
  width: 248px;
  min-width: 248px;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-right: 1px solid #E5E7EB;
  height: 100%;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 2;
}

/* Header */
.tai-sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 12px;
  border-bottom: 1px solid #F3F4F6;
}

.tai-sb-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tai-sb-logo-icon {
  display: flex;
  align-items: center;
  color: #16A34A;
}

.tai-sb-logo-text {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.2px;
}

.tai-credits-badge {
  background: #DCFCE7;
  color: #16A34A;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Tabs */
.tai-sb-tabs {
  display: flex;
  padding: 8px 10px 0;
  gap: 4px;
  border-bottom: 1px solid #F3F4F6;
}

.tai-tab {
  flex: 1;
  padding: 7px 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: #6B7280;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 150ms ease;
  text-align: center;
  white-space: nowrap;
}

.tai-tab:hover { color: #111827; }

.tai-tab.active {
  color: #16A34A;
  border-bottom-color: #16A34A;
  font-weight: 600;
}

/* Scrollable body */
.tai-sb-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 4px;
}

.tai-sb-body::-webkit-scrollbar { width: 4px; }
.tai-sb-body::-webkit-scrollbar-track { background: transparent; }
.tai-sb-body::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 2px; }

/* Section label */
.tai-sb-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0 14px 8px;
}

/* Section wrapper */
.tai-sb-section {
  padding: 0 0 8px;
}

/* Back row */
.tai-back-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 10px;
  flex-wrap: wrap;
}

.tai-back-btn {
  font-size: 11.5px;
  color: #6B7280;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 0;
  transition: color 120ms;
}

.tai-back-btn:hover { color: #111827; }

.tai-room-name-chip {
  font-size: 11px;
  font-weight: 600;
  color: #16A34A;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Footer */
.tai-sb-footer {
  display: none;
}

/* Render button */
.tai-render-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px 70px 11px 14px;
  background: #16A34A;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease, box-shadow 150ms ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(22,163,74,0.30);
}

.tai-render-btn:hover {
  background: #15803D;
  box-shadow: 0 4px 14px rgba(22,163,74,0.38);
}

.tai-render-btn:active { transform: scale(0.98); }

.tai-render-btn svg { flex-shrink: 0; }

.tai-credit-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,0.22);
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

/* ================================================================
   ROOM GRID
   ================================================================ */
.tai-rooms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 14px;
}

.tai-room-card {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  font: inherit;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 150ms, transform 150ms, box-shadow 150ms;
  background: #F3F4F6;
  -webkit-appearance: none;
}

.tai-room-card:hover {
  border-color: #16A34A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}

.tai-room-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.tai-room-card-label {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  padding: 5px 8px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================================
   UPLOAD ZONE
   ================================================================ */
.tai-upload-zone {
  margin: 0 14px;
  border: 2px dashed #D1D5DB;
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}

.tai-upload-zone:hover,
.tai-upload-zone.drag {
  border-color: #16A34A;
  background: #F0FDF4;
}

.tai-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #F3F4F6;
  border-radius: 50%;
  margin-bottom: 10px;
  color: #6B7280;
}

.tai-upload-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.tai-upload-sub {
  font-size: 11px;
  color: #9CA3AF;
  line-height: 1.5;
}

/* ================================================================
   SURFACE BUTTONS
   ================================================================ */
.tai-surface-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 2px;
}

.tai-surface-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 500;
  color: #374151;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.tai-surface-btn:hover {
  border-color: #9CA3AF;
  background: #F3F4F6;
}

.tai-surface-btn.active {
  background: #111827;
  color: #FFFFFF;
  border-color: #111827;
}

.tai-surface-info {
  font-size: 11.5px;
  color: #9CA3AF;
  padding: 4px 2px;
}

/* Visual separator between floor and wall buttons */
.tai-surface-sep {
  width: 100%;
  height: 0;
  border-top: 1px solid #E5E7EB;
  margin: 2px 0;
}

/* Wall row: selection button + texture checkbox — display:contents keeps parent flex layout intact */
.tai-wall-row {
  display: contents;
}

/* Wall selection button internals */
.tai-surface-btn span {
  flex: 1;
}

.tai-tex-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #16A34A;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.tai-tex-dot.empty {
  background: transparent;
  width: 0;
  overflow: hidden;
}

.tai-surface-btn.has-texture {
  padding-right: 8px;
}

/* Checkbox button: small circle to the right of each wall button */
.tai-wall-chk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1.5px solid #E5E7EB;
  background: #F9FAFB;
  color: #9CA3AF;
  cursor: pointer;
  transition: all 140ms ease;
  flex-shrink: 0;
  margin-left: -2px;  /* visually attach to the wall button */
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.tai-wall-chk:hover {
  background: #F3F4F6;
}

.tai-wall-chk.applied {
  background: #16A34A;
  border-color: #15803D;
  color: #FFFFFF;
}

.tai-wall-chk.applied:hover {
  background: #DC2626;
  border-color: #B91C1C;
}

/* Lime-green selection outline overlay */
.tai-selection-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 5;
}

/* ================================================================
   PRODUCT SEARCH & CATEGORIES
   ================================================================ */
.tai-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 14px 6px;
  padding: 8px 11px;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 9px;
  transition: border-color 150ms;
}

.tai-search-wrap:focus-within {
  border-color: #9CA3AF;
  background: #FFFFFF;
}

.tai-search-icon { color: #9CA3AF; flex-shrink: 0; }

.tai-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  color: #111827;
}

.tai-search-input::placeholder { color: #9CA3AF; }

/* Category chips */
.tai-cat-chips {
  display: flex;
  gap: 5px;
  padding: 0 14px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tai-cat-chips::-webkit-scrollbar { display: none; }

.tai-cat-chip {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
  background: #F3F4F6;
  border: 1.5px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
  flex-shrink: 0;
}

.tai-cat-chip:hover { background: #E5E7EB; color: #111827; }

.tai-cat-chip.active {
  background: #ECFDF5;
  color: #16A34A;
  border-color: #BBF7D0;
  font-weight: 600;
}

/* Products header */
.tai-products-header {
  padding: 0 14px 6px;
}

.tai-products-count {
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  letter-spacing: 0.3px;
}

/* ================================================================
   PRODUCT GRID
   ================================================================ */
.tai-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 14px 10px;
}

.tai-product-card {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  background: #F9FAFB;
  transition: border-color 150ms, transform 120ms, box-shadow 150ms;
}

.tai-product-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.09);
  border-color: #D1D5DB;
}

.tai-product-card.active {
  border-color: #16A34A;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}

.tai-product-card.suggested {
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.18);
  animation: tai-pulse-suggest 600ms ease 2;
}

@keyframes tai-pulse-suggest {
  0%, 100% { box-shadow: 0 0 0 3px rgba(245,158,11,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(245,158,11,0.25); }
}

.tai-product-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.tai-product-name {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  color: #374151;
  padding: 3px 5px 1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  overflow: hidden;
  min-height: 2.5em;
}

.tai-product-sku {
  font-size: 9.5px;
  color: #9CA3AF;
  padding: 0 5px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Finish pills (glossy / matte / satin / polished / lappato) */
.tai-finish-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 2px 7px;
  border-radius: 9px;
  line-height: 1.35;
  margin: 2px 5px 5px;
  border: 1px solid transparent;
  white-space: nowrap;
  width: fit-content;
}
.tai-finish-pill.tai-finish-matte {
  background: #EEF2F7;
  color: #475569;
  border-color: #D8DEE8;
}
.tai-finish-pill.tai-finish-satin {
  background: #F5F0FA;
  color: #6D4AAE;
  border-color: #E3D3F1;
}
.tai-finish-pill.tai-finish-glossy,
.tai-finish-pill.tai-finish-polished {
  background: linear-gradient(135deg, #FFF7E0 0%, #FFE7B3 100%);
  color: #8A5A00;
  border-color: #F4D98A;
}
.tai-finish-pill.tai-finish-lappato {
  background: #E8F5FF;
  color: #1E5A9B;
  border-color: #BFDFF7;
}

/* Compact variant used inside product grid cards */
.tai-product-card .tai-finish-pill {
  margin: 0 5px 4px;
  font-size: 9px;
  padding: 1px 6px;
}

/* Products expand button */
.tai-products-expand-btn {
  display: block;
  width: calc(100% - 28px);
  margin: 4px 14px 8px;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 600;
  color: #16A34A;
  background: #F0FDF4;
  border: 1.5px solid #BBF7D0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
  text-align: center;
}

.tai-products-expand-btn:hover {
  background: #DCFCE7;
  border-color: #86EFAC;
}

/* ================================================================
   ADVANCED SETTINGS ACCORDION
   ================================================================ */
.tai-advanced {
  border-top: 1px solid #F3F4F6;
  margin-top: 4px;
}

.tai-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 120ms;
}

.tai-advanced-toggle:hover { color: #111827; }
.tai-advanced-toggle span { color: #374151; }

.tai-advanced-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
}

.tai-advanced-body.open {
  max-height: 400px;
}

.tai-adv-group {
  padding: 2px 14px 12px;
}

.tai-adv-label {
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.tai-adv-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dim inputs */
.tai-dim-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tai-dim-label {
  font-size: 9.5px;
  font-weight: 600;
  color: #9CA3AF;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.tai-dim-input {
  width: 100%;
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 7px;
  outline: none;
  transition: border-color 150ms;
}

.tai-dim-input:focus {
  border-color: #16A34A;
  background: #FFFFFF;
}

/* Grout */
.tai-grout-row {
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tai-grout-sw {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #E5E7EB;
  cursor: pointer;
  transition: transform 140ms, border-color 140ms;
  flex-shrink: 0;
}

.tai-grout-sw:hover { transform: scale(1.15); }
.tai-grout-sw.active { border-color: #16A34A; transform: scale(1.18); }

.tai-grout-picker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #E5E7EB;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.tai-grout-label {
  font-size: 11px;
  color: #6B7280;
  font-weight: 500;
  margin-left: 2px;
}

.tai-slider-row {
  gap: 8px;
  padding-top: 2px;
}

.tai-slider-label {
  font-size: 11px;
  color: #6B7280;
  white-space: nowrap;
  flex-shrink: 0;
}

.tai-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #E5E7EB;
  border-radius: 4px;
  outline: none;
}

.tai-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #16A34A;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.tai-slider-value {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  min-width: 26px;
  text-align: right;
  flex-shrink: 0;
}

/* Pattern buttons */
.tai-pattern-row {
  display: flex;
  gap: 6px;
}

.tai-pattern-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 9px;
  cursor: pointer;
  color: #9CA3AF;
  transition: all 140ms ease;
  flex-shrink: 0;
}

.tai-pattern-btn:hover {
  border-color: #9CA3AF;
  color: #374151;
  background: #F3F4F6;
}

.tai-pattern-btn.active {
  border-color: #16A34A;
  background: #F0FDF4;
  color: #16A34A;
}

/* ================================================================
   VIEWER
   ================================================================ */
.tai-viewer {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #F0F2F5;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Placeholder — doubles as a primary upload CTA in the empty state */
.tai-viewer-placeholder {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 540px;
  padding: 0 24px;
  user-select: none;
}

.tai-viewer-upload-label {
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding-left: 2px;
}

.tai-viewer-upload-zone {
  border: 2px dashed #D1D5DB;
  border-radius: 16px;
  background: #FFFFFF;
  padding: 56px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, box-shadow 200ms;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.tai-viewer-upload-zone:hover,
.tai-viewer-upload-zone.drag {
  border-color: #16A34A;
  background: #F0FDF4;
  box-shadow: 0 4px 20px rgba(22,163,74,0.08);
}

.tai-viewer-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: #F3F4F6;
  border-radius: 50%;
  color: #6B7280;
  margin-bottom: 4px;
  transition: background 150ms, color 150ms;
}

.tai-viewer-upload-zone:hover .tai-viewer-upload-icon,
.tai-viewer-upload-zone.drag .tai-viewer-upload-icon {
  background: #DCFCE7;
  color: #16A34A;
}

.tai-viewer-upload-icon svg {
  width: 26px;
  height: 26px;
}

.tai-viewer-upload-title {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

.tai-viewer-upload-sub {
  font-size: 13px;
  color: #9CA3AF;
  line-height: 1.6;
  max-width: 360px;
}

@media (max-width: 640px) {
  .tai-viewer-placeholder { padding: 0 16px; }
  .tai-viewer-upload-zone { padding: 40px 20px; }
  .tai-viewer-upload-title { font-size: 17px; }
  .tai-viewer-upload-sub { font-size: 12px; }
  .tai-viewer-upload-icon { width: 56px; height: 56px; }
}

/* Sidebar upload label/zone/divider exist only as a mobile fallback (the
   viewer is hidden on mobile empty state). Hide on desktop where the viewer
   placeholder already shows a big upload CTA. */
@media (min-width: 768px) {
  .tai-sb-upload-mobile {
    display: none !important;
  }
}

/* Inverse: the "Alege din MoodLab" section label replaces the mobile divider
   on desktop. Hide it on mobile. */
@media (max-width: 767px) {
  .tai-sb-moodlab-desktop {
    display: none !important;
  }
}

/* Room image */
.tai-room-img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 200ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

/* Compare */
.tai-compare {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: ew-resize;
}

.tai-compare-before,
.tai-compare-after {
  position: absolute;
  inset: 0;
}

.tai-compare-before img,
.tai-compare-after img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.tai-compare-divider {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: #FFFFFF;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
  z-index: 2;
}

.tai-compare-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #374151;
  z-index: 3;
  cursor: ew-resize;
  user-select: none;
}

.tai-compare-label {
  position: absolute;
  bottom: 60px;
  padding: 4px 12px;
  background: rgba(0,0,0,0.55);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.tai-compare-label.before { left: 12px; }
.tai-compare-label.after { right: 12px; }

/* Loading overlay */
.tai-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
}

.tai-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #E5E7EB;
  border-top-color: #16A34A;
  border-radius: 50%;
  animation: tai-spin 800ms linear infinite;
}

@keyframes tai-spin { to { transform: rotate(360deg); } }

.tai-loading-text {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.tai-loading-bar {
  width: 160px;
  height: 3px;
  background: #E5E7EB;
  border-radius: 2px;
  overflow: hidden;
}

.tai-loading-bar-fill {
  height: 100%;
  background: #16A34A;
  border-radius: 2px;
  animation: tai-bar-fill 10s linear forwards;
}

@keyframes tai-bar-fill { 0% { width: 0; } 80% { width: 90%; } 100% { width: 95%; } }

/* Viewer toolbar */
.tai-viewer-toolbar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(17,24,39,0.82);
  backdrop-filter: blur(12px);
  border-radius: 30px;
  padding: 5px 8px;
  z-index: 5;
}

/* ── Top action bar ─────────────────────────────────────────────────── */
.tai-viewer-topbar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(17, 24, 39, 0.82);
  backdrop-filter: blur(14px);
  border-radius: 28px;
  padding: 6px 6px 6px 14px;
  z-index: 5;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  transition: background .2s, box-shadow .2s;
  max-width: calc(100% - 32px);
}

.tai-viewer-topbar.tai-hidden { display: none; }

.tai-topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.tai-topbar-status-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.tai-topbar-status-text {
  line-height: 1;
}

.tai-viewer-topbar.original .tai-topbar-status-ico { color: #a8b5c5; }
.tai-viewer-topbar.committed .tai-topbar-status-ico { color: #7ce38b; }
.tai-viewer-topbar.pending {
  background: linear-gradient(180deg, rgba(251, 146, 60, 0.96) 0%, rgba(234, 88, 12, 0.95) 100%);
  box-shadow: 0 4px 22px rgba(234, 88, 12, 0.45);
  padding-right: 6px;
}
.tai-viewer-topbar.pending .tai-topbar-status { color: #fff; }
.tai-viewer-topbar.pending .tai-topbar-status-ico { color: #fff; }

/* Confirm button */
.tai-topbar-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #c2410c;
  border: none;
  border-radius: 22px;
  padding: 8px 14px 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.15px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background .14s, transform .08s, box-shadow .14s;
}

.tai-topbar-confirm:hover {
  background: #fff7ed;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

.tai-topbar-confirm:active {
  transform: scale(0.97);
}

.tai-topbar-confirm.tai-hidden { display: none; }

.tai-topbar-confirm svg { flex-shrink: 0; }

/* Enhance pill — sits between the status badge and the Confirmă button.
   Subtle indigo → fuchsia gradient so it reads as "magic / AI upgrade"
   without fighting the orange CTA. */
.tai-topbar-enhance {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #ec4899 100%);
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 7px 12px 7px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.35);
  transition: filter .15s, transform .08s, box-shadow .15s, opacity .15s;
}
.tai-topbar-enhance:hover {
  filter: brightness(1.08);
  box-shadow: 0 3px 14px rgba(139, 92, 246, 0.48);
}
.tai-topbar-enhance:active { transform: scale(0.97); }
.tai-topbar-enhance:disabled { opacity: 0.55; cursor: not-allowed; filter: saturate(0.6); }
.tai-topbar-enhance.tai-hidden { display: none; }
.tai-topbar-enhance svg { flex-shrink: 0; }

/* When top bar is in "pending" orange state, tone enhance down so the main
   confirm CTA stays the primary action. */
.tai-viewer-topbar.pending .tai-topbar-enhance {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
  color: #fff7ed;
  backdrop-filter: blur(6px);
}
.tai-viewer-topbar.pending .tai-topbar-enhance:hover {
  background: rgba(255, 255, 255, 0.28);
  filter: none;
}

/* ── Enhance modal ──────────────────────────────────────────────────── */
.tai-enhance-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: tai-enh-fade .18s ease-out;
}
@keyframes tai-enh-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.tai-enhance-modal {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  animation: tai-enh-pop .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes tai-enh-pop {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.tai-enhance-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eef0f4;
  background: linear-gradient(180deg, #faf9ff 0%, #fff 100%);
}

.tai-enhance-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  color: #4c1d95;
  letter-spacing: 0.1px;
}

.tai-enhance-title svg { color: #8b5cf6; flex-shrink: 0; }

.tai-enhance-subtitle {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}

.tai-enhance-list {
  padding: 8px 10px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.tai-enhance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}

.tai-enhance-row:hover {
  background: #f5f3ff;
}

.tai-enhance-row.selected {
  background: #f5f3ff;
  border-color: #a78bfa;
}

.tai-enhance-row-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.tai-enhance-check {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: #8b5cf6;
  flex-shrink: 0;
  cursor: pointer;
}

.tai-enhance-row-text {
  flex: 1;
  min-width: 0;
}

.tai-enhance-row-label {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
}

.tai-enhance-row-desc {
  margin-top: 2px;
  font-size: 11.5px;
  color: #6b7280;
  line-height: 1.4;
}

.tai-enhance-row-cost {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: #6d28d9;
  background: #ede9fe;
  border-radius: 14px;
  padding: 3px 9px;
  white-space: nowrap;
}

.tai-enhance-row.selected .tai-enhance-row-cost {
  background: #8b5cf6;
  color: #fff;
}

.tai-enhance-footer {
  padding: 12px 16px 14px;
  border-top: 1px solid #eef0f4;
  background: #fbfafe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tai-enhance-total {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.tai-enhance-total-sub {
  font-size: 11px;
  color: #6b7280;
}

.tai-enhance-total-amt {
  font-size: 15px;
  font-weight: 700;
  color: #4c1d95;
  margin-top: 2px;
}

.tai-enhance-btn-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.tai-enhance-cancel {
  padding: 9px 14px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  color: #4b5563;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}

.tai-enhance-cancel:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.tai-enhance-apply {
  padding: 9px 16px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #ec4899 100%);
  border: none;
  color: #fff;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.15px;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.28);
  transition: filter .14s, transform .08s, box-shadow .14s, opacity .14s;
}

.tai-enhance-apply:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.4);
}

.tai-enhance-apply:active:not(:disabled) { transform: scale(0.985); }

.tai-enhance-apply:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.8;
}

@media (max-width: 520px) {
  .tai-enhance-modal { border-radius: 14px; }
  .tai-enhance-title { font-size: 14px; }
  .tai-enhance-row-label { font-size: 12.5px; }
  .tai-enhance-row-desc { font-size: 11px; }
  .tai-topbar-enhance span { display: none; }
  .tai-topbar-enhance { padding: 7px 9px; }
}

/* Spinner for the re-segmenting state */
.tai-spin { animation: tai-topbar-spin 1.1s linear infinite; transform-origin: center; }
@keyframes tai-topbar-spin { to { transform: rotate(360deg); } }

/* Committed chip badge in sidebar slots */
.tai-slot-chip.committed {
  background: #ecfdf5;
  border-color: #86efac;
}

.tai-slot-chip-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  flex-shrink: 0;
  margin-right: 4px;
}

.tai-slot-chip.committed .tai-slot-chip-name { color: #065f46; }
.tai-slot-chip.committed .tai-slot-chip-scope { color: #059669; }

/* Narrow viewports: stack the confirm label if it gets tight */
@media (max-width: 760px) {
  .tai-viewer-topbar {
    top: 10px;
    padding: 5px 5px 5px 12px;
    gap: 8px;
    font-size: 11.5px;
  }
  .tai-topbar-confirm {
    padding: 7px 10px 7px 9px;
    font-size: 11.5px;
  }
}

.tai-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  color: rgba(255,255,255,0.75);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background 140ms, color 140ms;
}

.tai-toolbar-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #FFFFFF;
}

.tai-toolbar-btn.active {
  background: #16A34A;
  color: #FFFFFF;
}

/* ================================================================
   CHAT FAB — always visible
   ================================================================ */
.tai-chat-fab {
  display: flex;
  position: absolute;
  bottom: 20px;
  right: 320px;
  width: 52px;
  height: 52px;
  background: #16A34A;
  color: #FFFFFF;
  border: none;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(22,163,74,0.40), 0 2px 6px rgba(0,0,0,0.12);
  transition: background 150ms, transform 150ms, box-shadow 150ms;
}

.tai-chat-fab:hover {
  background: #15803D;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(22,163,74,0.45), 0 2px 8px rgba(0,0,0,0.15);
}

.tai-chat-fab.active {
  background: #374151;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* ================================================================
   CHAT PANEL — floating popup (all screen sizes)
   ================================================================ */
.tai-chat-panel {
  position: absolute;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: auto;
  max-height: 520px;
  min-width: unset;
  bottom: 80px;
  right: 316px;
  background: #FFFFFF;
  border-left: none;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.14), 0 2px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  z-index: 21;
  overflow: hidden;
  transform: scale(0.94) translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 200ms ease, opacity 200ms ease;
  transform-origin: bottom right;
  flex-shrink: 0;
}

.tai-chat-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.tai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #F3F4F6;
  background: #FFFFFF;
}

.tai-chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tai-chat-dot {
  width: 8px;
  height: 8px;
  background: #16A34A;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(22,163,74,0.2);
  animation: tai-dot-pulse 2s ease infinite;
}

@keyframes tai-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(22,163,74,0.2); }
  50% { box-shadow: 0 0 0 5px rgba(22,163,74,0.1); }
}

.tai-chat-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
}

.tai-chat-sub {
  font-size: 11px;
  color: #9CA3AF;
}

.tai-chat-close {
  width: 26px;
  height: 26px;
  background: #F3F4F6;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: #6B7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms;
}

.tai-chat-close:hover { background: #E5E7EB; }

/* Suggestion chips */
.tai-chat-chips {
  display: flex;
  gap: 5px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid #F3F4F6;
}

.tai-chat-chips::-webkit-scrollbar { display: none; }

.tai-chat-chip {
  padding: 4px 11px;
  font-size: 11.5px;
  color: #374151;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms;
  flex-shrink: 0;
}

.tai-chat-chip:hover {
  border-color: #16A34A;
  color: #16A34A;
  background: #F0FDF4;
}

/* Messages */
.tai-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.tai-chat-msgs::-webkit-scrollbar { width: 3px; }
.tai-chat-msgs::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 2px; }

.tai-chat-msg {
  display: flex;
  gap: 7px;
  align-items: flex-end;
}

.tai-chat-msg.user {
  justify-content: flex-end;
}

.tai-chat-avatar {
  width: 26px;
  height: 26px;
  background: #16A34A;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tai-chat-bubble {
  max-width: 78%;
  padding: 8px 11px;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 12px;
  word-break: break-word;
}

.tai-chat-msg.bot .tai-chat-bubble {
  background: #F9FAFB;
  color: #111827;
  border: 1px solid #F3F4F6;
  border-bottom-left-radius: 4px;
}

.tai-chat-msg.user .tai-chat-bubble {
  background: #16A34A;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.tai-typing-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tai-typing {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.tai-typing span {
  width: 5px;
  height: 5px;
  background: #9CA3AF;
  border-radius: 50%;
  animation: tai-bounce 1.2s ease infinite;
}

.tai-typing span:nth-child(2) { animation-delay: 0.2s; }
.tai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes tai-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}

.tai-step-txt {
  font-size: 11px;
  color: #9CA3AF;
  font-style: italic;
}

/* Input row */
.tai-chat-input-row {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid #F3F4F6;
}

.tai-chat-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #111827;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  outline: none;
  transition: border-color 150ms;
}

.tai-chat-input:focus {
  border-color: #16A34A;
  background: #FFFFFF;
}

.tai-chat-input::placeholder { color: #9CA3AF; }

.tai-chat-send {
  width: 34px;
  height: 34px;
  background: #16A34A;
  color: #FFFFFF;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 140ms, transform 100ms;
}

.tai-chat-send:hover { background: #15803D; }
.tai-chat-send:active { transform: scale(0.92); }

/* ================================================================
   USED PRODUCTS PANEL (right column)
   ================================================================ */
.tai-used-panel {
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-left: 1px solid #E5E7EB;
  height: 100%;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 2;
}

.tai-used-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid #F3F4F6;
}

.tai-used-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.2px;
}

.tai-used-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
}

.tai-used-body::-webkit-scrollbar { width: 4px; }
.tai-used-body::-webkit-scrollbar-track { background: transparent; }
.tai-used-body::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 2px; }

/* Empty state */
.tai-used-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 16px;
  gap: 10px;
}

.tai-used-empty-icon {
  width: 52px;
  height: 52px;
  background: #F3F4F6;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  margin-bottom: 4px;
}

.tai-used-empty-title {
  font-size: 13px;
  font-weight: 700;
  color: #6B7280;
}

.tai-used-empty-text {
  font-size: 12px;
  color: #9CA3AF;
  line-height: 1.55;
  max-width: 200px;
}

/* Chat panel injected at top of right sidebar */
.tai-design-chat-panel {
  padding: 12px 14px 14px;
  border-top: 1px solid #F3F4F6;
}

/* 2-per-row grid */
.tai-used-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Mini card */
.tai-used-mini-card {
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 200ms, box-shadow 200ms;
}

.tai-used-mini-card:hover {
  border-color: #D1D5DB;
  box-shadow: 0 3px 12px rgba(0,0,0,0.07);
}

/* Square thumbnail */
.tai-used-mini-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #F3F4F6;
  position: relative;
}

.tai-used-mini-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease;
}

.tai-used-mini-card:hover .tai-used-mini-img {
  transform: scale(1.06);
}

/* Role badge */
.tai-used-mini-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: rgba(22,163,74,0.88);
  color: #fff;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 5px;
  border-radius: 5px;
}

/* Remove button */
.tai-used-mini-rm {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 150ms, background 150ms;
  z-index: 2;
}
.tai-used-mini-card:hover .tai-used-mini-rm {
  opacity: 1;
}
.tai-used-mini-rm:hover {
  background: rgba(220,38,38,0.85);
}

/* Info section */
.tai-used-mini-info {
  padding: 7px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.tai-used-mini-name {
  font-size: 10.5px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tai-used-mini-dims {
  font-size: 9px;
  color: #9CA3AF;
}

/* CTA button */
.tai-used-mini-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: auto;
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #FFFFFF;
  background: #16A34A;
  border-radius: 7px;
  text-decoration: none;
  text-align: center;
  transition: background 150ms, transform 100ms;
}

.tai-used-mini-cta:hover {
  background: #15803D;
  color: #FFFFFF;
  text-decoration: none;
}

.tai-used-mini-cta:active {
  transform: scale(0.96);
}

.tai-used-mini-cta svg {
  flex-shrink: 0;
}

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.tai-toasts {
  position: fixed;
  /* Sit above the bottom viewer-toolbar (bottom:16px, ~42px tall) with a small
     gap, so error/success messages never hide the action buttons. Mobile
     override below pushes it higher to clear the mobile toolbar (bottom:74px). */
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
  max-width: min(92vw, 460px);
  width: max-content;
}

.tai-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  background: #1F2937;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.20);
  animation: tai-toast-in 280ms ease-out;
  /* Long localized messages (ex: "Analiza a durat prea mult...") must wrap
     inside the pill instead of stretching edge-to-edge over the toolbar. */
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
  text-align: left;
}

.tai-toast.success { background: #166534; }
.tai-toast.error { background: #991B1B; }
.tai-toast.warning { background: #92400E; }

.tai-toast-icon {
  font-size: 13px;
  font-weight: 700;
}

@keyframes tai-toast-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes tai-toast-out {
  to { transform: translateY(8px); opacity: 0; }
}

/* ================================================================
   PRODUCT BANNER (after texture apply)
   ================================================================ */
.tai-product-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #166534 0%, #15803d 100%);
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  animation: tai-banner-in 350ms ease-out;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.tai-product-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.tai-product-banner-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.tai-product-banner-text {
  color: rgba(255,255,255,0.92);
}

.tai-product-banner-text strong {
  color: #fff;
  font-weight: 600;
}

.tai-product-banner-link {
  color: #bbf7d0;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s;
}
.tai-product-banner-link:hover {
  color: #fff;
  text-decoration: underline;
}

.tai-product-banner-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.tai-product-banner-close:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

@keyframes tai-banner-in {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes tai-banner-out {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-100%); opacity: 0; }
}

/* ================================================================
   FULLSCREEN OVERLAY
   ================================================================ */
.tai-fs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  cursor: zoom-out;
  backdrop-filter: blur(8px);
}

/* ================================================================
   UTILITIES
   ================================================================ */
.tai-hidden { display: none !important; }

/* ================================================================
   SCROLLBAR (global for body scroll)
   ================================================================ */
.tai-app ::-webkit-scrollbar { width: 4px; height: 4px; }
.tai-app ::-webkit-scrollbar-track { background: transparent; }
.tai-app ::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 4px; }
.tai-app ::-webkit-scrollbar-thumb:hover { background: #D1D5DB; }

/* ================================================================
   DESIGN WIZARD MODAL
   ================================================================ */

.tai-wz-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  transition: background 220ms ease;
  padding: 16px;
}

.tai-wz-backdrop.open {
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px);
}

.tai-wz-modal {
  background: #FFFFFF;
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 28px 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.20), 0 4px 20px rgba(0,0,0,0.10);
  transform: scale(0.95) translateY(12px);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.tai-wz-backdrop.open .tai-wz-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.tai-wz-modal::-webkit-scrollbar { width: 4px; }
.tai-wz-modal::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 2px; }

/* Progress dots */
.tai-wz-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.tai-wz-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E5E7EB;
  transition: all 200ms;
}

.tai-wz-dot.active {
  background: #16A34A;
  width: 24px;
  border-radius: 4px;
}

.tai-wz-dot.done {
  background: #BBF7D0;
}

/* Title */
.tai-wz-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.tai-wz-sub {
  font-size: 13.5px;
  color: #6B7280;
  margin-bottom: 22px;
}

/* Step content */
.tai-wz-content {
  margin-bottom: 20px;
}

/* Category grid — Step 1 */
.tai-wz-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tai-wz-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 12px;
  background: #F9FAFB;
  border: 2px solid #F3F4F6;
  border-radius: 14px;
  cursor: pointer;
  transition: all 150ms ease;
}

.tai-wz-cat-card:hover {
  border-color: #D1D5DB;
  background: #F3F4F6;
}

.tai-wz-cat-card.active {
  border-color: #16A34A;
  background: #F0FDF4;
}

.tai-wz-cat-emoji {
  font-size: 36px;
  line-height: 1;
}

.tai-wz-cat-label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  text-align: center;
}

.tai-wz-cat-card.active .tai-wz-cat-label {
  color: #16A34A;
}

/* Room grid — Step 2 */
.tai-wz-room-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.tai-wz-room-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: #F9FAFB;
  border: 2px solid #F3F4F6;
  border-radius: 12px;
  cursor: pointer;
  transition: all 150ms ease;
}

.tai-wz-room-card:hover {
  border-color: #D1D5DB;
  background: #F3F4F6;
}

.tai-wz-room-card.active {
  border-color: #16A34A;
  background: #F0FDF4;
}

.tai-wz-room-emoji {
  font-size: 26px;
  line-height: 1;
}

.tai-wz-room-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #374151;
  text-align: center;
}

.tai-wz-room-card.active .tai-wz-room-label {
  color: #16A34A;
}

/* Style grid — Step 3 */
.tai-wz-style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tai-wz-style-card {
  padding: 13px 14px;
  background: #F9FAFB;
  border: 2px solid #F3F4F6;
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
  transition: all 150ms ease;
}

.tai-wz-style-card:hover {
  border-color: #D1D5DB;
  background: #F3F4F6;
}

.tai-wz-style-card.active {
  border-color: #16A34A;
  background: #F0FDF4;
}

.tai-wz-style-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 2px;
}

.tai-wz-style-desc {
  font-size: 11.5px;
  color: #6B7280;
}

.tai-wz-style-card.active .tai-wz-style-name { color: #15803D; }

/* Materials step — Step 3 */
.tai-wz-mat-sec {
  margin-bottom: 16px;
}

.tai-wz-mat-title {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
}

.tai-wz-tone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}

.tai-wz-tone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 6px;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  transition: all 140ms;
}

.tai-wz-tone:hover { border-color: #9CA3AF; }

.tai-wz-tone.active {
  border-color: #16A34A;
  background: #F0FDF4;
  color: #15803D;
  font-weight: 600;
}

.tai-wz-tone-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tai-wz-tone-label { white-space: nowrap; }

.tai-wz-mat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tai-wz-mat-chip {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
  background: #F3F4F6;
  border: 1.5px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 140ms;
}

.tai-wz-mat-chip:hover { border-color: #D1D5DB; color: #111827; }

.tai-wz-mat-chip.active {
  background: #ECFDF5;
  color: #16A34A;
  border-color: #BBF7D0;
  font-weight: 600;
}

/* Wall toggle row */
.tai-wz-wall-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
}

.tai-wz-wall-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #16A34A;
  cursor: pointer;
  flex-shrink: 0;
}

.tai-wz-wall-toggle-row label {
  font-size: 12.5px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}

/* Notes row */
.tai-wz-notes-row {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tai-wz-notes-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #6B7280;
}

.tai-wz-notes-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 12.5px;
  color: #111827;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  outline: none;
  transition: border-color 150ms;
}

.tai-wz-notes-input:focus {
  border-color: #16A34A;
  background: #FFFFFF;
}

.tai-wz-notes-input::placeholder { color: #9CA3AF; }

/* Wizard buttons */
.tai-wz-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid #F3F4F6;
}

.tai-wz-back-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  background: #F3F4F6;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 140ms, color 140ms;
}

.tai-wz-back-btn:hover { background: #E5E7EB; color: #374151; }

.tai-wz-next-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  background: #16A34A;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 140ms, transform 100ms;
  box-shadow: 0 2px 8px rgba(22,163,74,0.28);
}

.tai-wz-next-btn:hover { background: #15803D; }
.tai-wz-next-btn:active { transform: scale(0.97); }

/* ================================================================
   MATERIALS PANEL (after render)
   ================================================================ */
.tai-mat-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top: 1px solid #E5E7EB;
  border-radius: 14px 14px 0 0;
  padding: 16px 18px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
  z-index: 8;
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 200px;
  overflow-y: auto;
}

.tai-mat-panel.open {
  transform: translateY(0);
}

.tai-mat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tai-mat-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tai-mat-summary {
  font-size: 11px;
  font-weight: 500;
  color: #6B7280;
  background: #F3F4F6;
  padding: 2px 8px;
  border-radius: 20px;
}

.tai-mat-close {
  width: 24px;
  height: 24px;
  background: #F3F4F6;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  color: #6B7280;
  flex-shrink: 0;
  transition: background 140ms;
}

.tai-mat-close:hover { background: #E5E7EB; }

.tai-mat-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.tai-mat-list::-webkit-scrollbar { display: none; }

.tai-mat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  min-width: 220px;
  flex-shrink: 0;
}

.tai-mat-thumb {
  width: 50px;
  height: 50px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: #E5E7EB;
}

.tai-mat-info {
  flex: 1;
  min-width: 0;
}

.tai-mat-role {
  font-size: 10px;
  font-weight: 700;
  color: #16A34A;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 1px;
}

.tai-mat-name {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.tai-mat-dims {
  font-size: 10.5px;
  color: #9CA3AF;
}

.tai-mat-link {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #16A34A;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 140ms;
}

.tai-mat-link:hover { background: #DCFCE7; }

/* Shimmer animation for look skeletons */
@keyframes tai-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .tai-app {
    flex-direction: column;
  }

  /* ---- EMPTY STATE: no photo loaded ----
     Viewer is hidden; sidebar fills all available space             */

  /* Hide the gray empty viewer when no photo is loaded */
  .tai-viewer:has(.tai-viewer-placeholder:not(.tai-hidden)) {
    display: none;
  }

  /* Sidebar expands to fill all space in empty state */
  .tai-app:has(.tai-viewer-placeholder:not(.tai-hidden)) .tai-sidebar {
    flex: 1;
    max-height: calc(100vh - 64px);
    border-bottom: none;
  }

  /* ---- ACTIVE STATE: .tai-app IS the scroll container, header sticky inside it ----
     html/body stay overflow:hidden — .tai-app becomes the scrolling viewport.
     Visual order: sticky-header | back+surface | PHOTO | used-panel+chat | search+chips | products
     Viewer is a sibling of sidebar in DOM — flex+order reposition it visually.
     ---------------------------------------------------------------------- */

  /* .tai-app becomes the full-height scroll container */
  .tai-app.tai-workspace {
    display: flex;
    flex-direction: column;
    height: 100%;          /* fill the 100vh parent */
    overflow-y: auto;      /* THIS container scrolls, not the window */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  /* Sidebar: display:contents — children join the flex of .tai-app */
  .tai-app.tai-workspace .tai-sidebar {
    display: contents;
  }

  /* Sidebar body: display:contents — sb-section & products-wrapper join the flex */
  .tai-app.tai-workspace .tai-sb-body {
    display: contents;
  }

  /* Order 1 — header: sticky at top of the .tai-app scroll container */
  .tai-app.tai-workspace .tai-sb-header {
    order: 1;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    padding: 6px 14px;
    border-bottom: 1px solid #F3F4F6;
    flex-shrink: 0;
  }

  /* Order 2 — back btn + surface selector */
  .tai-app.tai-workspace .tai-sb-section {
    order: 2;
    background: #fff;
    border-bottom: 1px solid #F3F4F6;
    padding-bottom: 8px;
    flex-shrink: 0;
  }

  /* Order 3 — photo viewer: height driven by the image's natural aspect ratio */
  .tai-app.tai-workspace .tai-viewer {
    order: 3;
    width: 100%;
    /* Reset flex:1 from base — size comes from image content, not flex algorithm */
    flex: none;
    height: auto;
    min-height: 0;
    padding-bottom: 0;
    position: relative;
    background: #000;
    display: block;
    overflow: hidden;
    align-items: unset;
    justify-content: unset;
  }

  .tai-app.tai-workspace .tai-viewer-toolbar {
    position: absolute;
    bottom: 8px;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    gap: 10px;
  }

  .tai-app.tai-workspace .tai-viewer-toolbar button svg {
    width: 16px;
    height: 16px;
  }

  /* Order 4 — products wrapper: grows to natural height, no inner scroll */
  .tai-app.tai-workspace .tai-sb-products-wrapper {
    order: 4;
    display: block;
    overflow: visible;
    background: #fff;
    flex-shrink: 0;
    /* Extra room so expand button + back-to-top clear iOS Safari nav bar */
    padding-bottom: calc(115px + env(safe-area-inset-bottom, 0px));
  }

  /* Used panel: first child of products wrapper (JS insertBefore) */
  .tai-app.tai-workspace .tai-used-panel {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    min-width: unset !important;
    height: auto !important;
    max-height: none !important;
    border-bottom: 2px solid #F3F4F6;
    border-left: none !important;
    border-top: none !important;
    overflow: visible;
    background: #f9fafb;
    padding-bottom: 0;
  }

  .tai-app.tai-workspace .tai-used-panel .tai-used-body {
    flex: none !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding: 8px 12px;
  }

  .tai-app.tai-workspace .tai-used-header { padding: 10px 14px 8px; }
  .tai-app.tai-workspace .tai-used-title  { font-size: 13px; }

  /* Single-column horizontal cards on mobile */
  .tai-app.tai-workspace .tai-used-grid {
    grid-template-columns: 1fr;
    padding: 6px 12px;
    gap: 8px;
  }

  /* Horizontal card: image left, info+button right */
  .tai-app.tai-workspace .tai-used-mini-card {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    border-radius: 10px;
    min-height: 0;
  }

  /* Small square image on the left */
  .tai-app.tai-workspace .tai-used-mini-img-wrap {
    width: 80px;
    min-width: 80px;
    height: 80px;
    aspect-ratio: unset;
    border-radius: 8px 0 0 8px;
    flex-shrink: 0;
  }

  /* Info section: column, fills remaining width */
  .tai-app.tai-workspace .tai-used-mini-info {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
  }

  /* Truncate name to 1 line */
  .tai-app.tai-workspace .tai-used-mini-name {
    font-size: 11px;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: unset;
    margin-bottom: 1px;
  }

  .tai-app.tai-workspace .tai-used-mini-dims {
    font-size: 9.5px;
    margin-bottom: 5px;
  }

  /* CTA button compact, full width */
  .tai-app.tai-workspace .tai-used-mini-cta {
    width: 100%;
    padding: 5px 8px;
    font-size: 10px;
    border-radius: 6px;
    margin-top: 0;
  }

  .tai-app.tai-workspace .tai-design-chat-panel { padding: 10px 14px; }
  .tai-app.tai-workspace .tai-design-gen-btn,
  .tai-app.tai-workspace .tai-render-btn { margin-bottom: 4px; }

  /* Separator before catalog */
  .tai-app.tai-workspace .tai-search-wrap {
    border-top: 2px solid #F3F4F6;
    background: #fff;
  }

  .tai-app.tai-workspace .tai-advanced { display: none; }

  /* Image defines the viewer height — natural aspect ratio, no cropping */
  .tai-app.tai-workspace .tai-room-img {
    display: block;
    width: 100%;
    /* Override base height:100% — let the image's intrinsic ratio set the height */
    height: auto !important;
    max-height: none;
    object-fit: fill;   /* width=100%, height=auto → no letterboxing, no cropping */
    position: static;   /* ensure it's in the normal flow so viewer wraps around it */
  }

  /* Default sidebar sizing (non-workspace initial state) */
  .tai-sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    max-height: none;   /* let it grow to content — body scroll handles overflow */
    border-right: none;
    border-bottom: 1px solid #E5E7EB;
  }

  /* Mobile: sidebar collapses to full width, so re-center the back-to-top
     button on the viewport (which now equals the products column width). */
  .tai-back-top {
    left: 50%;
  }

  /* Viewer fills remaining space in initial empty state */
  .tai-viewer {
    flex: 1;
    min-height: 200px;
    padding-bottom: 64px;
  }

  /* Sidebar body: bottom padding for iOS safe area + expand button clearance */
  .tai-sb-body {
    padding-bottom: calc(115px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tai-used-panel {
    display: none;
  }

  /* Render button: fixed bar at screen bottom */
  .tai-sb-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    border-top: 1px solid #E5E7EB;
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
  }

  /* Viewer toolbar: fixed to viewport above the render button */
  .tai-viewer-toolbar {
    position: fixed;
    bottom: 74px;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Toast stack: lift above the mobile viewer-toolbar (~74px + ~42px tall)
     so it never hides the action icons. */
  .tai-toasts {
    bottom: 128px;
  }

  /* Chat FAB: above the fixed render button */
  .tai-chat-fab {
    right: 16px;
    bottom: 80px;
  }

  .tai-chat-panel {
    right: 12px;
    bottom: 144px;
    max-width: calc(100vw - 24px);
    max-height: 60vh;
  }

  /* Product grid: 5 compact columns on mobile */
  .tai-products-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    padding: 0 8px 8px;
  }

  .tai-product-card {
    border-radius: 3px;
    border-width: 1.5px;
  }

  /* Product name: up to two wrapped lines so full names remain readable */
  .tai-product-name {
    font-size: 9px;
    line-height: 1.2;
    padding: 2px 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    overflow: hidden;
    min-height: 2.4em;
  }

  /* Expand button: full-width, easy tap target */
  .tai-products-expand-btn {
    width: calc(100% - 16px);
    margin: 6px 8px 8px;
    padding: 9px 0;
    font-size: 11px;
  }

  /* Upload zone: more prominent in empty state on mobile */
  .tai-app:has(.tai-viewer-placeholder:not(.tai-hidden)) .tai-upload-zone {
    padding: 36px 16px;
    border-color: #A7F3D0;
    background: #F0FDF4;
  }

  .tai-app:has(.tai-viewer-placeholder:not(.tai-hidden)) .tai-upload-icon {
    width: 56px;
    height: 56px;
    background: #D1FAE5;
    color: #16A34A;
  }
}

/* ================================================================
   DESIGN FLOW: Product slots + embedded chat
   ================================================================ */

.tai-design-flow-section {
  border: 1.5px solid #e8f4e8;
  background: linear-gradient(135deg, #f8fdf8 0%, #f0f9f0 100%);
  border-radius: 10px;
  margin: 8px 12px;
  padding: 12px;
}

.tai-design-flow-section .tai-sb-section-label {
  color: #2d7a2d;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  font-size: 11.5px;
  padding: 0;
}

/* Product slots */
/* Slots row */
.tai-design-slots {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: flex-start;
}

/* The square box for each surface */
.tai-design-slot {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1.5px dashed #c8e6c8;
  background: #fff;
  padding: 9px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .2s, background .2s;
}

.tai-design-slot.filled {
  border-style: solid;
  border-color: #81c784;
  background: #f6fbf6;
}

.tai-design-slot.empty {
  cursor: pointer;
}

.tai-design-slot.empty:hover {
  border-color: #5a9a5a;
  background: #f0faf0;
}

/* Box header: icon + label + counter */
.tai-slot-box-header {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #3a7a3a;
}

.tai-slot-box-label {
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tai-slot-box-count {
  font-size: 9px;
  font-weight: 600;
  background: #e8f5e8;
  color: #5a8a5a;
  border-radius: 8px;
  padding: 1px 5px;
}

.tai-slot-box-count.full {
  background: #ffebee;
  color: #c62828;
}

/* Body: chips or empty hint */
.tai-slot-box-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tai-slot-empty-hint {
  font-size: 9.5px;
  color: #a8c4a8;
  font-style: italic;
}

.tai-slot-add-hint {
  font-size: 9px;
  color: #78a878;
  font-style: italic;
  margin-top: 1px;
}

/* Individual product chip */
.tai-slot-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #e8f5e8;
  border: 1px solid #b2d8b2;
  border-radius: 20px;
  padding: 3px 5px 3px 9px;
  min-width: 0;
}

.tai-slot-chip-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}

.tai-slot-chip-name {
  font-size: 10px;
  font-weight: 500;
  color: #2e6e2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tai-slot-chip-scope {
  font-size: 8.5px;
  font-weight: 500;
  color: #5c885c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.1px;
}

.tai-slot-chip-rm {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: none;
  background: #ffcdd2;
  color: #c62828;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s;
}

.tai-slot-chip-rm:hover {
  background: #ef9a9a;
}

/* Embedded chat */
.tai-design-chat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.tai-design-chat-msgs {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.tai-design-msg {
  display: flex;
  gap: 6px;
  animation: tai-fadeIn .2s ease;
}

.tai-design-msg.bot { align-self: flex-start; max-width: 92%; }
.tai-design-msg.user { align-self: flex-end; flex-direction: row-reverse; max-width: 85%; }

.tai-design-bubble {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.5;
}

.tai-design-msg.bot .tai-design-bubble {
  background: #fff;
  color: #333;
  border: 1px solid #d8ecd8;
  border-radius: 2px 10px 10px 10px;
}

.tai-design-msg.user .tai-design-bubble {
  background: #2d7a2d;
  color: #fff;
  border-radius: 10px 2px 10px 10px;
}

.tai-design-chat-input-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.tai-design-chat-textarea {
  flex: 1;
  border: 1.5px solid #c8e6c8;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: #fff;
  color: #333;
  transition: border-color .15s;
  line-height: 1.4;
}

.tai-design-chat-textarea:focus {
  border-color: #4caf50;
}

.tai-design-chat-send {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #4caf50;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
  padding: 0;
}

.tai-design-chat-send:hover {
  background: #388e3c;
}

.tai-design-chat-send:disabled {
  background: #a5d6a7;
  cursor: not-allowed;
}

/* Attach (paperclip) button — shares sizing with send, softer ghost style. */
.tai-design-chat-attach {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid #c8e6c8;
  background: #fff;
  color: #2d7a2d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: border-color .15s, background .15s, color .15s;
}

.tai-design-chat-attach:hover {
  border-color: #4caf50;
  background: #f1f8f1;
}

.tai-design-chat-attach:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Staged-attachment thumbnails above the composer. */
.tai-design-chat-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 2px 0;
}

.tai-design-chat-thumb {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #c8e6c8;
  background: #f4faf4;
  flex-shrink: 0;
}

.tai-design-chat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tai-design-chat-thumb-rm {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 20, 20, 0.72);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.tai-design-chat-thumb-rm:hover {
  background: rgba(20, 20, 20, 0.9);
}

/* Drag-over highlight over the chat area while dragging files. */
.tai-design-chat--drag .tai-design-chat-textarea {
  border-color: #4caf50;
  background: #f4faf4;
}

/* Image grid inside a user bubble (sent attachments). */
.tai-design-bubble-imgs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 4px;
  max-width: 220px;
}

.tai-design-bubble-imgs img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.tai-design-bubble-caption {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.4;
}

/* "Thinking…" dots while Claude is analysing the image. */
.tai-design-typing .tai-design-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
}

.tai-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #99c299;
  animation: tai-typing-bounce 1.1s infinite ease-in-out both;
}

.tai-typing-dot:nth-child(2) { animation-delay: .15s; }
.tai-typing-dot:nth-child(3) { animation-delay: .3s; }

@keyframes tai-typing-bounce {
  0%, 80%, 100% { transform: scale(.7); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Generate button */
.tai-design-gen-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #2d7a2d 0%, #1b5e20 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(45,122,45,.35);
}

.tai-design-gen-btn:hover {
  opacity: .92;
  transform: translateY(-1px);
}

.tai-design-gen-btn:active {
  transform: translateY(0);
}

/* Spinning gear icon during generation */
.tai-gen-icon-spin {
  animation: tai-spin 800ms linear infinite;
  flex-shrink: 0;
}

.tai-design-gen-btn:disabled {
  opacity: .75;
  cursor: not-allowed;
  transform: none;
}

/* ---- "Înapoi sus" — pinned to the bottom of the products column.
   Desktop: centered inside the 248px-wide left sidebar (the products
   selection area), NOT over the viewer. Mobile workspace mode: the
   sidebar collapses into a full-width column, so we center on the
   viewport instead. ---- */
.tai-back-top {
  position: fixed;
  /* 248px sidebar → center is at 124px from viewport left edge */
  left: 124px;
  transform: translateX(-50%);
  /* Above iOS Safari/Chrome nav bar */
  bottom: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1.5px solid #D1D5DB;
  border-radius: 20px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  opacity: 1;
  pointer-events: auto;
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 150ms;
  white-space: nowrap;
}

.tai-back-top:hover {
  background: #F9FAFB;
  border-color: #9CA3AF;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.tai-back-top:active {
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.tai-back-top--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

/* Redesign Complet AI — lime variant in right sidebar */
.tai-render-btn.tai-render-btn--lime {
  margin-top: 8px;
  background: #84cc16;
  box-shadow: 0 2px 8px rgba(132,204,22,0.35);
  color: #1a2e05;
}

.tai-render-btn.tai-render-btn--lime:hover {
  background: #65a30d;
  box-shadow: 0 4px 14px rgba(132,204,22,0.45);
}

.tai-render-btn.tai-render-btn--lime .tai-credit-badge {
  background: rgba(0,0,0,0.15);
  color: #1a2e05;
}

/* Product card highlight for tagged products */
.tai-product-card.tagged-floor::after,
.tai-product-card.tagged-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.tai-product-card.tagged-floor {
  border-color: #4caf50;
  box-shadow: 0 0 0 2px rgba(76,175,80,.3);
}

.tai-product-card.tagged-floor::before {
  content: "🏠";
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 10px;
  line-height: 1;
  z-index: 2;
}

.tai-product-card.tagged-wall {
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33,150,243,.3);
}

.tai-product-card.tagged-wall::before {
  content: "🧱";
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 10px;
  line-height: 1;
  z-index: 2;
}

/* Product tag modal */
.tai-tag-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: tai-fadeIn .15s ease;
}

.tai-tag-modal {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  width: min(340px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

.tai-tag-modal-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tai-tag-modal-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid #e0e0e0;
  flex-shrink: 0;
}

.tai-tag-modal-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tai-tag-modal-name {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  line-height: 1.3;
}

.tai-tag-modal-sku {
  font-size: 11px;
  color: #888;
}

.tai-tag-modal-label {
  font-size: 12px;
  color: #555;
  font-weight: 500;
  text-align: center;
}

.tai-tag-modal-btns {
  display: flex;
  gap: 10px;
}

.tai-tag-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 10px;
  border: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all .15s;
}

.tai-tag-btn.floor {
  background: #f1f9f1;
  border-color: #81c784;
  color: #2d7a2d;
}

.tai-tag-btn.floor:hover {
  background: #e1f4e1;
  border-color: #4caf50;
}

.tai-tag-btn.wall {
  background: #e8f4ff;
  border-color: #90caf9;
  color: #1565c0;
}

.tai-tag-btn.wall:hover {
  background: #d4eaff;
  border-color: #2196f3;
}

.tai-tag-btn.current {
  border-style: solid;
  border-width: 2.5px;
  font-weight: 700;
}

.tai-tag-btn.full {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.tai-tag-btn.full small {
  font-size: 9px;
  font-weight: 400;
}

/* Body wrapper that swaps between screen A (floor/wall) and screen B
   (per-wall picker) without rebuilding the modal shell. */
.tai-tag-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tai-tag-btn-caret {
  margin-left: auto;
  font-size: 18px;
  line-height: 0.9;
  opacity: 0.7;
}

.tai-tag-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: #1565c0;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  transition: background .12s, color .12s;
}

.tai-tag-back:hover {
  background: #eaf3fc;
  color: #0d47a1;
}

.tai-tag-back span {
  font-size: 16px;
  line-height: 0.9;
}

/* Per-wall picker (screen B) */
.tai-tag-wall-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tai-tag-wall-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f5f9ff;
  border: 1.5px solid #cfe0f5;
  border-radius: 10px;
  color: #1565c0;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .14s, border-color .14s, transform .08s;
}

.tai-tag-wall-btn:hover {
  background: #e6effc;
  border-color: #90caf9;
}

.tai-tag-wall-btn:active {
  transform: scale(0.98);
}

.tai-tag-wall-btn.current {
  background: #e3f2fd;
  border-color: #1976d2;
  border-width: 2px;
  font-weight: 600;
}

.tai-tag-wall-btn.all {
  background: linear-gradient(180deg, #e8f4ff 0%, #d7eafa 100%);
  border-color: #64b5f6;
  color: #0d47a1;
  font-weight: 600;
  padding: 12px 14px;
}

.tai-tag-wall-btn.all:hover {
  background: linear-gradient(180deg, #dcecfa 0%, #c5ddf5 100%);
  border-color: #1976d2;
}

.tai-tag-wall-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
}

.tai-tag-wall-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tai-tag-wall-sub {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 500;
  color: #5a7a9a;
  background: rgba(255, 255, 255, 0.55);
  padding: 2px 7px;
  border-radius: 10px;
}

.tai-tag-wall-btn.current .tai-tag-wall-sub {
  background: #1976d2;
  color: #fff;
}

.tai-tag-wall-sep {
  font-size: 10.5px;
  font-weight: 500;
  color: #9aa0a6;
  text-align: center;
  letter-spacing: 0.3px;
  margin: 4px 0 2px;
  position: relative;
}

.tai-tag-wall-sep::before,
.tai-tag-wall-sep::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26%;
  height: 1px;
  background: #e0e4ea;
}

.tai-tag-wall-sep::before { left: 0; }
.tai-tag-wall-sep::after  { right: 0; }

/* ── Multi-select checkbox variant for per-wall buttons ──────────────── */
.tai-tag-wall-btn.check {
  position: relative;
}

.tai-tag-wall-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.tai-tag-wall-check-box {
  color: #90caf9;
  transition: color .14s;
}

.tai-tag-wall-check-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  color: #fff;
  opacity: 0;
  transition: opacity .12s, transform .12s;
}

.tai-tag-wall-btn.check.selected {
  background: #e3f2fd;
  border-color: #1976d2;
  border-width: 2px;
  padding: 9px 11px; /* compensate +1 border */
  font-weight: 600;
}

.tai-tag-wall-btn.check.selected .tai-tag-wall-check-box {
  color: #1976d2;
  fill: #1976d2;
}

.tai-tag-wall-btn.check.selected .tai-tag-wall-check-mark {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tai-tag-wall-btn.check.taken {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f3f5f7;
  border-color: #d7dde3;
  color: #78909c;
}

.tai-tag-wall-btn.check.taken:hover {
  background: #f3f5f7;
  border-color: #d7dde3;
  transform: none;
}

.tai-tag-wall-btn.check.taken .tai-tag-wall-check-box {
  color: #b0bec5;
}

/* Walls that currently hold a DIFFERENT product — selecting them replaces
   what's there. Warm-amber accent so the user sees the consequence. */
.tai-tag-wall-btn.check.replace {
  border-color: #f3b851;
  background: #fff8e8;
}
.tai-tag-wall-btn.check.replace:hover {
  background: #fff1d0;
  border-color: #e09a2a;
}
.tai-tag-wall-btn.check.replace.selected {
  border-color: #d97706;
  background: #fff3cf;
}
.tai-tag-wall-btn.check.replace .tai-tag-wall-check-box {
  color: #e09a2a;
}
.tai-tag-wall-replace {
  color: #b45309 !important;
  font-weight: 600;
}

/* ── Apply button + hint ─────────────────────────────────────────────── */
.tai-tag-wall-hint {
  margin-top: 8px;
  font-size: 11.5px;
  color: #d84315;
  text-align: center;
  line-height: 1.35;
}

.tai-tag-wall-hint.tai-hidden {
  display: none;
}

.tai-tag-wall-apply {
  margin-top: 10px;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #1e88e5 0%, #1565c0 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px rgba(21, 101, 192, 0.25);
  transition: background .14s, transform .08s, box-shadow .14s, opacity .14s;
}

.tai-tag-wall-apply:hover:not(:disabled) {
  background: linear-gradient(180deg, #1976d2 0%, #0d47a1 100%);
  box-shadow: 0 3px 10px rgba(21, 101, 192, 0.35);
}

.tai-tag-wall-apply:active:not(:disabled) {
  transform: scale(0.985);
}

.tai-tag-wall-apply:disabled {
  background: #cfd8dc;
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.85;
}

.tai-tag-cancel {
  background: none;
  border: none;
  color: #999;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  text-decoration: underline;
}

.tai-tag-cancel:hover { color: #555; }
