* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2744;
  --accent: #0f9d58;
  --accent-light: #34d399;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #2d3748;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.header {
  background: linear-gradient(135deg, var(--bg-secondary), #0d1b2a);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  flex-shrink: 0;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-light);
}

.header .subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  width: 220px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.progress-label {
  font-size: 0.8rem;
  color: var(--accent-light);
  background: rgba(15, 157, 88, 0.15);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* Section Nav */
.section-nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  overflow-x: auto;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.section-nav button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  width: 100%;
}

.section-nav button:hover,
.section-nav button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Nav item with progress */
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-progress {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 0 4px;
}

.nav-progress-pipe {
  color: var(--info);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
}

.nav-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.nav-progress-fill {
  height: 100%;
  background: var(--info);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Board */
.board-container {
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  flex: 1;
  overflow-y: auto;
  width: 100%;
}

.section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.group {
  margin-bottom: 2rem;
}

.group-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--info);
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.item-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.item-card.has-note {
  border-left: 3px solid var(--accent);
}

.item-card .item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.item-card .item-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card .item-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.6rem;
  background: var(--accent);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.modal-header h2 {
  font-size: 1.2rem;
  color: var(--accent-light);
  padding-right: 2rem;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 0.4rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-close:hover { color: var(--danger); }

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-body h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body h3 i {
  color: var(--accent);
}

/* Note textarea */
#noteText {
  width: 100%;
  min-height: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}

#noteText:focus {
  outline: none;
  border-color: var(--accent);
}

/* Links */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-card);
  border-radius: 6px;
}

.link-item a {
  color: var(--info);
  text-decoration: none;
  font-size: 0.85rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-item a:hover { text-decoration: underline; }

.link-item .remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.8rem;
}

.add-link-form {
  display: flex;
  gap: 0.5rem;
}

.add-link-form input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}

.add-link-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.add-link-form button {
  background: var(--accent);
  border: none;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
}

/* Images */
.images-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.image-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.9);
  border: none;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-image-form {
  display: flex;
  align-items: center;
}

.add-image-form input[type="file"] {
  display: none;
}

.upload-btn {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  color: var(--text-secondary);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* AI Section */
.ai-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  width: 100%;
}

.ai-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.ai-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ai-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.7;
  max-height: 400px;
  overflow-y: auto;
}

.ai-result.hidden { display: none; }

.ai-result code {
  background: rgba(0,0,0,0.3);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.ai-result pre {
  background: rgba(0,0,0,0.4);
  padding: 0.8rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.5rem 0;
}

/* Save button */
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.save-btn {
  background: var(--accent);
  border: none;
  color: white;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.save-btn:hover {
  background: var(--accent-light);
  color: #0f0f0f;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
  .header { flex-direction: column; align-items: flex-start; }
  .header-actions { width: 100%; }
  .search-input { flex: 1; }
  .board-container { padding: 1rem; }
  .items-grid { grid-template-columns: 1fr; }
  .modal-content { width: 95%; max-height: 95vh; }
}

/* Terms Section */
.terms-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.term-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-radius 0.1s;
}

.term-item-wrapper:has(.term-preview:not(.hidden)) .term-item {
  border-radius: 8px 8px 0 0;
  border-color: var(--accent);
}

.term-item .term-name {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.term-item .term-link {
  font-size: 0.75rem;
  color: var(--accent-light);
  text-decoration: none;
  background: rgba(15, 157, 88, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.term-item .term-link:hover {
  background: rgba(15, 157, 88, 0.25);
  text-decoration: underline;
}

.term-item .term-no-link {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

.term-item .remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.6;
}

.term-item .remove-btn:hover {
  opacity: 1;
}

.add-term-form {
  display: flex;
  gap: 0.5rem;
}

.add-term-form input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.add-term-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.add-term-btn {
  background: var(--accent);
  border: none;
  color: white;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.add-term-btn:hover {
  background: var(--accent-light);
  color: #0f0f0f;
}

/* Term preview (expandable div below term) */
.term-item-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.term-preview {
  background: #0d1b2a;
  border: 1px solid var(--accent);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 0.75rem 1rem;
  margin-top: -4px;
  animation: slideDown 0.2s ease;
}

.term-preview.hidden {
  display: none;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.term-preview-header {
  margin-bottom: 0.5rem;
}

.term-preview-header strong {
  color: var(--accent-light);
  font-size: 0.85rem;
}

.term-preview-subtitle {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.term-preview-body {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
}

.term-preview-body .empty-note {
  color: var(--text-muted);
  font-style: italic;
}

.term-preview-goto {
  margin-top: 0.5rem;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent-light);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.term-preview-goto:hover {
  background: var(--accent);
  color: white;
}

/* Header add button */
.header-add-btn {
  background: var(--accent);
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.header-add-btn:hover {
  background: var(--accent-light);
  color: #0f0f0f;
  transform: scale(1.1);
}

/* Create modal */
.create-modal-content {
  max-width: 550px;
}

.create-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.create-tab {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.create-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.create-pane {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.create-pane.hidden {
  display: none;
}

.create-pane label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.create-pane input,
.create-pane select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}

.create-pane input:focus,
.create-pane select:focus {
  outline: none;
  border-color: var(--accent);
}

.create-pane select {
  cursor: pointer;
}

/* Term: create new topic button */
.term-create-btn {
  background: none;
  border: 1px dashed var(--warning);
  color: var(--warning);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.term-create-btn:hover {
  background: rgba(245, 158, 11, 0.15);
}

/* Term: remove link button */
.term-unlink-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.65rem;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
}

.term-unlink-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Term: reject suggestion button */
.term-reject-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  transition: all 0.15s;
}

.term-reject-btn:hover {
  color: var(--danger);
}

/* Subtitle with AI button */
.subtitle-with-ai {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.subtitle-with-ai textarea {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

.subtitle-with-ai textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.ai-subtitle-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ai-subtitle-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: white;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.ai-subtitle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
}

.ai-subtitle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ai-subtitle-refresh-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.ai-subtitle-refresh-btn:hover {
  border-color: var(--warning);
  color: var(--warning);
}

.ai-subtitle-refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.subtitle-ai-loading {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.3rem 0;
}

.subtitle-ai-loading.hidden {
  display: none;
}

/* Sync button */
.header-sync-btn {
  background: var(--info);
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.header-sync-btn:hover {
  background: #60a5fa;
  transform: scale(1.1);
}

.header-sync-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.header-sync-btn.hidden {
  display: none;
}

/* Download from Dynamo button */
.header-download-btn {
  background: #8b5cf6;
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.header-download-btn:hover {
  background: #a78bfa;
  transform: scale(1.1);
}

.header-download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.header-download-btn.hidden {
  display: none;
}

/* Cert link in nav */
.nav-cert-link {
  display: block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-cert-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

/* Goals link in nav */
.nav-goals-link {
  display: block;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-goals-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
}

/* Header navigation links */
.header-link {
  font-size: 0.8rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.header-link.cert {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.header-link.cert:hover {
  background: rgba(245, 158, 11, 0.25);
}

.header-link.goals {
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.1);
}

.header-link.goals:hover {
  background: rgba(139, 92, 246, 0.25);
}

/* Fill filter select */
.fill-filter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.fill-filter:focus {
  outline: none;
  border-color: var(--accent);
}

/* Delete item button inside modal */
.delete-item-btn {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
  margin-right: auto;
}

.delete-item-btn:hover {
  background: var(--danger);
  color: white;
}

/* Move item panel */
.move-item-btn {
  background: none;
  border: 1px solid var(--info);
  color: var(--info);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.move-item-btn:hover {
  background: var(--info);
  color: white;
}

.move-panel {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.move-panel.hidden {
  display: none;
}

.move-panel select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  max-width: 180px;
}

.move-panel select:focus {
  outline: none;
  border-color: var(--accent);
}

.move-confirm-btn {
  background: var(--info);
  border: none;
  color: white;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
}

.move-confirm-btn:hover {
  background: #60a5fa;
}

/* Editable titles */
.editable-title[contenteditable="true"] {
  outline: 1px dashed var(--accent);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  background: rgba(15, 157, 88, 0.05);
}

.editable-title {
  cursor: default;
}

.editable-title:hover {
  cursor: text;
  opacity: 0.9;
}

/* Section/Group header rows with delete */
.section-header-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.group-header-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.section-delete-btn,
.group-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.3rem;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.2s;
}

.section-header-row:hover .section-delete-btn,
.group-header-row:hover .group-delete-btn {
  opacity: 1;
}

.section-delete-btn:hover,
.group-delete-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Note rating */
.note-rating-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.rate-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: white;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
}

.rate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

.rate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.rating-result {
  font-size: 0.85rem;
  font-weight: 600;
}

.rating-loading.hidden { display: none; }

/* Rating badges on cards */
.item-rating-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.item-rating-badge.good {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.item-rating-badge.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.item-rating-badge.weak {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Ideal answer box */
.ideal-answer-box {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.ideal-answer-box.hidden { display: none; }

.ideal-answer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(245, 158, 11, 0.08);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--warning);
  font-weight: 500;
}

.ideal-answer-header:hover {
  background: rgba(245, 158, 11, 0.15);
}

.ideal-answer-content {
  padding: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  background: var(--bg-card);
  max-height: 200px;
  overflow-y: auto;
}

.ideal-answer-content.hidden { display: none; }

/* Backup/Restore buttons */
.header-backup-btn,
.header-restore-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.header-backup-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header-restore-btn:hover {
  border-color: var(--warning);
  color: var(--warning);
}

/* ─── Auth Styles ─────────────────────────────────────────────────────────── */
.auth-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-weight: 500;
}

.auth-badge.online {
  background: rgba(15, 157, 88, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(15, 157, 88, 0.3);
}

.auth-badge.offline {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.auth-login-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.2s;
}

.auth-login-btn:hover {
  background: var(--accent-light);
  color: #0f0f0f;
}

.auth-logout-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.auth-logout-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}
