/* ===== Model Picker Menu ===== */
.model-menu {
  position: fixed;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 320px;
  z-index: 2100;
  overflow: hidden;
  animation: menuIn 0.15s ease;
}

.model-menu-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

.model-menu-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.model-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  transition: background var(--transition);
}

.model-menu-item:hover { background: var(--bg-hover); }
.model-menu-item.active { background: var(--bg-active); font-weight: 500; }

.model-menu-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
}

.model-menu-footer button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
}

.model-menu-footer button:hover { background: var(--bg-hover); color: var(--text-primary); }
.model-menu-footer svg { width: 16px; height: 16px; }

/* ===== Chat view extras ===== */
.btn-stop {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: #0d0d0d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .btn-stop { background: #ffffff; color: #0d0d0d; }
.btn-stop svg { width: 18px; height: 18px; }

.chat-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ===== Projects ===== */
.project-template-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-width: 640px;
}

.project-template-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}

.project-template-card:hover {
  background: var(--bg-hover);
  box-shadow: var(--shadow-sm);
}

.project-template-icon { font-size: 32px; margin-bottom: 12px; }
.project-template-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.project-template-card p { font-size: 13px; color: var(--text-secondary); }

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.project-card-actions {
  display: flex;
  gap: 4px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h2 { font-size: 18px; font-weight: 600; }

.modal-body {
  padding: 16px 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 20px;
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
}

/* ===== Codex (Haijun Code) ===== */
.codex-main {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 480px;
}

.codex-sidebar {
  width: 240px;
  min-width: 240px;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 16px;
}

.codex-folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.codex-folder-header span { font-size: 14px; font-weight: 600; }

.codex-folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
  margin-bottom: 4px;
}

.codex-folder-item:hover { background: var(--bg-hover); }
.codex-folder-item .icon-btn { width: 26px; height: 26px; }
.codex-folder-item .icon-btn svg { width: 14px; height: 14px; }

.codex-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.codex-empty { text-align: center; max-width: 420px; }
.codex-empty h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.codex-empty p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

.codex-file-list { margin-top: 8px; }

.codex-file-item {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: 'Consolas', 'Monaco', monospace;
  cursor: pointer;
  transition: background var(--transition);
}

.codex-file-item:hover { background: var(--bg-hover); }
.codex-file-item.active { background: var(--bg-active); font-weight: 500; }

.btn-sm { padding: 6px 12px !important; font-size: 12px !important; }

/* ===== Upgrade / Pricing ===== */
.upgrade-head {
  text-align: center;
  margin-bottom: 24px;
}

.upgrade-head h2 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.upgrade-head p { font-size: 14px; color: var(--text-secondary); }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pricing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.pricing-card h3 { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }
.pricing-card strong { font-size: 24px; font-weight: 600; margin-bottom: 12px; }
.pricing-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; flex: 1; }

.pricing-card button {
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
}

/* ===== Profile modal ===== */
.profile-modal-inner h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.profile-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 26px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto 16px;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  cursor: pointer;
}

/* ===== Help QA ===== */
.help-qa { border-bottom: 1px solid var(--border-light); }

.help-qa-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 0;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.help-qa-icon {
  width: 18px;
  height: 18px;
  position: relative;
  transition: transform var(--transition);
}

.help-qa-icon::before,
.help-qa-icon::after {
  content: '';
  position: absolute;
  background: var(--text-secondary);
  border-radius: 1px;
}

.help-qa-icon::before { left: 2px; right: 2px; top: 8px; height: 2px; }
.help-qa-icon::after { top: 2px; bottom: 2px; left: 8px; width: 2px; }

.help-qa.open .help-qa-icon { transform: rotate(45deg); }

.help-qa-a {
  display: none;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 0 0 16px;
}

.help-qa.open .help-qa-a { display: block; }

/* ===== Release notes ===== */
.release-note {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.release-note-header h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.release-date { font-size: 13px; color: var(--text-muted); }
.release-note ul { padding-left: 20px; font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-top: 8px; }

/* ===== Download page ===== */
.download-page {
  display: flex;
  justify-content: center;
}

.download-card {
  max-width: 640px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
}

.download-icon { font-size: 48px; margin-bottom: 16px; }
.download-card h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.download-card p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

.download-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.download-buttons button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
}

.download-buttons svg { width: 16px; height: 16px; }

/* ===== Settings panel extra ===== */
.settings-panel h2 { font-size: 20px; font-weight: 600; margin-bottom: 24px; }

.settings-modal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 12px;
}

.settings-modal-title strong { font-size: 16px; }

/* ===== Misc ===== */
.btn-upgrade-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background var(--transition);
}

.btn-upgrade-header:hover { background: var(--bg-hover); }
.btn-upgrade-header svg { width: 15px; height: 15px; }

@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .codex-sidebar { width: 100%; min-width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .codex-main { flex-direction: column; }
}

/* ===== Codex workspace (logged in) ===== */
.codex-workspace {
  display: grid;
  grid-template-columns: 200px 1fr 300px;
  height: calc(100vh - var(--header-height, 60px) - 60px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  gap: 0;
}

.codex-files {
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  background: var(--bg-secondary);
}

.codex-editor {
  display: flex;
  flex-direction: column;
}

.codex-editor-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}

.codex-editor-toolbar button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.codex-editor-toolbar svg { width: 14px; height: 14px; }

.codex-editor-area {
  flex: 1;
  padding: 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-secondary);
  border: none;
  outline: none;
  resize: none;
  color: var(--text-primary);
}

.codex-chat {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.codex-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.codex-chat-messages .message .message-content {
  font-size: 13px;
}

.codex-chat-input {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.codex-chat-input textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  resize: none;
  outline: none;
  font-size: 13px;
}

@media (max-width: 900px) {
  .codex-workspace { grid-template-columns: 1fr; height: auto; }
  .codex-files, .codex-chat { display: none; }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  z-index: 3000;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
  animation: slideUp 0.25s ease;
}

/* ===== Lingkungan Kerja (Sidebar Kanan) ===== */
.workspace-panel {
  position: relative;
  width: 400px;
  min-width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  z-index: 90;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.workspace-panel.open { transform: translateX(0); }

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  gap: 6px;
}

.workspace-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.workspace-tabs::-webkit-scrollbar { display: none; }

.workspace-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.workspace-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.workspace-tab.active { background: var(--bg-hover); color: var(--text-primary); }

.workspace-close { flex-shrink: 0; }

.workspace-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

.workspace-view { display: none; flex: 1; overflow-y: auto; padding: 12px; }
.workspace-view.active { display: block; }

.workspace-empty { color: var(--text-secondary); font-size: 13px; line-height: 1.6; text-align: center; padding: 24px 12px; }

/* Queue */
.workspace-list { display: flex; flex-direction: column; gap: 8px; }
.ws-queue-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg-hover); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 10px 12px;
}
.ws-queue-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-queue-title { font-size: 13px; font-weight: 500; color: var(--text-primary); word-break: break-word; }
.ws-queue-time { font-size: 11px; color: var(--text-secondary); }
.q-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--text-secondary); }
.q-dot.running { background: #f59e0b; animation: pulse 1.2s ease infinite; }
.q-dot.done { background: #22c55e; }
.q-dot.error { background: #ef4444; }

/* Files tree */
.workspace-file-header, .workspace-note-header, .workspace-preview-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px;
}
.workspace-file-header span, .workspace-note-header span {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary);
}
.btn-refresh {
  border: none; background: transparent; color: var(--text-secondary); cursor: pointer;
  padding: 4px; border-radius: var(--radius-sm); display: inline-flex; align-items: center;
}
.btn-refresh:hover { background: var(--bg-hover); color: var(--text-primary); }

.workspace-tree { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ws-tree-folder { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--text-primary); font-weight: 600; }
.ws-tree-folder svg { width: 15px; height: 15px; color: var(--text-secondary); }
.ws-tree-count { font-size: 11px; color: var(--text-secondary); font-weight: 400; margin-left: auto; }
.ws-tree-file { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 28px; color: var(--text-secondary); border-radius: var(--radius-sm); cursor: pointer; }
.ws-tree-file:hover { background: var(--bg-hover); color: var(--text-primary); }
.ws-tree-file svg { width: 14px; height: 14px; }

/* Changes */
.ws-change-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); }
.ws-change-item:hover { background: var(--bg-hover); }
.ws-change-badge {
  width: 20px; height: 20px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; margin-top: 2px;
}
.ws-change-badge.add { background: #22c55e; }
.ws-change-badge.del { background: #ef4444; }
.ws-change-badge.edit { background: #3b82f6; }

/* Preview */
.workspace-preview-bar input {
  flex: 1; background: var(--input-bg); border: 1px solid var(--border-light); color: var(--text-primary);
  border-radius: var(--radius-sm); padding: 7px 10px; font-size: 12px; outline: none; min-width: 0;
}
#ws-preview-frame {
  width: 100%; height: calc(100% - 60px); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); background: #fff; display: block;
}
.workspace-preview-hint { font-size: 11px; color: var(--text-secondary); margin-top: 8px; text-align: center; }

/* Terminal */
.terminal-window {
  background: #0d1117; border: 1px solid #30363d; border-radius: var(--radius-md);
  font-family: 'Cascadia Code', Consolas, 'Courier New', monospace; font-size: 12px;
  height: 100%; display: flex; flex-direction: column; overflow: hidden;
}
.terminal-output { flex: 1; overflow-y: auto; padding: 12px; color: #e6edf3; line-height: 1.55; }
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-prompt-out { color: #3fb950; font-weight: 600; }
.terminal-line { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid #30363d; }
.terminal-prompt { color: #3fb950; font-weight: 600; white-space: nowrap; font-size: 12px; }
#terminal-input {
  flex: 1; background: transparent; border: none; outline: none; color: #e6edf3;
  font-family: inherit; font-size: 12px;
}

/* Notes */
#ws-notes-text {
  width: 100%; height: calc(100% - 40px); background: var(--input-bg);
  border: 1px solid var(--border-light); border-radius: var(--radius-md);
  color: var(--text-primary); padding: 12px; font-size: 13px; line-height: 1.6;
  resize: none; outline: none; font-family: inherit;
}

/* Tombol ⋯ di header */
.btn-workspace-toggle { color: var(--text-secondary); }
.btn-workspace-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ===== Responsif: Mobile ===== */
@media (max-width: 900px) {
  .workspace-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-width: 0;
    z-index: 900;
    transform: translateX(100%);
  }
  .workspace-panel.open { transform: translateX(0); }
  .workspace-header { padding: 10px; }
  .workspace-tab { padding: 8px 12px; font-size: 13px; }
  #ws-preview-frame { height: calc(100% - 56px); }
}

/* ===== Markdown (balasan Haijun AI) ===== */
.md-code-block {
  background: #0d1117; border: 1px solid var(--border-light); border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; margin: 8px 0; font-size: 12.5px;
  line-height: 1.55; font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
}
.md-code-block code { color: #e6edf3; white-space: pre-wrap; word-break: break-word; }
.md-code {
  background: var(--bg-hover); border: 1px solid var(--border-light); border-radius: 5px;
  padding: 1px 6px; font-size: 12.5px; font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
}
.md-h { margin: 12px 0 6px; line-height: 1.3; }
.md-hr { border: none; border-top: 1px solid var(--border-light); margin: 12px 0; }
.md-quote {
  border-left: 3px solid var(--accent); padding: 6px 12px; margin: 8px 0;
  color: var(--text-secondary); background: var(--bg-hover); border-radius: 0 8px 8px 0;
}
.md-list { margin: 6px 0 6px 20px; padding: 0; }
.md-list li { margin: 3px 0; line-height: 1.5; }
.message-content p { margin: 4px 0; }
.message-content a { color: var(--accent); text-decoration: underline; }

/* ===== Hasil Gambar ===== */
.image-result { margin-top: 20px; }
.image-result.loading { text-align: center; padding: 30px 0; color: var(--text-secondary); font-size: 14px; }
.image-result-imgwrap { border-radius: 14px; overflow: hidden; border: 1px solid var(--border-light); }
.image-result-img { width: 100%; height: auto; max-height: 480px; object-fit: cover; display: block; }
.btn-link { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; background: none; border: none; }
.btn-link:hover { text-decoration: underline; }

/* ===== Pustaka: thumbnail & hapus ===== */
.library-file-thumb { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.library-file-item { cursor: pointer; }
.library-file-item .icon-btn { opacity: 0; transition: opacity .15s ease; }
.library-file-item:hover .icon-btn { opacity: 1; }
.library-file-name { display: flex; align-items: center; gap: 8px; }

.image-result-loading { text-align: center; padding: 40px 0; color: var(--text-secondary); font-size: 14px; }
.image-result-img.hidden { display: none; }

/* ===== Mobile: sidebar kiri ===== */
@media (max-width: 768px) {
  .sidebar.open {
    z-index: 200;
    box-shadow: 8px 0 40px rgba(0,0,0,.35);
    transform: translateX(0) !important;
  }
}

/* ===== Workspace: Queue (hasil kode) ===== */
.ws-code-preview {
  background: #0d1117; border: 1px solid #30363d; border-radius: 8px;
  padding: 8px 10px; font-family: Consolas, 'Courier New', monospace;
  font-size: 11px; color: #e6edf3; margin-top: 6px; white-space: pre-wrap;
  word-break: break-word; max-height: 130px; overflow: hidden;
}
.ws-item-actions { display: flex; gap: 6px; margin-top: 8px; }
.btn-mini {
  border: 1px solid var(--border-light); background: var(--bg-input); color: var(--text-primary);
  border-radius: 6px; padding: 4px 10px; font-size: 11px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-mini:hover { background: var(--bg-hover); }
.btn-mini svg { width: 12px; height: 12px; }

/* ===== Workspace: Files ===== */
.ws-tree-thumb { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; }

/* ===== Workspace: Changes (biaya token) ===== */
.ws-cost-total {
  background: var(--bg-hover); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; margin-bottom: 10px;
  color: var(--text-secondary);
}
.ws-cost-total strong { color: var(--text-primary); font-size: 15px; }

/* ===== Workspace: Preview (review kode) ===== */
.workspace-review .rev-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rev-findings { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.rev-finding {
  display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.45;
  padding: 8px 10px; border-radius: 8px; background: var(--bg-hover);
  border: 1px solid var(--border-light); color: var(--text-primary);
}
.rev-badge {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; margin-top: 1px;
}
.rev-badge.ok { background: #22c55e; }
.rev-badge.warn { background: #f59e0b; }
.rev-badge.info { background: #3b82f6; }
.rev-score { margin-top: 12px; font-size: 12px; color: var(--text-secondary); }
.rev-score-bar {
  display: block; margin-top: 6px; height: 8px; background: var(--bg-input);
  border-radius: 99px; overflow: hidden; border: 1px solid var(--border-light);
}
.rev-score-bar span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #4f8cff); border-radius: 99px; }

/* ===== Workspace: Notes (notifikasi) ===== */
.workspace-notifications { display: flex; flex-direction: column; gap: 8px; }
.ws-notif {
  display: flex; align-items: flex-start; gap: 10px; background: var(--bg-hover);
  border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 10px 12px;
}
.term-out-dim { color: var(--text-dim); }

/* ===== Mobile: tinggi sidebar = viewport dinamis ===== */
@media (max-width: 768px) {
  .sidebar { height: 100vh; height: 100dvh; }
  .sidebar-nav { overflow-y: auto; }
}
@media (max-width: 900px) {
  .workspace-panel { height: 100vh; height: 100dvh; }
}

/* ===== Mobile: seluruh shell pas dengan layar (hanya area chat yang gulir) ===== */
@media (max-width: 768px) {
  .app,
  .main {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .main-footer {
    padding: 6px 16px 10px;
    flex-shrink: 0;
  }
  .chat-home { overflow: hidden; }
}

/* ===== Gambar inline di chat ===== */
.md-image-wrap {
  margin: 10px 0;
  border-radius: 12px;
  overflow: hidden;
  max-width: 420px;
  background: var(--surface-secondary, #f0f0f0);
  border: 1px solid var(--border-color, #e5e5e5);
}
.md-image-wrap .md-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.image-result-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  font-size: 13px;
  color: var(--text-secondary, #555);
}
.image-result-loading .typing-indicator span {
  width: 6px;
  height: 6px;
}

/* ===== Tombol mode berpikir (🧠) & mikrofon (🎤) ===== */
.chat-action-btn.active,
.chat-thinking-btn.active,
.chat-mic-btn.active {
  background: var(--bg-active);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.chat-action-btn.active svg,
.chat-thinking-btn.active svg,
.chat-mic-btn.active svg { color: var(--accent); }

/* Indikator mode berpikir saat jawaban diproses */
.thinking-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-active);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
}

/* ===== Blok Mode Berpikir (thinking steps) ===== */
.thinking-steps {
  background: var(--bg-hover, #f5f5f5);
  border: 1px solid var(--border, #e5e5e5);
  border-left: 3px solid var(--accent, #0d0d0d);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0 14px;
  font-size: 13px;
  color: var(--text-secondary, #555);
}
.thinking-steps summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-primary, #0d0d0d);
  user-select: none;
  list-style: none;
}
.thinking-steps summary::-webkit-details-marker { display: none; }
.thinking-steps summary::after {
  content: '▾';
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  transition: transform .15s ease;
}
.thinking-steps[open] summary::after { transform: rotate(180deg); }
.thinking-steps-icon { font-size: 14px; }
.thinking-steps-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #888);
  background: var(--bg-primary, #fff);
  border-radius: 999px;
  padding: 1px 8px;
}
.thinking-steps-list {
  margin: 10px 0 2px 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.thinking-steps-list li { line-height: 1.55; }
.thinking-pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary, #555);
  padding: 8px 0;
  font-style: italic;
}
.thinking-pending .thinking-steps-icon { animation: thinkingPulse 1.2s ease-in-out infinite; }
@keyframes thinkingPulse {
  0%, 100% { opacity: .5; transform: scale(.95); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* === Settings Navigation Section Labels === */
.settings-nav-section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #999);
  padding: 16px 12px 6px;
  margin-top: 4px;
}

/* === Track Settings === */
.track-search {
  margin-bottom: 16px;
}
.settings-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: var(--radius-md, 12px);
  font-size: 14px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
}
.settings-input:focus {
  outline: none;
  border-color: var(--accent, #7c3aed);
}
.track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.track-card {
  border: 1px solid var(--border, #e0e0e0);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  transition: background var(--transition, 0.15s);
}
.track-card:hover {
  background: var(--bg-hover, #f5f5f5);
}
.track-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.track-card-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

/* === Connector Settings === */
.connector-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.connector-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: var(--radius-md, 12px);
  transition: background var(--transition, 0.15s);
}
.connector-card:hover {
  background: var(--bg-hover, #f5f5f5);
}
.connector-card-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f9f9f9);
  border-radius: var(--radius-sm, 8px);
}
.connector-card-info {
  flex: 1;
}
.connector-card-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
.connector-card-info p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted, #999);
}

/* === Memory Settings === */
.memory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.memory-card {
  border: 1px solid var(--border, #e0e0e0);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  transition: background var(--transition, 0.15s);
}
.memory-card:hover {
  background: var(--bg-hover, #f5f5f5);
}
.memory-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

/* === Toggle Button === */
.toggle {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg-hover, #ccc);
  position: relative;
  cursor: pointer;
  transition: background var(--transition, 0.15s);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform var(--transition, 0.15s);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle.on {
  background: var(--accent, #7c3aed);
}
.toggle.on::after {
  transform: translateX(16px);
}

/* === Browse Tabs === */
.browse-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border, #e0e0e0);
  padding-bottom: 0;
}
.browse-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #666);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition, 0.15s), border-color var(--transition, 0.15s);
}
.browse-tab:hover {
  color: var(--text-primary, #111);
}
.browse-tab.active {
  color: var(--text-primary, #111);
  border-bottom-color: var(--accent, #7c3aed);
}
.directory-author {
  font-size: 11px;
  color: var(--text-muted, #999);
}
.directory-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

/* === Directory Pages === */
.directory-section {
  margin-bottom: 32px;
}
.directory-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary, #111);
}
.directory-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.directory-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: var(--radius-md, 12px);
  transition: background var(--transition, 0.15s), box-shadow var(--transition, 0.15s);
}
.directory-card:hover {
  background: var(--bg-hover, #f5f5f5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.directory-card-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f9f9f9);
  border-radius: var(--radius-md, 12px);
  flex-shrink: 0;
}
.directory-card-info {
  flex: 1;
  min-width: 0;
}
.directory-card-info h4 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 500;
}
.directory-card-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #666);
  line-height: 1.4;
}
.directory-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.directory-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-hover, #f0f0f0);
  color: var(--text-muted, #999);
}
.directory-install-btn {
  flex-shrink: 0;
  min-width: 90px;
}


/* === Button Sizes === */
.btn-secondary {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border, #e0e0e0);
  cursor: pointer;
  font-weight: 500;
  background: var(--bg-secondary, #f3f3f3);
  color: var(--text-primary, #111);
  transition: background var(--transition, 0.15s), opacity var(--transition, 0.15s);
}
.btn-secondary:hover { background: var(--bg-hover, #e8e8e8); }

/* Haijun AI - Updated 2026-08-25 */
