@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #08090d;
  --bg-secondary: #0f1117;
  --bg-tertiary: #161822;
  --bg-panel: rgba(15, 17, 23, 0.85);
  --bg-hover: rgba(0, 212, 170, 0.08);
  --bg-active: rgba(0, 212, 170, 0.15);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(0, 212, 170, 0.3);
  --text-primary: #e8eaed;
  --text-secondary: #8b8fa3;
  --text-muted: #555870;
  --accent: #00d4aa;
  --accent-dim: rgba(0, 212, 170, 0.2);
  --accent-glow: rgba(0, 212, 170, 0.4);
  --danger: #ff4757;
  --warning: #ffa502;
  --success: #2ed573;
  --info: #3b82f6;
  --waveform: #00d4aa;
  --waveform-bg: #1a1d2e;
  --vu-green: #2ed573;
  --vu-yellow: #ffa502;
  --vu-red: #ff4757;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --glass: rgba(22, 24, 34, 0.7);
  --glass-border: rgba(255,255,255,0.08);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e8eaed;
  --bg-panel: rgba(255, 255, 255, 0.9);
  --bg-hover: rgba(0, 180, 140, 0.08);
  --bg-active: rgba(0, 180, 140, 0.12);
  --border: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 180, 140, 0.4);
  --text-primary: #1a1a2e;
  --text-secondary: #555770;
  --text-muted: #888a9e;
  --accent: #00a884;
  --accent-dim: rgba(0, 168, 132, 0.12);
  --accent-glow: rgba(0, 168, 132, 0.25);
  --waveform: #00a884;
  --waveform-bg: #e0e3e8;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0,0,0,0.06);
}

[data-theme="light"] .waveform-cursor { background: #333; box-shadow: 0 0 8px rgba(0,0,0,0.3); }
[data-theme="light"] .toast { background: #fff; }
[data-theme="light"] .login-container { background: linear-gradient(135deg, #e8f5e9 0%, #e0f2f1 50%, #e1f5fe 100%); }
[data-theme="light"] .login-card { background: #fff; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .login-logo h1 { color: #1a1a2e; }

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

html { font-size: 14px; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── App Layout ── */
#app { display: flex; flex-direction: column; height: 100vh; }

.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 52px; min-height: 52px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.1rem; color: var(--accent);
  letter-spacing: -0.5px;
}

.header-logo svg { width: 24px; height: 24px; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.main-layout {
  display: flex; flex: 1; overflow: hidden;
}

/* ── Sidebar Nav ── */
.sidebar {
  display: flex; flex-direction: column; align-items: center;
  width: 64px; min-width: 64px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 12px 0; gap: 4px;
  z-index: 50;
}

.nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border: none; background: transparent; color: var(--text-muted);
  border-radius: var(--radius-md); cursor: pointer;
  transition: var(--transition); position: relative;
  font-size: 0.6rem; gap: 3px;
}

.nav-btn svg { width: 20px; height: 20px; transition: var(--transition); }

.nav-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

.nav-btn.active {
  color: var(--accent); background: var(--bg-active);
}

.nav-btn.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 24px; background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-separator {
  width: 32px; height: 1px; background: var(--border); margin: 8px 0;
}

/* ── Content Area ── */
.content-area {
  flex: 1; display: flex; overflow: hidden;
}

.module-panel {
  flex: 1; display: none; flex-direction: column;
  padding: 20px; overflow-y: auto; gap: 16px;
}

.module-panel.active { display: flex; }

/* ── Projects Sidebar ── */
.projects-sidebar {
  width: 260px; min-width: 260px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.projects-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.projects-tree {
  flex: 1; overflow-y: auto; padding: 8px;
}

.projects-actions {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}

/* ── Tree / Navigator ── */
.tree-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition);
  font-size: 0.8rem; color: var(--text-secondary);
  user-select: none;
}

.tree-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.tree-item.active { background: var(--bg-active); color: var(--accent); }

.tree-toggle {
  display: inline-block; width: 14px; height: 14px;
  font-size: 0.6rem; transition: transform 0.2s;
  text-align: center; line-height: 14px; color: var(--text-muted);
}

.tree-toggle.open { transform: rotate(90deg); }

.tree-children {
  margin-left: 12px; border-left: 1px solid var(--border);
  padding-left: 4px;
}

.tree-children.hidden { display: none; }

.tree-item .btn { opacity: 0; padding: 2px 4px; height: 20px; font-size: 0.7rem; }
.tree-item:hover .btn { opacity: 1; }

.badge-geo {
  font-size: 0.6rem; padding: 1px 6px; border-radius: 4px;
  font-weight: 600;
}

/* ── Cards / Panels ── */
.card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.95rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}

.card-title .icon { color: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent); color: #000;
}
.btn-primary:hover { background: #00e8bb; box-shadow: 0 0 20px var(--accent-glow); }

.btn-secondary {
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-hover); }

.btn-danger { background: rgba(255,71,87,0.15); color: var(--danger); }
.btn-danger:hover { background: rgba(255,71,87,0.25); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }

.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius-sm);
}

.btn-lg { padding: 12px 24px; font-size: 0.95rem; border-radius: var(--radius-md); }

.btn-record {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--danger); border: 3px solid rgba(255,71,87,0.3);
  color: #fff; padding: 0;
  animation: none;
}

.btn-record.recording {
  animation: pulse-record 1.5s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(255,71,87,0.5);
}

@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 15px rgba(255,71,87,0.4); }
  50% { box-shadow: 0 0 35px rgba(255,71,87,0.7); }
}

/* ── Form Controls ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.75rem; font-weight: 500; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  color: var(--text-primary); font-family: inherit; font-size: 0.85rem;
  transition: var(--transition); outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-textarea { resize: vertical; min-height: 100px; }

/* ── Range Slider ── */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--bg-tertiary); border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px;
  background: var(--accent); border-radius: 50%;
  cursor: pointer; box-shadow: 0 0 8px var(--accent-glow);
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2); box-shadow: 0 0 14px var(--accent-glow);
}

/* ── Waveform ── */
.waveform-container {
  background: var(--waveform-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
  height: 160px; cursor: crosshair;
}

.waveform-canvas { width: 100%; height: 100%; display: block; }

.waveform-cursor {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #fff; pointer-events: none;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
  transition: left 0.05s linear;
}

.waveform-selection {
  position: absolute; top: 0; bottom: 0;
  background: rgba(0, 212, 170, 0.15);
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  pointer-events: none;
}

.waveform-time {
  position: absolute; bottom: 4px; right: 8px;
  font-size: 0.7rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── VU Meter ── */
.vu-meter {
  width: 100%; height: 8px;
  background: var(--bg-tertiary); border-radius: 4px;
  overflow: hidden; position: relative;
}

.vu-meter-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--vu-green) 0%, var(--vu-yellow) 70%, var(--vu-red) 100%);
  transition: width 0.08s linear;
  width: 0%;
}

/* ── EQ Bands ── */
.eq-band {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1;
}

.eq-band label {
  font-size: 0.65rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.3px;
}

.eq-band .eq-value {
  font-size: 0.7rem; color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.eq-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  height: 120px;
}

/* ── Toolbar ── */
.toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.toolbar .separator {
  width: 1px; height: 24px; background: var(--border); margin: 0 4px;
}

/* ── Tabs ── */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
}

.tab {
  padding: 8px 16px; border: none; background: transparent;
  color: var(--text-muted); font-family: inherit; font-size: 0.8rem;
  cursor: pointer; transition: var(--transition);
  border-bottom: 2px solid transparent;
  font-weight: 500;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Badge / Tag ── */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 20px; font-size: 0.7rem; font-weight: 600;
}

.badge-accent { background: var(--accent-dim); color: var(--accent); }
.badge-danger { background: rgba(255,71,87,0.15); color: var(--danger); }
.badge-success { background: rgba(46,213,115,0.15); color: var(--success); }

/* ── Tree View ── */
.tree-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: var(--radius-sm);
  font-size: 0.8rem; cursor: pointer;
  color: var(--text-secondary); transition: var(--transition);
}

.tree-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.tree-item.active { background: var(--bg-active); color: var(--accent); }

.tree-children { padding-left: 16px; }

.tree-toggle {
  width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; color: var(--text-muted); transition: var(--transition);
}

.tree-toggle.open { transform: rotate(90deg); }

/* ── Image Preview ── */
.img-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

.img-preview {
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border); position: relative;
  background: var(--bg-tertiary);
}

.img-preview img {
  width: 100%; height: auto; display: block;
  max-height: 300px; object-fit: contain;
}

.img-preview .img-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  font-size: 0.75rem; color: var(--text-secondary);
  display: flex; justify-content: space-between;
}

/* ── Drag & Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px; text-align: center;
  color: var(--text-muted); cursor: pointer;
  transition: var(--transition);
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim);
}

.drop-zone svg { width: 40px; height: 40px; opacity: 0.5; }

/* ── Text Editor ── */
.text-editor-content {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 16px; min-height: 300px;
  color: var(--text-primary);
  font-size: 0.9rem; line-height: 1.7;
  outline: none;
}

.text-editor-content:focus {
  border-color: var(--accent);
}

.text-editor-content h1 { font-size: 1.5rem; margin-bottom: 8px; }
.text-editor-content h2 { font-size: 1.2rem; margin-bottom: 6px; }
.text-editor-content ul, .text-editor-content ol { padding-left: 20px; }

/* ── Recording Controls ── */
.rec-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; padding: 20px;
}

.rec-timer {
  font-size: 2rem; font-weight: 300;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary); letter-spacing: 2px;
  min-width: 160px; text-align: center;
}

.rec-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--text-muted);
}

.rec-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
}

.rec-status.recording .dot {
  background: var(--danger);
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Language Selector ── */
.lang-selector {
  display: flex; gap: 4px; flex-wrap: wrap;
}

.lang-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 20px; background: transparent;
  color: var(--text-secondary); font-size: 0.75rem;
  cursor: pointer; transition: var(--transition);
  font-family: inherit;
}

.lang-btn:hover { border-color: var(--border-hover); background: var(--bg-hover); color: var(--text-primary); }
.lang-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 10px var(--accent-dim); }

/* ── Compression Stats ── */
.compression-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}

.stat-card {
  background: var(--bg-tertiary); border-radius: var(--radius-md);
  padding: 12px; text-align: center;
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 1.4rem; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: var(--transition);
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  min-width: 450px; max-width: 90vw; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-title {
  font-size: 1.1rem; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  padding: 12px 20px; border-radius: var(--radius-md);
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 0.85rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease-out;
  display: flex; align-items: center; gap: 8px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .projects-sidebar { width: 220px; min-width: 220px; }
}

@media (max-width: 768px) {
  .projects-sidebar { display: none; }
  .sidebar { width: 52px; min-width: 52px; }
  .nav-btn { width: 40px; height: 40px; font-size: 0; }
  .module-panel { padding: 12px; }
}

/* ── Utility ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── Login Screen ── */
.login-container {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #08090d 0%, #0a1628 50%, #0d1f2d 100%);
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-logo {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 32px;
  color: var(--accent);
}

.login-logo h1 {
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-primary); letter-spacing: -0.5px;
}

.login-users {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 260px; overflow-y: auto;
}

.login-user-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--bg-tertiary);
  color: var(--text-primary); font-family: inherit; font-size: 0.9rem;
  cursor: pointer; transition: var(--transition); width: 100%;
  text-align: left;
}

.login-user-btn:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.login-user-btn.active { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

.login-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}

.auth-error {
  color: var(--danger); font-size: 0.8rem;
  min-height: 20px; margin-bottom: 8px;
}

.login-lang {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Theme Toggle ── */
.theme-toggle {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px;
}

.theme-toggle button {
  border: none; background: transparent;
  color: var(--text-muted); font-size: 0.75rem;
  padding: 4px 10px; border-radius: 16px;
  cursor: pointer; transition: var(--transition);
  font-family: inherit;
}

.theme-toggle button.active {
  background: var(--accent-dim); color: var(--accent);
}

/* ── User Badge ── */
.user-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
}

.user-badge:hover { border-color: var(--border-hover); }

/* ── Quota Bar ── */
.quota-bar {
  position: relative; width: 140px; height: 24px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.quota-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent), #00e8bb);
  border-radius: 12px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.quota-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 600;
  color: var(--text-primary); z-index: 1;
  text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

/* ── Code Protection ── */
body.protected {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body.protected input,
body.protected textarea,
body.protected [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ── Library Selection ── */
.lib-card-check {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px;
  accent-color: var(--accent);
  cursor: pointer; z-index: 5;
}

.lib-card { position: relative; }
.lib-card.selected { outline: 2px solid var(--accent); }

.lib-section-header {
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.5px; padding: 8px 0 4px;
  border-bottom: 1px solid var(--border); margin-bottom: 8px;
}

/* ── POI Cards ── */
.poi-card {
  padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 8px;
  background: var(--bg-secondary); transition: var(--transition);
  border-left: 3px solid var(--accent);
}

.poi-card:hover { border-color: var(--border-hover); background: var(--bg-hover); }

/* ── Modal Enhancements ── */
.modal-title {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 16px;
  color: var(--text-primary);
}

.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--border);
}

.mb-8 { margin-bottom: 8px; }

/* ── POI tag on Library cards ── */
.poi-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.65rem; padding: 2px 8px; border-radius: 10px;
  background: rgba(0,212,170,0.1); color: var(--accent);
  border: 1px solid rgba(0,212,170,0.2);
}

.btn-danger {
  background: var(--danger); color: white; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; transition: var(--transition);
}
.btn-danger:hover { opacity: 0.85; }

/* ── Geo Context Bar ── */
.geo-context-bar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  min-height: 40px;
}
