/* ── Reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }

:root {
  --bg:       #0f0f0f;
  --sidebar:  #1a1a1a;
  --surface:  #242424;
  --border:   #2e2e2e;
  --accent:   #ff6b00;
  --text:     #e8e8e8;
  --muted:    #888;
  --font:     system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --danger:   #e05252;
  --success:  #4caf7d;
  --warning:  #f0a500;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Layout ────────────────────────────────────────────────────── */
body {
  display: flex;
}

.sidebar {
  width: 200px;
  min-height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 0 0 24px 0;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}

/* ── Sidebar logo ──────────────────────────────────────────────── */
.sidebar-logo {
  padding: 20px 20px 24px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* ── Nav links ─────────────────────────────────────────────────── */
.nav-links {
  list-style: none;
  padding: 0 10px;
}

.nav-links li a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.nav-links li a:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-links li a.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
}

/* ── Top bar ───────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar);
  font-size: 14px;
}

.topbar-title {
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-date {
  color: var(--muted);
}

.topbar-logout {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: color 0.15s, border-color 0.15s;
}
.topbar-logout:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* ── Content area ──────────────────────────────────────────────── */
.content {
  padding: 36px 40px;
  max-width: 960px;
  width: 100%;
}

.content h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.content p {
  color: var(--muted);
  max-width: 600px;
}

/* ── Utility ───────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  color: var(--muted);
}

.badge-accent {
  background: var(--accent);
  color: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:hover td {
  background: var(--surface);
}

.placeholder-note {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  color: var(--muted);
  font-size: 14px;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--border);
  color: var(--text);
}

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

.btn-primary:hover {
  background: #e05e00;
  border-color: #e05e00;
}

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

.btn-spinner {
  display: inline-block;
  animation: spin 0.7s linear infinite;
}

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

/* ── Trends page ────────────────────────────────────────────────── */
.trends-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 4px;
}

.last-run-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.error-note {
  margin-top: 16px;
  padding: 14px 18px;
  background: #2a1010;
  border-left: 3px solid #c0392b;
  border-radius: 4px;
  color: #e57373;
  font-size: 13px;
  font-family: monospace;
}

/* ── Stat strip ─────────────────────────────────────────────────── */
.stat-strip {
  display: flex;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: var(--surface);
  gap: 4px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.stat-accent  { color: var(--accent); }
.stat-breakout { color: #f0a500; }

.stat-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ── Filter tabs ────────────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.filter-tab {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.filter-tab:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--muted);
}

.filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Section header ─────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}

.section-desc {
  font-size: 12px;
  color: var(--muted);
}

/* ── Chips grid ─────────────────────────────────────────────────── */
.chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.chips-grid-dense {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

/* ── Chip ───────────────────────────────────────────────────────── */
.chip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
}

.chip:hover {
  border-color: var(--muted);
}

.chip-sm {
  padding: 10px 12px;
  gap: 8px;
}

.chip-term {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.chip-sm .chip-term {
  font-size: 12px;
}

.chip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chip-product-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.chip-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Tier variants ──────────────────────────────────────────────── */
.chip-breakout {
  background: #1a0e00;
  border-color: var(--accent);
}

.chip-breakout .chip-term {
  color: #ffbb66;
}

.chip-hot {
  background: var(--surface);
  border-color: #3a2a1a;
}

.chip-hot .chip-term {
  color: var(--text);
}

/* ── Badges inside chips ────────────────────────────────────────── */
.region-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.region-gb {
  background: #1a2a3a;
  color: #6aafd4;
}

.region-us {
  background: #2a1a1a;
  color: #d47a6a;
}

.score-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.chip-hot .score-badge,
.chip-breakout .score-badge {
  color: var(--accent);
}

.breakout-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  letter-spacing: 0.06em;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
  50%       { box-shadow: 0 0 8px 2px rgba(255, 107, 0, 0.4); }
}

/* ── Ideas page ─────────────────────────────────────────────────── */

.generate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.generate-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
  margin-right: 4px;
}

.ideas-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-row-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  width: 46px;
  flex-shrink: 0;
}

/* ── Idea card ──────────────────────────────────────────────────── */

.idea-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.idea-card:hover {
  border-color: #444;
}

.idea-card[data-status="approved"] {
  border-left: 3px solid #27ae60;
}

.idea-card[data-status="rejected"] {
  opacity: 0.45;
}

.idea-main {
  display: flex;
  gap: 20px;
  padding: 16px 20px;
  align-items: flex-start;
}

.idea-body {
  flex: 1;
  min-width: 0;
}

.idea-slogan {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.idea-why {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
  font-style: italic;
}

.q-source-headline,
.idea-source-headline {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border-left: 2px solid #4a9eff44;
  border-radius: 0 4px 4px 0;
}
.q-source-headline-label,
.idea-source-headline-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  margin-bottom: 2px;
}

.idea-date {
  font-size: 11px;
  color: #555;
  margin-bottom: 8px;
}

.idea-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* ── Idea sidebar ───────────────────────────────────────────────── */

.idea-sidebar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.confidence-wrap {
  text-align: center;
}

.confidence-score {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.conf-high { color: var(--accent); }
.conf-mid  { color: #c8a84e; }
.conf-low  { color: var(--muted); }

.confidence-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.idea-actions {
  display: flex;
  gap: 5px;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

.btn-approve {
  background: transparent;
  border-color: #2a5a3a;
  color: #4caf78;
}

.btn-approve:hover {
  background: #0d2a1a;
  border-color: #4caf78;
  color: #4caf78;
}

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

.btn-reject:hover {
  background: #2a0d0d;
  border-color: #e06060;
  color: #e06060;
}

.btn-list {
  background: transparent;
  border-color: #2a4a2a;
  color: #66bb6a;
}

.btn-list:hover {
  background: #1a2a1a;
  border-color: #66bb6a;
}

.listed-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* ── Idea badges ────────────────────────────────────────────────── */

.idea-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Source colours */
.source-headline { background: #1a2a3a; color: #6aafd4; }
.source-seasonal { background: #261a36; color: #b06ad4; }
.source-manual   { background: #0d2a1a; color: #4caf78; }
.source-trend    { background: #1f1500; color: var(--accent); }

/* Status colours */
.status-new       { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.status-generated { background: #1a2a3a; color: #6aafd4; }
.status-approved  { background: #0d2a1a; color: #4caf78; }
.status-listed    { background: #1a2a1a; color: #66bb6a; }
.status-rejected  { background: #2a0d0d; color: #e06060; }

/* Angle — intentionally subtle */
.angle-badge {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Design type */
.design-text  { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.design-image { background: #1a180e; border: 1px solid #3a3010; color: #c8a84e; }

/* Product fit pills */
.product-pill {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

/* Detail toggle button */
.detail-toggle {
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  transition: color 0.1s, border-color 0.1s;
  white-space: nowrap;
}

.detail-toggle:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* ── Detail panel ───────────────────────────────────────────────── */

.idea-detail {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.detail-field {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.detail-notes {
  color: var(--muted);
  font-size: 12px;
}

.font-examples {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.font-example {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.image-prompt-text {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  background: var(--surface);
  border-radius: 5px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  line-height: 1.6;
}

.image-preview-wrap {
  margin: 10px 0;
}

.idea-image-preview {
  max-width: 320px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

/* -- Tag Vocabulary Page --------------------------------------------------- */

.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { padding: 8px 16px; font-size: 14px; color: var(--muted); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; transition: color 0.15s; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab:hover { color: var(--text); }

.badge-active { background: #1a3a1a; color: #4caf50; padding: 2px 8px; border-radius: 3px; font-size: 12px; }
.badge-proposed { background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 3px; font-size: 12px; }
.badge-retired { background: var(--surface); color: var(--muted); padding: 2px 8px; border-radius: 3px; font-size: 12px; opacity: 0.6; }

.btn-danger { }
.btn-danger:hover { background: #2a1010; color: #e57373; border-color: #c0392b; }

.tags-table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.tags-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tags-summary { color: var(--muted); font-size: 14px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.add-tag-form { display: none; margin-top: 16px; padding: 16px; background: var(--surface); border-radius: 5px; }
.add-tag-form.visible { display: flex; gap: 8px; align-items: flex-end; }
.add-tag-form input { border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 8px 12px; border-radius: 5px; font-size: 14px; }

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

/* -- Pattern Dashboard -- */

.page-subheading {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.patterns-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

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

.filter-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
}

.filter-pill.active {
    background: var(--border);
    color: var(--text);
}

.sort-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    color: var(--text);
}

.cluster-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.cluster-card:hover {
    border-color: #3e3e3e;
}

.cluster-card.posted {
    opacity: 0.6;
}

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

.cluster-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.heat-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.heat-hot {
    background: #e05252;
    color: #fff;
}

.heat-warm {
    background: #f0a500;
    color: #fff;
}

.heat-cool {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
}

.tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.tag-pill {
    background: var(--sidebar);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    display: inline-block;
}

.tag-dim {
    color: var(--muted);
}

.member-count {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
}

.top-members, .all-members {
    margin-bottom: 8px;
}

.member-item {
    font-size: 14px;
    color: var(--muted);
    padding: 2px 0;
}

.cluster-entities {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
}

.entity-link {
    color: var(--muted);
    text-decoration: underline;
}

.entity-name {
    color: var(--muted);
}

.matching-slogans {
    font-size: 14px;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 8px;
}

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

.btn-dismiss {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-dismiss:hover {
    background: #2a1010;
    color: #e57373;
}

.expand-link {
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
}

.expand-link:hover {
    color: var(--text);
}

/* Draft expand */
.draft-expand {
    background: var(--sidebar);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 16px;
    margin-top: -8px;
}

.draft-subreddit {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.draft-subreddit label {
    font-size: 14px;
    color: var(--muted);
}

.draft-subreddit select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    color: var(--text);
}

.draft-version {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.draft-title {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
}

.draft-body {
    width: 100%;
    min-height: 120px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
    resize: vertical;
    margin-bottom: 8px;
}

.draft-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.text-link-muted {
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
}

.text-link-muted:hover {
    color: var(--text);
}

/* Feedback modal */
.feedback-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    width: 480px;
    max-width: 90vw;
}

.feedback-modal h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.modal-subheading {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 16px;
}

.feedback-tag-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.feedback-tag-label {
    font-size: 14px;
    color: var(--text);
}

.feedback-toggles {
    display: flex;
    gap: 4px;
}

.feedback-toggle {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
}

.feedback-toggle.selected-good {
    background: #2d7a2d;
    color: #6fcf6f;
    border-color: #2d7a2d;
}

.feedback-toggle.selected-neutral {
    background: var(--surface);
    color: var(--muted);
}

.feedback-toggle.selected-bad {
    background: #7a2d2d;
    color: #cf6f6f;
    border-color: #7a2d2d;
}

.modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
}

#feedbackNotes {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
    resize: vertical;
    margin-top: 12px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--muted);
}

.empty-state h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* Loading spinner for draft generation */
.btn-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Phase 6: Draft approval UX */

.drafted-badge {
    background: var(--success);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    display: none;
}

.cluster-card.drafted .drafted-badge {
    display: inline-block;
}

.copy-btn {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s;
}

.copy-btn:hover {
    background: var(--surface-2);
}

.copy-btn--copied {
    color: var(--success);
    border-color: var(--success);
}

.posted-toggle {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.posted-toggle:hover {
    background: var(--surface-2);
}

.posted-toggle--done {
    background: rgba(76, 175, 125, 0.15);
    color: var(--success);
    border-color: var(--success);
    cursor: default;
}

.draft-copy-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
