
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --sidebar-bg: #f7f8fa;
      --sidebar-surface: #ffffff;
      --chat-blue: #1a73e8;
      --chat-blue-light: #e8f0fd;
      --chat-blue-mid: #4a90d9;
      --text-primary: #1c1e21;
      --text-secondary: #65676b;
      --text-muted: #90949c;
      --border-color: #e4e6eb;
      --border-hover: #c4c8d0;
      --green-online: #44b700;
      --tag-bg: rgba(26,115,232,0.08);
      --tag-border: rgba(26,115,232,0.2);
      --border-subtle: #e4e6eb;
      --amber: #C8833A;
      --amber-light: #E8A85A;
    }

    html, body {
      height: 100%;
      font-family: 'DM Sans', sans-serif;
      background-color: #f0f2f5;
      color: var(--text-primary);
      overflow: hidden;
    }

    body::before, body::after { display: none; }

    .page {
      position: relative;
      z-index: 1;
      display: grid;
      grid-template-columns: 340px 1fr;
      height: 100vh;
      height: 100dvh;
    }

    /* ── SIDEBAR ── */
    .sidebar {
      display: flex;
      flex-direction: column;
      padding: 28px 24px 20px;
      border-right: 1px solid var(--border-color);
      position: relative;
      overflow: hidden;
      gap: 0;
      background: var(--sidebar-bg);
    }
    .sidebar::before, .sidebar::after { display: none; }

    .sidebar-panel {
      position: relative;
      z-index: 1;
      flex: 1;
      display: none;
      flex-direction: column;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: none;
    }
    .sidebar-panel::-webkit-scrollbar { display: none; }
    .sidebar-panel.active { display: flex; }

    .panel-tag {
      display: inline-block;
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 2px;
      text-transform: uppercase;
      color: var(--chat-blue);
      margin-bottom: 14px;
      padding: 4px 10px;
      border: 1px solid var(--tag-border);
      border-radius: 4px;
      background: var(--tag-bg);
      align-self: flex-start;
    }

    .panel-heading {
      font-family: 'Playfair Display', serif;
      font-size: 22px;
      font-weight: 700;
      color: var(--text-primary);
      line-height: 1.2;
      margin-bottom: 6px;
    }

    .panel-sub {
      font-size: 12px;
      color: var(--text-secondary);
      line-height: 1.65;
      margin-bottom: 12px;
    }

    /* ── BRAND PANEL ── */
    #panel-brand { gap: 0; }

    .brand-name {
      font-family: 'Playfair Display', serif;
      font-size: 36px;
      font-weight: 700;
      line-height: 1.05;
      color: var(--text-primary);
    }
    .brand-name span {
      color: var(--chat-blue);
      font-style: italic;
      font-weight: 400;
    }

    .brand-sub {
      font-size: 13px;
      color: var(--text-secondary);
      font-weight: 300;
      margin-top: 12px;
      line-height: 1.7;
      max-width: 240px;
    }

    .divider {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 20px 0;
    }
    .divider-line { flex: 1; height: 1px; background: var(--border-color); }
    .divider-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--chat-blue); opacity: 0.4; }

    .features {
      display: flex;
      flex-direction: column;
      gap: 16px;
      padding: 8px 4px;
    }

    .feature {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      background: none !important;
      border: none !important;
      box-shadow: none !important;
      padding: 0 !important;
      opacity: 0;
      transform: translateX(-10px);
      animation: slideIn 0.45s ease forwards;
    }
    .feature:hover {
      box-shadow: none !important;
      border-color: transparent !important;
    }
    .feature:nth-child(1) { animation-delay: 0.2s; }
    .feature:nth-child(2) { animation-delay: 0.35s; }
    .feature:nth-child(3) { animation-delay: 0.5s; }
    .feature:nth-child(4) { animation-delay: 0.65s; }
    .feature:nth-child(5) { animation-delay: 0.8s; }

    .feature.vision-feature {
      background: none !important;
      border: none !important;
    }

    .feature-icon {
      width: 24px;
      height: 24px;
      background: transparent !important;
      border: none !important;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
      margin-top: 2px;
    }

    .feature-text {
      font-size: 12.5px;
      color: var(--text-secondary);
      line-height: 1.5;
    }
    .feature-text strong {
      display: inline-flex;
      align-items: center;
      color: var(--text-primary);
      font-weight: 600;
      font-size: 13.5px;
      margin-bottom: 3px;
    }
    .vision-feature .feature-text strong { color: var(--chat-blue); }

    /* ── SUB-PANELS NAVIGATION ── */
    .panel-header-nav {
      margin-bottom: 16px;
      display: flex;
      align-items: center;
    }
    .panel-back-btn {
      background: none;
      border: none;
      font-size: 12px;
      color: var(--text-secondary);
      font-family: 'DM Sans', sans-serif;
      font-weight: 500;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 2px 0;
      transition: color 0.2s, transform 0.2s;
    }
    .panel-back-btn:hover {
      color: var(--chat-blue);
      transform: translateX(-2px);
    }

    /* ── MOBILE STATE CONTROLS ── */
    .sidebar-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.4);
      backdrop-filter: blur(3px);
      z-index: 998;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar-backdrop.visible {
      opacity: 1;
      pointer-events: auto;
    }

    .sidebar-close-btn {
      display: none;
    }

    .menu-toggle-btn {
      display: none;
      background: none;
      border: none;
      font-size: 20px;
      color: var(--text-primary);
      cursor: pointer;
      padding: 4px 8px;
      align-items: center;
      justify-content: center;
      border-radius: 6px;
      transition: background-color 0.2s;
    }
    .menu-toggle-btn:hover {
      background-color: var(--sidebar-bg);
    }

    /* ── VISION PANEL ── */
    #panel-vision { gap: 12px; }

    .drop-zone {
      border: 1.5px dashed var(--border-hover);
      border-radius: 10px;
      padding: 20px 14px;
      text-align: center;
      cursor: pointer;
      transition: all 0.25s;
      background: var(--sidebar-surface);
      position: relative;
      flex-shrink: 0;
    }
    .drop-zone:hover, .drop-zone.dragging {
      border-color: var(--chat-blue);
      background: var(--chat-blue-light);
    }
    .drop-zone input[type="file"] {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      width: 100%;
      height: 100%;
    }
    .drop-icon { font-size: 28px; margin-bottom: 6px; display: block; }
    .drop-label { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; }
    .drop-label span { color: var(--chat-blue); font-weight: 600; }

    .img-preview-wrap {
      display: none;
      position: relative;
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid var(--border-color);
      flex-shrink: 0;
    }
    .img-preview-wrap.visible { display: block; }
    .img-preview { width: 100%; height: 130px; object-fit: cover; display: block; }
    .img-preview-overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 50%);
      display: flex;
      align-items: flex-end;
      padding: 8px 10px;
    }
    .img-change-btn {
      font-size: 11px;
      color: #fff;
      cursor: pointer;
      background: none;
      border: none;
      font-family: 'DM Sans', sans-serif;
      padding: 0;
      font-weight: 500;
    }
    .img-change-btn:hover { color: #c8e0ff; }

    .or-divider {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 11px;
      color: var(--text-muted);
      flex-shrink: 0;
    }
    .or-divider::before, .or-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border-color);
    }

    .camera-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 9px;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: var(--sidebar-surface);
      color: var(--text-primary);
      font-size: 12px;
      font-family: 'DM Sans', sans-serif;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
      flex-shrink: 0;
    }
    .camera-btn:hover {
      border-color: var(--chat-blue);
      background: var(--chat-blue-light);
      color: var(--chat-blue);
    }

    .scan-status {
      display: none;
      align-items: center;
      gap: 10px;
      font-size: 12px;
      color: var(--text-secondary);
      flex-shrink: 0;
    }
    .scan-status.visible { display: flex; }
    .scan-spinner {
      width: 13px; height: 13px;
      border: 2px solid rgba(26,115,232,0.2);
      border-top-color: var(--chat-blue);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      flex-shrink: 0;
    }

    .scan-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 11px;
      border-radius: 8px;
      border: none;
      background: var(--chat-blue);
      color: #fff;
      font-size: 13px;
      font-family: 'DM Sans', sans-serif;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      flex-shrink: 0;
    }
    .scan-btn:hover { background: var(--chat-blue-mid); }
    .scan-btn:disabled { opacity: 0.35; cursor: not-allowed; }

    /* ── INGREDIENTS PANEL ── */
    #panel-ingredients { gap: 12px; }

    .tags-wrap {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-top: 2px;
    }

    .ing-tag {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: 20px;
      background: var(--chat-blue-light);
      border: 1px solid var(--tag-border);
      font-size: 11.5px;
      color: var(--chat-blue);
      opacity: 0;
      transform: scale(0.85);
      animation: tagPop 0.3s ease forwards;
      cursor: default;
    }
    .ing-tag-dot {
      width: 4px; height: 4px;
      border-radius: 50%;
      background: var(--chat-blue);
      flex-shrink: 0;
    }

    .use-ingredients-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 11px;
      border-radius: 8px;
      border: none;
      background: var(--chat-blue);
      color: #fff;
      font-size: 13px;
      font-family: 'DM Sans', sans-serif;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      flex-shrink: 0;
    }
    .use-ingredients-btn:hover { background: var(--chat-blue-mid); }

    .rescan-link {
      text-align: center;
      font-size: 11px;
      color: var(--text-muted);
      cursor: pointer;
      transition: color 0.2s;
      flex-shrink: 0;
    }
    .rescan-link:hover { color: var(--chat-blue); }

    /* ── RECIPE PANEL ── */
    #panel-recipe { gap: 12px; }

    .recipe-img-wrap {
      width: 100%;
      height: 190px;
      border-radius: 12px;
      overflow: hidden;
      position: relative;
      border: 1px solid var(--border-color);
      box-shadow: 0 8px 20px rgba(0,0,0,0.08);
      flex-shrink: 0;
    }

    .recipe-img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      background-color: var(--sidebar-bg);
      display: none;
      transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    }
    .recipe-img.visible {
      display: block;
    }
    .recipe-img-wrap:hover .recipe-img {
      transform: scale(1.05);
    }

    /* Image loading skeleton */
    .recipe-img-skeleton {
      width: 100%;
      height: 100%;
      position: absolute;
      inset: 0;
      border-radius: 11px;
      background: linear-gradient(90deg, #e4e6eb 25%, #f0f2f5 50%, #e4e6eb 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s infinite;
      display: none;
    }
    .recipe-img-skeleton.visible {
      display: block;
    }

    @keyframes shimmer {
      0% { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }

    .recipe-name {
      font-family: 'Playfair Display', serif;
      font-size: 19px;
      font-weight: 700;
      color: var(--text-primary);
      line-height: 1.2;
    }

    .recipe-meta-row {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .meta-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 9px;
      border-radius: 20px;
      background: var(--chat-blue-light);
      border: 1px solid var(--tag-border);
      font-size: 11px;
      color: var(--chat-blue);
    }

    .nutrition-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
    }

    .nutrition-card {
      background: var(--sidebar-surface);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 8px 4px;
      text-align: center;
    }
    .nutrition-value {
      font-size: 16px;
      font-weight: 700;
      color: var(--chat-blue);
      font-family: 'Playfair Display', serif;
      line-height: 1;
    }
    .nutrition-label {
      font-size: 9.5px;
      color: var(--text-muted);
      margin-top: 3px;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }

    .new-recipe-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 9px;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: var(--sidebar-surface);
      color: var(--text-secondary);
      font-size: 12px;
      font-family: 'DM Sans', sans-serif;
      cursor: pointer;
      transition: all 0.2s;
      flex-shrink: 0;
    }
    .new-recipe-btn:hover {
      border-color: var(--chat-blue);
      color: var(--chat-blue);
      background: var(--chat-blue-light);
    }
	/* - suggestion cards */
	 .suggestions-list {
	  display: flex;
	  flex-direction: column;
	  gap: 10px;
	  margin-top: 8px;
	}

	.suggestion-card {
	  border-radius: 10px;
	  overflow: hidden;
	  border: 1px solid var(--border-color);
	  background: var(--sidebar-surface);
	  cursor: pointer;
	  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
	}
	.suggestion-card:hover {
	  box-shadow: 0 6px 16px rgba(26,115,232,0.12);
	  border-color: var(--tag-border);
	  transform: translateY(-2px);
	}

	.suggestion-card-img-wrap {
	  width: 100%;
	  height: 130px;
	  position: relative;
	  overflow: hidden;
	  background: var(--sidebar-bg);
	}

	.suggestion-card-img {
	  width: 100%;
	  height: 100%;
	  object-fit: cover;
	  display: block;
	  transition: transform 0.5s ease;
	}
	.suggestion-card:hover .suggestion-card-img {
	  transform: scale(1.04);
	}

	.suggestion-card-img-skeleton {
	  width: 100%;
	  height: 100%;
	  position: absolute;
	  inset: 0;
	  background: linear-gradient(90deg, #e4e6eb 25%, #f0f2f5 50%, #e4e6eb 75%);
	  background-size: 200% 100%;
	  animation: shimmer 1.5s infinite;
	  display: none;
	}
	.suggestion-card-img-skeleton.visible {
	  display: block;
	}

	.suggestion-card-body {
	  padding: 8px 10px;
	}

	.suggestion-card-name {
	  font-size: 12.5px;
	  font-weight: 600;
	  color: var(--text-primary);
	  line-height: 1.3;
	  margin-bottom: 3px;
	}

	.suggestion-card-desc {
	  font-size: 11px;
	  color: var(--text-muted);
	  line-height: 1.4;
	}
    /* ── CAMERA MODAL ── */
    .camera-modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(255,255,255,0.92);
      backdrop-filter: blur(10px);
      z-index: 200;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 20px;
    }
    .camera-modal.open { display: flex; }

    .camera-modal-label {
      font-size: 12px;
      color: var(--text-secondary);
      letter-spacing: 1px;
      text-transform: uppercase;
    }

    .camera-video-wrap {
      position: relative;
      border-radius: 14px;
      overflow: hidden;
      border: 1.5px solid var(--border-color);
      max-width: 500px;
      width: 90vw;
      box-shadow: 0 8px 40px rgba(0,0,0,0.1);
    }
    #camera-video {
      width: 100%;
      display: block;
      background: #f0f2f5;
      max-height: 60vh;
      object-fit: cover;
    }

    .camera-guide {
      position: absolute;
      width: 20px; height: 20px;
      border-color: var(--chat-blue);
      border-style: solid;
      opacity: 0.7;
    }
    .camera-guide.tl { top: 10px; left: 10px; border-width: 2px 0 0 2px; }
    .camera-guide.tr { top: 10px; right: 10px; border-width: 2px 2px 0 0; }
    .camera-guide.bl { bottom: 10px; left: 10px; border-width: 0 0 2px 2px; }
    .camera-guide.br { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }

    .camera-controls { display: flex; align-items: center; gap: 16px; }

    .capture-btn {
      width: 58px; height: 58px;
      border-radius: 50%;
      border: 3px solid var(--chat-blue);
      background: transparent;
      cursor: pointer;
      position: relative;
      transition: transform 0.15s;
    }
    .capture-btn::after {
      content: '';
      position: absolute;
      inset: 5px;
      border-radius: 50%;
      background: var(--chat-blue);
      transition: all 0.15s;
    }
    .capture-btn:hover { transform: scale(1.05); }
    .capture-btn:hover::after { background: var(--chat-blue-mid); }
    .capture-btn:active { transform: scale(0.95); }

    .cancel-camera-btn {
      padding: 9px 18px;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: var(--sidebar-surface);
      color: var(--text-secondary);
      font-family: 'DM Sans', sans-serif;
      font-size: 12px;
      cursor: pointer;
      transition: all 0.2s;
    }


    .cancel-camera-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }

    #camera-canvas { display: none; }

    /* ── SIDEBAR FOOTER ── */
    .sidebar-footer {
      position: relative;
      z-index: 1;
      flex-shrink: 0;
      padding-top: 14px;
      border-top: 1px solid var(--border-color);
      margin-top: 14px;
    }

    .vision-toggle-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 13px 20px;
      border-radius: 10px;
      border: none;
      background: linear-gradient(135deg, var(--chat-blue) 0%, #357ae8 100%);
      color: #ffffff;
      font-size: 13.5px;
      font-family: 'DM Sans', sans-serif;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      width: 100%;
      text-align: center;
      box-shadow: 0 4px 14px rgba(26, 115, 232, 0.25);
    }
    .vision-toggle-btn:hover {
      background: linear-gradient(135deg, #257ff2 0%, #1a73e8 100%);
      box-shadow: 0 6px 18px rgba(26, 115, 232, 0.4);
      transform: translateY(-1.5px) scale(1.015);
    }
    .vision-toggle-btn:active {
      transform: translateY(0.5px) scale(0.985);
      box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
    }
    .vision-toggle-btn.active {
      background: #e1e3e6;
      color: var(--text-primary);
      border: 1px solid var(--border-hover);
      box-shadow: none;
    }
    .vision-toggle-icon {
      font-size: 15px;
      flex-shrink: 0;
      transition: transform 0.25s ease;
    }
    .vision-toggle-btn:hover .vision-toggle-icon {
      transform: scale(1.15) rotate(-5deg);
    }

    .made-by { font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px; }
    .made-by span { color: var(--chat-blue); font-weight: 500; }

    /* ── CHAT PANEL ── */
    .chat-wrapper {
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
      background: #fff;
    }

    .chat-topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 24px;
      border-bottom: 1px solid var(--border-color);
      background: #fff;
      flex-shrink: 0;
    }

    .status-pill {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: var(--text-secondary);
      font-weight: 500;
      letter-spacing: 0.3px;
    }
    .status-dot {
      width: 7px; height: 7px;
      border-radius: 50%;
      background: var(--green-online);
      box-shadow: 0 0 6px var(--green-online);
      animation: pulse 2.5s ease-in-out infinite;
    }

    .topbar-right { display: flex; align-items: center; gap: 8px; }

    .topbar-vision-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: 6px;
      border: 1px solid var(--border-color);
      background: var(--sidebar-bg);
      color: var(--text-secondary);
      font-size: 11.5px;
      font-family: 'DM Sans', sans-serif;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
    }
    .topbar-vision-btn:hover {
      border-color: var(--chat-blue);
      color: var(--chat-blue);
      background: var(--chat-blue-light);
    }

    .topbar-actions { display: flex; gap: 6px; }

    .action-btn {
      width: 30px; height: 30px;
      border-radius: 6px;
      border: 1px solid var(--border-color);
      background: var(--sidebar-bg);
      color: var(--text-secondary);
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      font-size: 13px;
      transition: all 0.2s;
    }
    .action-btn:hover {
      border-color: var(--chat-blue);
      color: var(--chat-blue);
      background: var(--chat-blue-light);
    }

    /* ── CHAT CONTAINER ── */
    #bg-chat {
      flex: 1;
      position: relative;
      overflow: hidden;
      background: #f7f8fa;
    }

    .ingredient-float {
      position: absolute;
      font-size: 22px;
      opacity: 0.04;
      pointer-events: none;
      animation: floatDrift 8s ease-in-out infinite;
      z-index: 0;
    }
    .ingredient-float:nth-child(1) { top: 12%; left: 8%; animation-delay: 0s; }
    .ingredient-float:nth-child(2) { top: 25%; right: 10%; animation-delay: 1.5s; }
    .ingredient-float:nth-child(3) { bottom: 30%; left: 12%; animation-delay: 3s; }
    .ingredient-float:nth-child(4) { bottom: 15%; right: 8%; animation-delay: 2s; }
    .ingredient-float:nth-child(5) { top: 55%; left: 50%; animation-delay: 4s; }

    .chat-placeholder {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 14px;
      pointer-events: none;
      transition: opacity 0.6s;
      z-index: 1;
    }
    .chef-icon { font-size: 52px; animation: float 3s ease-in-out infinite; }
    .loading-text {
      font-family: 'Playfair Display', serif;
      font-size: 18px;
      color: var(--text-muted);
      font-style: italic;
    }
    .loading-dots { display: flex; gap: 6px; }
    .loading-dots span {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--chat-blue);
      opacity: 0.4;
      animation: dotBounce 1.4s ease-in-out infinite;
    }
    .loading-dots span:nth-child(2) { animation-delay: 0.2s; }
    .loading-dots span:nth-child(3) { animation-delay: 0.4s; }

    #bg-chat > div[class*="bpWebchat"],
    #bg-chat > div[id*="botpress"],
    #bg-chat iframe {
      position: absolute !important;
      inset: 0 !important;
      width: 100% !important;
      height: 100% !important;
      border: none !important;
      border-radius: 0 !important;
      z-index: 2;
    }

    /* ── TOAST ── */
    .toast {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%) translateY(70px);
      background: rgba(28,30,33,0.95);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 8px;
      padding: 9px 16px;
      font-size: 12.5px;
      color: #fff;
      z-index: 300;
      transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
      backdrop-filter: blur(10px);
      white-space: nowrap;
      pointer-events: none;
    }
    .toast.show { transform: translateX(-50%) translateY(0); }
    .toast-accent { color: #7eb3f5; font-weight: 500; }

    /* ── NOT READY OVERLAY ── */
    .not-ready-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(255,255,255,0.7);
      backdrop-filter: blur(4px);
      z-index: 150;
      align-items: center;
      justify-content: center;
    }
    .not-ready-overlay.show { display: flex; }
    .not-ready-box {
      background: #fff;
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 28px 32px;
      text-align: center;
      max-width: 300px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    }
    .not-ready-box p {
      font-size: 13px;
      color: var(--text-secondary);
      line-height: 1.6;
      margin-top: 8px;
    }
    .not-ready-box strong {
      font-family: 'Playfair Display', serif;
      font-size: 17px;
      color: var(--text-primary);
    }

    /* ── ANIMATIONS ── */
    @keyframes slideIn { to { opacity: 1; transform: translateX(0); } }
    @keyframes pulse {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.5; transform: scale(0.85); }
    }
    @keyframes float {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }
    @keyframes dotBounce {
      0%, 80%, 100% { transform: scale(1); opacity: 0.4; }
      40% { transform: scale(1.4); opacity: 1; }
    }
    @keyframes floatDrift {
      0%, 100% { transform: translate(0, 0) rotate(0deg); }
      33% { transform: translate(8px, -12px) rotate(5deg); }
      66% { transform: translate(-6px, 8px) rotate(-3deg); }
    }
    @keyframes tagPop { to { opacity: 1; transform: scale(1); } }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ── RESPONSIVE ── */
    @media (max-width: 768px) {
      .page {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
      }

      /* Style Sidebar as a Drawer Overlay */
      .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85vw;
        max-width: 320px;
        height: 100%;
        max-height: 100vh;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 15px 0 35px rgba(0, 0, 0, 0.15);
        border-right: 1px solid var(--border-color);
        background: var(--sidebar-bg);
        padding: 24px 20px;
      }

      .sidebar.drawer-open {
        transform: translateX(0);
      }

      /* Toggle elements display */
      .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 18px;
        right: 18px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--border-color);
        border: none;
        font-size: 20px;
        color: var(--text-secondary);
        cursor: pointer;
        z-index: 10;
        transition: background-color 0.2s;
      }
      .sidebar-close-btn:hover {
        background-color: var(--border-hover);
        color: var(--text-primary);
      }

      .menu-toggle-btn {
        display: flex;
      }

      .brand-name {
        font-size: 28px;
        margin-top: 12px;
      }

      /* Enable vision toggle and features on mobile */
      .features, .divider {
        display: flex;
      }

      /* Let all active panels render inside the drawer on mobile */
      .sidebar-panel {
        display: none;
      }
      .sidebar-panel.active {
        display: flex;
      }

      /* Adjust topbar visibility */
      .topbar-vision-btn {
        display: flex; /* Keep scan button visible for quick scan */
      }
      
      .topbar-actions .action-btn[title="Fullscreen"] {
        display: none; /* Hide fullscreen on mobile to save space */
      }
      
      /* Camera modal styling adjustments for mobile */
      .camera-video-wrap {
        width: 95vw;
        border-radius: 10px;
      }
      #camera-video {
        max-height: 50vh;
      }

      /* Lift the chat input box on mobile to prevent overlapping with system nav */
      #bg-chat > div[class*="bpWebchat"],
      #bg-chat > div[id*="botpress"],
      #bg-chat iframe {
        bottom: env(safe-area-inset-bottom, 12px) !important;
        height: calc(100% - env(safe-area-inset-bottom, 12px)) !important;
      }
    }
  