/* ── Blocks (.sb-block: the missions block under the brain) and the 📊 Stats / 🏆 Trophies views ── */
.sb-block {
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 14px;
}

.sb-head {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Stats */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.stat-row:last-child { border-bottom: none; }
.stat-row .sr-k { color: var(--muted); }
.stat-row .sr-v { font-weight: 600; }

/* ── Stats tab (📊) of the Stats & trophies modal — chrome comes from modal.css ───────────────────────────── */
#stats-list.modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-content: start;
}

.stats-section .stats-h {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 9px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  column-gap: 28px;
  row-gap: 0;
}

/* Overall content-coverage bar */
.overall-bar {
  height: 9px;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}
.overall-fill {
  height: 100%;
  background: var(--action);
  border-radius: 5px;
}

/* Per-domain/grammar-type coverage rows */
.cat-prog-list { display: flex; flex-direction: column; gap: 8px; }
.domain-group-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
.domain-group-header:first-child { margin-top: 0; }
.cat-prog {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px auto;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.cat-prog.cat-locked { opacity: 0.55; }
.cat-prog { --shade: var(--muted); }   /* set inline to the domain's shade (config.js::categoryShade) */
.cp-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--shade); }
.cp-bar {
  height: 7px;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.cp-fill { height: 100%; border-radius: 4px; background: var(--shade); transition: width 0.4s ease; }
.cp-val { font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; }

/* The tab panels set their own display, which would beat the [hidden] attribute */
#stats-list[hidden], #ach-list[hidden] { display: none; }

/* ── Achievements tab (🏆) of the Stats & trophies modal — chrome comes from modal.css ── */
#ach-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.ach-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.3;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ach-icon { font-size: 20px; flex-shrink: 0; }
.ach-text { display: flex; flex-direction: column; gap: 2px; }
.ach-name { font-weight: 700; }
.ach-desc { font-size: 11px; color: var(--muted); }
.ach-earned { color: var(--text); }
.ach-earned { border-color: var(--action-lilac); }
.ach-locked { color: var(--muted); }
.ach-locked .ach-icon { filter: grayscale(1) opacity(0.35); }

/* ── Achievement toast ───────────────────────────────────────────────────────── */
#ach-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 8px 40px color-mix(in srgb, var(--shadow) 60%, transparent);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
#ach-toast.toast-in  { opacity: 1; transform: translateX(-50%) translateY(0); }
#ach-toast.toast-out { opacity: 0; transform: translateX(-50%) translateY(10px); }
