/* main-integrate: departments beat — the two counters, hover/focus/tap open
 * one and compress the other; reduced motion holds both open. Lifted
 * verbatim from the picked mock's main2.css, split by block. */

.counters {
  margin-top: var(--resurs-gap-cards);
  display: flex;
  align-items: stretch;
  gap: var(--resurs-card-gap);
}
.counter {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--resurs-counter-min-height);
  display: flex;
  flex-direction: column;
  padding: 30px 30px 26px;
  border-radius: var(--resurs-radius-panel);
  background: var(--resurs-surface);
  cursor: pointer;
  transition: flex-grow var(--resurs-slow) var(--resurs-ease),
              background var(--resurs-quick) var(--resurs-ease);
}
.counter[aria-expanded='true'] { background: var(--resurs-tint); }
.counters[data-open='a'] .counter[data-contour='a'],
.counters[data-open='b'] .counter[data-contour='b'] { flex-grow: var(--resurs-counter-open); }
.counters[data-open='a'] .counter[data-contour='b'],
.counters[data-open='b'] .counter[data-contour='a'] { flex-grow: var(--resurs-counter-shut); }

.counter-face { display: grid; gap: 4px; }
.counter-num {
  font-size: var(--resurs-size-counter);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  transition: font-size var(--resurs-slow) var(--resurs-ease);
}
.counter-unit { font-size: var(--resurs-size-small); color: var(--resurs-ink-muted); }
.counter-name {
  margin-top: 18px;
  font-size: var(--resurs-size-title);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.counter-hint {
  margin-top: 8px;
  max-width: 44ch;
  font-size: var(--resurs-size-small);
  line-height: 1.45;
  color: var(--resurs-ink-soft);
  transition: opacity var(--resurs-quick) var(--resurs-ease);
}
.counter-cue {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--resurs-size-small);
  color: var(--resurs-accent);
  transition: opacity var(--resurs-quick) var(--resurs-ease);
}
.counter[aria-expanded='true'] .counter-cue { opacity: 0; }
/* The compressed counter keeps its number and its name; the sentence goes. */
.counters[data-open='a'] .counter[data-contour='b'] .counter-hint,
.counters[data-open='b'] .counter[data-contour='a'] .counter-hint { opacity: 0; }

/* The mosaic at rest: one plate per department, no names. It sits at the
   foot of the tile and collapses as the named rows open. */
.counter-preview {
  display: grid;
  grid-template-rows: 1fr;
  margin-top: auto;
  opacity: 1;
  transition: grid-template-rows var(--resurs-slow) var(--resurs-ease),
              opacity var(--resurs-quick) var(--resurs-ease);
}
.counter-preview > div { min-height: 0; overflow: hidden; }
.dep-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 28px; }
.dep-chips .plate { width: 40px; height: 40px; }
.counter[aria-expanded='true'] .counter-preview { grid-template-rows: 0fr; opacity: 0; }
.counters[data-open='a'] .counter[data-contour='b'] .dep-chips .plate,
.counters[data-open='b'] .counter[data-contour='a'] .dep-chips .plate { width: 34px; height: 34px; }

/* The reveal: a grid track from 0fr to 1fr, so the list measures itself. */
.counter-list {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--resurs-slow) var(--resurs-ease),
              opacity var(--resurs-quick) var(--resurs-ease);
}
.counter[aria-expanded='true'] .counter-list {
  grid-template-rows: 1fr;
  opacity: 1;
  transition-delay: 0ms, 120ms;
}
.counter-list > div { min-height: 0; overflow: hidden; }
.dep-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
}
/* One icon row: the VTB row, an object on a plate beside its name. */
.dep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 9px 10px;
  border-radius: var(--resurs-radius-tile);
  background: var(--resurs-ground);
  transition: box-shadow var(--resurs-quick) var(--resurs-ease);
}
.dep-row:hover { box-shadow: inset 0 0 0 1px var(--resurs-hairline); }
.dep-row:hover .plate { transform: translateY(-1px); --resurs-plate-cast: var(--resurs-plate-cast-lifted); }
.dep-row .plate { width: 40px; height: 40px; }
.dep-row-name { flex: 1; min-width: 0; font-size: var(--resurs-size-small); line-height: 1.3; }
.dep-row .icon-chevron { color: var(--resurs-ink-muted); flex: none; }

.counters-foot {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.counters-foot p { font-size: var(--resurs-size-small); color: var(--resurs-ink-muted); }

/* Reduced motion: both stand open, equal, still. */
@media (prefers-reduced-motion: reduce) {
  .counter, .counter-num, .counter-hint, .counter-cue, .counter-list, .counter-preview, .dep-row, .dep-chips .plate { transition: none; }
  .counters[data-open] .counter { flex-grow: 1; }
  .counter-hint { opacity: 1 !important; }
  .dep-row:hover .plate { transform: none; }
}

@media (max-width: 1080px) {
  .counter { padding: 24px 22px 22px; }
  .dep-rows { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* One column: the open counter grows down, not sideways. A zero basis in
     the column direction would collapse both, so the basis is the content. */
  .counters { flex-direction: column; }
  .counter, .counters[data-open] .counter { flex: none; }
  /* Stacked, nothing is compressed sideways, so the sentence stays. */
  .counters[data-open] .counter .counter-hint { opacity: 1; }
  .counter { padding: 22px 18px 20px; }
  .counter-name { margin-top: 12px; }
}
