:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-muted: #f3f0e8;
  --surface-tint: #faf8f4;
  --border: #e5dfd3;
  --border-strong: #d3cab8;
  --text: #22201c;
  --text-muted: #615b51;
  --text-subtle: #7e776c;

  --accent: #2c5e4f;
  --accent-hover: #224a3e;
  --accent-soft: #e6f1ed;

  --comment-bg: #dcfce7;
  --comment-text: #166534;
  --comment-border: #86efac;

  --read-bg: #dbeafe;
  --read-text: #1e40af;
  --read-border: #93c5fd;

  --discover-bg: #fef3c7;
  --discover-text: #92400e;
  --discover-border: #fcd34d;

  --skip-bg: #f3f2ef;
  --skip-text: #57534e;
  --skip-border: #d6d3d1;

  --status-unreviewed-bg: #eef2ff;
  --status-unreviewed-text: #3730a3;
  --status-read-bg: #dbeafe;
  --status-read-text: #1e40af;
  --status-replied-bg: #dcfce7;
  --status-replied-text: #166534;
  --status-saved-bg: #fef3c7;
  --status-saved-text: #92400e;
  --status-ignored-bg: #f1f0ed;
  --status-ignored-text: #57534e;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(24, 21, 16, 0.05);
  --shadow-md: 0 4px 14px rgba(24, 21, 16, 0.06);
}

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

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-muted);
  padding: 1px 5px;
  border-radius: 5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Header */
.top-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand-block {
  min-width: 0;
}

.brand-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.user-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.readonly-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.top-header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text);
}

.btn-sm {
  font-size: 13px;
  padding: 6px 11px;
  min-height: 34px;
}

.inline-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d97706;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
}

/* Replies to Me panel */
.replies-panel {
  background: #fffdf7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.replies-header-left,
.replies-header-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.reply-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.reply-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.reply-card-body {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reply-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Angle button pair */
.angle-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

/* Draft & Review drawer inside thread card */
.draft-drawer {
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-tint);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.draft-drawer textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  min-height: 92px;
}

.draft-drawer textarea:focus {
  outline: 2px solid rgba(44, 94, 79, 0.25);
  border-color: var(--accent);
}

.draft-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.draft-controls-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.draft-feedback {
  background: var(--surface);
  border: 1px solid #c7ddd4;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.draft-feedback p {
  margin: 0;
}

.polished-box {
  background: #f6fbf8;
  border: 1px solid #d1e7da;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  white-space: pre-wrap;
  font-size: 14px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.polished-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

/* Banner */
.banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.banner-warning {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  color: #78350f;
}

.banner-danger {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #7f1d1d;
}

/* Token meter */
.token-meter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.token-meter-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  margin-bottom: 8px;
  font-size: 13px;
}

.token-meter-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.token-model-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
}

.token-meter-numbers {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.token-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.token-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s ease, background-color 0.25s ease;
}

.token-progress-fill.warning {
  background: #d97706;
}

.token-progress-fill.capped {
  background: #dc2626;
}

/* Run summary card */
.run-summary-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.run-summary-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 300px;
}

.run-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.run-indicator.running {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.22);
  animation: pulse 1.2s infinite;
}

.run-indicator.idle {
  background: #a8a29e;
}

.run-indicator.error {
  background: #dc2626;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.run-summary-text {
  font-size: 13.5px;
  color: var(--text-muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.stat-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-tint);
  color: var(--text-muted);
}

.stat-pill.comment {
  background: var(--comment-bg);
  color: var(--comment-text);
  border-color: var(--comment-border);
}

.stat-pill.read {
  background: var(--read-bg);
  color: var(--read-text);
  border-color: var(--read-border);
}

.stat-pill.discover {
  background: var(--discover-bg);
  color: var(--discover-text);
  border-color: var(--discover-border);
}

/* Runs panel */
.runs-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

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

.runs-panel-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

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

.run-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  border: 1px solid var(--border);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.run-item-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 4px;
}

.run-item-notes {
  color: var(--text-muted);
  font-size: 12.5px;
}

/* Auth gate & Capture/Import panel */
.auth-gate {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px;
  margin: 28px auto;
  box-shadow: var(--shadow-md);
}

.auth-gate h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.auth-gate p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-form input {
  flex: 1 1 200px;
  font: inherit;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}

.form-error {
  margin-top: 8px;
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
}

.capture-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.capture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.capture-box {
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.capture-box h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 700;
}

.capture-desc {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.capture-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bookmarklet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.capture-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-subtle);
}

.manual-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.manual-field {
  flex: 1 1 170px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.manual-field-wide {
  flex: 2 1 280px;
}

.manual-field label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}

.manual-field input,
.manual-field select,
.manual-field textarea {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.manual-field textarea {
  resize: vertical;
}

.manual-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Filter card */
.filters-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.filter-row-split {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-start;
  justify-content: space-between;
}

.filter-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.chip {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.14s ease;
  max-width: 100%;
  text-align: left;
}

.chip:hover {
  background: var(--surface-muted);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.chip-comment.active {
  background: var(--comment-text);
  border-color: var(--comment-text);
  color: #ffffff;
}

.chip-read.active {
  background: var(--read-text);
  border-color: var(--read-text);
  color: #ffffff;
}

.chip-discover.active {
  background: var(--discover-text);
  border-color: var(--discover-text);
  color: #ffffff;
}

.skip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  margin-top: 2px;
}

.skip-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.filter-utility-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.search-wrap {
  flex: 1 1 240px;
  min-width: 0;
}

.search-wrap input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-tint);
  color: var(--text);
}

.search-wrap input:focus,
.sort-wrap select:focus {
  outline: 2px solid rgba(44, 94, 79, 0.25);
  border-color: var(--accent);
  background: var(--surface);
}

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

.filter-label-inline {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-subtle);
}

.sort-wrap select {
  font: inherit;
  font-size: 13.5px;
  padding: 7px 10px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

/* Results meta */
.results-meta {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 0 2px 12px;
}

/* Thread cards */
.threads-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.thread-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  min-width: 0;
}

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

.thread-card.is-skip {
  opacity: 0.78;
}

.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-meta-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
}

.subreddit-link {
  font-weight: 700;
  color: var(--text);
}

.feed-tag {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-weight: 500;
}

.meta-dot {
  color: var(--border-strong);
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.3;
}

.score-badge {
  background: var(--text);
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.score-badge.score-high {
  background: var(--comment-text);
}

.score-badge.score-mid {
  background: var(--read-text);
}

.score-badge.score-low {
  background: #78716c;
}

.bucket-COMMENT {
  background: var(--comment-bg);
  color: var(--comment-text);
  border-color: var(--comment-border);
}

.bucket-READ {
  background: var(--read-bg);
  color: var(--read-text);
  border-color: var(--read-border);
}

.bucket-DISCOVER {
  background: var(--discover-bg);
  color: var(--discover-text);
  border-color: var(--discover-border);
}

.bucket-SKIP {
  background: var(--skip-bg);
  color: var(--skip-text);
  border-color: var(--skip-border);
}

.status-unreviewed {
  background: var(--status-unreviewed-bg);
  color: var(--status-unreviewed-text);
}

.status-read {
  background: var(--status-read-bg);
  color: var(--status-read-text);
}

.status-replied {
  background: var(--status-replied-bg);
  color: var(--status-replied-text);
}

.status-saved {
  background: var(--status-saved-bg);
  color: var(--status-saved-text);
}

.status-ignored {
  background: var(--status-ignored-bg);
  color: var(--status-ignored-text);
}

.card-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.card-title a {
  color: var(--text);
}

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

/* Why it fits */
.why-box {
  background: var(--surface-tint);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 13px;
  margin-bottom: 14px;
  font-size: 14.5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.section-heading {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin: 0 0 8px;
}

/* Reply angles */
.angles-section {
  margin-bottom: 14px;
}

.angles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.angle-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #f6fbf8;
  border: 1px solid #d1e7da;
  border-radius: var(--radius-sm);
}

.angle-text {
  font-size: 14px;
  color: var(--text);
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.copy-btn {
  flex-shrink: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  min-height: 30px;
  border-radius: 6px;
  border: 1px solid #a7d7bc;
  background: #ffffff;
  color: var(--comment-text);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.copy-btn:hover {
  background: var(--comment-bg);
}

.copy-btn.copied {
  background: var(--comment-text);
  border-color: var(--comment-text);
  color: #ffffff;
}

/* Takeaways */
.takeaways-section {
  margin-bottom: 14px;
}

.takeaways-list {
  margin: 0;
  padding-left: 19px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
  color: var(--text);
}

.takeaways-list li {
  overflow-wrap: anywhere;
}

/* Discoveries */
.discoveries-section {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
}

.discoveries-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discovery-item {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.discovery-handle {
  font-weight: 700;
  color: var(--discover-text);
  margin-right: 6px;
}

/* Details disclosure */
.context-details {
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.context-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-subtle);
  padding: 4px 0;
  user-select: none;
}

.context-details summary:hover {
  color: var(--text);
}

.context-body {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-wrap: anywhere;
}

.rubric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12.5px;
}

.rubric-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
}

.excerpt-text {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 13px;
}

/* Card footer actions */
.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-actions-left,
.card-actions-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.status-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  min-height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.14s ease;
}

.status-btn:hover {
  background: var(--surface-muted);
}

.status-btn.active-read {
  background: var(--status-read-bg);
  border-color: var(--read-border);
  color: var(--status-read-text);
}

.status-btn.active-replied {
  background: var(--status-replied-bg);
  border-color: var(--comment-border);
  color: var(--status-replied-text);
}

.status-btn.active-saved {
  background: var(--status-saved-bg);
  border-color: var(--discover-border);
  color: var(--status-saved-text);
}

.status-btn.active-ignored {
  background: var(--status-ignored-bg);
  border-color: var(--skip-border);
  color: var(--status-ignored-text);
}

/* Empty state */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 38px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--text);
}

.empty-state p {
  margin: 0 auto;
  max-width: 480px;
  font-size: 14px;
}

/* Footer */
.app-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-subtle);
}

/* Toast */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: calc(100vw - 40px);
  background: var(--text);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 100;
}

/* Mobile refinements */
@media (max-width: 640px) {
  .app-shell {
    padding: 16px 12px 36px;
  }

  .thread-card {
    padding: 15px 14px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1 1 auto;
  }

  .angle-item {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-btn {
    align-self: flex-end;
  }

  .card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .card-actions-right {
    justify-content: flex-start;
  }
}

