/* ═══ RESET & BASE ══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:     #0f766e;
  --primary-lt:  #ccfbf1;
  --primary-dk:  #0d5f58;
  --accent:      #f59e0b;
  --danger:      #ef4444;
  --danger-lt:   #fee2e2;
  --success:     #22c55e;
  --success-lt:  #dcfce7;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-400:    #9ca3af;
  --gray-600:    #4b5563;
  --gray-800:    #1f2937;
  --sidebar-w:   220px;
  --radius:      10px;
  --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ═══ SIDEBAR ════════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
}

.logo-icon { font-size: 22px; flex-shrink: 0; }

.logo-text { flex: 1; overflow: hidden; white-space: nowrap; transition: opacity .2s, width .2s; }

.sidebar-toggle {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .2s;
  padding: 0;
  line-height: 1;
}
.sidebar-toggle:hover { background: var(--gray-100); color: var(--primary); }

.sidebar-nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--gray-600);
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link:hover { background: var(--gray-100); color: var(--gray-800); }
.nav-link.active { background: var(--primary-lt); color: var(--primary); }
.nav-icon { font-size: 16px; flex-shrink: 0; }
.nav-label { transition: opacity .2s; }

/* ── Collapsed sidebar ── */
.sidebar--collapsed {
  width: 52px;
}
.sidebar--collapsed .logo-text,
.sidebar--collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }
.sidebar--collapsed .sidebar-toggle { transform: rotate(180deg); }
.sidebar--collapsed .sidebar-logo { padding: 20px 14px; justify-content: center; gap: 0; }
.sidebar--collapsed .nav-link { padding: 10px; justify-content: center; gap: 0; }

.sidebar { transition: width .2s ease; }

/* ═══ MAIN ═══════════════════════════════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  transition: margin-left .2s ease;
}
.sidebar--collapsed ~ .main {
  margin-left: 52px;
}

#app {
  padding: 28px 32px;
}

/* ═══ PAGE HEADER ════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { color: var(--gray-400); font-size: 13px; margin-top: 2px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 16px;
  cursor: pointer;
}
.back-link:hover { color: var(--primary); }

/* ═══ BUTTONS ════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }

.btn-outline {
  background: #fff;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-outline:hover { background: var(--gray-100); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: 16px; padding: 4px 6px;
  border-radius: 6px; transition: all .15s;
}
.btn-icon:hover { background: var(--gray-100); color: var(--gray-800); }
.btn-icon.danger:hover { background: var(--danger-lt); color: var(--danger); }
.btn:disabled { opacity: .7; cursor: not-allowed; }
.btn-icon:disabled { opacity: .5; cursor: not-allowed; }

.btn-spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}
.btn-spinner--dark {
  border-color: rgba(0,0,0,.2);
  border-top-color: var(--gray-600);
}

/* ═══ CARDS ══════════════════════════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all .15s;
  box-shadow: var(--shadow);
}
.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon { font-size: 28px; margin-bottom: 10px; }
.card-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.card-desc { color: var(--gray-400); font-size: 12px; margin-bottom: 14px; }
.card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--gray-600);
}
.card-meta-item { display: flex; align-items: center; gap: 4px; }

/* ═══ TABLE ══════════════════════════════════════════════════════════════════ */
.table-wrap {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: var(--gray-50);
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

.td-actions { display: flex; gap: 6px; align-items: center; }

/* ═══ BADGES ══════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.badge-reading   { background: #dbeafe; color: #1d4ed8; }
.badge-listening { background: #fce7f3; color: #be185d; }
.badge-writing   { background: #fef9c3; color: #854d0e; }
.badge-speaking  { background: #f0fdf4; color: #166534; }
.badge-active    { background: var(--success-lt); color: #166534; }
.badge-inactive  { background: var(--gray-100); color: var(--gray-400); }

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--gray-100);
  border-radius: 8px;
  font-size: 13px;
  color: var(--gray-600);
}

/* ═══ SKILL FILTER TABS ══════════════════════════════════════════════════════ */
.skill-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.skill-tab {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--gray-200);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  color: var(--gray-600);
}
.skill-tab:hover { border-color: var(--primary); color: var(--primary); }
.skill-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ═══ FORM ════════════════════════════════════════════════════════════════════ */
.form-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  max-width: 960px;
}

.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}
.form-hint { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  color: var(--gray-800);
  background: #fff;
  outline: none;
  transition: border .15s;
  font-family: inherit;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.1);
}

.form-textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.7;
}

.form-textarea.large { min-height: 320px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.skill-section { margin-top: 8px; }

/* ═══ ANSWER GRID ════════════════════════════════════════════════════════════ */
.answer-grid-wrap {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 16px;
}

.answer-count-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.answer-count-row input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  text-align: center;
}
.answer-count-row input:focus { border-color: var(--primary); }

.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}

.answer-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 10px;
}

.answer-row-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.location-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 10px 6px 38px;
  border-top: 1px dashed var(--gray-200);
}

.explanation-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px 4px 38px;
  border-top: 1px dashed var(--gray-200);
}

.field-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
  min-width: 72px;
}

.location-text-display {
  flex: 1;
  font-size: 12px;
  color: var(--gray-600);
  white-space: normal;
  word-break: break-word;
  font-style: italic;
  padding-top: 1px;
}

.btn-pick-location {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.6;
}
.btn-pick-location.picking-active {
  background: var(--primary);
  color: #fff;
}

.btn-clear-location {
  font-size: 13px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.btn-clear-location.hidden { display: none; }

.answer-explanation {
  border: none;
  outline: none;
  font-size: 12px;
  resize: none;
  padding: 2px 0;
  color: var(--gray-600);
  background: transparent;
  width: 100%;
  font-family: inherit;
  line-height: 1.5;
}
.answer-explanation::placeholder { color: var(--gray-400); }
.answer-explanation:focus { color: var(--gray-800); }

#q-content.location-picking {
  border-color: #f97316 !important;
  outline: 2px solid #fed7aa;
  cursor: crosshair;
}
.location-pick-hint {
  font-size: 12px;
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.location-pick-hint.hidden { display: none; }

.q-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  min-width: 30px;
  padding-top: 4px;
}

.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  flex: 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-lt);
  color: var(--primary-dk);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
}
.chip-remove:hover { color: var(--danger); }

.chip-input {
  border: none;
  outline: none;
  font-size: 12px;
  width: 100px;
  background: transparent;
  color: var(--gray-800);
  padding: 2px 0;
}
.chip-input::placeholder { color: var(--gray-400); }

/* ═══ VOCABULARY SECTION ════════════════════════════════════════════════════ */
.vocab-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.vocab-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vocab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  flex-wrap: wrap;
}

.vocab-word {
  font-weight: 700;
  color: var(--primary-dk);
  min-width: 80px;
}

.vocab-def {
  flex: 1;
  color: var(--gray-600);
  min-width: 120px;
}

.vocab-example {
  flex: 1;
  color: var(--gray-400);
  font-style: italic;
  font-size: 12px;
  min-width: 100px;
}

.vocab-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 16px;
  line-height: 1;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
}
.vocab-remove:hover { color: var(--danger); }

/* ═══ AUDIO UPLOAD ═══════════════════════════════════════════════════════════ */
.audio-upload-area {
  border: 2px dashed var(--gray-200);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.audio-upload-area:hover,
.audio-upload-area.dragover { border-color: var(--primary); background: var(--primary-lt); }

.audio-upload-area input[type="file"] { display: none; }
.audio-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--success-lt);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #166534;
}
.audio-preview .remove-audio {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger);
  font-size: 16px;
}

/* ═══ MODAL ══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--gray-400);
  line-height: 1;
}
.modal-close:hover { color: var(--gray-800); }

.modal-body { padding: 20px 24px 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

/* Question picker inside modal */
.question-picker {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-top: 8px;
}

.question-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background .1s;
}
.question-picker-item:last-child { border-bottom: none; }
.question-picker-item:hover { background: var(--gray-50); }
.question-picker-item.selected { background: var(--primary-lt); }
.question-picker-item input[type="radio"] { accent-color: var(--primary); }

/* ═══ DETAIL HEADER ══════════════════════════════════════════════════════════ */
.detail-header {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.detail-header-info h2 { font-size: 20px; font-weight: 700; }
.detail-header-meta {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-400);
}
.detail-header-meta span { display: flex; align-items: center; gap: 4px; }

/* ═══ EMPTY STATE ════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p { font-size: 13px; margin-bottom: 20px; }

/* ═══ LOADING ════════════════════════════════════════════════════════════════ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px;
  color: var(--gray-400);
  gap: 12px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ TOAST ══════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: slideIn .2s ease;
  max-width: 320px;
}
.toast-success { background: #166534; color: #fff; }
.toast-error   { background: var(--danger); color: #fff; }
.toast-info    { background: #1e40af; color: #fff; }

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

/* ═══ DEADLINE BADGE ═════════════════════════════════════════════════════════ */
.deadline {
  font-size: 12px;
  color: var(--gray-600);
}
.deadline.overdue { color: var(--danger); font-weight: 600; }

/* ═══ TOGGLE SWITCH ══════════════════════════════════════════════════════════ */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-200);
  border-radius: 99px;
  cursor: pointer;
  transition: .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ═══ GRADING LAYOUT ══════════════════════════════════════════════════════════ */
.grading-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.grading-content-panel,
.grading-sidebar {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

.grading-sidebar {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.grading-panel-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grading-select-hint {
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--primary);
  background: var(--primary-lt);
  padding: 2px 8px;
  border-radius: 99px;
}

.grading-sidebar-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

/* Writing text display */
.writing-display {
  font-size: 15px;
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  user-select: text;
  color: var(--gray-800);
  min-height: 300px;
}

/* Annotation highlights */
.ann-highlight {
  background: #fef08a;
  border-bottom: 2px solid #eab308;
  border-radius: 2px;
  cursor: pointer;
  padding: 1px 0;
  transition: background .15s;
  position: relative;
}
.ann-highlight:hover { background: #fde047; }

.ann-marker {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: #ca8a04;
  padding: 1px 4px;
  border-radius: 99px;
  margin-left: 2px;
  vertical-align: super;
  line-height: 1;
}

/* Annotation cards in sidebar */
.annotations-list { display: flex; flex-direction: column; gap: 8px; }

.annotations-empty {
  font-size: 12px;
  color: var(--gray-400);
  padding: 8px 0;
  line-height: 1.6;
}

.annotation-card {
  border: 1px solid var(--gray-200);
  border-left: 3px solid #eab308;
  border-radius: 0 6px 6px 0;
  padding: 8px 10px;
  background: var(--gray-50);
  font-size: 12px;
}

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

.annotation-number {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: #ca8a04;
  padding: 1px 6px;
  border-radius: 99px;
}

.annotation-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  transition: color .15s;
}
.annotation-delete:hover { color: var(--danger); }

.annotation-quote {
  color: var(--gray-400);
  font-style: italic;
  font-size: 11px;
  margin-bottom: 4px;
  line-height: 1.5;
}

.annotation-comment {
  color: var(--gray-800);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* AI Feedback */
.ai-feedback-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-feedback-toggle:hover { color: var(--primary); }

.ai-toggle-icon {
  font-size: 10px;
  color: var(--gray-400);
}

.ai-feedback-block {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 12px;
}

.ai-feedback-criterion {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 5px;
}

.ai-feedback-text {
  font-size: 13px;
  color: var(--gray-800);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Floating annotation popup */
.annotation-popup {
  position: absolute;
  z-index: 500;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  width: 340px;
}

.annotation-popup-quote {
  font-size: 12px;
  color: var(--gray-600);
  font-style: italic;
  background: var(--gray-100);
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.annotation-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
