body.guest-mode .sidebar,
body.guest-mode #sidebar,
body.guest-mode #toggleSidebar,
body.guest-mode .sidebar-footer,
body.guest-mode #rightsidebar2,
body.guest-mode .sidebar2,
body.guest-mode #rightSidebar,
body.guest-mode .right-sidebar,
body.guest-mode .streak-indicator,
body.guest-mode .notification-wrapper,
body.guest-mode #modelSwitcher,
body.guest-mode #button-drop,
body.guest-mode #fileAttach,
body.guest-mode #documentInput,
body.guest-mode #document-attachment-container,
body.guest-mode #attachment-container,
body.guest-mode #uploadDocumentBtn,
body.guest-mode #toggleCanvasBtn,
body.guest-mode #toggleGraphBtn,
body.guest-mode #enebleThink,
body.guest-mode #openSubjectAIBtn,
body.guest-mode #open-conversation-gallery,
body.guest-mode #open-share-modal,
body.guest-mode #mindmap-open-btn,
body.guest-mode #mcqblust-gameyard-icon,
body.guest-mode #collab-mic-toggle,
body.guest-mode #conversation-gallery,
body.guest-mode #share-modal {
  display: none !important;
}
body.guest-mode .app-container {
  grid-template-columns: 1fr;
}
body.guest-mode .main-content {
  margin-left: 0 !important;
}
.guest-welcome-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.55);
  z-index: 1000001;
  padding: 24px;
}
.guest-welcome-lightbox.is-visible {
  display: flex;
}
.guest-welcome-card {
  width: min(520px, 92vw);
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
}
.guest-welcome-media img {
  display: block;
  width: 100%;
  height: auto;
}
.guest-welcome-content {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.guest-welcome-content h3 {
  margin: 0;
  font-size: 20px;
  color: #111827;
}
.guest-welcome-content p {
  margin: 0;
  font-size: 14px;
  color: #4b5563;
}
.guest-welcome-actions {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.guest-welcome-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
.guest-welcome-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111827;
  font-weight: 600;
  font-size: 13px;
}
.guest-cta {
  margin-top: 6px;
  font-size: 12px;
  color: #777;
  text-align: center;
}
.guest-new-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  font-size: 13px;
}
.guest-new-chat-btn:hover {
  border-color: #111827;
}
.guest-nav-stack {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
}
.guest-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px dashed #e5e7eb;
  background: #f9fafb;
  color: #111827;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
}
.guest-login-btn:hover {
  border-color: #111827;
}
.navbar-right {
  position: relative;
}
.streak-indicator {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin-right: 10px;
  border-radius: 999px;
  background: #fff2e6;
  border: 1px solid #f6c79f;
  color: #9a3412;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.streak-indicator.is-idle {
  background: #fff7ed;
}
.streak-day-count {
  min-width: 14px;
  text-align: center;
  display: none;
}
.streak-emoji img {
  display: block;
}
.streak-popover {
  position: absolute;
  right: 0;
  top: 42px;
  width: min(260px, 85vw);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
  display: none;
  z-index: 10000;
}
.streak-popover.is-visible {
  display: block;
}
.streak-popover h4 {
  margin: 0 22px 6px 0;
  font-size: 14px;
  color: #0f172a;
}
.streak-popover p {
  margin: 0 0 10px;
  font-size: 12px;
  color: #475569;
}
.streak-popover-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
}
.streak-popover-close:hover {
  color: #475569;
}
.streak-checkin-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1000002;
}
.streak-checkin-overlay.is-visible {
  display: flex;
}
.streak-checkin-card {
  width: min(520px, 94vw);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.25);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.streak-checkin-header h3 {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}
.streak-checkin-header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #475569;
}
.streak-checkin-time {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.streak-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}
.streak-input input,
.streak-input textarea {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  color: #0f172a;
}
.streak-input textarea {
  resize: vertical;
  min-height: 70px;
}
.streak-checkin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.streak-checkin-message {
  font-size: 12px;
  color: #b91c1c;
  min-height: 16px;
}
.streak-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.streak-about {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}
.streak-about h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #7c2d12;
}
.streak-about p {
  margin: 0 0 6px;
}
.streak-about p:last-child {
  margin-bottom: 0;
}
.streak-help {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.streak-active-card {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #0f172a;
}
.streak-history {
  margin-top: 12px;
}
.streak-history h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #1f2937;
}
.streak-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #334155;
}
.streak-badges {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}
.streak-badge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}
.streak-badge img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.streak-badge-emoji img {
  width: 32px;
  height: 32px;
  display: block;
}
[data-theme="dark"] .streak-indicator {
  background: var(--red-50);
  border-color: var(--border-color);
  color: var(--text-primary);
}
[data-theme="dark"] .streak-indicator.is-idle {
  background: #2a1c14;
}
[data-theme="dark"] .streak-popover {
  background: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .streak-about {
  background: #2a1c14;
  border-color: #3b2f26;
  color: #f5e6d3;
}
[data-theme="dark"] .streak-about h4 {
  color: #f2c685;
}
[data-theme="dark"] .streak-popover h4 {
  color: var(--text-primary);
}
[data-theme="dark"] .streak-popover p {
  color: var(--text-secondary);
}
[data-theme="dark"] .streak-popover-close {
  color: #94a3b8;
}
[data-theme="dark"] .streak-active-card {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}
[data-theme="dark"] .streak-badge {
  background: var(--card-bg);
  border-color: var(--border-color);
}
[data-theme="dark"] .streak-badge-title {
  color: var(--text-primary);
}
[data-theme="dark"] .streak-badge-meta {
  color: var(--text-secondary);
}
[data-theme="dark"] .streak-progress {
  background: #2d3748;
}
[data-theme="dark"] .streak-checkin-card {
  background: #111827;
  color: #e2e8f0;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
}
[data-theme="dark"] .streak-checkin-header h3 {
  color: #f8fafc;
}
[data-theme="dark"] .streak-checkin-header p {
  color: #94a3b8;
}
[data-theme="dark"] .streak-input {
  color: #94a3b8;
}
[data-theme="dark"] .streak-input input,
[data-theme="dark"] .streak-input textarea {
  background: #0f172a;
  border-color: #1f2937;
  color: #e2e8f0;
}
[data-theme="dark"] .streak-checkin-message {
  color: #fca5a5;
}
.streak-badge-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.streak-badge-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}
.streak-progress {
  margin-top: 6px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.streak-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f97316, #f59e0b);
  width: 0%;
}
.sidebar,
.sidebar-items {
  overflow-x: hidden;
}
.sidebar-but .sidebar-but-shortcut {
  position: relative;
  z-index: 3;
}

/* Preferencebox mobile UX improvements */
@media (max-width: 900px) {
  .preferencebox-overlay {
    padding: 12px;
    align-items: stretch;
  }

  .preferencebox {
    width: 100%;
    height: 100%;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .preferencebox-overlay {
    padding: 0;
  }

  .preferencebox {
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }

  .preferencebox-close-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
    top: 10px;
    right: 10px;
  }

  .preferencebox-sidebar {
    padding: 48px 12px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--sidebar-bg);
  }

  .preferencebox-sidebar nav ul {
    display: flex;
    gap: 8px;
  }

  .preferencebox-sidebar nav a {
    white-space: nowrap;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    padding: 8px 12px;
  }

  .preferencebox-sidebar nav a.active {
    border-color: var(--primary-red);
  }

  .preferencebox-content {
    padding: 20px 16px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .preferencebox-content h2 {
    font-size: 20px;
    padding-bottom: 12px;
    margin-bottom: 18px;
  }

  .form-section {
    margin-bottom: 24px;
  }

  .profile-photo-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .streak-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .streak-actions .btn {
    width: 100%;
  }

  .delete-account-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .delete-account-actions .btn {
    width: 100%;
  }

  .price-slider-container {
    padding: 16px;
  }

  .table-scroll-container {
    overflow-x: auto;
  }

  .billing-history-table {
    min-width: 560px;
  }
}

@media (max-width: 520px) {
  .preferencebox-sidebar nav a {
    font-size: 13px;
  }

  .preferencebox-sidebar nav a i {
    display: none;
  }
}

.whiteboard-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.whiteboard-sidebar .canvas-header {
  background: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: none;
}

.whiteboard-sidebar .canvas-header h3 {
  color: #f8fafc;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.5);
}

.wt-wrapper {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.6));
}
[data-theme="dark"] .wt-wrapper {
  background: #0b1220;
}

.wt-container {
  width: 100%;
  height: 100%;
}

.wt-status {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.wt-status.visible {
  opacity: 1;
}

/* Subject AI Modal Styles */
.subject-ai-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000001;
  padding: 24px;
  pointer-events: none;
}

.subject-ai-modal[style*="display: flex"],
.subject-ai-modal.visible {
  pointer-events: auto;
}

.subject-ai-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  z-index: -1;
}

.subject-ai-card {
  position: relative;
  width: min(480px, 90vw);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.subject-ai-header {
  padding: 20px;
  border-bottom: 1px solid #eff0f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subject-ai-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.subject-ai-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.subject-ai-close:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.subject-ai-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.subject-ai-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subject-ai-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.subject-ai-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.subject-ai-btn {
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.subject-ai-btn:hover:not(:disabled) {
  border-color: #7c3aed;
  background: #f5f3ff;
  color: #7c3aed;
}

.subject-ai-btn.active {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #ffffff;
}

.subject-ai-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.subject-ai-message {
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 8px;
  min-height: 1px;
}

.subject-ai-message.error {
  background: #fee2e2;
  color: #991b1b;
}

.subject-ai-message.success {
  background: #dcfce7;
  color: #166534;
}

.subject-ai-footer {
  padding: 16px 20px;
  border-top: 1px solid #eff0f6;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}


/* Badge Styles */
.beta-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #fbbf24;
  color: #78350f;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  vertical-align: text-top;
  letter-spacing: 0.5px;
}

.coming-soon-badge {
  display: block;
  font-size: 10px;
  color: #9ca3af;
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

.subject-ai-btn.coming-soon {
  position: relative;
  opacity: 0.6;
}

.subject-ai-btn.coming-soon:disabled {
  opacity: 0.5;
  background: #f9fafb;
  border-color: #e5e7eb;
}

.subject-ai-btn.coming-soon:disabled:hover {
  border-color: #e5e7eb;
  background: #f9fafb;
}
