/* === Theme tokens ===
   Neutrals derive from the site's generic tokens (base_style.css) so the
   feedback board inherits each project's own light/dark palette instead of
   carrying its own hardcoded one. Status-accent colors stay a small
   semantic palette of their own (not brand-tied). */
.bugs-app {
  --bg: var(--container-bg, var(--card-bg));
  --bg-elev: var(--card-bg);
  --bg-row-hover: color-mix(in srgb, var(--primary-blue) 6%, var(--card-bg));
  --bg-row-active: color-mix(in srgb, var(--primary-blue) 10%, var(--card-bg));
  --border: var(--border-color);
  --border-strong: color-mix(
    in srgb,
    var(--border-color) 70%,
    var(--text-color)
  );
  --fg: var(--heading-color);
  --fg-muted: var(--muted-text);
  --fg-faint: color-mix(in srgb, var(--muted-text) 70%, transparent);

  /* Status colors (semantic, not "accent") */
  --status-open: #c08a14;
  --status-open-bg: #fdf6e3;
  --status-progress: #2c5fd0;
  --status-progress-bg: #ecf1fc;
  --status-fixed: #1f8a5f;
  --status-fixed-bg: #e6f5ed;
  --status-closed: #6b6a67;
  --status-closed-bg: #f0efed;

  --sev-low: #6b6a67;
  --sev-medium: #c08a14;
  --sev-high: #d36420;
  --sev-critical: #b8232a;

  /* Accent — the project's primary brand colour so the feedback page's
     primary buttons match each project. */
  --accent: var(--primary-blue);
  --accent-fg: var(--btn-text, #ffffff);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;
}

.bugs-app[data-theme='dark'] {
  --status-open: #e0b341;
  --status-open-bg: rgba(224, 179, 65, 0.1);
  --status-progress: #6fa0ff;
  --status-progress-bg: rgba(111, 160, 255, 0.1);
  --status-fixed: #4dc28a;
  --status-fixed-bg: rgba(77, 194, 138, 0.1);
  --status-closed: #9c9b96;
  --status-closed-bg: rgba(155, 154, 150, 0.08);

  --sev-low: #9c9b96;
  --sev-medium: #e0b341;
  --sev-high: #ee8a4d;
  --sev-critical: #e8595f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bugs-app *,
.bugs-app {
  box-sizing: border-box;
}

.bugs-app,
.bugs-app {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.bugs-app button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}

.bugs-app input,
.bugs-app textarea,
.bugs-app select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.bugs-app a {
  color: inherit;
  text-decoration: none;
}

.bugs-app .mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1;
}

.bugs-app .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: var(--fg-muted);
  transition:
    background 120ms,
    color 120ms;
}
.bugs-app .icon-btn:hover {
  background: var(--bg-row-hover);
  color: var(--fg);
}

/* .btn / .btn-primary / .btn-ghost intentionally have NO color/background
   rules here - they're the site's own shared button classes (styled by
   base_elements.css + each project's own theme), so buttons in the
   tracker render as the project's real, native button style instead of a
   competing one-off look. Only bugs-specific sizing lives here. */
.bugs-app .btn {
  gap: 6px;
  padding: 7px 13px;
  font-size: 13px;
  white-space: nowrap;
}
.bugs-app .btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* === Page === */
.bugs-app .page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
.bugs-app .page-header {
  margin-bottom: 32px !important;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.bugs-app .page-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.bugs-app .page-subtitle {
  color: var(--fg-muted);
  margin: 0;
  font-size: 14px;
}

/* === Stats strip === */
.bugs-app .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  margin-bottom: 24px;
  overflow: hidden;
}
.bugs-app .stat {
  padding: 18px 22px;
  border-right: 1px solid var(--border);
}
.bugs-app .stat:last-child {
  border-right: none;
}
.bugs-app .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bugs-app .stat-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-feature-settings: 'tnum' 1;
}
.bugs-app .stat-delta {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 2px;
}
.bugs-app .stat-delta.up {
  color: var(--status-fixed);
}
.bugs-app .stat-delta.down {
  color: var(--sev-critical);
}

/* === Toolbar === */
.bugs-app .toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  padding-bottom: 12px;
}
/* Bug-tracker uses base_search_field (.search-field / .search-field__input)
   so the native browser X clear button shows. The base component caps the
   width at 190px - override that and tighten the height to match the
   surrounding toolbar. */
.bugs-app .bugs-search-field {
  flex: 1;
  max-width: none;
  --search-height: 36px;
  --search-icon-size: 14px;
}
.bugs-app .bugs-search-field .search-field__input {
  padding-right: 56px !important;
  font-size: 13px;
}
.bugs-app .bugs-search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
  padding: 3px 6px;
  background: var(--bg-row-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-muted);
  pointer-events: none;
  user-select: none;
}
/* Hide the hint when the field is focused - the user clearly knows
   where it is once they're typing, and it would just clutter. */
.bugs-app .bugs-search-field .search-field__input:focus ~ .bugs-search-kbd {
  display: none;
}
/* Custom clear (X) button - only shown once there's a query.
   Replaces the native <input type="search"> cancel button, which fired
   inconsistent events across browsers. */
.bugs-app .bugs-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  background: var(--bg-row-hover) !important;
  color: var(--fg-muted) !important;
  border-radius: 50% !important;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
.bugs-app .bugs-search-clear:hover {
  background: var(--border) !important;
  color: var(--fg) !important;
}
.bugs-app .bugs-search-field.has-value .bugs-search-clear {
  display: inline-flex;
}
.bugs-app .bugs-search-field.has-value .bugs-search-kbd {
  display: none;
}

/* Status filter tabs - subtle pill design from the Claude Design source.
   !important needed to defeat the global .button/.btn rule in
   base_elements.css which itself uses !important. */
.bugs-app .filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px !important;
  margin: 0 !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg-elev) !important;
  color: var(--fg-muted) !important;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease !important;
  box-shadow: none !important;
}
.bugs-app .filter-btn:hover {
  color: var(--fg) !important;
  border-color: var(--border-strong) !important;
  background: var(--bg-elev) !important;
}
.bugs-app .filter-btn.active {
  color: var(--bg) !important;
  border-color: var(--fg) !important;
  background: var(--fg) !important;
}
.bugs-app .filter-btn .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  background: var(--bg-row-hover);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 2px;
}
.bugs-app .filter-btn.active .count {
  color: var(--fg);
  background: var(--bg);
}

/* Kind toggle (Bugs/Suggestions filter) */
.bugs-app .kind-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
/* Kind toggle - Claude Design's segmented pill. The active variant
   takes the kind's tint colour (red for Bugs, blue for Suggestions);
   the icon inherits via currentColor.
   !important needed throughout to defeat the global
   button { color: var(--text-color) !important; } rule. */
.bugs-app .kind-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px !important;
  margin: 0 !important;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 6px !important;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.12s ease,
    color 0.12s ease !important;
  box-shadow: none !important;
}
.bugs-app .kind-toggle-btn:hover {
  color: var(--fg) !important;
}
.bugs-app .kind-toggle-btn .count {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  background: var(--bg-elev);
  border-radius: 4px;
  color: var(--fg-muted);
}
.bugs-app .kind-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bugs-app .kind-toggle-btn.active {
  background: var(--bg-elev) !important;
  color: var(--fg) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
/* "All" active uses the site primary (purple) as its tint, so each
   active state has its own colour: All = purple, Bugs = red,
   Suggestions = blue. */
.bugs-app
  .kind-toggle-btn.active:not(.kind-toggle-bug):not(.kind-toggle-suggestion) {
  color: var(--primary-blue) !important;
}
.bugs-app
  .kind-toggle-btn.active:not(.kind-toggle-bug):not(.kind-toggle-suggestion)
  .count {
  background: color-mix(in srgb, var(--primary-blue) 14%, transparent);
  color: var(--primary-blue);
  font-weight: 600;
}
.bugs-app .kind-toggle-bug.active {
  color: #c93f34 !important;
}
.bugs-app .kind-toggle-bug.active .count {
  background: color-mix(in oklab, #d4453a 14%, transparent);
  color: #c93f34;
  font-weight: 600;
}
.bugs-app .kind-toggle-suggestion.active {
  color: #2566c2 !important;
}
.bugs-app .kind-toggle-suggestion.active .count {
  background: color-mix(in oklab, #2a73d4 14%, transparent);
  color: #2566c2;
  font-weight: 600;
}
.bugs-app[data-theme='dark'] .kind-toggle-bug.active {
  color: #ff8077 !important;
}
.bugs-app[data-theme='dark'] .kind-toggle-bug.active .count {
  background: color-mix(in oklab, #ff6b60 18%, transparent);
  color: #ff8077;
}
.bugs-app[data-theme='dark'] .kind-toggle-suggestion.active {
  color: #7eb1ff !important;
}
.bugs-app[data-theme='dark'] .kind-toggle-suggestion.active .count {
  background: color-mix(in oklab, #5b9bff 22%, transparent);
  color: #7eb1ff;
}

.bugs-app .sort-select {
  padding: 7px 28px 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 4l3 3 3-3' fill='none' stroke='%239aa0a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

/* === Filter pills row === */
.bugs-app .filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.bugs-app .filter-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

/* === Bug list === */
.bugs-app .bug-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bugs-app .bug-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bugs-app .bug-row {
  display: grid;
  grid-template-columns: 1fr minmax(80px, auto) auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition:
    background 160ms cubic-bezier(0.2, 0, 0, 1),
    border-color 160ms cubic-bezier(0.2, 0, 0, 1),
    transform 160ms cubic-bezier(0.2, 0, 0, 1);
}
.bugs-app .bug-row:hover {
  background: var(--bg-row-hover);
  border-color: color-mix(in srgb, var(--primary-blue) 45%, var(--border));
  transform: translateY(-1px);
}

/* Vote button */
/* === Vote button (right side, thumbs-up pill) === */
.bugs-app .vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg-muted);
  transition:
    background 140ms,
    border-color 140ms,
    color 140ms;
  white-space: nowrap;
}
.bugs-app .vote-btn:hover {
  border-color: var(--border-strong);
  color: var(--fg);
  background: var(--bg-row-hover);
}
/* Voted state — Discord reaction style: tinted background, accent border,
   accent count colour. Falls back to the site's primary-blue (purple in
   this build) so it tracks the rest of the UI. */
.bugs-app .vote-btn.voted {
  background: color-mix(in srgb, var(--primary-blue) 14%, transparent);
  color: var(--primary-blue);
  border-color: color-mix(in srgb, var(--primary-blue) 60%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary-blue) 35%, transparent)
    inset;
}
.bugs-app .vote-btn.voted:hover {
  background: color-mix(in srgb, var(--primary-blue) 22%, transparent);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}
.bugs-app[data-theme='dark'] .vote-btn.voted {
  background: color-mix(in srgb, var(--primary-blue) 22%, transparent);
}
.bugs-app .vote-emoji {
  font-size: 13px;
  line-height: 1;
  filter: grayscale(0.5) opacity(0.7);
  transition:
    transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 160ms;
}
.bugs-app .vote-btn:hover .vote-emoji {
  transform: scale(1.15) rotate(-8deg);
  filter: grayscale(0) opacity(1);
}
.bugs-app .vote-btn.voted .vote-emoji {
  filter: none;
  transform: scale(1.05);
}
.bugs-app .vote-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-feature-settings: 'tnum' 1;
  min-width: 22px;
  text-align: right;
  display: inline-flex;
  justify-content: flex-end;
  line-height: 1;
}
.bugs-app .vote-btn.voted .vote-count {
  color: var(--primary-blue);
  font-weight: 700;
}

/* Quick pop animation when the user has just voted - Discord-like
   feedback that the click registered. Gated by .just-voted so it only
   plays on the actual click, not on every render of an already-voted
   button. JS adds .just-voted then strips it after the animation. */
@keyframes votePop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.22);
  }
  70% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}
.bugs-app .vote-btn.just-voted .vote-emoji {
  animation: votePop 360ms cubic-bezier(0.2, 0.7, 0.2, 1.4);
}
@media (prefers-reduced-motion: reduce) {
  .bugs-app .vote-btn.just-voted .vote-emoji {
    animation: none;
  }
}

/* Odometer roll: each .vc-digit is a 1ch-wide window, the .vc-track
   stacks 0-9 vertically and translates to the active digit. Changes
   animate via the transition on transform. */
.bugs-app .vc-digit {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  vertical-align: top;
  position: relative;
  font-variant-numeric: tabular-nums;
}
.bugs-app .vc-track {
  display: flex;
  flex-direction: column;
  transition: transform 360ms cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
.bugs-app .vc-track > span {
  display: block;
  height: 1em;
  line-height: 1;
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .bugs-app .vc-track {
    transition: none;
  }
}

/* Title cell */
.bugs-app .bug-title-cell {
  min-width: 0;
}
.bugs-app .bug-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bugs-app .bug-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  flex-shrink: 0;
  white-space: nowrap;
}
.bugs-app .bug-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.bugs-app .bug-meta-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 6px;
  flex-wrap: wrap;
}
.bugs-app .meta-product {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
}
.bugs-app .bug-meta-line .dot {
  width: 2px;
  height: 2px;
  background: var(--fg-faint);
  border-radius: 50%;
}

/* Severity pill */
.bugs-app .sev-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}
.bugs-app .sev-bar {
  width: 3px;
  height: 11px;
  border-radius: 1px;
}
.bugs-app .sev-pill[data-sev='low'] .sev-bar {
  background: var(--sev-low);
}
.bugs-app .sev-pill[data-sev='medium'] .sev-bar {
  background: var(--sev-medium);
}
.bugs-app .sev-pill[data-sev='high'] .sev-bar {
  background: var(--sev-high);
}
.bugs-app .sev-pill[data-sev='critical'] .sev-bar {
  background: var(--sev-critical);
}
.bugs-app .sev-pill[data-sev='critical'] {
  color: var(--sev-critical);
}

/* Status pill */
.bugs-app .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.bugs-app .status-pill[data-status='open'] {
  background: var(--status-open-bg);
  color: var(--status-open);
}
.bugs-app .status-pill[data-status='in-progress'] {
  background: var(--status-progress-bg);
  color: var(--status-progress);
}
.bugs-app .status-pill[data-status='fixed'] {
  background: var(--status-fixed-bg);
  color: var(--status-fixed);
}
.bugs-app .status-pill[data-status='closed'] {
  background: var(--status-closed-bg);
  color: var(--status-closed);
}
.bugs-app .status-pill[data-status='rejected'] {
  background: color-mix(in oklab, #d4453a 14%, transparent);
  color: #c93f34;
}
.bugs-app[data-theme='dark'] .status-pill[data-status='rejected'] {
  background: color-mix(in oklab, #ff6b60 18%, transparent);
  color: #ff8077;
}
.bugs-app .bug-row.rejected .bug-title,
.bugs-app .bug-row.rejected .bug-comments,
.bugs-app .bug-row.rejected .bug-updated {
  opacity: 0.55;
}
.bugs-app .bug-row.rejected .bug-title {
  text-decoration: line-through;
}
.bugs-app .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.bugs-app .bug-product {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}
.bugs-app .bug-comments {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--fg-muted);
  font-size: 12px;
  font-family: var(--font-mono);
  min-width: 28px;
  justify-content: flex-end;
}
.bugs-app .bug-updated {
  font-size: 12px;
  color: var(--fg-faint);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

/* === Detail (rendered inside the right-side slide-over panel) === */
.bugs-app .bug-detail {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 24px 28px 28px 28px;
}
.bugs-app .detail-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 32px;
}
.bugs-app .detail-section {
  margin-bottom: 22px;
}
.bugs-app .detail-section:last-child {
  margin-bottom: 0;
}
.bugs-app .detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.bugs-app .detail-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
}
.bugs-app .detail-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.bugs-app .detail-steps li {
  position: relative;
  padding: 4px 0 4px 28px;
  counter-increment: step;
  font-size: 13px;
  line-height: 1.6;
}
.bugs-app .detail-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-row-hover);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
  display: grid;
  place-items: center;
}
.bugs-app .expect-actual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.bugs-app .exp-card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}
.bugs-app .exp-card .label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.bugs-app .exp-card.expected .label {
  color: var(--status-fixed);
}
.bugs-app .exp-card.actual .label {
  color: var(--sev-critical);
}

/* Sidebar */
.bugs-app .detail-side {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}
.bugs-app .side-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 12px;
  border-bottom: 1px dashed var(--border);
}
.bugs-app .side-row:last-child {
  border-bottom: none;
}
.bugs-app .side-key {
  color: var(--fg-muted);
}
.bugs-app .side-val {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Timeline */
.bugs-app .timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
}
.bugs-app .timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}
.bugs-app .timeline li {
  position: relative;
  padding: 6px 0 6px 22px;
  font-size: 12px;
}
.bugs-app .timeline li::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 11px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 2px solid var(--fg-faint);
}
.bugs-app .timeline li.done::before {
  background: var(--status-fixed);
  border-color: var(--status-fixed);
}
.bugs-app .timeline li.current::before {
  background: var(--status-progress);
  border-color: var(--status-progress);
}
.bugs-app .timeline-label {
  color: var(--fg);
}
.bugs-app .timeline-date {
  color: var(--fg-faint);
  font-size: 11px;
}

/* Comments */
.bugs-app .comments {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.bugs-app .comment {
  display: flex;
  gap: 12px;
  padding: 12px 0;
}
.bugs-app .comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-row-hover);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  flex-shrink: 0;
}
.bugs-app .comment-avatar.team {
  background: var(--fg);
  color: var(--bg);
}
.bugs-app .comment-body {
  flex: 1;
}
.bugs-app .comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.bugs-app .comment-author {
  font-weight: 500;
  font-size: 13px;
}
.bugs-app .comment-team-tag {
  font-size: 10px;
  background: #f5c518;
  color: #1a1304;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.bugs-app .comment-when {
  font-size: 11px;
  color: var(--fg-faint);
}
.bugs-app .comment-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg);
}

.bugs-app .comment-input {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.bugs-app .comment-input textarea {
  flex: 1;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
  outline: none;
  font-size: 13px;
}
.bugs-app .comment-input textarea:focus {
  border-color: var(--border-strong);
}

/* === Modal === */
/* Shell (.modal backdrop, .modal-content, .modal-header, .modal-body,
   .modal-footer, .modal-actions, .close) comes entirely from
   base_modal.css. Only bugs-specific sizing/content styling lives here. */
.bugs-app .modal .modal-content.modal-content-sm {
  width: min(520px, calc(100vw - 32px)) !important;
}
/* Attachment preview modal: sized to fit large images / videos. */
.bugs-app .modal .modal-content.modal-content-preview {
  width: min(960px, calc(100vw - 32px)) !important;
}
.bugs-app .attach-preview-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px !important;
  background: var(--bg);
  max-height: calc(100vh - 140px);
  overflow: auto;
}
.bugs-app .attach-preview-img,
.bugs-app .attach-preview-video {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  display: block;
  border-radius: var(--radius-md);
  background: #000;
}
.bugs-app .side-panel-close {
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}
.bugs-app .side-panel-close:hover {
  background: var(--bg-row-hover);
  color: var(--fg);
}
.bugs-app .modal-header {
  align-items: flex-start !important;
  padding: 20px 22px 16px !important;
  border-bottom: 1px solid var(--border) !important;
}
.bugs-app .modal-header h3 {
  font-size: 21px !important;
  line-height: 1.3 !important;
  letter-spacing: -0.2px !important;
}
.bugs-app .modal-subtitle {
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 400;
  line-height: 1.5;
  margin: 5px 0 0 !important;
  max-width: 62ch;
}
/* Base modal right-aligns footer actions; this one also carries a hint on
   the left, so it needs space-between. */
.bugs-app .modal-footer {
  justify-content: space-between !important;
}
.bugs-app .modal-footer .modal-actions {
  display: flex;
  gap: 8px;
}
.bugs-app .modal-foot-hint {
  font-size: 12px;
  color: var(--fg-muted);
}

/* Form */
.bugs-app .field {
  margin-bottom: 28px !important;
}
.bugs-app .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px !important;
}
.bugs-app .field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px !important;
}
.bugs-app .field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 14px !important;
  color: var(--fg);
}
.bugs-app .field-label .optional {
  font-size: 11px;
  color: var(--fg-faint);
  font-weight: 400;
}
/* Required marker sits inline immediately after the label text (not
   right-aligned by the parent flex). The wrapping span around
   "Label *" is what keeps both as a single flex child. */
.bugs-app .field-label .required-mark {
  color: var(--sev-critical);
  font-weight: 500;
}
/* Wrap around disabled Submit so the title-tooltip shows even when the
   inner button is disabled (Safari/Firefox quirk). */
.bugs-app .submit-wrap {
  display: inline-flex;
}
.bugs-app .submit-wrap:has(button:disabled) {
  cursor: not-allowed;
}
.bugs-app .textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}
.bugs-app .textarea.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}
.bugs-app .select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 4l3 3 3-3' fill='none' stroke='%239aa0a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.bugs-app .helper {
  font-size: 11px;
  color: var(--fg-faint);
  margin-top: 5px;
}

/* Severity radio */
.bugs-app .sev-radio {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.bugs-app .sev-opt {
  position: relative;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  transition: border-color 120ms;
}
.bugs-app .sev-opt input {
  position: absolute;
  opacity: 0;
}
.bugs-app .sev-opt:hover {
  border-color: var(--border-strong);
}
.bugs-app .sev-opt.checked {
  border-color: var(--fg);
  background: var(--bg-row-hover);
}
.bugs-app .sev-opt .sev-bar {
  width: 3px;
  height: 12px;
  border-radius: 1px;
}
.bugs-app .sev-opt[data-sev='low'] .sev-bar {
  background: var(--sev-low);
}
.bugs-app .sev-opt[data-sev='medium'] .sev-bar {
  background: var(--sev-medium);
}
.bugs-app .sev-opt[data-sev='high'] .sev-bar {
  background: var(--sev-high);
}
.bugs-app .sev-opt[data-sev='critical'] .sev-bar {
  background: var(--sev-critical);
}

/* Device segmented */
.bugs-app .segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
  width: 100%;
}
.bugs-app .seg-opt {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--fg-muted);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  text-transform: capitalize;
}
.bugs-app .seg-opt:last-child {
  border-right: none;
}
.bugs-app .seg-opt:hover {
  color: var(--fg);
}
.bugs-app .seg-opt.active {
  background: color-mix(in srgb, var(--primary-blue) 12%, var(--bg-elev));
  color: var(--primary-blue);
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--primary-blue);
}
.bugs-app .seg-opt.active svg {
  color: var(--primary-blue);
}

/* File drop */
.bugs-app .dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--fg-muted);
  background: var(--bg);
  cursor: pointer;
  transition:
    background 120ms,
    border-color 120ms;
}
.bugs-app .dropzone:hover,
.bugs-app .dropzone.drag-over {
  background: var(--bg-row-hover);
  border-color: var(--fg-faint);
}
.bugs-app .dropzone.drag-over {
  border-style: solid;
}
.bugs-app .dropzone .dz-title {
  color: var(--fg);
  margin-bottom: 2px;
  font-weight: 500;
}
.bugs-app .dropzone .dz-link {
  text-decoration: underline;
}
.dz-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dz-file {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 12px;
  color: var(--fg);
}
.dz-file .dz-fname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dz-file .dz-fsize {
  margin-left: 8px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.dz-file .dz-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}
.dz-file .dz-remove:hover {
  background: var(--bg-row-hover);
  color: var(--fg);
}

.bugs-app .steps-input {
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Center-align so the trash icon sits at the same y as the input
   regardless of input height set by base_elements / form vars. */
.bugs-app .step-item {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px !important;
}
.bugs-app .step-num {
  flex-shrink: 0;
  width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
}
.bugs-app .step-item .input {
  flex: 1;
  min-width: 0;
}
/* Trash button: borderless, square, matches input height. !important
   needed because base_elements applies button border + bg with
   !important to all <button> elements. */
.bugs-app .step-remove {
  flex-shrink: 0;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 0 !important;
  color: var(--fg-faint) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease !important;
}
.bugs-app .step-remove:hover {
  background: var(--bg-row-hover) !important;
  color: var(--fg) !important;
  border-color: transparent !important;
}
/* Add-step is a borderless link-style button. Override the global
   button chrome (border + filled bg + 18px padding) so the "+" reads
   as inline text instead of being shoved against a visible button edge. */
.bugs-app .step-add {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 12px !important;
  font-weight: 500;
  color: var(--fg-muted) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: var(--radius-sm) !important;
  padding: 4px 8px !important;
  margin: 4px 0 0 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease !important;
}
.bugs-app .step-add:hover {
  color: var(--fg) !important;
  background: var(--bg-row-hover) !important;
  border-color: transparent !important;
}

/* Empty state */
.bugs-app .empty {
  text-align: center;
  margin-top: 22px !important;
  padding: 60px 20px;
  color: var(--fg-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg);
}
.bugs-app .empty h3 {
  margin: 0 0 10px !important;
  color: var(--fg);
  font-size: 16px;
  font-weight: 600;
}
.bugs-app .empty p {
  margin: 0 0 28px !important;
  font-size: 13.5px;
}

/* Markdown helper bar */
.bugs-app .md-bar {
  display: flex;
  gap: 2px;
  margin-bottom: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
  background: var(--bg);
}
.bugs-app .md-btn {
  padding: 3px 7px;
  font-size: 11px;
  color: var(--fg-muted);
  border-radius: 3px;
  font-family: var(--font-mono);
}
.bugs-app .md-btn:hover {
  background: var(--bg-row-hover);
  color: var(--fg);
}
.bugs-app .md-bar + .textarea {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Responsive niceties */
@media (max-width: 880px) {
  .bugs-app .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .bugs-app .stat:nth-child(2) {
    border-right: none;
  }
  .bugs-app .stat:nth-child(1),
  .bugs-app .stat:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }
  .bugs-app .bug-row {
    grid-template-columns: 1fr auto auto;
    gap: 12px;
  }
  .bugs-app .bug-row .bug-comments,
  .bugs-app .bug-row .bug-updated {
    display: none;
  }
  .bugs-app .detail-grid {
    grid-template-columns: 1fr;
  }
  .bugs-app .detail-side {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 16px;
  }
  .bugs-app .field-row,
  .bugs-app .field-row-3 {
    grid-template-columns: 1fr;
  }
  .bugs-app .app-nav {
    display: none;
  }
  .bugs-app .page {
    padding: 24px 16px 60px;
  }
  .bugs-app .app-header-inner {
    padding: 12px 16px;
  }
}

.bugs-app .bug-title-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Kind badge (bug vs suggestion) on each row */
.bugs-app .kind-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
}
.bugs-app .kind-badge.kind-bug {
  background: color-mix(in oklab, #d4453a 14%, transparent);
  color: #c93f34;
}
.bugs-app .kind-badge.kind-suggestion {
  background: color-mix(in oklab, #2a73d4 14%, transparent);
  color: #2566c2;
}
.bugs-app[data-theme='dark'] .kind-badge.kind-bug {
  background: color-mix(in oklab, #ff6b60 18%, transparent);
  color: #ff8077;
}
.bugs-app[data-theme='dark'] .kind-badge.kind-suggestion {
  background: color-mix(in oklab, #5b9bff 22%, transparent);
  color: #7eb1ff;
}

/* Kind radio in Report a bug modal */
.bugs-app .bugs-opt-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bugs-app .bugs-opt-icon.kind-opt-bug {
  background: color-mix(in oklab, #d4453a 14%, transparent);
  color: #c93f34;
}
.bugs-app .bugs-opt-icon.kind-opt-suggestion {
  background: color-mix(in oklab, #2a73d4 14%, transparent);
  color: #2566c2;
}
.bugs-app[data-theme='dark'] .bugs-opt-icon.kind-opt-bug {
  background: color-mix(in oklab, #ff6b60 18%, transparent);
  color: #ff8077;
}
.bugs-app[data-theme='dark'] .bugs-opt-icon.kind-opt-suggestion {
  background: color-mix(in oklab, #5b9bff 22%, transparent);
  color: #7eb1ff;
}

/* === Pagination === */
.bugs-app .pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  flex-wrap: wrap;
}
.bugs-app .pagination-summary {
  font-size: 13px;
  color: var(--fg-muted);
}
.bugs-app .pagination-summary strong {
  color: var(--fg);
  font-weight: 600;
}
/* Pagination: every control sits inline on the same baseline, same
   32px height. No pill container, no per-button border at rest -
   active is the only one with chrome. */
.bugs-app .pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bugs-app .page-list {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  margin: 0;
}
.bugs-app .page-btn {
  height: 32px;
  min-width: 32px;
  width: auto;
  padding: 0 10px !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--fg-muted) !important;
  border-radius: 6px !important;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-shadow: none !important;
  box-sizing: border-box;
  transition:
    background 0.12s ease,
    color 0.12s ease !important;
}
.bugs-app .page-btn:hover:not(:disabled):not(.active) {
  background: var(--bg-row-hover) !important;
  color: var(--fg) !important;
}
.bugs-app .page-btn.active {
  background: var(--fg) !important;
  color: var(--bg) !important;
  font-weight: 600 !important;
  cursor: default;
}
.bugs-app .page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.bugs-app .page-nav {
  width: 32px;
  min-width: 32px;
  padding: 0 !important;
  color: var(--fg-muted) !important;
  /* Flex centering nails the geometric middle, but a digit's optical
     centre sits a hair below the geometric one (descender room). The
     chevron, being symmetric around its viewBox centre, would therefore
     read 1px higher than the digit. Nudge it down to match. */
  line-height: 0;
}
.bugs-app .page-nav svg {
  display: block;
  margin-top: -1px;
}
.bugs-app .page-nav:hover:not(:disabled) {
  background: var(--bg-row-hover) !important;
  color: var(--fg) !important;
}
.bugs-app .page-ellipsis {
  height: 32px;
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-faint);
  font-size: 13px;
  user-select: none;
}
@media (max-width: 600px) {
  .bugs-app .pagination {
    justify-content: center;
  }
  .bugs-app .pagination-summary {
    width: 100%;
    text-align: center;
  }
}

/* === Thread page === */
.bugs-app .thread-page {
  max-width: 820px;
}
.bugs-app .thread-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 22px;
}
/* Plain-text breadcrumb link - overrides global a { border-bottom: dotted }
   from base_elements.css so it doesn't read like a link. */
.bugs-app .crumb-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fg-muted) !important;
  font-size: 13px;
  text-decoration: none;
  border: 0 !important;
  border-bottom: 0 !important;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: color 0.12s ease;
}
.bugs-app .crumb-link:hover {
  color: var(--fg) !important;
  background: transparent;
}
.bugs-app .crumb-sep {
  color: var(--fg-faint);
}
.bugs-app .crumb-current {
  font-size: 12px;
  color: var(--fg);
}

.bugs-app .thread-header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.bugs-app .thread-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  line-height: 1.35;
  color: var(--fg);
}
.bugs-app .thread-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-muted);
  flex-wrap: wrap;
}
.bugs-app .thread-meta-dot {
  color: var(--fg-faint);
}
.bugs-app .thread-meta-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 2px;
}
.bugs-app .thread-meta-spacer {
  flex: 1;
  min-width: 12px;
}

.bugs-app .thread-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.bugs-app .thread-main {
  min-width: 0;
}

.bugs-app .thread-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.bugs-app .thread-card.original {
  border-color: var(--border-strong);
}
/* OP card in thread view embeds the full bug-detail block. Strip its
   inner padding so .bug-detail's own padding governs the layout, and
   give a small header row for the reporter avatar/name. */
.bugs-app .thread-card.thread-card-detail {
  padding: 0;
  overflow: hidden;
}
.bugs-app .thread-card.thread-card-detail .bug-detail {
  border-top: 1px solid var(--border);
}
.bugs-app .thread-original-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
}
.bugs-app .thread-original-by {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.bugs-app .thread-card.comment-card.team {
  background: var(--bg);
}
.bugs-app .thread-card .comment {
  padding: 0;
}

.bugs-app .thread-comments-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin: 28px 4px 14px;
}
.bugs-app .thread-empty-comments {
  text-align: center;
  padding: 32px 12px;
  color: var(--fg-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.bugs-app .comment-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}
.bugs-app .comment-action {
  font-size: 12px;
  color: var(--fg-muted) !important;
  background: transparent !important;
  border: 0 !important;
  padding: 4px 8px !important;
  margin: 0 !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-ui);
  cursor: pointer;
  box-shadow: none !important;
}
.bugs-app .comment-action:hover {
  background: var(--bg-row-hover) !important;
  color: var(--fg) !important;
}

/* Icon-only Reply button - no frame, no fill, just the glyph. */
.bugs-app .comment-icon-btn {
  width: 26px !important;
  min-width: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 0 !important;
  color: var(--fg-muted) !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease !important;
}
.bugs-app .comment-icon-btn:hover {
  background: var(--bg-row-hover) !important;
  color: var(--fg) !important;
}

/* Vote pill inside comment actions — same proportions as the main
   bug vote, only marginally trimmed so it fits the comment row. */
.bugs-app .vote-btn-sm {
  padding: 5px 12px 5px 10px !important;
  gap: 6px !important;
}
.bugs-app .vote-btn-sm .vote-emoji {
  font-size: 13px;
}
.bugs-app .vote-btn-sm .vote-count {
  font-size: 12px;
  min-width: 18px;
}
.bugs-app .comment-action-report {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto !important;
}
.bugs-app .comment-action-report:hover {
  color: var(--sev-critical);
  background: color-mix(in oklab, var(--sev-critical) 8%, transparent);
}
.bugs-app .comment-action-delete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.bugs-app .comment-action-delete:hover {
  color: var(--sev-critical);
  background: color-mix(in oklab, var(--sev-critical) 8%, transparent);
}
.bugs-app .comment-actions {
  justify-content: flex-start;
  align-items: center;
}

/* Inline reply composer + nested reply list, both indented to sit
   underneath the parent comment. */
.bugs-app .reply-composer {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
}
.bugs-app .reply-composer .textarea {
  min-height: 64px;
  font-size: 13px;
}
.bugs-app .reply-composer .composer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.bugs-app .reply-list {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bugs-app .reply-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.bugs-app .reply-item .comment-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}
.bugs-app .reply-body {
  flex: 1;
  min-width: 0;
}
.bugs-app .reply-body .comment-text {
  font-size: 13px;
}

/* === Rendered markdown body (descriptions / comments / replies) ====== */
.bugs-app .md-content {
  word-break: break-word;
}
.bugs-app .md-content strong {
  font-weight: 700;
  color: var(--fg);
}
.bugs-app .md-content em {
  font-style: italic;
}
.bugs-app .md-content code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-row-hover);
  border: 1px solid var(--border);
  color: var(--fg);
}
.bugs-app .md-content a {
  color: var(--primary-blue, var(--fg));
  text-decoration: underline;
  text-underline-offset: 2px;
  border-bottom: 0;
}
.bugs-app .md-content a:hover {
  opacity: 0.85;
}
.bugs-app .md-content .md-mention {
  color: var(--primary-blue, var(--fg));
  font-weight: 600;
}
.bugs-app .md-content .md-list {
  margin: 6px 0;
  padding-left: 22px;
  list-style: disc;
}
.bugs-app .md-content .md-list li {
  margin: 0;
  padding: 1px 0;
  line-height: 1.55;
}
.bugs-app .md-content .md-list li::marker {
  color: var(--fg-muted);
}
/* When a list ends, the trailing <br> from the next line would push
   following text down. Trim it. */
.bugs-app .md-content .md-list + br {
  display: none;
}

/* Live character counter shown beneath description / comment / reply
   textareas. Goes amber at 90% of the limit, red once the input hits
   the maxlength ceiling. */
.bugs-app .char-counter {
  font-size: 11px;
  color: var(--fg-faint);
  margin-top: 4px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  user-select: none;
  transition: color 0.12s ease;
}
.bugs-app .char-counter.near {
  color: var(--sev-medium);
}
.bugs-app .char-counter.over {
  color: var(--sev-critical);
  font-weight: 600;
}
/* Reply action row sits right under the reply text and stays
   left-aligned (no auto-margin pushing Report to the far right). */
.bugs-app .reply-item .comment-actions {
  margin-top: 4px;
  gap: 4px;
}
.bugs-app .reply-item .comment-action-report {
  margin-left: 0 !important;
}

.bugs-app .thread-card.composer {
  margin-top: 8px;
  background: var(--bg);
}
.bugs-app .thread-card.composer .detail-label {
  margin-bottom: 10px;
}
.bugs-app .composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.bugs-app .composer-hint {
  font-size: 12px;
  color: var(--fg-muted);
}

.bugs-app .bug-comments {
  cursor: pointer;
}
.bugs-app .bug-comments:hover {
  color: var(--fg);
}

/* === Comments CTA inside collapsed detail === */
.bugs-app .comments-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding: 14px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
}
.bugs-app .comments-cta-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
}

/* === Frequency list === */
/* Fields tagged .field-bug-only are only relevant for bugs; hidden when
   the user toggles the create modal to "Suggestion". */
.bugs-app .modal-content[data-kind='suggestion'] .field-bug-only {
  display: none;
}

/* === Admin actions bar === */
.bugs-app .admin-bar {
  margin-top: 18px;
  padding: 14px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(
    135deg,
    transparent 0 8px,
    color-mix(in oklab, var(--fg) 2.5%, transparent) 8px 9px
  );
  position: relative;
}
.bugs-app .admin-bar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.bugs-app .admin-bar-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--fg);
  color: var(--bg);
}
.bugs-app .admin-bar-hint {
  font-size: 12px;
  color: var(--fg-muted);
}
.bugs-app .admin-bar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Public reject info panel shown at the top of a rejected bug's detail
   (visible to everyone, including the original reporter). */
.bugs-app .public-reject-info {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid color-mix(in oklab, #d4453a 30%, transparent);
  background: color-mix(in oklab, #d4453a 8%, transparent);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.bugs-app[data-theme='dark'] .public-reject-info {
  border-color: color-mix(in oklab, #ff6b60 30%, transparent);
  background: color-mix(in oklab, #ff6b60 12%, transparent);
}
.bugs-app .public-reject-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg);
}
.bugs-app .public-reject-row svg {
  color: #c93f34;
  flex-shrink: 0;
}
.bugs-app[data-theme='dark'] .public-reject-row svg {
  color: #ff8077;
}
.bugs-app .public-reject-label {
  color: var(--fg-muted);
  font-weight: 500;
}
.bugs-app .public-reject-reason {
  color: #c93f34;
  font-weight: 500;
}
.bugs-app[data-theme='dark'] .public-reject-reason {
  color: #ff8077;
}
.bugs-app .public-reject-note {
  margin-top: 4px;
  color: var(--fg-muted);
  white-space: pre-wrap;
}

/* Reject reason / note panel inside the admin bar (only when rejected) */
.bugs-app .admin-reject-info {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in oklab, #d4453a 30%, transparent);
  background: color-mix(in oklab, #d4453a 8%, transparent);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.bugs-app[data-theme='dark'] .admin-reject-info {
  border-color: color-mix(in oklab, #ff6b60 30%, transparent);
  background: color-mix(in oklab, #ff6b60 12%, transparent);
}
.bugs-app .admin-reject-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg);
}
.bugs-app .admin-reject-label {
  color: var(--fg-muted);
  font-weight: 500;
}
.bugs-app .admin-reject-reason {
  color: #c93f34;
  font-weight: 500;
}
.bugs-app[data-theme='dark'] .admin-reject-reason {
  color: #ff8077;
}
.bugs-app .admin-reject-note {
  margin-top: 4px;
  color: var(--fg-muted);
  white-space: pre-wrap;
}

/* Admin attachments list */
.bugs-app .admin-attach-row {
  margin-top: 8px;
}
.bugs-app .admin-attach-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 6px;
}
.bugs-app .admin-attach-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bg-row-hover);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 500;
}
.bugs-app .admin-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.bugs-app .admin-attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.bugs-app .admin-attach-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  box-sizing: border-box;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-row-hover);
  color: var(--fg-muted);
  text-decoration: none;
  cursor: pointer;
}
/* Image attachments render as a small, capped square preview. */
.bugs-app .admin-attach-thumb:not(.admin-attach-thumb-file) {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  max-width: 56px;
  max-height: 56px;
}
.bugs-app .admin-attach-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.bugs-app .admin-attach-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  font-size: 12px;
}
.bugs-app .admin-attach-name {
  /* Rendered as a <button> (opens preview) or <a> (opens in new tab); reset
     native chrome so both look identical to the plain filename text. */
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--fg);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bugs-app .admin-attach-name:hover {
  text-decoration: underline;
}
.bugs-app .admin-attach-size {
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.bugs-app .admin-attach-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}
.bugs-app .admin-attach-action:hover {
  background: var(--bg-row-hover);
  color: var(--fg);
}

/* Status changer */
.bugs-app .admin-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
}
.bugs-app .admin-status-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.bugs-app .admin-status-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.bugs-app .admin-status-pill {
  font-size: 12px;
}
.bugs-app .admin-status-select {
  font-size: 13px;
  padding: 5px 28px 5px 10px;
  height: auto;
  min-width: 140px;
  margin-left: auto;
}
.bugs-app .admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 13px;
  font-family: var(--font-ui);
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    transform 0.08s ease;
}
.bugs-app .admin-btn:hover {
  background: var(--bg-row-hover);
}
.bugs-app .admin-btn:active {
  transform: translateY(1px);
}
.bugs-app .admin-btn-board:hover {
  border-color: var(--fg);
}
.bugs-app .admin-btn-approve {
  color: #1f7a3a;
  border-color: color-mix(in oklab, #2a8a44 35%, var(--border));
}
.bugs-app .admin-btn-approve:hover {
  background: color-mix(in oklab, #2a8a44 10%, transparent);
  border-color: #2a8a44;
}
.bugs-app .admin-btn-reject {
  color: var(--sev-critical);
  border-color: color-mix(in oklab, var(--sev-critical) 35%, var(--border));
}
.bugs-app .admin-btn-reject:hover {
  background: color-mix(in oklab, var(--sev-critical) 8%, transparent);
  border-color: var(--sev-critical);
}
.bugs-app .admin-btn-delete {
  color: var(--fg-muted);
  border-color: var(--border);
}
.bugs-app .admin-btn-delete:hover {
  color: var(--sev-critical);
  background: color-mix(in oklab, var(--sev-critical) 6%, transparent);
  border-color: color-mix(in oklab, var(--sev-critical) 30%, var(--border));
}

/* Reject CTA inside modal foot */
.bugs-app .btn-reject {
  background: var(--sev-critical);
  color: #fff;
  border-color: var(--sev-critical);
}
.bugs-app .btn-reject:hover:not(:disabled) {
  background: color-mix(in oklab, var(--sev-critical) 88%, #000);
  border-color: color-mix(in oklab, var(--sev-critical) 88%, #000);
}
.bugs-app .btn-reject:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Delete confirm modal */
.bugs-app .delete-modal-title {
  color: var(--sev-critical);
}
.bugs-app .delete-warning {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid color-mix(in oklab, var(--sev-critical) 30%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--sev-critical) 6%, transparent);
}
.bugs-app .delete-warning > svg {
  color: var(--sev-critical);
  margin-top: 2px;
}
.bugs-app .delete-warning-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 2px;
}
.bugs-app .delete-warning-desc {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.45;
}
.bugs-app .delete-confirm-phrase {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg-row-hover);
  color: var(--sev-critical);
  font-weight: 500;
}
.bugs-app .admin-flash {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
  animation: adminFlashIn 0.25s ease;
}
.bugs-app .admin-flash-reject {
  color: var(--sev-critical);
}
.bugs-app .admin-flash-approve {
  color: #1f7a3a;
}
.bugs-app .admin-flash-delete {
  color: var(--sev-critical);
}
@keyframes adminFlashIn {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bugs-app .modal-foot-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* === Report button (sidebar) === */
.bugs-app .report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition:
    color 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}
.bugs-app .report-btn:hover {
  color: var(--sev-critical);
  border-color: var(--sev-critical);
  background: color-mix(in oklab, var(--sev-critical) 8%, transparent);
}

/* === Report issue modal === */
.bugs-app .report-target {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  margin-bottom: 18px;
}
.bugs-app .report-target-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.bugs-app .report-target-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.4;
}
.bugs-app .report-reasons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bugs-app .report-reason {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg);
  transition:
    border-color 0.12s ease,
    background 0.12s ease;
}
.bugs-app .report-reason:hover {
  border-color: var(--border-strong);
}
.bugs-app .report-reason input[type='radio'] {
  display: none;
}
.bugs-app .report-reason.checked {
  border-color: var(--fg);
  background: var(--bg-elev);
}
.bugs-app .report-radio-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  margin-top: 2px;
  position: relative;
  transition: border-color 0.12s ease;
}
.bugs-app .report-reason.checked .report-radio-dot {
  border-color: var(--fg);
}
.bugs-app .report-reason.checked .report-radio-dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--fg);
}
.bugs-app .report-reason-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bugs-app .report-reason-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}
.bugs-app .report-reason-desc {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.4;
}

/* Thank-you state */
.bugs-app .report-thanks {
  padding: 48px 32px;
  text-align: center;
}
.bugs-app .report-thanks-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1.5px solid var(--fg);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.bugs-app .report-thanks-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}
.bugs-app .report-thanks-sub {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
  max-width: 360px;
  margin: 0 auto;
}

/* Page header row (title left, CTA buttons right) */
.bugs-app .page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.bugs-app .page-cta {
  flex-shrink: 0;
  margin-top: 6px;
}
/* Hero now carries two CTAs side by side: "Report a Bug" (outlined, small
   red dot) and "Suggest a Feature" (filled brand). */
.bugs-app .page-cta-group {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  margin-top: 6px;
}
.bugs-app .cta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sev-critical);
  display: inline-block;
}
@media (max-width: 600px) {
  .bugs-app .page-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .bugs-app .page-cta,
  .bugs-app .page-cta-group {
    align-self: flex-start;
  }
}

/* === Two-column layout: sidebar filters + main column === */
.bugs-app .bugs-layout {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 32px;
  align-items: start;
}
.bugs-app .bugs-sidebar {
  position: sticky;
  top: calc(var(--navbar-offset, 64px) + 16px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.bugs-app .bugs-sidebar-group {
  display: flex;
  flex-direction: column;
}

/* Filter rows reuse the shared user-panel/admin sidebar nav component
   (base_sidebar.css) - only layout glue lives here, never colors. */
.bugs-app .bugs-filter-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bugs-app .bugs-filter-nav .base-sidebar__item {
  margin: 0;
}
/* Restores the component's own padding: `.bugs-app button` (a broad reset
   at the top of this file) zeroes it and outranks the component's
   single-class rule, which left the label flush against the pill edge.
   font-size needs !important purely to beat the component's own
   `font-size: 14px !important` - the filter list sits in page content, not
   a full-height sidebar, so it reads a step smaller. */
.bugs-app .bugs-filter-nav .base-sidebar__item-link {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 13px !important;
}
/* Filter group titles are real <h2>s (the page's only h1 is "Help us
   improve"), so they need the heading defaults reset back to a section label. */
.bugs-app .bugs-filter-heading {
  margin: 0 0 8px;
  padding: 0 4px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1.4;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}
.bugs-app .bugs-filter-count {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--base-sidebar-text-muted);
}
.bugs-app .bugs-filter-nav .base-sidebar__item-link.active .bugs-filter-count {
  color: inherit;
}

.bugs-app .bugs-filter-nav .base-sidebar__item-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 0;
  font-size: 12px;
}

/* Each status owns its colour: `data-tone` feeds the sidebar component's
   --base-sidebar-item-accent, which already drives the row's hover/active
   frame + fill, and tints the row's icon to match. */
.bugs-app .bugs-filter-nav [data-tone='open'] {
  --base-sidebar-item-accent: var(--status-open);
}
.bugs-app .bugs-filter-nav [data-tone='in-progress'] {
  --base-sidebar-item-accent: var(--status-progress);
}
.bugs-app .bugs-filter-nav [data-tone='fixed'] {
  --base-sidebar-item-accent: var(--status-fixed);
}
.bugs-app .bugs-filter-nav [data-tone='closed'] {
  --base-sidebar-item-accent: var(--status-closed);
}
.bugs-app .bugs-filter-nav [data-tone='rejected'] {
  --base-sidebar-item-accent: var(--sev-critical);
}
.bugs-app .bugs-filter-nav [data-tone] .base-sidebar__item-icon {
  color: var(--base-sidebar-item-accent);
}
.bugs-app .bugs-main-col {
  min-width: 0;
}

/* === Sort/search row + segmented sort control === */
.bugs-app .bugs-sort-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
/* Sort control is the shared segmented-tabs component; it owns its own look. */
.bugs-app .bugs-sort-segment {
  flex-shrink: 0;
}

/* === Mobile filter chip row (hidden on desktop) === */
.bugs-app .bugs-mobile-chips {
  display: none;
}

/* === Mobile sticky bottom CTA bar (hidden on desktop) === */
.bugs-app .bugs-mobile-cta-bar {
  display: none;
}

@media (max-width: 720px) {
  .bugs-app .bugs-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .bugs-app .bugs-sidebar {
    display: none;
  }
  .bugs-app .page-cta-group {
    display: none;
  }
  .bugs-app .bugs-mobile-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .bugs-app .bugs-mobile-chips::-webkit-scrollbar {
    display: none;
  }
  .bugs-app .bugs-mobile-chip {
    flex-shrink: 0;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--fg-muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
  }
  .bugs-app .bugs-mobile-chip.active {
    background: color-mix(in srgb, var(--primary-blue) 14%, transparent);
    border-color: color-mix(in srgb, var(--primary-blue) 45%, var(--border));
    color: var(--primary-blue);
  }
  .bugs-app .bugs-mobile-cta-bar {
    display: flex;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-elev);
    border-top: 1px solid var(--border);
  }
  .bugs-app .bugs-mobile-cta-bar .btn {
    flex: 1;
    justify-content: center;
  }
  .bugs-app .page {
    padding-bottom: 96px;
  }
}

/* Option cards use base_selectable_card.css; this only lays the icon out
   beside the title/description stack and hides the native radio (the card's
   selected state is the affordance). */
.bugs-app .bugs-opt-grid {
  gap: 10px;
}
.bugs-app .bugs-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}
.bugs-app .bugs-opt input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bugs-app .bugs-opt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bugs-app .bugs-opt .selectable-card-title {
  font-size: 14px;
  margin-bottom: 0;
}
.bugs-app .bugs-opt .selectable-card-desc {
  font-size: 12.5px;
  line-height: 1.45;
}

/* Frequency scale uses the shared segmented control; it needs to wrap and
   fill the modal width rather than sit inline like the sort switcher. */
.bugs-app .bugs-freq-seg {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}
.bugs-app .bugs-freq-seg .base-seg-tab {
  flex: 1 1 auto;
}

/* The base selected state is a border + faint tint, which reads as too
   subtle here; add a brand ring so the chosen option is unmistakable. */
.bugs-app .bugs-opt.selected::after {
  content: '\2713';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bugs-app .bugs-opt.selected .selectable-card-title {
  color: var(--primary-blue);
}
