/* Carte « Éléments affichés » des plans et coupes (D-S0-19) : compacte, une ligne par catégorie
   (case · nom · nombre · demi-teinte), groupes à case trois états. */
.vis-card {
  display: grid;
  gap: 10px;
  padding: 18px 16px;
}

.vis-template {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: var(--t-sm);
  color: var(--text-2);
}

.vis-template select {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
}

.vis-modified {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sev-review-bg);
  color: var(--text-1);
  font-size: 0.7rem;
  font-weight: 600;
}

.vis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.vis-actions .secondary-action.compact {
  height: 26px;
  padding: 0 9px;
  font-size: 0.74rem;
}

.vis-colhead,
.vis-group-row,
.vis-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 6px;
}

.vis-colhead {
  padding: 0 2px 2px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vis-colhead span:nth-child(2),
.vis-colhead span:nth-child(3) {
  text-align: right;
}

.vis-colhead span:nth-child(3) {
  text-align: center;
}

.vis-groups,
.vis-cats {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vis-groups {
  gap: 6px;
  max-height: min(52vh, 460px);
  overflow: auto;
  padding-right: 2px;
}

.vis-cats {
  margin-left: 14px;
  padding-left: 6px;
  border-left: 1px solid var(--line);
}

.vis-toggle {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  height: 26px;
  padding: 0 4px;
  border: 0;
  border-radius: var(--r-1);
  background: transparent;
  color: var(--text-2);
  font-size: var(--t-sm);
  text-align: left;
  cursor: pointer;
}

.vis-toggle:hover { background: var(--bg-2); color: var(--text-1); }
.vis-toggle:focus-visible, .vis-half:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vis-group-toggle { font-weight: 600; color: var(--text-1); }
.vis-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vis-toggle[aria-checked="true"] .vis-check,
.vis-toggle[aria-checked="mixed"] .vis-check {
  border-color: var(--text-1);
  background: var(--text-1);
  color: var(--bg-1);
}

.vis-dash {
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: var(--bg-1);
}

.vis-count {
  color: var(--text-3);
  font-size: 0.74rem;
  text-align: right;
}

.vis-row[data-mode="hidden"] .vis-name { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.vis-row[data-mode="half"] .vis-name { color: var(--text-3); font-style: italic; }

.vis-half {
  width: 26px;
  height: 22px;
  justify-self: center;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.vis-half:hover { color: var(--text-1); border-color: var(--text-3); }
.vis-half[aria-pressed="true"] { border-color: var(--text-2); background: var(--bg-3); color: var(--text-1); }
.vis-half-none { width: 26px; }

[data-vis-card] [aria-disabled="true"] { opacity: 0.55; cursor: progress; }

.vis-filter .secondary-action.compact { height: 26px; font-size: 0.74rem; }
.vis-filter .icon { width: 13px; height: 13px; vertical-align: -2px; }

.vis-summary {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--r-1);
  background: var(--sev-info-bg);
  color: var(--text-1);
  line-height: 1.4;
}

@media (max-width: 720px) {
  .vis-groups { max-height: none; }
  .vis-toggle { height: 32px; }
  .vis-half { height: 28px; width: 30px; }
  .vis-colhead, .vis-group-row, .vis-row { grid-template-columns: minmax(0, 1fr) auto 32px; }
}

.vis-hint { flex-basis: 100%; margin: 0; }
.vis-cats-flat { margin-left: 0; padding-left: 0; border-left: 0; }
