/* Размер интерактивных элементов во всех состояниях, включая меню и диалоги. */
button, .button, .search-field, .select-wrap select {
  min-height: var(--control-height);
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-4) var(--space-12);
  border: var(--line-size) solid transparent;
  border-radius: var(--radius-action);
  background: var(--action-surface);
  color: var(--brand);
  cursor: pointer;
  line-height: var(--leading-title);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}
.button:hover {
  background: var(--brand-selection);
  border-color: var(--brand-line);
  color: var(--brand);
}
.button[aria-pressed=true],.button[aria-expanded=true],.button[aria-selected=true],
.button[aria-current=page],.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-dark);
}
.button.primary {
  box-shadow: var(--action-depth);
}
.button.primary:hover {
  background: var(--brand-hover);
  border-color: var(--action-edge);
}
.button.primary:active {
  box-shadow: none;
}
.button.cta {
  justify-content: space-between;
  min-height: var(--course-action-height);
  padding-inline: var(--space-16) var(--space-6);
  font-weight: var(--weight-bold);
}
.button.cta > [data-icon]:last-child {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--space-28);
  height: var(--space-28);
  border-radius: var(--radius-art);
  background: var(--action-icon-surface);
}
.button.icon-only {
  width: var(--control-height);
  border-radius: var(--radius-round);
  padding: 0;
  flex: none;
}
.button:disabled {
  cursor: default;
  opacity: var(--disabled-opacity);
  background: var(--panel);
  border-color: transparent;
  color: var(--muted);
}
.button .icon {
  width: var(--icon-medium);
  height: var(--icon-medium);
}

.button.icon-only .icon {
  width: var(--icon-large);
  height: var(--icon-large);
}

.button.heart:hover,
.button.heart[aria-pressed=true] {
  background: var(--heart-soft);
  border-color: var(--heart-border);
  color: var(--heart-active);
}

.icon-selected,
:is(.heart[aria-pressed=true], .favorites[data-has-saved]) [href="#icon-heart"] {
  display: none;
}

:is(.heart[aria-pressed=true], .favorites[data-has-saved]) .icon-selected {
  display: inline;
}

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: color var(--motion-fast), background-color var(--motion-fast),
      border-color var(--motion-fast), box-shadow var(--motion-fast);
  }
  .button.cta > [data-icon]:last-child {
    transition: transform var(--motion-ui) var(--ease-out);
  }
  .button.cta:hover > [data-icon]:last-child {
    transform: translateX(var(--action-shift));
  }
}

.search-field {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-8);
  padding-inline: var(--space-8);
  border: var(--line-size) solid var(--line);
  border-radius: var(--radius-action);
  color: var(--muted);
  background: var(--surface);
}
.search-field:focus-within {
  outline: var(--space-2) solid var(--brand);
  outline-offset: var(--space-2);
}
.search-field input {
  width: 100%;
  padding: var(--space-6) 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: var(--text-body);
  color: var(--ink);
}
.search-field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.select-wrap [data-icon]:first-child {
  position: absolute;
  left: var(--space-8);
  color: var(--muted);
  pointer-events: none;
}
.select-wrap [data-icon]:last-child {
  position: absolute;
  right: var(--space-8);
  color: var(--muted);
  pointer-events: none;
}
.select-wrap [data-icon]:last-child .icon {
  width: var(--icon-small);
  height: var(--icon-small);
}
.select-wrap select {
  max-width: 100%;
  padding: var(--space-4) var(--space-28) var(--space-4) var(--space-32);
  appearance: none;
  border: var(--line-size) solid var(--line);
  border-radius: var(--radius-action);
  background: var(--surface);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
}
.select-wrap select:hover {
  border-color: var(--brand);
}
.select-wrap[data-active] select {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand);
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  color: var(--brand);
  font-weight: var(--weight-semibold);
}

.text-action:hover {
  text-decoration: underline;
}
