.exports-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.exports-card.exports-details {
  overflow: hidden;
}

.exports-card.exports-details .section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 40px;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.exports-card.exports-details:not(.is-open) .section-heading {
  grid-template-columns: minmax(0, 1fr) 40px;
}

.exports-card.exports-details:not(.is-open) .exports-heading-actions,
.exports-card.exports-details:not(.is-open) > :not(.section-heading) {
  display: none;
}

.exports-details-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  color: var(--muted);
  background: var(--panel-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.exports-details-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.exports-card.exports-details.is-open .exports-details-toggle svg {
  transform: rotate(180deg);
}

.exports-details-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button-danger {
  border: 1px solid rgba(255, 122, 137, 0.38);
  background: rgba(255, 122, 137, 0.12);
  color: var(--danger);
}

.export-item-compact {
  padding: 8px 10px;
  border-radius: 12px;
}

.export-compact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.export-compact-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 0.88rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.export-save-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(87, 209, 161, 0.32);
  border-radius: 11px;
  color: var(--accent);
  background: rgba(87, 209, 161, 0.1);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.export-save-button.coach-copy-button {
  border-color: var(--line);
  color: var(--text);
  background: var(--panel-soft);
}

.export-save-button.coach-copy-button.is-copied {
  border-color: rgba(87, 209, 161, 0.42);
  color: var(--accent);
  background: rgba(87, 209, 161, 0.1);
}

.export-save-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.export-save-button:active {
  transform: scale(0.95);
}

.export-save-button:focus-visible,
.button-danger:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .exports-heading-actions {
    gap: 6px;
  }

  .exports-heading-actions .button-compact {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 0.7rem;
  }

  .exports-card.exports-details .section-heading {
    grid-template-columns: minmax(0, 1fr) auto 38px;
    gap: 8px;
  }

  .exports-card.exports-details:not(.is-open) .section-heading {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .exports-details-toggle {
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .export-item-compact {
    padding: 7px 8px;
  }

  .export-compact-name {
    font-size: 0.8rem;
  }

  .export-save-button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
}

@media (max-width: 390px) {
  .exports-card.exports-details .section-heading {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .exports-card.exports-details.is-open .section-heading {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .exports-card.exports-details.is-open .exports-heading-actions {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .exports-card.exports-details.is-open .exports-details-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  .exports-heading-actions {
    justify-content: stretch;
  }

  .exports-heading-actions .button-compact {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exports-details-toggle svg {
    transition-duration: 1ms;
  }
}
