/* ── Campaign-specific styles ────────────────────────────────── */

/* ── Campaign Cards ──────────────────────────────────────────── */

.campaign-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.campaign-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.campaign-card .camp-name {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.campaign-card .camp-meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.campaign-card .camp-latest {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 6px;
}

.camp-capacity {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.camp-capacity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.camp-capacity-row strong {
  color: var(--ink);
  font-size: 0.8rem;
  white-space: nowrap;
}

.camp-capacity-track {
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.camp-capacity-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.camp-capacity-note {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.camp-capacity.nearing-limit {
  border-color: rgba(192, 57, 43, 0.28);
}

.camp-capacity.nearing-limit .camp-capacity-fill {
  background: var(--error);
}

.camp-capacity-readonly {
  display: inline-flex;
  width: auto;
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.quick-recap-card {
  border: 1px dashed var(--border-strong);
  background: var(--surface-alt);
  transition: background 0.15s, border-color 0.15s;
}

.quick-recap-card:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.no-campaigns {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-faint);
}

.no-campaigns p {
  font-size: 0.95rem;
}

/* ── Dashboard Tiles ─────────────────────────────────────────── */

.campaign-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 8px 0 20px;
  border-bottom: 2px solid var(--accent-border);
}

.campaign-tab {
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.campaign-tab:hover {
  color: var(--ink);
  background: rgba(212, 163, 77, 0.06);
}

.campaign-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.campaign-tab-pane {
  display: none;
}

.campaign-tab-pane.active {
  display: block;
}

.campaign-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.campaign-dashboard-compact {
  margin: 0 auto 20px;
}

.campaign-secondary-actions {
  margin-top: 12px;
}

.dashboard-customize-row {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 8px;
}

.dashboard-tile.dashboard-tile-hidden {
  display: none !important;
}

.dashboard-customize-list {
  display: grid;
  gap: 8px;
}

.dashboard-customize-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  cursor: pointer;
}

.dashboard-customize-option input {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.dashboard-customize-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard-customize-option strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.dashboard-customize-option small {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.export-options-list {
  display: grid;
  gap: 8px;
}

.export-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  cursor: pointer;
}

.export-option input {
  width: auto;
  margin: 3px 0 0;
  flex-shrink: 0;
}

.export-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-option strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.export-option small {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.export-options-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.campaign-secondary-actions .dashboard-tile {
  min-height: 84px;
  padding: 12px;
}

.campaign-secondary-actions .tile-icon {
  width: 32px;
  height: 32px;
  font-size: 1.35rem;
}

@media (max-width: 768px) {
  .campaign-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dashboard-tile {
  background: linear-gradient(180deg, var(--surface-alt), var(--surface));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 100px;
  justify-content: center;
}

.dashboard-tile:hover {
  background: linear-gradient(180deg, #222640, var(--surface-alt));
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32), 0 0 18px rgba(212, 163, 77, 0.08);
}

.dashboard-tile:active {
  transform: translateY(0);
}

.tile-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 2px;
  border-radius: 10px;
  background: rgba(11, 13, 23, 0.58);
  border: 1px solid rgba(212, 163, 77, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tile-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.2;
}

.tile-desc {
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.2;
}

.campaign-action-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
  text-align: center;
}

.campaign-action-row-primary {
  margin-top: 0;
  margin-bottom: 20px;
}

.campaign-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface-alt), var(--surface));
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.campaign-action-btn:hover {
  background: linear-gradient(180deg, #222640, var(--surface-alt));
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32), 0 0 18px rgba(212, 163, 77, 0.08);
}

.campaign-action-btn:active {
  transform: translateY(0);
}

.campaign-action-btn:disabled {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.campaign-action-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(11, 13, 23, 0.58);
  border: 1px solid rgba(212, 163, 77, 0.16);
  line-height: 1;
}

/* ── Timeline ────────────────────────────────────────────────── */

.timeline-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.timeline-list-header h3 {
  margin: 0 0 2px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.timeline-list-header p {
  margin: 0;
  font-size: 0.8rem;
}

.timeline-entry {
  position: relative;
  padding-left: 32px;
  padding-bottom: 24px;
  border-left: 2px solid var(--border);
  margin-left: 8px;
}

.timeline-entry:last-child {
  border-left-color: transparent;
}

.timeline-dot {
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-border);
}

.timeline-entry .tl-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.timeline-entry .tl-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.timeline-entry .tl-session {
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-weight: 500;
}

.timeline-entry .tl-date {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.timeline-entry .tl-preview {
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-entry .tl-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tl-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

/* ── Thread Tracker ──────────────────────────────────────────── */

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.threads-collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.threads-collapsible + .threads-collapsible {
  margin-top: 10px;
}

.threads-collapsible summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 14px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.threads-collapsible summary::-webkit-details-marker {
  display: none;
}

.threads-collapsible summary::after {
  content: '+';
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--accent);
  font-weight: 700;
}

.threads-collapsible[open] summary::after {
  content: '-';
}

.threads-collapsible .thread-list {
  padding: 0 12px 12px;
}

.thread-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.5;
}

.thread-item.thread-open {
  background: rgba(184, 110, 44, 0.06);
  border: 1px solid var(--accent-border);
  color: var(--ink);
}

.thread-item.thread-resolved {
  background: var(--success-bg);
  border: 1px solid rgba(74, 140, 92, 0.15);
  color: var(--ink-muted);
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
}

.thread-item .thread-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.thread-item .thread-meta {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

.threads-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

/* ── Expandable Recap in Timeline ────────────────────────────── */

.tl-expand-btn {
  font: inherit;
  font-size: 0.82rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 6px;
}

.tl-expand-btn:hover {
  text-decoration: underline;
}

.tl-delete-btn {
  color: #dc2626;
}

.tl-delete-btn:hover {
  color: #b91c1c;
  text-decoration: underline;
}

.tl-full-recap {
  display: none;
  margin-top: 12px;
  padding: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.tl-full-recap.visible {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

.tl-full-recap .recap-narrative {
  font-size: 0.9rem;
}

/* ── Continuity Banner ───────────────────────────────────────── */

#continuity-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}

/* ── Recap Editing ──────────────────────────────────────────── */

.recap-edit-form {
  padding: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  animation: fadeSlideIn 0.3s ease;
}

.recap-edit-title {
  width: 100%;
  font-family: 'Lora', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.recap-edit-metadata {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.metadata-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metadata-field label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.metadata-input {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.metadata-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.recap-edit-textarea {
  width: 100%;
  min-height: 200px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.65;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px;
  resize: vertical;
  margin-bottom: 12px;
}

.recap-edit-textarea:focus,
.recap-edit-title:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.recap-edit-meta-group {
  margin-bottom: 12px;
}

.recap-edit-meta-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.recap-edit-meta {
  width: 100%;
  min-height: 60px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  resize: vertical;
}

.recap-edit-meta:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Edit Reason Selector ───────────────────────────────────── */

.recap-edit-reason {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.recap-edit-reason label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.recap-edit-reason select {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

.recap-edit-reason input[type="text"] {
  font-size: 0.85rem;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

/* ── Edit Actions ───────────────────────────────────────────── */

.recap-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ── Reason Badges ──────────────────────────────────────────── */

.reason-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reason-badge.canon-fix { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.reason-badge.retcon { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.reason-badge.correction { background: rgba(107, 114, 128, 0.12); color: #6b7280; }
.reason-badge.player-note { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.reason-badge.ai-regen { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.reason-badge.other { background: rgba(245, 158, 11, 0.12); color: #d97706; }

/* ── Edited Badge (timeline) ────────────────────────────────── */

.recap-edited-badge {
  font-size: 0.72rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* ── Revision History Panel ─────────────────────────────────── */

.recap-history-panel {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: fadeSlideIn 0.3s ease;
}

.recap-history-panel h4 {
  font-size: 0.88rem;
  margin-bottom: 10px;
  color: var(--ink);
}

.recap-history-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.recap-history-entry:last-child {
  border-bottom: none;
}

.recap-history-entry .history-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.recap-history-entry .history-meta .history-time {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.recap-history-entry .history-meta .history-user {
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.recap-history-entry .history-fields {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

.recap-history-entry .history-note {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 4px;
}

.history-toggle-btn {
  font: inherit;
  font-size: 0.78rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 4px;
}

.history-toggle-btn:hover {
  text-decoration: underline;
}

.history-snapshot {
  display: none;
  margin-top: 8px;
  padding: 10px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  max-height: 300px;
  overflow-y: auto;
}

.history-snapshot.visible {
  display: block;
  animation: fadeSlideIn 0.2s ease;
}

/* ── Share Badge (timeline) ─────────────────────────────────── */

.share-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.share-badge:hover {
  background: var(--accent);
  color: white;
}

.share-badge:disabled {
  cursor: wait;
  opacity: 0.68;
}

/* ── Campaign Section Labels ─────────────────────────────────── */

.campaign-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.camp-role-badge {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

/* ── Notes (Multi-Perspective Canon) ─────────────────────────── */

.tl-notes {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-card {
  padding: 10px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  animation: fadeSlideIn 0.25s ease;
}

.note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.note-author {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.note-vis-badge {
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 8px;
  font-weight: 600;
  cursor: default;
  user-select: none;
}

.note-vis-badge.note-private {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.note-vis-badge.note-party {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.note-vis-badge.note-dm-only {
  background: rgba(234, 88, 12, 0.1);
  color: #ea580c;
}

.note-delete-btn {
  font: inherit;
  font-size: 0.9rem;
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0 4px;
  margin-left: auto;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.note-delete-btn:hover {
  opacity: 1;
  color: #ef4444;
}

.note-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 4px;
  overflow-wrap: break-word;
}

.note-content {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.55;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ── Inline Note Editor ────────────────────────────────────────── */

.note-edit-inline {
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideIn 0.2s ease;
}

.note-editor-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.toolbar-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.toolbar-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--ink);
}

.note-edit-textarea {
  width: 100%;
  min-height: 120px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  background: var(--bg-subtle);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px;
  resize: vertical;
  margin-bottom: 12px;
}

.note-edit-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.note-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Party Panel (Invites & Members) ─────────────────────────── */

.party-panel {
  margin-top: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: fadeSlideIn 0.25s ease;
}

.known-names-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.known-names-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.known-names-header h4 {
  margin: 0 0 3px;
  font-size: 0.98rem;
}

.known-names-header p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

.known-name-seeds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 12px;
}

.known-name-seeds-label,
.known-name-group-label {
  width: 100%;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.known-name-seed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(200, 151, 62, 0.32);
  background: rgba(200, 151, 62, 0.1);
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  padding: 4px 9px;
}

.known-name-seed small {
  color: var(--ink-faint);
  font-size: 0.68rem;
}

.known-name-seed:hover {
  border-color: var(--accent);
}

.known-name-group {
  margin-top: 12px;
}

.known-name-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.known-name-aliases {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 0.76rem;
}

.known-name-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .known-names-header,
  .known-name-card {
    flex-direction: column;
  }
}

/* ── Invite Panel ────────────────────────────────────────────── */

.invite-panel-content {
  display: flex;
  flex-direction: column;
}

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

.invite-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.invite-code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  flex: 1;
}

.invite-usage {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.invite-revoke {
  color: #ef4444 !important;
}

/* ── Member List ─────────────────────────────────────────────── */

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

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.member-name {
  flex: 1;
  font-weight: 500;
  color: var(--ink);
}

.member-role-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.member-role-badge.role-dm {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.member-role-badge.role-player {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.btn-sm {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-sm:hover {
  background: var(--surface-alt);
  border-color: var(--border-strong);
}

/* ── Recap Style Picker ──────────────────────────────────────── */

.style-picker {
  margin-bottom: 20px;
}

.style-picker-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.style-picker-buttons.try-style-buttons {
  grid-template-columns: repeat(3, 1fr);
}

.style-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
  font-family: 'Inter', sans-serif;
  text-align: center;
  min-height: 80px;
  justify-content: center;
}

.style-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-alt);
  transform: translateY(-1px);
}

.style-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-border);
}

.style-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.style-label {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}

.style-desc {
  font-size: 0.72rem;
  opacity: 0.7;
  line-height: 1.2;
}

.style-btn.active .style-label {
  color: var(--accent);
}

.style-btn.active .style-desc {
  color: var(--accent);
  opacity: 0.8;
}

.style-guidance {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--ink-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.style-guidance strong {
  color: var(--ink);
}

.style-preview {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.style-preview summary {
  padding: 12px 14px;
  color: var(--ink);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
}

.style-preview summary:hover {
  background: var(--surface-alt);
}

.style-preview[open] summary {
  border-bottom: 1px solid var(--border);
}

.style-preview-source {
  margin: 14px 14px 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.style-preview-source strong {
  color: var(--ink);
}

.style-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.style-preview-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-alt);
  min-width: 0;
}

.style-preview-card h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.style-preview-card p,
.style-preview-card li {
  color: var(--ink-muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.style-preview-card p {
  margin: 0;
}

.style-preview-card ul {
  margin: 0;
  padding-left: 18px;
}

.style-preview-note {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--ink-faint);
  font-size: 0.8rem;
  line-height: 1.55;
}

/* 2-column layout for compact two-option style pickers */
.style-picker-buttons:has(.style-btn:nth-child(2):last-child) {
  grid-template-columns: repeat(2, 1fr);
}

/* Mobile: 2 columns */
@media (max-width: 500px) {
  .style-picker-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  .style-picker-buttons.try-style-buttons,
  .style-preview-grid {
    grid-template-columns: 1fr;
  }
  .style-btn {
    padding: 10px 6px;
    min-height: 68px;
  }
  .style-icon { font-size: 1.2rem; }
  .style-label { font-size: 0.78rem; }
  .style-desc { font-size: 0.68rem; }
}

/* ── Style Badge (Timeline) ──────────────────────────────────── */

.style-badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--ink-faint);
  border: 1px solid var(--border);
  cursor: default;
  user-select: none;
}

.style-badge.style-dramatic { /* default, subtle */ }
.style-badge.style-concise { background: rgba(59, 130, 246, 0.08); color: #3b82f6; border-color: rgba(59, 130, 246, 0.15); }
.style-badge.style-journal { background: rgba(34, 197, 94, 0.08); color: #22c55e; border-color: rgba(34, 197, 94, 0.15); }
.style-badge.style-letter  { background: rgba(139, 92, 246, 0.08); color: #8b5cf6; border-color: rgba(139, 92, 246, 0.15); }
.style-badge.style-bullets { background: rgba(234, 179, 8, 0.08); color: #eab308; border-color: rgba(234, 179, 8, 0.15); }

/* ── Campaign Wiki ──────────────────────────────────────────── */

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

.wiki-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.wiki-count {
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-weight: 500;
}

.wiki-empty {
  text-align: center;
  padding: 32px 20px;
}

.wiki-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.wiki-empty h4 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--ink);
}

.wiki-section {
  margin-bottom: 20px;
}

.wiki-section:last-child {
  margin-bottom: 0;
}

.wiki-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

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

@media (max-width: 600px) {
  .wiki-entity-grid {
    grid-template-columns: 1fr;
  }
}

.wiki-entity-card {
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wiki-entity-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.entity-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.entity-type-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.entity-name {
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  flex: 1;
}

.entity-description {
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-bottom: 6px;
}

.entity-meta {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 6px;
}

.entity-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ── Entity Status Badges ────────────────────────────────────── */

.entity-status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}

.entity-status-badge.entity-active {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.entity-status-badge.entity-deceased {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.entity-status-badge.entity-destroyed {
  background: rgba(107, 114, 128, 0.12);
  color: #6b7280;
}

.entity-status-badge.entity-missing {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

/* ── NL Wiki Edit Bar (V2.1) ────────────────────────────────── */

.wiki-ai-edit {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
}

.wiki-ai-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wiki-ai-edit-input {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.wiki-ai-edit-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.wiki-ai-edit-input::placeholder {
  color: var(--ink-faint);
  font-size: 0.82rem;
}

.wiki-ai-edit-btn {
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 8px 16px;
  white-space: nowrap;
}

.wiki-ai-edit-result {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  animation: fadeSlideIn 0.25s ease;
}

.wiki-ai-edit-result.wiki-ai-edit-success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.wiki-ai-edit-result.wiki-ai-edit-error {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

@media (max-width: 500px) {
  .wiki-ai-edit-row {
    flex-direction: column;
  }
  .wiki-ai-edit-input {
    width: 100%;
  }
  .wiki-ai-edit-btn {
    width: 100%;
  }
  .wiki-ai-edit-input::placeholder {
    font-size: 0.78rem;
  }
}

/* ── Previously On... Opener ─────────────────────────────────── */

.session-opener-strip {
  margin: 0 0 18px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.btn-opener {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 16px;
  border: 1px solid rgba(184, 110, 44, 0.28);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  letter-spacing: 0;
  position: relative;
  overflow: hidden;
}

.btn-opener::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-opener:hover {
  border-color: rgba(184, 110, 44, 0.45);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-opener:hover::before {
  opacity: 1;
}

.btn-opener:active {
  transform: translateY(0);
}

.btn-opener:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.opener-loading {
  text-align: center;
  padding: 24px;
}

.opener-card {
  text-align: left;
  padding: 28px 24px 20px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  box-shadow:
    0 2px 16px rgba(212, 175, 55, 0.06),
    0 0 0 1px rgba(212, 175, 55, 0.05);
  animation: openerFadeIn 0.5s ease;
  position: relative;
  overflow: hidden;
}

.opener-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
}

@keyframes openerFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.opener-header {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #d4af37;
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}

.opener-narration {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 16px;
}

.opener-narration p {
  margin: 0 0 12px;
}

.opener-narration p:last-child {
  margin-bottom: 0;
}

.opener-narration strong {
  color: var(--ink);
  font-weight: 700;
}

.opener-narration em {
  font-style: italic;
  color: var(--ink-muted);
}

.opener-refs {
  margin-bottom: 16px;
}

.opener-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .timeline-list-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .btn-opener {
    font-size: 0.95rem;
    width: 100%;
    padding: 10px 14px;
  }

  .opener-card {
    padding: 20px 16px 16px;
  }

  .opener-narration {
    font-size: 0.95rem;
  }

  .opener-actions {
    justify-content: center;
  }
}

/* ── Session Prep Dashboard ──────────────────────────────────── */

.btn-prep {
  background: linear-gradient(135deg, var(--accent), #c78a3c);
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(184, 110, 44, 0.25);
  transition: box-shadow 0.2s, transform 0.15s;
}

.btn-prep:hover {
  box-shadow: 0 4px 16px rgba(184, 110, 44, 0.35);
  transform: translateY(-1px);
}

.prep-panel {
  max-height: none;
}

.prep-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.prep-header h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.2rem;
  margin: 0;
}

.prep-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.prep-stats-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.prep-stat-pill {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.prep-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.prep-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.prep-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

/* ── Welcome Back Banner ──────────────────────────────────── */

.prep-welcome-back {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(184, 110, 44, 0.08);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 12px;
}

/* ── Last Session ──────────────────────────────────────────── */

.prep-last-session {
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.prep-last-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.prep-last-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.prep-days-badge {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.prep-last-recap {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

.prep-last-events {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.prep-last-events strong {
  color: var(--ink);
}

/* ── Thread Cards ──────────────────────────────────────────── */

.prep-thread-card {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  transition: border-color 0.15s;
}

.prep-thread-card:last-child {
  margin-bottom: 0;
}

.prep-thread-card.prep-urgency-high {
  border-left: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.04);
}

.prep-thread-card.prep-urgency-medium {
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.04);
}

.prep-thread-card.prep-urgency-low {
  border-left: 3px solid var(--border-strong);
}

.prep-thread-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.prep-thread-text {
  font-size: 0.88rem;
  color: var(--ink);
  flex: 1;
  line-height: 1.45;
}

.prep-urgency-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}

.prep-urgency-badge.prep-urgency-high {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.prep-urgency-badge.prep-urgency-medium {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.prep-urgency-badge.prep-urgency-low {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.prep-thread-meta {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

.prep-linked-entities {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* ── Entity Rows ──────────────────────────────────────────── */

.prep-entity-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.prep-entity-row:last-of-type {
  border-bottom: none;
}

.prep-entity-row .entity-type-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.prep-entity-info {
  flex: 1;
  min-width: 0;
}

.prep-entity-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
}

.prep-entity-status {
  margin-left: 8px;
  font-size: 0.72rem;
}

.prep-entity-desc {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.prep-entity-meta {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* ── Note Previews ────────────────────────────────────────── */

.prep-note-session-group {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin: 10px 0 6px;
}

.prep-note-session-group:first-child {
  margin-top: 0;
}

.prep-note-preview {
  padding: 8px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.prep-note-preview:last-child {
  margin-bottom: 0;
}

.prep-note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

/* ── Mobile Responsive ────────────────────────────────────── */

@media (max-width: 600px) {
  .prep-stats-bar {
    gap: 4px;
  }

  .prep-stat-pill {
    font-size: 0.7rem;
    padding: 2px 8px;
  }

  .prep-thread-header {
    flex-direction: column;
    gap: 4px;
  }

  .prep-urgency-badge {
    align-self: flex-start;
  }

  .prep-entity-row {
    gap: 8px;
  }
}

/* ── Campaign Stats Panel ────────────────────────────────────── */

.btn-stats {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
  transition: box-shadow 0.2s, transform 0.15s;
}

.btn-stats:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.stats-panel {
  max-height: none;
}

.stats-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.stats-header h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.2rem;
  margin: 0;
}

.stats-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Hero Stat Cards ──────────────────────────────────────────── */

.stats-hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stats-hero-card {
  text-align: center;
  padding: 16px 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stats-hero-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06);
}

.stats-hero-number {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}

.stats-hero-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.stats-hero-sub {
  font-size: 0.7rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* ── Section Layout ───────────────────────────────────────────── */

.stats-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.stats-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stats-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

/* ── Cadence ──────────────────────────────────────────────────── */

.stats-cadence-summary {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

.stats-cadence-details {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.stats-cadence-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 60px;
  padding: 4px 0;
}

.stats-cadence-bar {
  flex: 1;
  min-width: 6px;
  max-width: 24px;
  background: linear-gradient(to top, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.5));
  border-radius: 3px 3px 0 0;
  transition: background 0.2s, transform 0.15s;
  cursor: default;
}

.stats-cadence-bar:hover {
  background: linear-gradient(to top, rgba(99, 102, 241, 0.35), rgba(99, 102, 241, 0.7));
  transform: scaleY(1.05);
  transform-origin: bottom;
}

.stats-cadence-chart-label {
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 4px;
  text-align: center;
}

/* ── Thread Resolution Bar ────────────────────────────────────── */

.stats-resolution-bar {
  height: 8px;
  background: rgba(107, 114, 128, 0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.stats-resolution-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #34d399);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.stats-resolution-label {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* ── Entity Census Grid ───────────────────────────────────────── */

.stats-entity-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.stats-entity-type {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-entity-icon {
  font-size: 1rem;
}

.stats-entity-count {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.stats-entity-label {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.stats-entity-note {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* ── Party & Ratings ──────────────────────────────────────────── */

.stats-party-info {
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.stats-party-info strong {
  color: var(--ink);
}

.stats-rating-summary {
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* ── Milestone Shelf ──────────────────────────────────────────── */

.stats-milestone-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.stats-milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.stats-milestone.achieved {
  border-color: rgba(212, 175, 55, 0.3);
  background: linear-gradient(160deg, var(--surface-alt) 0%, rgba(212, 175, 55, 0.04) 100%);
}

.stats-milestone.achieved:hover {
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.08);
  transform: translateY(-1px);
}

.stats-milestone.locked {
  opacity: 0.45;
}

.stats-milestone-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 6px;
}

.stats-milestone.locked .stats-milestone-icon {
  filter: grayscale(0.8);
}

.stats-milestone-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 2px;
}

.stats-milestone.locked .stats-milestone-label {
  color: var(--ink-faint);
}

.stats-milestone-date {
  font-size: 0.7rem;
  color: var(--ink-faint);
}

/* ── Mobile Responsive (Stats) ────────────────────────────────── */

@media (max-width: 600px) {
  .stats-hero-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-hero-number {
    font-size: 1.4rem;
  }

  .stats-milestone-shelf {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .stats-cadence-chart {
    height: 48px;
  }
}

/* ── "What Did I Miss?" Player Catch-Up ──────────────────────── */

.btn-catchup {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
  transition: box-shadow 0.2s, transform 0.15s;
}

.btn-catchup:hover {
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35);
  transform: translateY(-1px);
}

.catchup-panel {
  max-height: none;
}

.catchup-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.catchup-header h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.2rem;
  margin: 0;
}

.catchup-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.catchup-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
}

.catchup-select {
  flex: 1;
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
}

.btn-catchup-generate {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn-catchup-generate:hover {
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
  transform: translateY(-1px);
}

.btn-catchup-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.catchup-sessions-badge {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.2);
  color: #0d9488;
  display: inline-block;
  margin-bottom: 12px;
}

.catchup-summary {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.65;
  padding: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.catchup-summary strong {
  color: var(--ink);
  font-weight: 700;
}

.catchup-summary em {
  color: var(--ink-muted);
}

.catchup-section {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.catchup-list {
  margin: 0;
  padding: 0 0 0 18px;
  list-style: none;
}

.catchup-list li {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 4px;
  position: relative;
}

.catchup-list li::before {
  content: "→";
  position: absolute;
  left: -16px;
  color: var(--ink-faint);
}

.catchup-threads li::before {
  content: "";
}

/* ── Mobile Catch-Up ──────────────────────────────────────── */

@media (max-width: 600px) {
  .catchup-picker {
    flex-direction: column;
    align-items: stretch;
  }

  .catchup-select {
    min-width: 0;
  }

  .btn-catchup-generate {
    width: 100%;
  }
}

/* ── Quick Reactions ──────────────────────────────────────── */

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

.reaction-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  line-height: 1;
}

.reaction-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  transform: translateY(-1px);
}

.reaction-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  box-shadow: 0 0 8px var(--accent-soft);
  font-weight: 600;
}

.reaction-btn.active:hover {
  background: var(--accent);
  color: white;
}

.reaction-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 6px;
  border-radius: 10px;
  display: inline-block;
}

.reaction-btn.active .reaction-count {
  background: rgba(255, 255, 255, 0.35);
  color: inherit;
}

/* ── Campaign Next Session Widget ────────────────────────── */

.campaign-schedule-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.campaign-schedule-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.schedule-widget-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.schedule-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.schedule-icon {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.schedule-text-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schedule-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.schedule-datetime-value {
  font-family: 'Inter', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-none {
  color: var(--ink-muted);
  font-weight: 400;
  font-style: italic;
}

.schedule-badge-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1;
  cursor: default;
  user-select: none;
}

.schedule-badge-status.confirmed {
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.schedule-badge-status.proposed {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.schedule-actions {
  display: flex;
  align-items: center;
}

.btn-sm {
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  border-radius: 16px !important;
}

/* ── Calendar Export Dropdown ────────────────────────────── */

.schedule-dropdown {
  position: relative;
  display: inline-block;
}

.schedule-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 100;
  animation: fadeSlideIn 0.15s ease;
  overflow: hidden;
}

.schedule-dropdown-content a {
  color: var(--ink);
  padding: 10px 14px;
  text-decoration: none;
  display: block;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: background 0.15s;
}

.schedule-dropdown-content a:hover {
  background: var(--surface-alt);
}

.schedule-dropdown-content a:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

/* ── Availability Poll / Voting Buttons ──────────────────── */

.poll-vote-btn {
  transition: all 0.15s ease;
  opacity: 0.5;
}

.poll-vote-btn:hover {
  opacity: 0.85;
  transform: scale(1.1);
}

.poll-vote-btn.active {
  opacity: 1;
  background: var(--accent-soft) !important;
  border-color: var(--accent-border) !important;
  box-shadow: 0 0 6px var(--accent-soft);
  transform: scale(1.15);
}

/* ── Player Thoughts (Optional Session Reactions) ─────────── */

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

.rating-stars {
  display: inline-flex;
  gap: 2px;
  cursor: pointer;
}

.rating-star {
  font-size: 1.05rem;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
  user-select: none;
  line-height: 1;
}

.rating-star:hover {
  transform: scale(1.1);
  opacity: 0.8;
}

.rating-star.filled {
  filter: drop-shadow(0 0 1px rgba(245, 158, 11, 0.2));
  opacity: 0.9;
}

.rating-star.empty {
  opacity: 0.25;
}

/* Aggregate line (DM sees average + count) */
.rating-aggregate {
  font-size: 0.78rem;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 4px;
}

.rating-aggregate .rating-avg {
  font-weight: 600;
  color: var(--ink-muted);
}

/* Comment input (appears after rating) */
.rating-comment-form {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  animation: fadeSlideIn 0.2s ease;
}

.rating-comment-input {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink);
  flex: 1;
  max-width: 280px;
}

.rating-comment-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.rating-comment-input::placeholder {
  color: var(--ink-faint);
}

.rating-comment-save {
  font: inherit;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s;
}

.rating-comment-save:hover {
  background: var(--accent);
  color: white;
}

/* Saved comment display */
.rating-user-comment {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 2px;
}

/* ── DM Feedback Panel ───────────────────────────────────── */

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

.feedback-campaign-avg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.feedback-avg-number {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.feedback-avg-meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.feedback-avg-meta strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 2px;
}

.feedback-session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.feedback-session-info {
  flex: 1;
  min-width: 0;
}

.feedback-session-title {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedback-session-meta {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.feedback-session-avg {
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
  min-width: 32px;
  text-align: center;
}

.feedback-session-count {
  font-size: 0.72rem;
  color: var(--ink-faint);
  min-width: 40px;
  text-align: right;
}

.feedback-comments {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.feedback-comment {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.feedback-comment .comment-author {
  font-weight: 600;
  color: var(--ink);
  margin-right: 4px;
}

.feedback-empty {
  text-align: center;
  padding: 24px;
  color: var(--ink-faint);
}

.feedback-empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

/* ── Rating Scale Toggle (in campaign settings area) ─────── */

.rating-scale-toggle {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.rating-scale-btn {
  font: inherit;
  font-size: 0.82rem;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.rating-scale-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  font-weight: 600;
}

.rating-scale-btn:hover:not(.active) {
  background: var(--surface-alt);
  border-color: var(--border-strong);
}

/* ── Mobile Ratings ──────────────────────────────────────── */

@media (max-width: 600px) {
  .rating-comment-input {
    max-width: 200px;
  }

  .feedback-session-item {
    flex-wrap: wrap;
  }

  .feedback-campaign-avg {
    flex-direction: column;
    text-align: center;
  }
}

/* ── Campaign Links (V4.0) ──────────────────────────────────── */

.links-header {
  margin-bottom: 16px;
}

.links-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.resource-panel-title-row,
.resource-panel-intro,
.resource-folder-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resource-panel-title-row {
  margin-bottom: 12px;
}

.resource-panel-intro {
  margin-bottom: 16px;
}

.resource-panel-intro p {
  margin: 0;
  font-size: 0.84rem;
}

.resource-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.resource-tabs .tab-link {
  padding: 8px 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

.resource-tabs .tab-link.active {
  border-bottom-color: var(--accent);
  font-weight: 700;
}

.links-section {
  margin-bottom: 16px;
}

.resource-folder-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--surface);
}

.links-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.resource-folder-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.resource-count {
  color: var(--ink-faint);
  font-weight: 500;
}

.resource-empty-row {
  margin: 8px 0 0;
  padding: 8px 0;
  text-align: center;
  font-size: 0.82rem;
}

.links-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resource-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.link-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.link-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.link-card.pinned {
  background: rgba(184, 110, 44, 0.04);
  border-color: var(--accent-border);
}

.link-card-body {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.link-card-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.link-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.link-card-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-url {
  font-size: 0.78rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.link-action-btn {
  font: inherit;
  font-size: 0.82rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--ink-faint);
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.link-action-btn:hover {
  opacity: 1;
  background: var(--surface);
}

.link-action-btn[title="Delete"]:hover {
  color: #ef4444;
}

.link-card-meta {
  width: 100%;
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

.link-add-form {
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.resource-add-form {
  margin-bottom: 10px;
}

.resource-add-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.resource-add-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.4fr) auto;
  gap: 8px;
  align-items: center;
}

.resource-file-drop-zone {
  padding: 14px 16px;
  text-align: left;
}

.resource-upload-status {
  font-size: 0.85rem;
  font-weight: 650;
}

.links-empty {
  padding: 12px 0;
}

@media (max-width: 600px) {
  .resource-panel-intro,
  .resource-folder-label {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-add-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Voice Input Service (V3.0) ─────────────────────────────────── */

.voice-input-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Mic Button ──────────────────────────────────────────────────── */

.voice-mic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.voice-mic-sm {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}

.voice-mic-lg {
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
}

.voice-mic-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  transform: scale(1.05);
}

.voice-mic-btn:active:not(:disabled) {
  transform: scale(0.95);
}

/* ── Listening State (pulsing red ring) ──────────────────────────── */

.voice-mic-btn.listening {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  animation: voicePulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes voicePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

/* ── Transcribing State (spinner) ────────────────────────────────── */

.voice-mic-btn.transcribing {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  pointer-events: none;
  opacity: 0.85;
}

.voice-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: voiceSpin 0.7s linear infinite;
}

@keyframes voiceSpin {
  to { transform: rotate(360deg); }
}

/* ── Engine Label Pill ───────────────────────────────────────────── */

.voice-engine-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  cursor: help;
  transition: opacity 0.2s;
}

.voice-engine-label:hover {
  opacity: 0.8;
}

/* Local / on-device — green */
.voice-engine-local {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Cloud — amber */
.voice-engine-cloud {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ── Mobile Responsive ───────────────────────────────────────────── */

@media (max-width: 600px) {
  /* Ensure 44px minimum touch targets on mobile */
  .voice-mic-sm {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .voice-engine-label {
    font-size: 0.62rem;
    padding: 2px 6px;
  }
}

/* ── Privacy Badges (V6.3) ──────────────────────────────────────── */

.parcane-privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: 0;
  cursor: default;
  vertical-align: middle;
  margin-left: 6px;
  user-select: none;
}

.parcane-privacy-badge:hover {
  opacity: 1;
}

/* Local — green (matches voice engine labels) */
.parcane-privacy-local {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Cloud — amber (matches voice engine labels) */
.parcane-privacy-cloud {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ── Local Inference Quality Indicator ──────────────────────────── */

.local-inference-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(34, 197, 94, 0.04);
  border: 1px solid rgba(34, 197, 94, 0.1);
  border-radius: var(--radius-sm);
}

.local-inference-note .inference-icon {
  font-size: 0.85rem;
}

/* ── Local Inference Progress ─────────────────────────────────── */

.local-inference-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--ink-muted);
  animation: fadeSlideIn 0.2s ease;
}

.local-inference-progress .inference-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(34, 197, 94, 0.3);
  border-top-color: #22c55e;
  border-radius: 50%;
  animation: voiceSpin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Engine Preferences Panel (V6.0.6) ─────────────────────────── */

.prefs-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.prefs-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 0;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.prefs-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.prefs-header h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.2rem;
  margin: 0 0 4px;
  color: var(--ink);
}

.prefs-subtitle {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 0;
}

.prefs-section {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.prefs-section h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}

/* ── Tier Selector Cards ────────────────────────────────────────── */

.prefs-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.prefs-tier-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  font-family: 'Inter', sans-serif;
}

.prefs-tier-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-alt);
}

.prefs-tier-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.tier-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.tier-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}

.tier-tagline {
  font-size: 0.68rem;
  color: var(--ink-faint);
  line-height: 1.3;
}

/* ── Per-Category Rows ──────────────────────────────────────────── */

.prefs-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.prefs-cat-row + .prefs-cat-row {
  border-top: 1px solid var(--border);
}

.prefs-cat-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.prefs-cat-label strong {
  font-size: 0.85rem;
  color: var(--ink);
}

.prefs-cat-desc {
  font-size: 0.72rem;
  color: var(--ink-faint);
  line-height: 1.3;
}

.prefs-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  min-width: 160px;
  max-width: 220px;
  cursor: pointer;
}

.prefs-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.prefs-select option:disabled {
  color: var(--ink-faint);
}

/* ── Footer ─────────────────────────────────────────────────────── */

.prefs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

.prefs-bench-link {
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.prefs-bench-link:hover {
  color: var(--accent);
}

.prefs-close-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.prefs-close-btn:hover {
  background: var(--accent-hover, var(--accent));
  transform: translateY(-1px);
}

/* ── Mobile Responsive (Preferences) ───────────────────────────── */

@media (max-width: 600px) {
  .prefs-panel {
    max-height: 90vh;
  }

  .prefs-tier-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .prefs-tier-card {
    flex-direction: row;
    text-align: left;
    padding: 10px 14px;
    gap: 10px;
  }

  .prefs-cat-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .prefs-select {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

/* ── Offline & Sync States ──────────────────────────────────── */

.is-draft {
  opacity: 0.8;
  border-style: dashed !important;
  border-color: var(--accent-border) !important;
  position: relative;
}

.is-draft::after {
  content: '📝 Syncing...';
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 8px;
  animation: pulse 2s infinite;
}

.timeline-entry.is-draft {
  border-left-style: dashed;
}

.note-card.is-draft {
  background: var(--surface);
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}/* ── Offline Readiness Dashboard ────────────────────────────────── */

.prefs-offline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.offline-stat-card {
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.offline-stat-card .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.offline-stat-card .stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value.status-ready { color: var(--success); }
.stat-value.status-warning { color: var(--accent); }
.stat-value.status-error { color: var(--error); }

.offline-prime-btn {
  width: 100%;
  margin-top: 12px;
  justify-content: center;
}

.prime-progress {
  margin-top: 12px;
  display: none;
}

.prime-progress.visible { display: block; }

.prime-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.prime-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.prime-log {
  font-size: 0.7rem;
  color: var(--ink-faint);
  margin-top: 4px;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Wiki Tagging & Search Filters (V12.3) ── */
.wiki-filter-bar {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wiki-search-box {
  position: relative;
  width: 100%;
}

.wiki-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.wiki-search-input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.wiki-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.wiki-tag-filter-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.tag-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-faint);
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wiki-tag-pill {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  user-select: none;
}

.wiki-tag-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--ink-faint);
  color: var(--ink);
}

.wiki-tag-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.tag-pill-count {
  font-size: 0.65rem;
  opacity: 0.6;
  background: rgba(0,0,0,0.2);
  padding: 1px 4px;
  border-radius: 4px;
}

.wiki-tag-pill.active .tag-pill-count {
  background: rgba(139, 92, 246, 0.2);
}

.entity-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.entity-tags .tl-tag {
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}

.entity-tags .tl-tag:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Card layout adjustments */
.wiki-entity-card {
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.wiki-entity-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-faint);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Edit Wiki Button */
.wiki-card-edit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0;
}

.wiki-entity-card:hover .wiki-card-edit-btn {
  opacity: 1;
}

.wiki-card-edit-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

/* ── Processing transparency ledger ── */
.processing-receipt-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.processing-receipt-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.35);
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.receipt-overall-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(74, 140, 92, 0.15);
  color: #4a8c5c;
  border: 1px solid rgba(74, 140, 92, 0.25);
  transition: all 0.3s ease;
  position: relative;
}

.receipt-overall-badge.fully-private {
  background: rgba(74, 140, 92, 0.22);
  color: #55af6e;
  border-color: rgba(74, 140, 92, 0.35);
  animation: pulse-green 2.5s infinite;
}

.receipt-overall-badge.hybrid-secure {
  background: rgba(184, 110, 44, 0.15);
  color: #b86e2c;
  border-color: rgba(184, 110, 44, 0.25);
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(74, 140, 92, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(74, 140, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 140, 92, 0); }
}

.receipt-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 14px 0;
}

.receipt-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.receipt-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.stage-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.stage-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.stage-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stage-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.stage-status {
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.stage-toggle-action {
  flex-shrink: 0;
}

.btn-toggle-stage {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--ink-muted);
}

.btn-toggle-stage:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-toggle-stage.local-active {
  border-color: rgba(74, 140, 92, 0.3);
  background: rgba(74, 140, 92, 0.08);
  color: #4a8c5c;
}

.btn-toggle-stage.local-active:hover {
  border-color: rgba(74, 140, 92, 0.5);
  background: rgba(74, 140, 92, 0.15);
  color: #55af6e;
}

.stage-lock-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
