/* Roadmap and issues.
   Built on the document page styles, since these are pages people read and
   link to rather than panels inside the tool. Wider than prose, though: a row
   of issue cards and a four-column board both need more than a reading
   measure, and 760px crushed them. */

/* Wide enough for the list and its filters, still narrow enough to read. */
.doc-issues { max-width: 1000px; }

/* A thread is prose again, so it comes back to a comfortable measure. */
.doc-issues .forum-thread-head,
.doc-issues .forum-posts,
.doc-issues .issue-form,
.doc-issues .issue-staff { max-width: 820px; }

.issues-head {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.issues-head h1 { margin-bottom: 6px; }
.issues-head .doc-lead { margin-bottom: 0; }
.issues-filters { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.issues-filters .search-input { min-width: 180px; }

.issues-notice {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 14px;
}
.issues-notice.warn { border-color: rgba(251, 191, 36, 0.45); color: var(--warn); }

/* --- cards --- */

.issue-list { display: grid; gap: 8px; }

.issue-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  text-decoration: none;
  color: inherit;
}
.issue-card:hover { border-color: var(--border-strong); background: var(--bg-raised); }
.issue-card.is-closed { opacity: 0.62; }

.issue-card-main { flex: 1; min-width: 0; }
.issue-card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.issue-card-head strong { font-weight: 600; }
.issue-number { font-family: var(--mono); font-size: 12px; color: var(--text-faint); flex: 0 0 auto; }

.issue-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.issue-kind,
.issue-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--bg-input);
  white-space: nowrap;
}
.kind-bug { color: var(--danger); border-color: rgba(248, 113, 113, 0.45); }
.kind-idea { color: var(--accent); border-color: rgba(110, 231, 183, 0.4); }
.kind-question { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); }
.issue-badge.closed { color: var(--text-faint); }
.issue-badge.board { color: var(--text); border-color: var(--border-strong); }

/* Votes read as a count first: the number is the useful part, not the word. */
.issue-votes {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 46px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}
.issue-votes.voted { border-color: var(--accent); }
.issue-vote-count { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.issue-votes.voted .issue-vote-count { color: var(--accent); }
.issue-vote-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }

/* --- one issue --- */

.issue-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.issue-head h1 { margin-bottom: 8px; font-size: 25px; }
.issue-head > div { flex: 1; min-width: 0; }

.issue-body { margin: 0 0 20px; }
.issue-body p { margin: 0 0 8px; color: var(--text-dim); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.issue-body p:empty { height: 8px; margin: 0; }

.issue-staff {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  background: var(--bg-panel);
}
.issue-staff-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  align-self: center;
}
.issue-staff label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.issue-staff select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font: inherit;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}
.issue-staff-pin {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  align-self: center;
}
/* Pushes deletion to the far end, away from the controls that are safe to
   press by accident. */
.issue-staff-spacer { flex: 1; }

/* A quiet action until it is wanted: a delete button on every comment would
   dominate a thread it is rarely used in. */
.issue-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease;
}
.issue-comment:hover .issue-remove,
.issue-remove:focus-visible { opacity: 1; }
.issue-remove:hover { color: var(--danger); }

@media (pointer: coarse) {
  .issue-remove { opacity: 1; }
}

.issue-comments { display: grid; gap: 10px; margin-bottom: 20px; }
.issue-comment {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}
.issue-comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.issue-comment .issue-body { margin: 0; }

.issue-form { display: grid; gap: 10px; margin-bottom: 30px; }
.issue-form h2 { margin-bottom: 2px; }
.issue-form label { display: grid; gap: 5px; font-size: 13px; color: var(--text-dim); }
.issue-form input,
.issue-form select,
.issue-form textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
  width: 100%;
}
.issue-form textarea { resize: vertical; line-height: 1.55; }
.issue-form button { justify-self: start; }

/* --- board --- */

.roadmap-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  align-items: start;
}

.roadmap-column {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 12px;
}
/* A colour per column so the board reads at a glance rather than by reading
   every heading. */
.roadmap-column.col-considering { border-top: 2px solid var(--text-faint); }
.roadmap-column.col-planned { border-top: 2px solid var(--warn); }
.roadmap-column.col-building { border-top: 2px solid var(--accent); }
.roadmap-column.col-shipped { border-top: 2px solid var(--accent-dim); }

.roadmap-column-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.roadmap-column-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.roadmap-count {
  margin-left: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  background: var(--bg-input);
  border-radius: 10px;
  padding: 1px 8px;
}

.roadmap-cards { display: grid; gap: 8px; }
.roadmap-cards .issue-card { padding: 11px 12px; background: var(--bg-input); }
.roadmap-cards .issue-votes { min-width: 40px; padding: 4px 6px; }
.roadmap-empty { font-size: 12px; color: var(--text-faint); margin: 0; padding: 6px 2px; }

@media (max-width: 620px) {
  .issues-head { flex-direction: column; align-items: stretch; }
  .issues-filters { margin-left: 0; }
  .issue-card { flex-wrap: wrap; }
}


/* --- forum ------------------------------------------------------------- */

/* Avatars.
   Nobody uploads a picture here, so this is initials on a colour derived from
   the name. It exists to give the left gutter something to anchor to: a forum
   list without it reads as an undifferentiated wall of titles. The colours are
   fixed classes rather than an inline style, so no policy exception is needed
   to draw them. */
.avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #0b0f14;
  user-select: none;
}
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }

.avatar-c0 { background: #6ee7b7; }
.avatar-c1 { background: #93c5fd; }
.avatar-c2 { background: #fcd34d; }
.avatar-c3 { background: #f9a8d4; }
.avatar-c4 { background: #c4b5fd; }
.avatar-c5 { background: #5eead4; }
.avatar-c6 { background: #fdba74; }
.avatar-c7 { background: #a3e635; }

/* Header: title on the left, the one action on the right. */
.forum-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}
.forum-head-text { flex: 1; min-width: 0; }
.forum-head h1 { margin-bottom: 6px; }
.forum-head .doc-lead { margin-bottom: 0; }
.forum-head > .btn { flex: 0 0 auto; margin-top: 6px; }

/* Categories as a row of tabs. On a forum the sections are visible at a
   glance; a dropdown hides them behind a click. */
.forum-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.forum-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.forum-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.forum-tab:hover { color: var(--text); background: var(--bg-panel); }
.forum-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.forum-bar-tools { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.forum-bar-tools .search-input { min-width: 190px; }
.forum-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
}

/* The list itself: one bordered table, rows divided by a rule rather than
   floating as separate cards. Counts line up in their own columns so the eye
   can run down them. */
.forum-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: hidden;
  margin-bottom: 26px;
}

.forum-thead,
.forum-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px 110px;
  align-items: center;
  gap: 14px;
}

.forum-thead {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}
.forum-thead > span:not(.forum-thead-topic) { text-align: center; }
.forum-thead > span:last-child { text-align: right; }
.forum-thead-topic { display: flex; align-items: baseline; gap: 10px; }
.forum-count { text-transform: none; letter-spacing: 0; font-size: 11px; }

/* The avatar sits outside the grid columns, so the row is avatar + grid. */
.forum-row {
  grid-template-columns: 34px 1fr 80px 80px 110px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.forum-rows > .forum-row:first-child { border-top: none; }
.forum-row:hover { background: var(--bg-raised); }
.forum-row.is-closed { opacity: 0.6; }
.forum-row.is-pinned { background: rgba(110, 231, 183, 0.035); }

.forum-row-main { min-width: 0; }
.forum-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 4px;
}
/* The title is the one thing that has to survive a narrow row. */
.forum-row-title > span:not([class]) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forum-row:hover .forum-row-title { color: var(--accent); }
.forum-pin { font-size: 11px; flex: 0 0 auto; }

.forum-row-sub {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-faint);
}
.forum-row-by { color: var(--text-dim); }

.forum-stat {
  text-align: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  line-height: 1.25;
}
.forum-stat b {
  display: block;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.forum-stat.voted b { color: var(--accent); }

.forum-when { text-align: right; font-size: 12px; color: var(--text-faint); }

/* A divider naming a group of rows, the way a forum keeps announcements
   above the ordinary topics rather than sorted in among them. */
.forum-group {
  padding: 7px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}
.forum-rows > .forum-group:first-child { border-top: none; }

.forum-empty { padding: 26px 16px; text-align: center; color: var(--text-faint); font-size: 13px; margin: 0; }
.forum-empty.warn { color: var(--warn); }

.forum-compose { margin-bottom: 30px; }
.forum-actions { display: flex; gap: 8px; }

/* --- a thread --- */

.forum-thread-head { margin-bottom: 18px; }
.forum-thread-head h1 { margin-bottom: 10px; font-size: 25px; line-height: 1.25; }
.forum-thread-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.forum-thread-meta .btn { margin-left: auto; }

/* Posts: the opening one and every reply share a shape, so the page reads as
   one conversation rather than a body with a comment list underneath. */
.forum-posts { display: grid; gap: 0; margin-bottom: 26px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.forum-post {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 18px;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
}
.forum-post:first-child { border-top: none; }
.forum-post.is-op { background: var(--bg-raised); }

.forum-post-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.forum-post-author { font-size: 12.5px; font-weight: 600; word-break: break-word; }
.forum-post-role {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
}

.forum-post-main { min-width: 0; }
.forum-post-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.forum-post-index { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.forum-post .issue-body { margin: 0; }

.forum-reply { margin-bottom: 30px; }

@media (max-width: 760px) {
  /* The counts are the first thing to go: on a phone the title and who wrote
     it are what the row is for. */
  .forum-thead { display: none; }
  .forum-row { grid-template-columns: 34px 1fr auto; }
  .forum-row .forum-stat:first-of-type { display: none; }
  .forum-when { display: none; }
  .forum-row-title { white-space: normal; }
  .forum-row-title > span:not([class]) { white-space: normal; }

  .forum-head { flex-direction: column; }
  .forum-bar-tools { margin-left: 0; width: 100%; }
  .forum-bar-tools .search-input { flex: 1; min-width: 0; }

  /* The author moves above their post rather than into a narrow gutter. */
  .forum-post { grid-template-columns: 1fr; gap: 10px; }
  .forum-post-side { flex-direction: row; text-align: left; gap: 10px; }
  .forum-post-side .avatar-lg { width: 32px; height: 32px; font-size: 12px; }
}
