/* Raid options, the bot status banner, the roster page's tabs, members, the
   signup log and the Members page's Attendance tab. */

/* Raid options: class and spec limits, archive choice */
.class-limit-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.class-limit {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
}

#raid-form .class-limit label.role-limit {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

#raid-form .class-limit input {
  width: 72px;
  flex: none;
}

.class-limit details {
  margin-top: 8px;
}

.class-limit summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
}

.class-limit summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.spec-limit-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

#raid-form .spec-limit-grid label.role-limit {
  font-size: 12px;
}

#raid-form label.archive-choice,
#settings-form label.archive-choice {
  margin: 0;
}

/* Bot status banner: Discord posting is paused while the bot is offline. */
.bot-status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 30px;
  border-bottom: 1px solid var(--warning-border);
  background: var(--warning-bg);
  font-size: 13px;
  color: var(--text-primary);
}

.bot-status-banner[hidden] {
  display: none;
}

.bot-status-banner .badge {
  flex: none;
}

.bot-status-banner p {
  margin: 0;
}

@media (max-width: 1000px) {
  .bot-status-banner {
    padding-inline: 26px;
  }
}

@media (max-width: 760px) {
  .bot-status-banner {
    padding: 12px 20px;
    align-items: flex-start;
    font-size: 12px;
  }

  .bot-status-banner p {
    padding-top: 2px;
  }
}

@media (max-width: 340px) {
  .dashboard-sidebar .brand-logo {
    height: 30px;
  }
}

/* Roster page tabs, attendance and members. Labels stay on one line; a tab
   that doesn't fit wraps to the next line, so every tab stays in sight. */
.roster-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin: 4px 0 18px;
  border-bottom: 1px solid var(--border);
}

.roster-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.roster-tab:hover {
  color: var(--text-primary);
}

.roster-tab[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--text-primary);
}

@media (max-width: 520px) {
  .roster-tabs {
    gap: 0;
  }

  .roster-tab {
    padding: 0 8px;
  }
}

.raid-card-due {
  /* Above the card's stretched title link, so it opens the attendance itself. */
  position: relative;
  z-index: 1;
  justify-self: start;
  width: fit-content;
  margin-top: 6px;
  text-decoration: none;
}

.attendance {
  container: attendance / inline-size;
}

/* Two rows of controls: the totals and search, then the switch and saving. */
.attn-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

@container attendance (min-width: 760px) {
  .attn-toolbar {
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: start;
  }
}

/* The totals double as filters. */
.attn-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attn-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.attn-filter strong {
  color: var(--text-primary);
}

.attn-filter:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.attn-filter:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.attn-filter[aria-pressed="true"] {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--text-primary);
}

.attn-filter.attn-present[aria-pressed="true"] {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.attn-filter.attn-late[aria-pressed="true"] {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.attn-filter.attn-excused[aria-pressed="true"] {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.attn-filter.attn-no_show[aria-pressed="true"] {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.attn-search input {
  width: 100%;
  min-height: 40px;
}

.attn-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.attn-status {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.attn-note {
  margin: 0 0 16px;
}

.attn-section + .attn-section {
  margin-top: 20px;
}

.attn-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 40px;
  margin-bottom: 8px;
}

/* Present, folded away: one bordered row with its toggle on the right. */
.attn-section-head.is-folded {
  margin-bottom: 0;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}

.attn-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.attn-actions label.choice,
.sr-team-rules-fields label.choice {
  display: inline-flex;
}

.attn-savebar {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-top: 14px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: 0 10px 30px rgb(0 0 0 / 50%);
  font-size: 13px;
}

.attn-pill {
  min-height: 28px;
}

.attn-table th {
  padding: 10px 16px;
  background: var(--bg-elevated);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.attn-table td {
  padding: 8px 16px;
  vertical-align: middle;
}

/* The choices keep to the right; the name takes the rest of the row. */
.attn-table th:last-child,
.attn-table td:last-child {
  width: 1%;
  text-align: right;
}

/* The member's line wraps (the log's note can make it long), so the choices keep their room. */
.attn-table td:first-child {
  white-space: normal;
}

.attn-table tr.is-changed td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.attn-benched-last {
  color: var(--warning);
}

.attn-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

/* A member's status: one segmented control, equal segments in a 7px track,
   the chosen one filled with its status color. */
.attn-choice {
  display: inline-grid;
  grid-auto-flow: column;
  /* Each segment as wide as the widest label. */
  grid-auto-columns: 1fr;
  gap: 2px;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-inset);
  min-width: 0;
}

.attn-option {
  position: relative;
  display: flex;
}

.attn-option input {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.attn-option span {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.attn-option input:hover + span {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.attn-option input:focus-visible + span {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.attn-option input:checked + span {
  font-weight: 600;
  color: var(--text-primary);
}

.attn-present input:checked + span {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.attn-late input:checked + span {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

.attn-benched input:checked + span {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.attn-excused input:checked + span {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.attn-no_show input:checked + span {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

/* A status as a read-only label (a member's raid history). */
.attn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.attn-pill.attn-present {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.attn-pill.attn-late {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

.attn-pill.attn-benched {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.attn-pill.attn-excused {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.attn-pill.attn-no_show {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

@container attendance (max-width: 640px) {
  /* The six totals as an even three-by-two grid rather than a ragged wrap. */
  .attn-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .attn-filter {
    justify-content: center;
    padding: 0 6px;
  }

  .attn-table thead {
    display: none;
  }

  .attn-table,
  .attn-table tbody,
  .attn-table tr,
  .attn-table td {
    display: block;
  }

  .attn-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }

  .attn-table tr:last-child {
    border-bottom: 0;
  }

  .attn-table td {
    padding: 0;
    border: 0;
  }

  .attn-table td:last-child {
    grid-column: 1 / -1;
    width: auto;
  }

  /* The five segments share the row evenly. */
  .attn-choice {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
  }

  .attn-option span {
    padding: 0 4px;
    font-size: 11px;
  }

  /* "Fire · 100% · Benched last time" wraps rather than running off the card. */
  .attn-table .table-name small {
    white-space: normal;
  }

  .attn-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .attn-actions label.choice,
  .attn-status {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .attn-actions .button {
    width: 100%;
  }

  .attn-toolbar,
  .attn-search,
  .attn-search input {
    width: 100%;
  }
}

/* A raid's Warcraft Logs card: on the Warcraft Logs tab its reports, the names
   nobody matched and the paste field; above an attendance review one summary
   line, with Use the log. */
.attn-wcl {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}

.attn-wcl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}

.attn-wcl-title {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.attn-wcl-head a {
  font-size: 12px;
}

/* What the reports need, then the link to the tab; wraps on phones. */
.attn-wcl-summary-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 0;
  font-size: 13px;
}

/* The card's gap spaces its notes; the shared note margin is !important. */
.attn-wcl .form-note {
  margin: 0 !important;
}

.attn-wcl-warning {
  color: var(--warning);
}

.attn-wcl-reports,
.attn-wcl-names {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A report: its title, when and how big on the left, its buttons on the right. */
.attn-wcl-report {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
}

.attn-wcl-report-main {
  display: grid;
  flex: 1 1 260px;
  gap: 2px;
  min-width: 0;
}

/* Titles come from Warcraft Logs and can be one long word. */
.attn-wcl-report-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.attn-wcl-report small {
  font-size: 12px;
  color: var(--text-muted);
}

.attn-wcl-problem {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--warning);
}

.attn-wcl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attn-wcl-differs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--accent-soft);
  font-size: 13px;
}

.attn-wcl-differs p {
  flex: 1 1 260px;
  margin: 0;
}

.attn-wcl-subtitle {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.attn-wcl-unmatched .attn-wcl-names {
  margin-top: 8px;
}

/* A name in the log nobody matched: the name, its picker and Match. */
.attn-wcl-name {
  display: grid;
  grid-template-columns: minmax(96px, 160px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

/* Names come from Warcraft Logs: a long one wraps instead of running under the picker. */
.attn-wcl-name label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.attn-wcl-name .signup-name {
  white-space: normal;
}

.attn-wcl-name select {
  width: 100%;
  min-height: 40px;
}

/* Find reports and what it searches; the line goes under the button on a narrow card. */
.attn-wcl-find {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.attn-wcl-find .form-note {
  flex: 1 1 220px;
  margin: 0;
}

.attn-wcl-paste {
  display: grid;
  gap: 6px;
}

.attn-wcl-paste label {
  font-size: 12px;
  color: var(--text-secondary);
}

.attn-wcl-paste-row {
  display: flex;
  gap: 8px;
}

.attn-wcl-paste-row input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
}

/* Wraps as a whole, never inside "No-show". */
.attn-log-note {
  color: var(--text-secondary);
  white-space: nowrap;
}

@container attendance (max-width: 640px) {
  .attn-wcl {
    padding: 12px;
  }

  .attn-wcl-actions,
  .attn-wcl-differs .button {
    width: 100%;
  }

  .attn-wcl-actions .button {
    flex: 1;
  }

  /* The name on its own line, then the picker and Match. */
  .attn-wcl-name {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .attn-wcl-name label {
    grid-column: 1 / -1;
  }
}

/* The smallest phones: the five labels get a smaller size so "No-show" still
   fits its segment. */
@container attendance (max-width: 320px) {
  .attn-option span {
    padding: 0 2px;
    font-size: 10px;
  }
}

.members-filters {
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

/* Search and filters start at the left; only the count sits on the right. */
.members-filters .search-label {
  margin-left: 0;
}

.members-count {
  margin: 0 0 0 auto;
  font-size: 12px;
  color: var(--text-muted);
}

.members-table th button {
  white-space: nowrap;
}

/* A heading without a sort (Alts), looking like the sort buttons beside it. */
.members-table .th-label {
  display: block;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 40px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.member-rate,
.member-parse {
  font-size: 15px;
}

/* The streak under the rate, on phones only, where Streak has no column. */
.member-streak {
  display: none;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* "Jaina, alt": the alt a search or filter matched through, under the main. */
.table-name small.member-via {
  color: var(--accent);
}

.member-none,
.member-alts-more,
.member-muted {
  color: var(--text-muted);
}

.member-alts-more {
  font-size: 12px;
}

/* Alts may take two lines, so the nine columns fit beside the sidebar. */
.members-table td.member-alts {
  min-width: 110px;
  white-space: normal;
}

/* One line of icons: a group that may wrap tells the table the column can be
   one icon narrower than it is, and the icons then spill into Alts. */
.members-table .table-name > span.profession-icons {
  flex-wrap: nowrap;
}

.member-rank select {
  min-width: 120px;
}

/* The opened row: a card per section, the characters across the top, then the
   raid history beside Discord and the note; one column when the table is
   narrow. The table can be wider than its box and scroll sideways, so the
   panel takes the box's visible width (the wrap is the query container) and
   stays in view while the table scrolls. */
.members-table-wrap {
  container: member-table / inline-size;
}

/* Specific enough to win over the phone rules for the table's columns. */
.members-table tr.member-details > td {
  padding: 16px 12px 18px;
  background: var(--bg-inset);
  white-space: normal;
}

.member-details-grid {
  position: sticky;
  left: 12px;
  width: calc(100cqi - 24px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.member-characters {
  grid-column: 1 / -1;
  container: member-characters / inline-size;
}

.member-details-side {
  display: grid;
  gap: 12px;
}

.member-section {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.member-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.member-section-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.member-section p {
  margin: 0;
  font-size: 13px;
}

/* Smaller than the toolbar's buttons: these sit in a dense list of rows. */
.member-details .button {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12px;
}

.member-account {
  display: grid;
  gap: 6px;
  margin: 0;
}

.member-account > div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.member-account dt {
  font-size: 12px;
  color: var(--text-muted);
}

.member-account dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.member-id {
  font-variant-numeric: tabular-nums;
}

.member-note textarea {
  display: block;
  width: 100%;
  min-height: 76px;
  resize: vertical;
}

/* The hint at the left and Save at the right, on a line that never reflows:
   the status line above it shows only an error, and a save shows on the
   button. */
.member-note-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.member-note .form-note {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.member-section .member-note-status.is-error {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

/* One width for Save, Saving… and Saved, so the hint keeps its lines. */
.member-details .member-note-save {
  flex: none;
  min-width: 92px;
  gap: 6px;
}

.member-details .member-note-save.is-saved,
.member-details .member-note-save.is-saved:hover {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

/* The raid history: date, raid (with the character they raided as) and
   status in columns every row shares, so the statuses line up. The last,
   empty column carries each row's divider to the card's edge. */
.member-history-list {
  display: grid;
  grid-template-columns: max-content minmax(0, max-content) max-content minmax(0, 1fr);
  column-gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.member-history-list li {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}

.member-history-list li + li {
  border-top: 1px solid var(--border);
}

.member-history-date {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.member-history-raid {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
}

.member-history-raid small {
  font-size: 11px;
  color: var(--text-muted);
}

.member-history-list .attn-pill {
  justify-self: start;
}

/* Profession icons after a name (professionIcons), and the opened member's
   saved characters with their professions. */
.profession-icons {
  display: inline-flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 2px;
  vertical-align: middle;
}

/* The global img max-width would let a squeezed group shrink its icons. */
.profession-icons .wow-icon {
  max-width: none;
}

.table-name > span.profession-icons {
  display: inline-flex;
}

/* The opened row's Parses: a boss, its average and its best parse. */
.member-parses-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.member-parses-table th,
.member-parses-table td {
  padding: 4px 12px 4px 0;
  text-align: left;
  font-weight: 400;
  vertical-align: baseline;
}

.member-parses-table thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.member-parses-table small,
.member-parses-source {
  color: var(--text-muted);
}

.member-parses-table td {
  white-space: nowrap;
}

.member-parses-where small + small::before {
  content: " · ";
}

.member-section .member-parses-source {
  margin-top: 8px;
}

/* The saved characters: who, professions and buttons in columns every row
   shares. The buttons sit at the right; the panel never scrolls out of view. */
.member-characters-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.member-characters-list li {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  row-gap: 8px;
  padding: 8px 0;
  font-size: 13px;
}

.member-characters-list li + li {
  border-top: 1px solid var(--border);
}

.member-character {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-character-text {
  display: grid;
  min-width: 0;
}

.member-character-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
}

.member-character-text small {
  font-size: 12px;
  color: var(--text-muted);
}

.member-character-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

/* Too narrow for one line: the buttons go under the character. */
@container member-characters (max-width: 640px) {
  .member-characters-list li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .member-character-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* The smallest phones: the professions go under the name, lined up with its
   text past the two icons, so the spec line keeps its width. */
@container member-characters (max-width: 300px) {
  .member-characters-list li {
    grid-template-columns: minmax(0, 1fr);
  }

  .member-character-professions {
    padding-left: 64px;
  }
}

/* A narrow table: one column of cards, closer to the edges. */
@container member-table (max-width: 699px) {
  .members-table tr.member-details > td {
    padding: 12px 8px 14px;
  }

  .member-details-grid {
    left: 8px;
    width: calc(100cqi - 16px);
    grid-template-columns: minmax(0, 1fr);
  }

  .member-section {
    padding: 12px;
  }
}

/* The Ranks dialog: a row per rank (name, Hidden, move and delete buttons),
   then the field that adds one. */
dialog.ranks-dialog {
  max-width: 560px;
}

.rank-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.rank-row .field-error,
.rank-add .field-error {
  grid-column: 1 / -1;
  margin: 0;
}

.rank-name {
  display: block;
  min-width: 0;
}

.rank-name input {
  width: 100%;
}

.rank-hidden {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 13px;
  cursor: pointer;
}

.rank-buttons {
  display: flex;
  gap: 4px;
}

.rank-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  margin-top: 16px;
}

.professions-group {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.professions-group legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
}

/* Wide enough for three choices that fit "Leatherworking"; one per row on phones. */
dialog.professions-dialog {
  max-width: 600px;
}

.professions-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 6px;
}

.professions-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-secondary);
  font-size: 13px;
  cursor: pointer;
}

.professions-choice > :is(input, img) {
  flex: none;
}

.professions-choice > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.professions-choice:has(input:checked) {
  border-color: var(--accent-border);
}

.professions-choice:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.professions-choice:has(input:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.professions-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* The signup log: the Log page and the raid page's recent activity. */
.signup-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.signup-log li {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 8px 0 8px 12px;
  border-left: 2px solid var(--border);
  font-size: 13px;
}

.signup-log li.signup-log-green {
  border-left-color: var(--success);
}

.signup-log li.signup-log-warning {
  border-left-color: var(--warning);
}

.signup-log li.signup-log-danger {
  border-left-color: var(--danger);
}

.signup-log time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.signup-log-text {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.signup-log-text > .wow-icon {
  margin-top: -3px;
}

.signup-log-text small {
  color: var(--text-muted);
}

.signup-log-name {
  font-weight: 600;
}

/* A spec in the text: its icon, then its name, kept together. */
.signup-log-spec {
  white-space: nowrap;
}

.signup-log-spec .wow-icon {
  margin: -2px 4px 0 0;
}

.signup-log-raid {
  font-size: 12px;
  text-align: right;
}

.signup-log-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.signup-log-pager p {
  margin: 0 auto 0 0;
  color: var(--text-secondary);
}

.activity-card h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.activity-card .signup-log li {
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.activity-card .signup-log time {
  font-size: 11px;
}

.activity-card .text-link {
  display: inline-block;
  margin-top: 10px;
}

@media (max-width: 760px) {
  .signup-log li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .signup-log-raid {
    text-align: left;
  }
}

@media (max-width: 760px) {
  /* Search on its own line, the four filters two by two, then the count with
     Ranks at the right. Only the placement changes, so the reading and tab
     order stay the page's. */
  .members-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .members-filters .search-label {
    grid-column: 1 / -1;
  }

  .members-filters label,
  .members-filters select,
  .members-filters input {
    width: 100%;
    min-width: 0;
  }

  /* Scoped to this toolbar: the Loot tab's count has the same class. */
  .members-filters .members-count {
    grid-row: 4;
    grid-column: 1;
    align-self: center;
    margin-left: 0;
  }

  .members-filters [data-manage-ranks] {
    grid-column: 2;
    justify-self: end;
  }

  /* An empty roster's toolbar is the Ranks button alone: a fixed row 4 would
     leave three empty rows' gaps above it. */
  .members-filters:has(.members-count) [data-manage-ranks] {
    grid-row: 4;
  }

  /* Member, Rank and Attendance share a phone's width; the streak goes under
     the rate. */
  .members-table .col-optional {
    display: none;
  }

  .member-streak {
    display: block;
  }

  .members-table th button,
  .members-table .th-label {
    padding: 0 6px;
    letter-spacing: 0.02em;
  }

  .members-table td {
    padding-inline: 6px;
  }

  .members-table th:first-child button,
  .members-table td:first-child {
    padding-left: 10px;
  }

  /* Member takes what the other two columns don't need. */
  .members-table th:first-child {
    width: 100%;
  }

  /* One line each for the name, the spec and the Discord name, cut short with
     an ellipsis rather than wrapped: a row stays two icons tall. The class icon
     stands alone, and the professions wait in the opened row. */
  .members-table .table-name {
    gap: 8px;
    max-width: 100%;
  }

  .members-table .table-name .icon-pair > .wow-icon + .wow-icon,
  .members-table .table-name > span.profession-icons,
  .members-table .table-name .member-spec-class {
    display: none;
  }

  .members-table .table-name > span:not(.icon-pair) {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .members-table .table-name small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .member-rank select {
    width: 104px;
    min-width: 0;
    padding-inline: 10px 26px;
    background-position: right 8px center;
  }
}

/* The smallest phones: Rank and Attendance give up a little room so the
   names keep more than a few letters. */
@media (max-width: 400px) {
  .members-table th button,
  .members-table .th-label {
    padding: 0 4px;
    font-size: 10px;
    letter-spacing: 0;
  }

  .members-table td {
    padding-inline: 4px;
  }

  .member-rank select {
    width: 88px;
    padding-inline: 8px 22px;
    background-position: right 6px center;
  }

  /* Where the best parse was logged would push the table past a phone's width. */
  .member-parses-where {
    display: none;
  }
}

@media (max-width: 480px) {
  /* The rank's name gets the whole line; Hidden and the buttons go under it. */
  .rank-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .rank-row .rank-name {
    grid-column: 1 / -1;
  }
}

/* The Members page's Attendance tab: the raid list beside one raid's review,
   or the two as separate steps on narrow screens. */
.attendance-tab {
  container: attn-tab / inline-size;
}

.attn-tab-grid {
  display: grid;
  gap: 20px;
}

@container attn-tab (min-width: 900px) {
  .attn-tab-grid {
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
  }

  .attn-raids {
    position: sticky;
    top: 16px;
  }

  /* The list is beside the review: no step back to it. */
  .attn-tab-grid .attn-back {
    display: none;
  }
}

@container attn-tab (max-width: 899px) {
  .attn-tab-grid.has-raid .attn-raids,
  .attn-tab-grid:not(.has-raid) .attn-review {
    display: none;
  }
}

/* The list and the review are matching cards. */
.attn-raids,
.attn-review {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
}

.attn-review:empty {
  display: none;
}

@container attn-tab (max-width: 599px) {
  .attn-raids,
  .attn-review {
    padding: 12px;
  }
}

.attn-raids-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.attn-raid-list + .attn-raids-title {
  margin-top: 16px;
}

.attn-raid-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.attn-raid {
  display: grid;
  gap: 3px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
}

.attn-raid:hover {
  background: var(--bg-hover);
}

.attn-raid:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.attn-raid[aria-current="page"] {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.attn-raid-title {
  font-size: 13px;
  font-weight: 600;
}

.attn-raid-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.attn-review-head {
  margin-bottom: 16px;
}

.attn-review-head h2 {
  margin: 0 0 2px;
  font-size: 20px;
}

.attn-review-head h2 a {
  color: inherit;
  text-decoration: none;
}

.attn-review-head h2 a:hover {
  color: var(--accent);
}

.attn-review-head p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.attn-review-head .attn-help {
  margin-top: 6px;
  color: var(--text-secondary);
}

.attn-back.back-link {
  min-height: 40px;
  margin-bottom: 4px;
}

.members-intro {
  margin: 0 0 14px;
}
