/* Practice setup: filters and topics on the left, mode list on the right. */

i[data-icon] { display: inline-flex; font-style: normal; }

/* ---------- Header bank status ---------- */

.bank-status {
  min-width: 260px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  background: var(--plate);
}

.bank-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.bank-status .status-note { margin-top: 4px; }

/* ---------- Layout ---------- */

.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.setup-main { display: grid; gap: 20px; min-width: 0; }

.block {
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  background: var(--plate);
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 4px;
}

.block-head h2 { font-size: 1.15rem; }
.block-head p { font-size: 0.92rem; }

/* ---------- Filters ---------- */

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  background: var(--ink);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease);
}

.check-field:hover { border-color: var(--rule-strong); }
.check-field input { flex: none; margin: 2px 0 0; }
.check-field > span { display: grid; gap: 2px; }
.check-field strong { font-weight: 600; }
.check-field .muted { font-size: 0.88rem; }

/* ---------- Topics ---------- */

.topic-panel-header { align-items: flex-start; margin-bottom: 16px; }
.topic-panel-header .muted { margin-top: 4px; }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 8px;
}

.topic-grid.show-advanced {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 12px;
}

.topic-card {
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  background: var(--ink);
  transition: border-color var(--fast) var(--ease);
}

.topic-card:has(.topic-super-checkbox:checked) {
  border-color: var(--signal);
  background: var(--signal-soft);
}

.topic-super,
.topic-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.topic-super {
  min-height: 46px;
  padding: 8px 12px;
  font-weight: 600;
}

.topic-super input,
.topic-option input { flex: none; margin: 0; }

.topic-sublist {
  display: grid;
  gap: 2px;
  padding: 0 8px 10px 34px;
}

.topic-grid:not(.show-advanced) .topic-sublist { display: none; }

.topic-option {
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.topic-option:hover { background: var(--plate-2); color: var(--text); }
.topic-option:has(input:checked) { color: var(--text); }
.topic-option input { width: 16px; height: 16px; }

/* ---------- Modes ---------- */

.modes {
  position: sticky;
  top: calc(var(--bar-h) + 16px);
}

.mode-list {
  display: grid;
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  background: var(--plate);
  overflow: hidden;
}

.mode {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon body"
    "icon count";
  column-gap: 14px;
  row-gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease);
}

.mode:last-child { border-bottom: 0; }
.mode:hover { background: var(--plate-2); }
.mode:focus-visible { outline-offset: -2px; border-radius: 0; }

.mode > i { grid-area: icon; padding-top: 2px; color: var(--signal); }
.mode > i .icon-svg { width: 22px; height: 22px; }

.mode-body { grid-area: body; display: grid; gap: 2px; }
.mode-body strong { font-weight: 600; }
.mode-body span { color: var(--muted); font-size: 0.9rem; }

.mode-count {
  grid-area: count;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Narrow ---------- */

@media (max-width: 1000px) {
  .setup-layout { grid-template-columns: 1fr; }
  .modes { position: static; }
  .mode-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode { border-right: 1px solid var(--rule); }
  .mode:nth-child(2n) { border-right: 0; }
  .mode:nth-last-child(-n + 2) { border-bottom: 0; }
}

@media (max-width: 620px) {
  .bank-status { min-width: 0; width: 100%; }
  .block { padding: 16px; }
  .controls { grid-template-columns: 1fr; }
  .mode-list { grid-template-columns: 1fr; }
  .mode { border-right: 0; }
  .mode:nth-last-child(2) { border-bottom: 1px solid var(--rule); }
  .topic-panel-header .button-row { width: 100%; }
  .topic-option { min-height: 40px; }
}
