/* Align related actions without changing navigation or page layouts. */
.detail-actions {
  align-items: stretch;
  gap: 10px;
}

.detail-actions > :is(button, a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 120px;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #596371;
  border-radius: 7px;
  background: #222a35;
  color: #e5e9ed;
  font: 700 12px/1.5 'Noto Sans KR', 'DM Sans', sans-serif;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  align-self: stretch;
}

.detail-actions > :is(.detail-bookmark, a) {
  border-color: #8b7350;
  background: transparent;
  color: #f0c985;
}

.detail-actions > .detail-bookmark.saved {
  background: #493d2e;
}

.detail-actions > .primary-btn {
  border-color: #f5bd59;
  background: #f5bd59;
  color: #1c1b1f;
  box-shadow: none;
}

.detail-actions > :is(button, a):hover {
  border-color: #e8c278;
  background: #303744;
}

.detail-actions > .primary-btn:hover {
  background: #ffd17e;
}

/* Match action heights in collection tools, saved cards, and form footers. */
:is(.inventory-tools, .inventory-faction-actions, .inventory-unit-actions,
    .bookmark-card-actions, .inventory-dialog-actions, .import-actions,
    .buy-guide-actions) {
  align-items: stretch;
  gap: 8px;
}

:is(.inventory-tools, .inventory-faction-actions, .inventory-unit-actions,
    .bookmark-card-actions, .inventory-dialog-actions, .import-actions,
    .buy-guide-actions) > :is(button, a, .upload-btn),
.bookmarks-empty button,
.detail-collection-match .outline-btn,
.faction-match button,
.faction-secondary,
.faction-sources > div > :is(a, button),
.report-card-source > a,
.remove-compare,
.import-footer .restore-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  margin-left: 0;
  padding: 10px 13px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  white-space: normal;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.roster-card .card-bottom > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 11px;
  line-height: 1.5;
}

.inventory-quick-stepper button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.inventory-dialog-actions > button {
  min-width: 100px;
}

.faction-sources > div {
  align-items: stretch;
  gap: 8px;
}

.faction-sources > div > a,
.report-card-source > a {
  border: 1px solid #8b7350;
  background: transparent;
  color: #f0c985;
  font-weight: 700;
}

.faction-sources > div > a:hover,
.report-card-source > a:hover {
  background: #302e2b;
  border-color: #e8c278;
  text-decoration: none;
}

.detail-actions > :is(button, a):focus-visible,
:is(.inventory-tools, .inventory-faction-actions, .inventory-unit-actions,
    .bookmark-card-actions, .inventory-dialog-actions, .import-actions,
    .buy-guide-actions) > :is(button, a, .upload-btn):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(48px, auto);
    gap: 8px;
  }

  .detail-actions > :is(button, a) {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 8px;
  }

  .detail-actions > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  :is(.inventory-tools, .bookmark-card-actions, .inventory-dialog-actions,
      .import-actions, .buy-guide-actions) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :is(.inventory-tools, .bookmark-card-actions, .inventory-dialog-actions,
      .import-actions, .buy-guide-actions) > :is(button, a, .upload-btn) {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 10px 8px;
  }

  .buy-guide-actions {
    width: 100%;
  }
}
