/* The bug tracker (bugs/index.html) on the website's look (site.css): its panels, buttons and lettering, with a
   colour for each status and severity, in the welcome screen's palette, that runs down the edge of a report's row. */

.bug-tracker {
  --status-new: #ffb13b;
  --status-confirmed: #ffe066;
  --status-in-progress: #8fb8ff;
  --status-fixed: #7ce046;
  --status-released: #4fd1a5;
  --status-cant-reproduce: #b9a7ff;
  --status-wont-fix: #9aa6c8;

  --severity-feature: #8fd0ff;
  --severity-text: #c9d6ff;
  --severity-minor: #ffe066;
  --severity-major: #ffb13b;
  --severity-crash: #ff8a7a;
  --severity-block: #ff4f6d;
}

.tracker-name { font-family: var(--display); font-size: 24px; flex: none; margin-left: -8px; }

.nowrap { white-space: nowrap; }

code {
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--inset);
  border: 1px solid var(--line);
  font-size: 0.92em;
}

/* --- statuses, severities, labels ------------------------------------------------------------------------ */

.status, .severity, .priority, .tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status { font-family: var(--display); font-size: 13px; color: #10183a; background: var(--edge, var(--soft)); }

.status-new { --edge: var(--status-new); }
.status-confirmed { --edge: var(--status-confirmed); }
.status-in-progress { --edge: var(--status-in-progress); }
.status-fixed { --edge: var(--status-fixed); }
.status-released { --edge: var(--status-released); }
.status-cant-reproduce { --edge: var(--status-cant-reproduce); }
.status-wont-fix { --edge: var(--status-wont-fix); }

.status-edge-new { --edge: var(--status-new); }
.status-edge-confirmed { --edge: var(--status-confirmed); }
.status-edge-in-progress { --edge: var(--status-in-progress); }
.status-edge-fixed { --edge: var(--status-fixed); }
.status-edge-released { --edge: var(--status-released); }
.status-edge-cant-reproduce { --edge: var(--status-cant-reproduce); }
.status-edge-wont-fix { --edge: var(--status-wont-fix); }

.severity { color: var(--sev); border-color: var(--sev); background: rgb(10 20 64 / 55%); }

.severity-feature { --sev: var(--severity-feature); }
.severity-text { --sev: var(--severity-text); }
.severity-minor { --sev: var(--severity-minor); }
.severity-major { --sev: var(--severity-major); }
.severity-crash { --sev: var(--severity-crash); }
.severity-block { --sev: var(--severity-block); background: rgb(120 24 40 / 60%); }

.priority { color: var(--soft); border-color: var(--line); }
.priority-high { color: var(--busy); border-color: var(--busy); }
.priority-urgent { color: #fff; background: #c0392b; border-color: #ffb1a6; }

.tag { color: var(--soft); background: linear-gradient(var(--chip-top), var(--chip-bottom)); border-color: rgb(157 184 255 / 35%); }
.tag.label { color: var(--gold); }
.tag.label:hover { text-decoration: none; border-color: var(--gold-rim); }
.tag.private { color: var(--purple-soft); background: linear-gradient(var(--purple-top), var(--purple-bottom)); border-color: var(--purple-rim); }

/* --- My view --------------------------------------------------------------------------------------------- */

.tracker-hero h1 { margin-bottom: 6px; }
.tracker-hero .lead { font-size: 16px; max-width: 640px; }

.status-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.status-tile {
  display: grid;
  justify-items: center;
  padding: 10px 8px;
  border-radius: 16px;
  color: var(--white);
  background: linear-gradient(var(--tile-top), var(--tile-bottom));
  border: 1px solid var(--line);
  border-bottom: 4px solid var(--edge, var(--rim));
}

.status-tile:hover { text-decoration: none; border-color: var(--gold-rim); background: var(--inset-hover); }
.status-tile.open { --edge: var(--gold); }
.status-tile.unassigned { --edge: var(--purple-rim); }

.home-lists { margin-top: 22px; }

.report-lines { display: grid; gap: 6px; }

.report-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--white);
  background: var(--inset);
  border: 1px solid var(--line);
  border-left: 4px solid var(--edge, var(--line));
  min-width: 0;
}

.report-line:hover { text-decoration: none; background: var(--inset-hover); }
.report-line .number { color: var(--gold); font-family: var(--display); flex: none; }
.report-line .line-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Reports --------------------------------------------------------------------------------------------- */

.filters { display: grid; gap: 12px; }

/* The filters' fold: only a phone shows its "Filters" line (bugs.js opens it everywhere else). */
.filter-fold > summary {
  display: none;
  cursor: pointer;
  color: var(--gold);
  font-family: var(--display);
  font-size: 17px;
  margin-bottom: 10px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 12px;
}

.filter-grid .wide { grid-column: span 2; }
.filter-grid select, .filter-grid input { width: 100%; padding: 8px 12px; }

.filter-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }

label.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  cursor: pointer;
}

label.check input { width: 18px; height: 18px; padding: 0; accent-color: var(--gold); flex: none; }

label.inline { display: inline-flex; align-items: center; gap: 8px; }
label.inline input { width: auto; }

.board { margin-top: 22px; padding: 12px; }
.table-scroll { overflow-x: auto; }

table.reports { width: 100%; border-collapse: separate; border-spacing: 0 6px; }

table.reports th {
  text-align: left;
  color: var(--soft);
  font-weight: normal;
  font-size: 13px;
  padding: 4px 10px;
  white-space: nowrap;
}

table.reports th a { color: var(--soft); }
table.reports th a:hover { color: var(--white); }

table.reports td {
  padding: 8px 10px;
  background: var(--inset);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.reports td:first-child { border-left: 5px solid var(--edge, var(--line)); border-radius: 12px 0 0 12px; }
table.reports td:last-child { border-right: 1px solid var(--line); border-radius: 0 12px 12px 0; }
table.reports tr:hover td { background: var(--inset-hover); }

table.reports .number a { font-family: var(--display); font-size: 16px; }
.title-cell { min-width: 260px; }
.row-title { color: var(--white); font-size: 15px; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 4px; }
.counts { color: var(--soft); }
.counts span + span { margin-left: 8px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }

/* --- one report ------------------------------------------------------------------------------------------ */

.issue-crumbs { color: var(--soft); margin-bottom: 10px; }

.issue-head { border-left: 8px solid var(--edge, var(--rim)); }
.issue-title { font-size: clamp(24px, 3.6vw, 34px); overflow-wrap: anywhere; }
.issue-number { color: var(--gold); }

.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }

.issue { margin-top: 22px; }
.issue .section-title { margin: 18px 0 8px; font-size: 19px; }
.issue .section-title:first-child { margin-top: 0; }

.text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

.steps-list { margin: 0; padding-left: 22px; display: grid; gap: 4px; }

.pictures { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.pictures figure { margin: 0; }

.pictures img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--rim-soft);
  background: var(--inset);
}

.pictures a:hover img { border-color: var(--gold-rim); }
.pictures figcaption { margin-top: 4px; overflow-wrap: anywhere; }

.picture-form { margin-top: 12px; flex-wrap: wrap; }
.picture-form input { flex: 1; min-width: 200px; }

.timeline { display: grid; gap: 8px; margin-bottom: 14px; }

.comment .who { align-items: center; }
.comment .who strong { font-family: var(--display); font-weight: normal; font-size: 16px; }
.comment.staff-only { background: linear-gradient(rgb(91 63 196 / 45%), rgb(43 30 115 / 45%)); border-color: var(--purple-rim); }

.history {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 12px;
  color: var(--soft);
  font-size: 13px;
}

.history strong { color: var(--white); font-weight: 600; }
.history .when { flex: none; font-size: 12px; }

.marker {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--rim);
}

.history-status .marker { background: var(--gold); }
.history-filed .marker { background: var(--green); }
.history-relation .marker, .history-duplicate .marker { background: var(--purple-rim); }

.details { display: grid; gap: 8px; padding: 18px; }
.field { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.field .label { color: var(--gold-label); }
.field .value { overflow-wrap: anywhere; }

.linked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.context {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  background: var(--inset);
  border: 1px solid var(--line);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.triage fieldset, .report-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgb(191 211 255 / 40%);
}

.triage legend, .report-form legend { color: var(--soft); font-size: 14px; padding: 0 6px; }
.triage .two, .report-form .two, .link-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.triage select, .report-form select, .link-form select { width: 100%; }
.link-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgb(217 204 255 / 40%); }

/* --- Report a bug, Snapshot, sign-in --------------------------------------------------------------------- */

.report-form { max-width: 820px; margin: 0 auto; }
.report-form textarea { min-height: 110px; }

.row.wrap { flex-wrap: wrap; }

.fixed-notes { margin-top: 12px; font: 13px/1.5 ui-monospace, Consolas, monospace; }

@media (max-width: 720px) {
  .tracker-name { display: none; }
  .filter-fold > summary { display: list-item; }
  .filter-grid .wide { grid-column: auto; }

  /* The board's rows as cards: number, severity and status, then the title the whole width, then who and when. */
  table.reports thead { display: none; }
  table.reports, table.reports tbody { display: block; }

  table.reports tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--inset);
    border: 1px solid var(--line);
    border-left: 5px solid var(--edge, var(--line));
  }

  table.reports tr:hover { background: var(--inset-hover); }
  table.reports td, table.reports td:first-child, table.reports td:last-child { padding: 0; background: none; border: 0; border-radius: 0; }
  table.reports tr:hover td { background: none; }
  table.reports .title-cell { flex: 1 1 100%; min-width: 0; }
  table.reports .counts { margin-left: auto; }
  .triage .two, .report-form .two, .link-form .two { grid-template-columns: 1fr; }
  .field { grid-template-columns: 90px minmax(0, 1fr); }
}
