/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0d0d12;
  --bg-secondary: #16161e;
  --bg-sidebar: #111118;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-input: #1e1e2a;
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(124, 58, 237, 0.4);

  --accent: #7c3aed;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;

  --gradient-main: linear-gradient(135deg, #7c3aed 0%, #3b82f6 50%, #06b6d4 100%);
  --gradient-thinking: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --sidebar-w: 260px;
  --topbar-h: 82px;
  --inputbar-h: auto;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  overflow: hidden;
  line-height: 1.6;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.35);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 20;
}

.sidebar.hidden {
  transform: translateX(-100%);
  position: absolute;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-main);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(90deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.new-chat-btn {
  width: 100%;
  padding: 0.6rem;
  background: rgba(124, 58, 237, 0.12);
  border: 1px dashed rgba(124, 58, 237, 0.35);
  border-radius: var(--radius-sm);
  color: #a78bfa;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.new-chat-btn:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--accent);
}

.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.history-item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.history-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.history-item.active {
  background: rgba(124, 58, 237, 0.15);
  color: #c4b5fd;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.powered-by {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ========== MAIN ========== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  position: relative;
}

/* ===== Top Bar ===== */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.topbar-modes {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.category-tabs {
  display: flex;
  gap: 0.35rem;
}

.cat-tab {
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cat-tab:hover {
  color: var(--text-secondary);
  border-color: rgba(124, 58, 237, 0.3);
}

.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.hidden {
  display: none !important;
}

.menu-btn {
  margin-top: 2px;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: all 0.15s;
}

.menu-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mode-selector {
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.mode-selector.hidden {
  display: none !important;
}

.mode-chip {
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.mode-chip:hover {
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--text-primary);
}

.mode-chip.active {
  background: rgba(124, 58, 237, 0.18);
  border-color: var(--accent);
  color: #c4b5fd;
}

/* ========== CHAT AREA ========== */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 1rem;
  display: flex;
  flex-direction: column;
}

/* ===== Welcome Screen ===== */
.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  text-align: center;
}

.welcome.hidden {
  display: none;
}

.welcome-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.welcome h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(90deg, #7c3aed, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.4rem;
}

.welcome p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-width: 600px;
  width: 100%;
}

@media (max-width: 600px) {
  .suggestions {
    grid-template-columns: 1fr;
  }
}

.suggestion-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
  transition: all 0.2s;
}

.suggestion-card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.suggestion-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ========== MESSAGES ========== */
#messagesContainer {
  padding: 0 1rem;
}

.message {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.25rem 0;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message+.message {
  border-top: 1px solid var(--border);
}

/* User message */
.msg-user {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  font-weight: 600;
}

.msg-avatar.user-av {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.msg-avatar.ai-av {
  background: var(--gradient-main);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-name {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.msg-name.user-name {
  color: #7dd3fc;
}

.msg-name.ai-name {
  color: #c4b5fd;
}

.msg-text {
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text-primary);
}

/* ===== Thinking Block ===== */
.thinking-block {
  margin: 0.5rem 0 0.75rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  user-select: none;
}

.thinking-header:hover {
  background: rgba(245, 158, 11, 0.04);
}

.thinking-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fbbf24;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
}

.thinking-dot.pulsing {
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.7);
  }
}

.thinking-status {
  font-size: 0.68rem;
  color: #92400e;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
}

.thinking-toggle {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.thinking-toggle.open {
  transform: rotate(180deg);
}

.thinking-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.thinking-body.open {
  max-height: 800px;
  overflow-y: auto;
}

.thinking-content {
  padding: 0.6rem 0.75rem;
  border-top: 1px solid rgba(245, 158, 11, 0.12);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.7;
  color: #d97706;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== Answer Markdown ===== */
.answer-text h1,
.answer-text h2,
.answer-text h3 {
  font-weight: 700;
  margin: 1.1em 0 0.4em;
}

.answer-text h1 {
  font-size: 1.25rem;
}

.answer-text h2 {
  font-size: 1.1rem;
  color: #a78bfa;
}

.answer-text h3 {
  font-size: 0.95rem;
  color: #7dd3fc;
}

.answer-text p {
  margin-bottom: 0.75em;
}

.answer-text ul,
.answer-text ol {
  padding-left: 1.4rem;
  margin-bottom: 0.75em;
}

.answer-text li {
  margin-bottom: 0.3em;
}

.answer-text strong {
  color: #fbbf24;
}

.answer-text em {
  color: #a78bfa;
}

.answer-text code {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.83em;
  color: #c4b5fd;
}

.answer-text pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  overflow-x: auto;
  margin: 0.75em 0;
}

.answer-text pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
}

.answer-text blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.3em 0.8em;
  margin: 0.7em 0;
  background: rgba(124, 58, 237, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.answer-text hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1em 0;
}

/* Copy button */
.copy-answer-btn {
  margin-top: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.copy-answer-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

/* ===== Cursor ===== */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent-cyan);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ========== INPUT BAR (BOTTOM) ========== */
.input-bar {
  padding: 0.75rem 1rem 0.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.input-wrapper {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.6rem 0.5rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.12);
}

.input-wrapper textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  resize: none;
  max-height: 150px;
  line-height: 1.5;
  padding: 0.3rem 0;
}

.input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient-main);
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.input-footer {
  text-align: center;
  padding-top: 0.4rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ===== Image Upload & Preview ===== */
.upload-btn {
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.upload-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.image-preview-container {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.image-preview-container.hidden {
  display: none;
}

#imagePreview {
  height: 60px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
}

.remove-image-btn {
  background: rgba(255, 50, 50, 0.2);
  color: #ff8888;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.remove-image-btn:hover {
  background: rgba(255, 50, 50, 0.4);
  color: #ffffff;
}

/* ===== Spinner ===== */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== BATCH PANEL ========== */
.batch-panel {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.batch-panel.hidden {
  display: none !important;
}

.batch-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.batch-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(90deg, #7c3aed, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
}

.batch-header p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.batch-info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.78rem;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
  line-height: 1.5;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.batch-input-section {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

.batch-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 180px;
  line-height: 1.8;
}

.batch-textarea:focus {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.12);
}

.batch-textarea::placeholder {
  color: var(--text-muted);
}

.batch-presets {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.preset-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.preset-btn {
  padding: 0.3rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.preset-btn:hover {
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.batch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.batch-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.batch-gen-btn {
  width: auto !important;
  height: auto !important;
  padding: 0.55rem 1.2rem !important;
  border-radius: 10px !important;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

/* ===== Batch Output / Progress ===== */
.batch-output {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

.batch-progress {
  padding: 0.75rem 0;
  margin-bottom: 0.75rem;
}

.progress-bar {
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-green));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.batch-file-list {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  transition: all 0.2s;
}

.file-item.done {
  border-color: rgba(16, 185, 129, 0.3);
}

.file-item.error {
  border-color: rgba(239, 68, 68, 0.3);
}

.file-item .fi-status {
  font-size: 1rem;
  flex-shrink: 0;
}

.file-item .fi-num {
  color: var(--accent);
  font-weight: 600;
  min-width: 28px;
}

.file-item .fi-topic {
  flex: 1;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .fi-lines {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.batch-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.btn-zip {
  background: linear-gradient(135deg, var(--accent-green), #059669) !important;
  color: white !important;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-zip:hover {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5) !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main {
    width: 100%;
  }

  .mode-selector {
    overflow-x: auto;
  }
}