/* Ebook Correction UI — imports shared variables/fonts from style.css */

/* === Upload screen === */

.upload-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow-y: auto;
  padding: 32px 16px;
}

.upload-box {
  text-align: center;
  padding: 60px 80px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-pane);
  transition: border-color 0.15s, background 0.15s;
}

.upload-box.drag-over {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.04);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.upload-box h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.upload-box p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.upload-label {
  display: inline-block;
  cursor: pointer;
}

.upload-status {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.upload-status.error {
  color: #dc2626;
}

/* === Buttons === */

.btn-primary {
  padding: 8px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary:hover {
  background: #4338ca;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 8px 16px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.btn-secondary:hover {
  background: #f0f0f4;
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Toolbar extras === */

.toolbar-cover-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Read-only badge — soft amber pill so the user notices but it
   doesn't shout. Shown next to the book title when the session
   belongs to a different client. */
.toolbar-readonly-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.18);
  color: #d97706;
  flex-shrink: 0;
}

.toolbar-cover {
  width: 24px;
  height: 32px;
  object-fit: cover;
  border-radius: 3px;
  vertical-align: middle;
  cursor: pointer;
  display: block;
}

.cover-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-toolbar);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 12px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 180px;
}

.cover-preview {
  width: 160px;
  height: auto;
  border-radius: 4px;
  display: block;
}

.cover-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cover-btn {
  font-size: 12px;
  padding: 5px 10px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.toolbar-sep {
  opacity: 0.3;
}

.toolbar-book-meta {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.toolbar-book-sep {
  opacity: 0.3;
  font-size: 18px;
  font-weight: 300;
}

.toolbar-book-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-toolbar);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
  outline: none;
  border-radius: 3px;
  padding: 0 2px;
  cursor: default;
}

.toolbar-book-author {
  font-size: 12px;
  font-style: italic;
  font-weight: 400;
  opacity: 0.8;
  color: var(--text-toolbar);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  outline: none;
  border-radius: 3px;
  padding: 0 2px;
  cursor: default;
}

.toolbar-book-title[contenteditable="true"],
.toolbar-book-author[contenteditable="true"] {
  cursor: text;
}

.toolbar-book-title[contenteditable="true"]:focus,
.toolbar-book-author[contenteditable="true"]:focus {
  background: rgba(255,255,255,0.08);
  outline: 1px solid rgba(255,255,255,0.25);
  white-space: pre;
  overflow: visible;
  text-overflow: clip;
}

.toolbar-progress {
  font-size: 13px;
  opacity: 0.7;
}

.toolbar-tab {
  transition: background 0.1s;
}

.toolbar-tab.active {
  background: rgba(255, 255, 255, 0.2);
}

/* === View containers === */

.view {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* === Review layout === */

.review-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left: issue list panel. Width is user-resizable via the adjacent
   splitter; JS sets flex-basis when the user drags. min-width is
   intentionally low so the user can squish the panel down hard
   without it bouncing back. */
.issue-list-panel {
  flex: 0 0 30%;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  background: var(--bg-pane);
}

/* Collapsed-sidebar rail. Hidden by default; replaces the panel + its
   splitter when body.sidebar-collapsed is set. */
.sidebar-rail {
  display: none;
  flex: 0 0 28px;
  background: var(--bg-pane);
  border-right: 1px solid var(--border);
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
}
body.sidebar-collapsed .issue-list-panel,
body.sidebar-collapsed #splitter-sidebar { display: none; }
body.sidebar-collapsed .sidebar-rail { display: flex; }

.sidebar-collapse-btn,
.sidebar-expand-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted, #6b7280);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.sidebar-collapse-btn:hover,
.sidebar-expand-btn:hover {
  background: var(--border, #d1d5db);
  color: var(--text, #111);
}
.sidebar-collapse-btn { margin-left: auto; }
@media (pointer: coarse) {
  .sidebar-collapse-btn, .sidebar-expand-btn { padding: 6px 10px; font-size: 22px; }
}

.issue-list-filters {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.issue-list-filters .threshold-control {
  font-size: 12px;
}

.issue-list-filters .threshold-control input[type="range"] {
  flex: 1;
  width: auto;
}

.type-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.type-filter-pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--border);
  color: var(--text-muted);
  opacity: 0.45;
}
.type-filter-pill.active {
  opacity: 1;
}

.issue-list-header {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.issue-list-title-group {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.issue-count {
  font-weight: 400;
  font-size: 12px;
}

.issue-list-header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.issue-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.issue-item {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: background 0.1s;
}

.issue-item:hover {
  background: var(--bg);
}

.issue-item.active {
  background: rgba(79, 70, 229, 0.08);
  border-left-color: var(--accent);
}

/* Accepted items stay fully interactive — the green check is the review
   marker, not a dim-out. */
.issue-item.accepted .issue-word {
  color: var(--text-muted, #6b7280);
}

/* Dirty: user has typed something here but not committed. The pencil
   glyph + amber tint signal "in progress" — lighter than the green
   check but heavier than an unedited issue's coloured dot. */
.issue-item.dirty .issue-word {
  color: #a16207;
  font-style: italic;
}

.issue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.issue-dot.green { background: #22c55e; }
.issue-dot.yellow { background: #eab308; }
.issue-dot.red { background: #ef4444; }
.issue-dot.orange { background: #f97316; }

/* Orphan section: corrections whose issueId no longer appears in the
 * current events list. Derived on the client; no persistent flag. */
.orphan-section-header {
  color: #9ca3af;
}
.issue-item.orphan-item {
  color: #9ca3af;
  cursor: pointer;
  /* No accepted/active states — orphans are read-only. */
}
.issue-item.orphan-item:hover {
  background: #f3f4f6;
}
.issue-dot.orphan-dot {
  background: #9ca3af;
}

.orphan-context {
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  color: #374151;
}
.orphan-context-title {
  font-weight: 600;
  margin-bottom: 8px;
}
.orphan-context-body {
  margin-bottom: 12px;
}
.orphan-context-kv {
  font-family: monospace;
  font-size: 12px;
  margin: 4px 0;
}
.orphan-context-k {
  color: #6b7280;
}

.issue-check {
  color: #22c55e;
  font-size: 14px;
  flex-shrink: 0;
  width: 8px;
  text-align: center;
}

.issue-pencil {
  color: #ca8a04;
  font-size: 13px;
  flex-shrink: 0;
  width: 8px;
  text-align: center;
}

.issue-word {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-count-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--border);
  border-radius: 8px;
  padding: 0 5px;
  flex-shrink: 0;
  margin-left: 2px;
}

.issue-conf {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Small pill showing the issue kind, since the sidebar is now grouped
   by chapter rather than by type. */
.issue-type-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 4px;
}
.issue-type-badge.badge-punct,
.type-filter-pill.badge-punct    { background: rgba(45, 212, 191, 0.18); color: #0d9488; }
.issue-type-badge.badge-unknown,
.type-filter-pill.badge-unknown  { background: rgba(249, 115, 22, 0.18); color: #c2410c; }
.issue-type-badge.badge-affix,
.type-filter-pill.badge-affix    { background: rgba(168, 85, 247, 0.18); color: #7e22ce; }
.issue-type-badge.badge-homo,
.type-filter-pill.badge-homo     { background: rgba(79, 70, 229, 0.18); color: #4338ca; }

/* Progress band — the fill sits behind the label so the bar reads as a
   filling-up shape under the text rather than a thin line above it. */
.issue-progress-band {
  position: relative;
  border-top: 1px solid var(--border);
  background: var(--bg-pane);
  overflow: hidden;
}

.issue-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: rgba(34, 197, 94, 0.18);
  transition: width 0.3s ease, background 0.2s ease;
}

.issue-progress-fill.processing {
  background: rgba(59, 130, 246, 0.20);
}

.issue-progress-label {
  position: relative;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Right: main review area */
.review-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Context panes (source + shavian paragraph). They share whatever
   vertical space the correction column doesn't claim — the column
   sizes to its content, so the panes get the rest. */
.context-pane {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  min-height: 0;
  overflow: hidden;
}

.pane-header {
  padding: 6px 24px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: #f8f8fc;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.context-content {
  padding: 17vh 24px 0 24px;
  font-size: 20px;
  line-height: 1.75;
  overflow-y: auto;
  background: var(--bg-pane);
  flex: 1;
  min-height: 0;
  /* Top/bottom fade so surrounding text dissolves toward the edges. */
  mask-image: linear-gradient(to bottom,
    transparent 0, black 28%, black 72%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0, black 28%, black 72%, transparent 100%);
}

/* A full viewport of breathing room past the last paragraph — runway
   for the cross-chapter "scroll off the end" animation. Implemented
   as a pseudo-element rather than padding-bottom because the latter
   interacted badly with flex sizing and pushed the pane's box past
   the viewport (mask fade clipped, scrollbar disappeared). */
.context-content::after {
  content: '';
  display: block;
  height: 50vh;
}

/* Splitter rules live in style.css (shared between text and ebook). */

/* Disable hyperlink navigation in the chapter panes — accidental clicks
   following links is annoying when reviewing. Highlight spans nested
   inside <a> still get clicks (pointer-events: auto restores them). */
.context-content a {
  pointer-events: none;
  color: inherit;
  text-decoration: none;
  cursor: text;
}
.context-content a span,
.context-content a .hl-current,
.context-content a .hl-other {
  pointer-events: auto;
}

/* Pin block margins in pixels so the two panes match regardless of
   the source's stylesheet or the target's larger Shavian font. */
.context-content p,
.context-content div,
.context-content blockquote,
.context-content li {
  margin-top: 0;
  margin-bottom: 12px;
}
.context-content h1,
.context-content h2,
.context-content h3,
.context-content h4,
.context-content h5,
.context-content h6 {
  margin-top: 18px;
  margin-bottom: 12px;
}

/* Target pane: larger still, Shavian font stack (matches text-mode view) */
#target-context.context-content {
  font-size: 22px;
  font-family: 'Bernie Sans Beta', 'InterAlia', system-ui, sans-serif;
  line-height: 1.8;
  /* Override .shavian-text's pre-wrap; block margins govern spacing. */
  white-space: normal;
}

.context-content .hl-current {
  background: rgba(79, 70, 229, 0.18);
  border-radius: 2px;
  padding: 1px 2px;
}

/* Non-active highlights for every other filtered issue in the chapter.
   Tints match the issue-list dot colours so the user can scan a pane
   and see roughly how many low-confidence spots are in it. */
.context-content .hl-other {
  border-radius: 2px;
  padding: 1px 2px;
}
.context-content .hl-other.green { background: rgba(34, 197, 94, 0.14); }
.context-content .hl-other.yellow { background: rgba(234, 179, 8, 0.16); }
.context-content .hl-other.red { background: rgba(239, 68, 68, 0.16); }
.context-content .hl-other.orange { background: rgba(249, 115, 22, 0.16); }

.context-content .correction-accepted {
  background: rgba(34, 197, 94, 0.2);
  border-radius: 2px;
  padding: 1px 2px;
  color: #16a34a;
}

.context-content .hl-current.correction-accepted {
  background: rgba(34, 197, 94, 0.35);
}

/* Dirty: user has a draft replacement here that DOES apply at export,
   but hasn't been committed. Visually distinct from accepted (solid
   green) and from the active cursor (blue). Dashed outline conveys
   "draft". */
.context-content .correction-dirty {
  background: rgba(234, 179, 8, 0.16);
  border: 1px dashed rgba(202, 138, 4, 0.7);
  border-radius: 2px;
  padding: 0 2px;
  color: #a16207;
}

.context-content .hl-current.correction-dirty {
  background: rgba(234, 179, 8, 0.32);
  border-color: #ca8a04;
}

.context-content .correction-pending {
  background: rgba(79, 70, 229, 0.12);
  border-radius: 2px;
  padding: 1px 2px;
  color: #6366f1;
  font-style: italic;
}

/* Attribute-sourced issue context (<img alt="...">, etc.) */
.context-content .alt-text-banner {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.10);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 10px;
}

.context-content .alt-text-body {
  font-style: italic;
  color: var(--text-secondary, #4b5563);
}

.context-content .alt-text-missing {
  color: #b91c1c;
  font-style: italic;
}

/* Fail-hard preview diagnostic. Shown in BOTH source and target panes
   when OffsetResolver.validatePreviewInputs rejects a renderContext()
   attempt (empty snippet, out-of-range offsets, missing attribute
   context, etc.). Never shown under normal operation. */
.context-content .preview-error {
  display: block;
  padding: 10px 12px;
  border: 1px solid #b91c1c;
  border-radius: 4px;
  background: rgba(185, 28, 28, 0.08);
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.45;
}

.context-content .preview-error code {
  display: block;
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: #450a0a;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Correction column — sizes to content (widget + bottom bar) so the
   two context panes above stretch to fill the remaining space. */
.correction-column {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Floating-editor mode: docked column is hidden; the same widget renders
   into #word-popup, anchored to the active issue's highlight. Toggled by
   ebook.js based on the editorMode flag. */
body.editor-floating .correction-column {
  display: none;
}

/* Floating popup. The widget itself (cw-compact) provides position,
   sizing, padding, border, shadow — we only override z-index so the
   popup stacks above the cover popover (200) but below the modal
   backdrop (1000). */
body.editor-floating #word-popup {
  z-index: 500;
}

/* Correction widget host. The widget itself sizes to its content; the
   alts list inside has a 3.5-row cap (see .cw-alts). */
.correction-widget {
  padding: 16px 24px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}
/* Alt list footprint is constant — 3.5 rows always, regardless of
   how many alts the issue has. Fewer alts leave whitespace below;
   more alts scroll. Keeps the widget at a fixed height across
   navigation so the layout doesn't jitter. Alt row = 8px*2 padding
   + 18px line ≈ 34px → 3.5 rows ≈ 119px. */
.correction-widget .cw-alts {
  flex: 0 0 119px;
  height: 119px;
}

/* Bottom bar */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: #f8f8fc;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.shortcut-hints {
  font-size: 12px;
  color: var(--text-muted);
}

.shortcut-hints kbd {
  background: var(--bg-pane);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: inherit;
}

.threshold-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.threshold-control input[type="range"] {
  width: 120px;
}


.metadata-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px !important;
}

.metadata-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.metadata-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metadata-input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
}

.metadata-input:focus {
  outline: none;
  border-color: var(--accent, #4a90d9);
}

/* === No-issue state === */

.no-issues-msg {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

.cancel-queued-btn {
  margin-top: 16px;
  padding: 6px 14px;
  font-size: 13px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}
.cancel-queued-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-color: #dc2626;
}
.cancel-queued-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* === Session list === */

.session-list-section {
  margin-top: 32px;
  width: 100%;
  max-width: 480px;
}

.session-list-heading {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

.session-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-pane);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.session-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.08);
}

.session-card-cover {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--border);
}

.session-card-info {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.session-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.session-card-progress {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.session-card-state {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 3px;
  margin-top: 4px;
}

.session-card-state-transliterating {
  background: rgba(234, 179, 8, 0.15);
  color: #a16207;
}

.session-card-state-queued {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
}

.session-card-state-error {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.session-card-state-unknown {
  background: var(--border);
  color: var(--text-muted);
}

.session-card-delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.1s;
}

.session-card:hover .session-card-delete {
  opacity: 1;
}

.session-card-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* === Issue section headers === */

.issue-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 1;
}

.issue-section-header:hover {
  background: #eeeef4;
}

.issue-section-chevron {
  font-size: 9px;
  flex-shrink: 0;
  opacity: 0.6;
}

.issue-section-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-section-count {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.7;
}

.issue-section-hide-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-pane);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  font-family: inherit;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.issue-section-hide-btn:hover {
  background: var(--border);
}

.issue-section-hide-btn.active {
  background: rgba(34, 197, 94, 0.12);
  border-color: #86efac;
  color: #16a34a;
}

/* === Spinner === */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

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

