:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --border: #334155;
  --border-focus: #60a5fa;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.16);
  --success-soft: rgba(16, 185, 129, 0.15);
  --warning-soft: rgba(245, 158, 11, 0.15);
  --danger-soft: rgba(239, 68, 68, 0.15);
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: clip;
  background-color: var(--bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* TOP NAVBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
}

.topbar-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-title,
.site-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  margin: 0;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}

.topbar-annotator .topbar-inner {
  justify-content: flex-end;
}

.source-filter-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.source-filter-pill label {
  color: var(--text-muted);
  font-weight: 500;
}

.source-select {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 15px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.user-pill::-webkit-scrollbar {
  display: none;
}

.user-pill > * {
  flex-shrink: 0;
}

.user-pill strong {
  color: var(--primary);
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-light);
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}

.btn-link:hover {
  color: var(--primary);
}

.btn-admin-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-admin-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* MAIN WORKSPACE LAYOUT */
.main-container {
  max-width: 1560px;
  margin: 18px auto 60px;
  padding: 0 20px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(440px, 1.45fr) minmax(480px, 1fr);
  gap: 22px;
  align-items: start;
}

/* ARTICLE PANEL (LEFT) */
.article-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 94px);
  overflow-y: auto;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-source {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #bfdbfe;
}

.font-controls {
  display: inline-flex;
  gap: 4px;
}

.font-btn {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.font-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.article-title {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-main);
  margin: 0 0 16px 0;
}

.article-body {
  font-size: 16px;
  line-height: 1.72;
  color: var(--text-main);
}

.article-body p {
  margin: 0 0 14px 0;
}

.article-footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-skip {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-skip:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.skip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.skip-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skip-popover-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

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

.btn-skip-confirm {
  flex: 1;
  background: var(--danger);
  border: 1px solid var(--danger);
  color: #fff;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-skip-confirm:hover {
  opacity: 0.9;
}

.btn-skip-cancel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-skip-cancel:hover {
  color: var(--text-main);
  border-color: var(--text-light);
}

/* QUESTIONNAIRE PANEL (RIGHT) */
.form-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.progress-bar-wrap {
  flex: 1;
  min-width: 180px;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  width: 0%;
  transition: width 0.25s ease;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.section-header {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-soft);
}

.question-block {
  margin-bottom: 20px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.question-block:last-child {
  margin-bottom: 0;
}

.question-block.unanswered-error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.question-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px 0;
}

.question-hint {
  font-size: 12.5px;
  color: var(--text-light);
  margin: 0 0 10px 0;
}

/* OPTION BUTTONS & GRIDS */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.options-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.options-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.opt-btn.span-full {
  grid-column: 1 / -1;
}

.opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
  min-height: 44px;
}

.opt-btn:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #f8fbff;
}

.opt-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.opt-btn:disabled,
.opt-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text-light);
}

.opt-btn.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: #1e3a8a;
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--primary);
}

.opt-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.opt-btn.checkbox .opt-indicator {
  border-radius: 5px;
}

.opt-btn.selected .opt-indicator {
  border-color: var(--primary);
  background: var(--primary);
}

.opt-btn.selected .opt-indicator::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.opt-btn.checkbox.selected .opt-indicator::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  width: auto;
  height: auto;
  background: none;
}

.conditional-box {
  margin-top: 12px;
  padding: 14px;
  border-left: 3px solid var(--primary);
  background: var(--surface-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* SUBMIT BAR */
.submit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  position: sticky;
  bottom: 12px;
  z-index: 40;
}

.btn-submit {
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-submit:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* EMPTY STATE */
.empty-queue-box {
  text-align: center;
  padding: 48px 24px;
  max-width: 640px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* MODAL */
dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 520px;
  width: calc(100% - 24px);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 30px;
  background: var(--surface);
  color: var(--text-main);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

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

.dialog-header h2 {
  font-size: 22px;
  margin: 0;
}

.user-modal-desc {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 20px;
}

#user-modal .form-group label,
.login-card .form-group label {
  font-size: 16px;
  margin-bottom: 8px;
}

#user-modal .form-input,
.login-card .form-input {
  font-size: 16px;
  padding: 12px 14px;
}

#user-modal .btn-primary,
.login-card .btn-primary {
  font-size: 16px;
  min-height: 48px !important;
}

.btn-close-dialog {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

/* FORMS */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: max(14px, 1em);
  font-family: inherit;
  background: var(--surface);
  color: var(--text-main);
}

.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
}

.btn-primary {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger-outline {
  background: var(--surface);
  border: 1px solid #fca5a5;
  color: var(--danger);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger-outline:hover {
  background: var(--danger-soft);
}

/* ADMIN DASHBOARD */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none !important;
}

/* RESPONSIVE TABLET & MOBILE */
@media (max-width: 1080px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .article-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 10px 12px;
  }

  .topbar-inner {
    gap: 8px;
  }

  .topbar-controls {
    width: 100%;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .user-pill {
    flex: 1 1 auto;
    font-size: 13.5px;
    padding: 6px 12px;
  }

  .main-container {
    padding: 0 12px;
  }

  .article-panel {
    padding: 16px;
  }

  .help-fab-wrap {
    bottom: 14px;
    left: 14px;
  }

  .options-grid.cols-3,
  .options-grid.cols-2 {
    grid-template-columns: 1fr;
  }

  .article-title {
    font-size: 19px;
  }

  .section-card {
    padding: 14px;
  }
}


/* ADMIN HELPER STYLES */
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  margin: 48px auto;
  box-shadow: var(--shadow);
}

.admin-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-heading {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px 0;
  color: var(--text-main);
}

.sub-heading {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--text-main);
}

.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.admin-two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: start;
}

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

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.data-table td.cell-wrap {
  white-space: normal;
  min-width: 220px;
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.back-link:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .admin-two-col {
    grid-template-columns: 1fr;
  }
}

/* FLOATING TASK HELP WIDGET */
.help-fab-wrap {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 150;
}

.help-fab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, background-color 0.15s, color 0.15s, transform 0.15s;
}

.help-fab-btn:hover,
.help-fab-wrap.open .help-fab-btn {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.help-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  width: 310px;
  max-width: calc(100vw - 28px);
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.help-popover-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--primary);
}

.help-popover p {
  margin: 0 0 6px 0;
  color: var(--text-muted);
}

.help-popover ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-main);
}

.help-popover li + li {
  margin-top: 4px;
}

@media (hover: hover) {
  .help-fab-wrap:hover .help-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
}

.help-fab-wrap:focus-within .help-popover,
.help-fab-wrap.open .help-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* THEME TOGGLE & DARK THEME OVERRIDES */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-main);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}

.btn-theme-toggle:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.btn-theme-toggle .theme-icon {
  display: block;
}

[data-theme="dark"] .btn-theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .btn-theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .topbar {
  background: rgba(17, 24, 39, 0.92);
}

[data-theme="dark"] .article-body {
  color: #e2e8f0;
}

[data-theme="dark"] .opt-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .opt-btn.selected {
  color: #dbeafe;
}

[data-theme="dark"] .btn-submit:disabled {
  background: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .toast {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid var(--border);
}

[data-theme="dark"] .btn-danger-outline {
  border-color: rgba(239, 68, 68, 0.45);
}

[data-theme="dark"] .badge-primary {
  border-color: rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .badge-source {
  background: var(--warning-soft);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}