/* ===== Wayfarer bug tracker — component styles =====
   Loaded AFTER /css/style.css, which supplies the :root tokens, reset and
   .btn / .form-* / .badge primitives. This file only adds tracker chrome. */

body {
  background: var(--bg-dark);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 80px;
}
.wrap--wide { max-width: 1280px; }

/* ---- Top bar ---- */
.tracker-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tracker-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.tracker-brand a { color: var(--white); }
.tracker-brand .sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tracker-nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tracker-nav-links a,
.tracker-nav-links span.who {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
}
.tracker-nav-links a:hover { color: var(--white); background: var(--bg-card); }
.tracker-nav-links a.active { color: var(--accent-glow); }

/* ---- Page head ---- */
.page-head { margin-bottom: 24px; }
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  margin-bottom: 6px;
}
.page-head p { color: var(--text-muted); max-width: 60ch; }

/* ---- Filters ---- */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.chip {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  color: var(--white);
  background: rgba(124, 92, 255, 0.18);
  border-color: var(--accent);
}
.chip .count { opacity: 0.6; margin-left: 5px; font-variant-numeric: tabular-nums; }

.filters select,
.filters input[type="search"] {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}
.filters input[type="search"] { flex: 1 1 200px; min-width: 0; }
.filters select { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.filters select:focus,
.filters input:focus { border-color: var(--accent); }

/* ---- Report list ---- */
.report-list { display: flex; flex-direction: column; gap: 10px; }
.report-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}
.report-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.vote-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--bg-dark);
}
.vote-box .arrow { font-size: 0.9rem; line-height: 1; }
.vote-box .n { font-weight: 700; font-size: 0.95rem; color: var(--text); font-variant-numeric: tabular-nums; }
.vote-box.voted { color: var(--accent-glow); border-color: var(--accent); }
.vote-box.voted .n { color: var(--accent-glow); }
button.vote-box { cursor: pointer; font-family: inherit; }
button.vote-box:hover { border-color: var(--accent); }

.report-main { min-width: 0; overflow: hidden; }
.report-main h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.report-main h3 a { color: var(--text); }
.report-main h3 a:hover { color: var(--accent-glow); }
.report-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.report-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Badges / pills ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.tag--bug        { background: rgba(255, 68, 102, 0.14);  color: #ff8098; border-color: rgba(255,68,102,0.3); }
.tag--suggestion { background: rgba(0, 229, 255, 0.12);   color: #66eaff; border-color: rgba(0,229,255,0.3); }
.tag--feedback   { background: rgba(124, 92, 255, 0.16);  color: var(--accent-glow); border-color: rgba(124,92,255,0.35); }
.tag--question   { background: rgba(255, 219, 107, 0.14); color: #ffdb6b; border-color: rgba(255,219,107,0.3); }
.tag--prod       { background: var(--bg-card-hover); color: var(--text-muted); border-color: var(--border); text-transform: none; letter-spacing: 0; }
a > .tag--prod:hover { color: var(--text); border-color: var(--accent); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-card-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--open, .pill--triaging { color: #66eaff; }
.pill--needs_info { color: #ffdb6b; }
.pill--confirmed, .pill--in_progress { color: var(--accent-glow); }
.pill--fixed, .pill--released { color: var(--success); }
.pill--duplicate, .pill--wontfix, .pill--cannot_reproduce { color: var(--text-dim); }

.prio { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.prio--high, .prio--critical { color: #ff8098; }
.prio--normal { color: var(--text-muted); }
.prio--low { color: var(--text-dim); }

.triage-tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 159, 127, 0.12);
  color: #ffb499;
  border: 1px solid rgba(255, 159, 127, 0.25);
}

/* ---- Empty / loading ---- */
.state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.state h3 { color: var(--text); margin-bottom: 8px; font-family: var(--font-display); }

/* ---- Pagination ---- */
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 26px; align-items: center; }
.pager button {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 0.85rem;
}
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager .pos { color: var(--text-dim); font-size: 0.82rem; }

/* ---- Forms ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; color: var(--text); margin-bottom: 7px; font-weight: 500; }
.field .hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 5px; }
.field input[type="text"],
.field input[type="email"],
.field textarea,
.field select {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field textarea.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.82rem; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field-inline { display: flex; align-items: flex-start; gap: 9px; }
.field-inline input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
.field-inline label { margin: 0; font-weight: 400; color: var(--text-muted); line-height: 1.4; }

.type-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.type-opt {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  background: var(--bg-dark);
  transition: all 0.15s;
}
.type-opt:hover { border-color: var(--accent); }
.type-opt.sel { border-color: var(--accent); background: rgba(124, 92, 255, 0.1); }
.type-opt input { position: absolute; opacity: 0; }
.type-opt .t { font-weight: 600; font-size: 0.92rem; display: block; margin-bottom: 3px; }
.type-opt .d { font-size: 0.76rem; color: var(--text-dim); }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

details.help {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--bg-dark);
}
details.help summary { cursor: pointer; font-size: 0.86rem; color: var(--accent-glow); }
details.help[open] summary { margin-bottom: 10px; }
details.help ol { margin: 0 0 0 18px; font-size: 0.84rem; color: var(--text-muted); line-height: 1.7; }
details.help code {
  background: var(--bg-card-hover); padding: 1px 6px; border-radius: 5px;
  font-family: ui-monospace, Consolas, monospace; font-size: 0.85em; color: var(--text);
}

/* ---- Parsed diagnostics panel ---- */
.diag-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.diag-chip {
  font-size: 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  color: var(--text-muted);
}
.diag-chip b { color: var(--text); font-weight: 600; }
.diag-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 10px; }
.diag-table th, .diag-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.diag-table th { color: var(--text-dim); font-weight: 600; }
.diag-raw {
  margin-top: 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: pre;
  max-height: 420px;
}

/* ---- Report detail ---- */
.detail-head { margin-bottom: 20px; }
.detail-head h1 { font-size: clamp(1.3rem, 3.5vw, 1.9rem); font-weight: 700; line-height: 1.3; margin: 8px 0; font-family: var(--font-body); }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 0.8rem; color: var(--text-dim); }
.detail-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.detail-body pre {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  margin: 10px 0;
}
.detail-body code { background: var(--bg-card-hover); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; font-size: 0.88em; }
.detail-body a { color: var(--accent-glow); }

.section-h { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin: 28px 0 12px; color: var(--text); }

.timeline { list-style: none; border-left: 2px solid var(--border); margin-left: 6px; padding-left: 16px; }
.timeline li { position: relative; padding: 6px 0; font-size: 0.82rem; color: var(--text-muted); }
.timeline li::before {
  content: ""; position: absolute; left: -22px; top: 12px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.timeline b { color: var(--text); }
.timeline time { color: var(--text-dim); }

.comment {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.comment.maintainer { border-color: rgba(124, 92, 255, 0.4); background: rgba(124, 92, 255, 0.06); }
.comment.internal { border-style: dashed; opacity: 0.85; }
.comment-head { display: flex; gap: 8px; align-items: center; font-size: 0.8rem; margin-bottom: 6px; }
.comment-head .name { font-weight: 600; color: var(--text); }
.comment-head .role { font-size: 0.68rem; padding: 1px 6px; border-radius: 5px; background: rgba(124,92,255,0.2); color: var(--accent-glow); }
.comment-head time { color: var(--text-dim); margin-left: auto; }
.comment-body { font-size: 0.9rem; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.comment-body pre { background: var(--bg-dark); border: 1px solid var(--border); border-radius: 6px; padding: 10px; overflow-x: auto; font-size: 0.8rem; }

/* ---- Admin table ---- */
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 900px; }
.admin-table th, .admin-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table th { background: var(--bg-card); color: var(--text-dim); font-weight: 600; position: sticky; top: 0; }
.admin-table tr:hover td { background: var(--bg-card); }
.admin-table td.title-cell { white-space: normal; max-width: 320px; }
.admin-table select {
  background: var(--bg-dark); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 4px 6px; font-size: 0.78rem; font-family: inherit;
}
.admin-table a { color: var(--accent-glow); font-variant-numeric: tabular-nums; }

/* ---- Toast / inline message reuse .form-message from style.css ---- */
.msg { margin: 14px 0; }

/* ---- Misc ---- */
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 200px; }
.muted { color: var(--text-dim); }
.success-box {
  text-align: center;
  padding: 40px 24px;
  border: 1px solid rgba(0, 230, 118, 0.3);
  background: rgba(0, 230, 118, 0.06);
  border-radius: var(--radius-lg);
}
.success-box .big { font-size: 1.4rem; font-weight: 700; font-family: var(--font-display); color: var(--success); margin-bottom: 8px; }
.success-box code { background: var(--bg-dark); padding: 3px 8px; border-radius: 6px; word-break: break-all; }

@media (max-width: 560px) {
  .report-card { grid-template-columns: auto minmax(0, 1fr); }
  .report-aside { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .filters { gap: 8px; }
  .filters input[type="search"] { flex-basis: 100%; }
  .filters select { flex: 1 1 45%; }
  .type-picker { grid-template-columns: 1fr 1fr; }
}
