/* The simple Groups tab (groups/groups_view.js) and the Settings tab
   (practice/settings-page.js). Seth, 2026-10-11: "stupid simple and
   extremely clean". Token-only colours (styles/watch.py). */

#page-groups .groups-page-lede {
  display: none;
}
#page-groups .groups-page {
  margin: 0 auto;
  max-width: 640px;
}
#groups-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.gs-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gs-name {
  font-size: 20px;
  margin: 0;
}
.gs-sub {
  color: var(--muted);
  font-size: 13px;
}
.gs-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.gs-flash {
  background: rgb(var(--accent-rgb) / 0.12);
  border-radius: 8px;
  margin: 0;
  overflow-wrap: anywhere;
  padding: 10px 12px;
}
.gs-row {
  display: flex;
  gap: 8px;
}
.gs-row .text-input {
  flex: 1;
  min-width: 0;
}
/* .primary is full-width by default (components.css); in a row it sizes to its label. */
.gs-row .primary {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 10px 22px;
  width: auto;
}

/* ---- in none: one list, one create row ---- */
.gs-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}
.gs-item {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 0;
}
.gs-item:first-child {
  padding-top: 0;
}
.gs-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.gs-item-text .gs-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- in a group: header, description, graphs ---- */
.gs-top {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}
.gs-title {
  align-items: baseline;
  display: flex;
  gap: 10px;
  min-width: 0;
}
.gs-actions {
  display: flex;
  gap: 8px;
}
.gs-leave.is-armed {
  border-color: var(--accent);
  color: var(--accent-text);
}
.gs-desc {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gs-desc-text {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
  white-space: pre-wrap;
}
.gs-desc-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  margin: -6px -8px;
  padding: 6px 8px;
  resize: none;
  width: calc(100% + 16px);
}
.gs-desc-input:hover {
  border-color: var(--border);
}
.gs-desc-input:focus {
  border-color: var(--accent);
  color: var(--text);
  outline: none;
}
.gs-desc-save {
  align-self: flex-start;
}
.gs-desc-save[hidden] {
  display: none;
}
.gs-members {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}
.gs-member {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  padding: 12px 0;
}
.gs-avatar {
  align-items: center;
  background: rgb(var(--accent-rgb) / 0.18);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  width: 32px;
}
.gs-private {
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 8px;
}

/* ---- SETTINGS ---------------------------------------------------------------- */
.settings-page {
  display: flex;
  margin: 0 auto;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
}
.settings-who {
  color: var(--muted);
  margin: 0;
}
#settings-logout {
  align-self: flex-start;
}
#settings-logout[hidden] {
  display: none;
}

/* "Choose what to study next" (practice/settings-page.js): the label is the
   whole card, the native checkbox drawn as a switch on the right. The
   checkbox stays the accessible control (role="switch"); only its look changes. */
.settings-choose {
  margin: 0;
}
.settings-switch {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
}
.settings-switch .account-theme-head {
  margin-bottom: 0;
}
.settings-switch input[type="checkbox"] {
  appearance: none;
  background: rgb(var(--tint-rgb) / calc(0.14 * var(--tint-k)));
  border-radius: 999px;
  cursor: pointer;
  flex: none;
  height: 22px;
  margin: 0;
  position: relative;
  transition: background 0.2s;
  width: 38px;
}
.settings-switch input[type="checkbox"]::after {
  background: var(--white);
  border-radius: 50%;
  content: "";
  height: 16px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 0.2s;
  width: 16px;
}
.settings-switch input[type="checkbox"]:checked {
  background: var(--accent);
}
.settings-switch input[type="checkbox"]:checked::after {
  background: var(--on-accent);
  transform: translateX(16px);
}
.settings-switch input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
