/* ── Suggestions ──────────────────────────────────────────────── */
.suggestions-wrap { width: min(100% - 32px, 900px); margin: 0 auto; padding: 28px 0 60px; }

.suggestions-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.suggestions-header h1 { font-size: 26px; margin-bottom: 4px; }

/* ── Active / Archive tabs ────────────────────────────────────── */
.suggestion-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.suggestion-tab {
  padding: 9px 16px; font-size: 14px; font-weight: 600;
  color: var(--text-3); background: none; border: 0;
  border-bottom: 2px solid transparent; cursor: pointer;
}
.suggestion-tab:hover { color: var(--text-2); }
.suggestion-tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }

/* ── Controls row ─────────────────────────────────────────────── */
.suggestion-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.suggestion-search { flex: 1; min-width: 180px; max-width: 320px; }
.suggestion-sort { width: auto; min-width: 160px; }

.suggestion-filter-dropdown { position: relative; flex-shrink: 0; }
.suggestion-filter-trigger { display: inline-flex; align-items: center; gap: 7px; }
.suggestion-filter-trigger.has-filters { color: var(--accent-2); border-color: var(--accent); background: var(--accent-dim); }
.suggestion-filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 11px; font-weight: 700; line-height: 1;
  color: var(--bg); background: var(--accent); border-radius: 9px;
}
.suggestion-filter-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  width: 250px; max-height: min(420px, 70vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; background: var(--bg-2);
  border: 1px solid var(--border-2); border-radius: calc(var(--r) + 2px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .4);
}
.suggestion-filter-group { padding: 6px 4px; }
.suggestion-filter-group + .suggestion-filter-group { border-top: 1px solid var(--border); }
.suggestion-filter-label {
  margin: 0 0 4px; padding: 0 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3);
}
.suggestion-filter-option {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 6px; border-radius: 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.suggestion-filter-option:hover { color: var(--text); background: var(--bg-hover); }
.suggestion-filter-option input { flex: none; accent-color: var(--accent); cursor: pointer; }
.suggestion-filter-option span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-filter-num {
  flex: none; padding: 1px 6px;
  font-size: 11px; font-weight: 700; color: var(--text-3);
  background: var(--bg-3); border-radius: 8px;
}
.suggestion-filter-actions { padding: 6px 4px 2px; border-top: 1px solid var(--border); }
.suggestion-filter-actions .btn { width: 100%; justify-content: center; }

/* ── Cards ────────────────────────────────────────────────────── */
.suggestion-list { display: flex; flex-direction: column; gap: 10px; }
.suggestion-card {
  display: flex; gap: 14px; padding: 14px 16px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: calc(var(--r) + 2px);
  transition: border-color var(--transition), transform var(--transition);
}
.suggestion-card:hover { border-color: var(--accent); }
/* Staff-only rows read as set aside, not as normal content. */
.suggestion-card.is-hidden-row { opacity: .68; border-style: dashed; }

.suggestion-main { flex: 1; min-width: 0; cursor: pointer; }
.suggestion-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.suggestion-title {
  font-size: 16px; font-weight: 650; line-height: 1.35; margin-bottom: 5px;
  color: var(--text); overflow-wrap: anywhere;
}
.suggestion-excerpt {
  font-size: 13px; line-height: 1.55; color: var(--text-2); margin-bottom: 8px;
  /* Two-line clamp keeps every card the same height in the list. */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-clamp: 2; overflow: hidden;
}
.suggestion-meta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Status + category chips ──────────────────────────────────── */
.suggestion-status {
  padding: 2px 9px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  border-radius: 20px; border: 1px solid transparent; white-space: nowrap;
}
.status-open    { color: var(--text-2); background: var(--bg-3); border-color: var(--border); }
.status-review  { color: #f0b429; background: color-mix(in srgb, #f0b429 14%, transparent); border-color: color-mix(in srgb, #f0b429 40%, transparent); }
.status-planned { color: var(--accent-2); background: var(--accent-dim); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.status-done    { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); border-color: color-mix(in srgb, var(--success) 42%, transparent); }
.status-denied  { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.status-dupe    { color: var(--text-3); background: var(--bg-3); border-color: var(--border); }

.suggestion-category {
  padding: 2px 8px; font-size: 11px; font-weight: 600;
  color: var(--text-3); background: var(--bg-3); border-radius: 20px;
}
.suggestion-hidden-flag {
  padding: 2px 8px; font-size: 11px; font-weight: 700;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--danger) 45%, transparent); border-radius: 20px;
}

/* ── Voting ───────────────────────────────────────────────────── */
.suggestion-vote {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: none; padding-top: 2px;
}
.vote-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 24px; padding: 0;
  color: var(--text-3); background: none;
  border: 1px solid transparent; border-radius: 6px; cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.vote-btn:hover:not(:disabled) { background: var(--bg-hover); }
.vote-btn:disabled { opacity: .38; cursor: default; }
.vote-yes.active { color: var(--success); background: color-mix(in srgb, var(--success) 15%, transparent); }
.vote-no.active  { color: var(--danger);  background: color-mix(in srgb, var(--danger) 15%, transparent); }
.vote-score { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.suggestion-vote-lg .vote-btn { width: 34px; height: 30px; }
.suggestion-vote-lg .vote-score { font-size: 16px; }

.suggestion-pagination {
  display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px;
}

/* ── Detail ───────────────────────────────────────────────────── */
.suggestion-back { margin-bottom: 14px; }
.suggestion-detail-head { display: flex; gap: 16px; margin-bottom: 16px; }
.suggestion-detail-title { flex: 1; min-width: 0; }
.suggestion-detail-title h1 { font-size: 23px; line-height: 1.3; margin: 4px 0 7px; overflow-wrap: anywhere; }
.suggestion-body {
  padding: 15px 17px; margin-bottom: 16px;
  font-size: 14px; line-height: 1.7; color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: calc(var(--r) + 2px);
}

.suggestion-status-note {
  padding: 13px 15px; margin-bottom: 14px;
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-left-width: 3px; border-radius: var(--r);
}
.suggestion-status-note strong { display: block; font-size: 13px; margin-bottom: 5px; color: var(--accent-2); }
.suggestion-status-note p { font-size: 13px; line-height: 1.6; color: var(--text-2); margin-bottom: 4px; }

.suggestion-duplicate-note {
  padding: 11px 14px; margin-bottom: 14px;
  font-size: 13px; color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r);
}
.suggestion-duplicate-note a { color: var(--accent-2); text-decoration: underline; }

.suggestion-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.suggestion-danger { color: var(--danger) !important; }

.suggestion-staff-panel {
  padding: 15px; margin-bottom: 20px;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: calc(var(--r) + 2px);
}
.suggestion-staff-group { display: flex; flex-direction: column; gap: 8px; }
.suggestion-staff-group + .suggestion-staff-group {
  flex-direction: row; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}

/* ── Comments ─────────────────────────────────────────────────── */
.suggestion-comments { margin-top: 26px; }
.suggestion-locked-note {
  padding: 11px 14px; margin-bottom: 14px;
  font-size: 13px; color: var(--text-3);
  background: var(--bg-2); border: 1px dashed var(--border-2); border-radius: var(--r);
}
.suggestion-comment-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.suggestion-comment-form .btn { align-self: flex-start; }
.suggestion-reply-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 11px; font-size: 12px; color: var(--text-2);
  background: var(--bg-3); border-left: 2px solid var(--accent); border-radius: var(--r);
}
.suggestion-reply-banner button { color: var(--text-3); background: none; border: 0; cursor: pointer; font-size: 14px; }

.suggestion-comment-list { display: flex; flex-direction: column; gap: 12px; }
.suggestion-comment {
  padding: 11px 13px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r);
}
.suggestion-comment:target { border-color: var(--accent); background: var(--accent-dim); }
.suggestion-comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 5px; }
.suggestion-comment-author { font-size: 13px; font-weight: 650; color: var(--text); }
.suggestion-comment-author:hover { color: var(--accent-2); }
.suggestion-comment-body { font-size: 13.5px; line-height: 1.65; color: var(--text-2); }
.suggestion-comment-deleted { font-size: 13px; font-style: italic; color: var(--text-3); }
.suggestion-comment-edit { display: flex; flex-direction: column; gap: 8px; }
.suggestion-comment-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 7px; }
.suggestion-comment-actions button {
  font-size: 12px; font-weight: 600; color: var(--text-3);
  background: none; border: 0; padding: 0; cursor: pointer;
}
.suggestion-comment-actions button:hover { color: var(--accent-2); }
.suggestion-comment-actions button.suggestion-danger:hover { color: var(--danger); }

.role-identity-icon { display: inline-flex; width: 14px; height: 14px; }
.role-identity-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; }

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .suggestions-wrap { width: min(100% - 20px, 900px); padding-top: 20px; }
  .suggestions-header { align-items: stretch; }
  .suggestions-header .btn { width: 100%; }
  .suggestion-controls { gap: 8px; }
  .suggestion-search { max-width: none; width: 100%; }
  .suggestion-sort { flex: 1; min-width: 0; }
  /* Anchored right would overflow the viewport on a narrow screen. */
  .suggestion-filter-panel { width: calc(100vw - 32px); max-width: 300px; }
  .suggestion-detail-title h1 { font-size: 20px; }
  .suggestion-card { padding: 12px 13px; gap: 10px; }
  /* A phone cannot afford 22px per level, but flattening entirely would lose
     the thread shape. commentIndent() halves the step below 640px; the accent
     rule carries the rest of the signal. */
  .suggestion-comment[style*="margin-left"] {
    border-left: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  }
}
