/* Individual transaction cards: Owner-approved Phase 3 final D10 geometry.
   Analysis tables, graphs, search controls and individual-card geometry are unchanged. */
/* Use the existing graph-card surface for each transaction group. Keep the
   grid's available width: the border is compensated independently of cards. */
.plus-v2-transaction-group,
.plus-v2-detail-list,
.compare-v2-mode [data-compare-v2-root] .compare-v2-transaction-group,
.compare-v2-mode [data-compare-v2-root] .compare-v2-detail-list {
  box-sizing: border-box;
  min-width: 0;
  margin-top: 18px;
  padding: 16px 0;
  border: 1px solid #d1dce8;
  border-radius: 14px;
  background: #fff;
}

:is(.plus-v2-transaction-group, .plus-v2-detail-list) > :not(.v2-result-grid):not(h3),
.compare-v2-mode [data-compare-v2-root] :is(.compare-v2-transaction-group, .compare-v2-detail-list) > :not(.v2-result-grid):not(h3) {
  margin-inline: 16px;
}

/* The heading fills the frame above its existing, unchanged card grid. */
:is(.plus-v2-transaction-group, .plus-v2-detail-list) > h3,
.compare-v2-mode [data-compare-v2-root] :is(.compare-v2-transaction-group, .compare-v2-detail-list) > h3 {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  margin: -16px 0 16px;
  padding: 8px 12px;
  border-radius: 13px 13px 0 0;
  background: rgba(226, 190, 123, .16);
  box-shadow: inset 0 -1px 0 #d1dce8;
  color: #1f2937;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

/* Replace Compare's single white panel with four surfaces. Retain its layout
   inset, and let the group frames occupy that same space. */
.compare-v2-mode [data-compare-v2-root] .compare-v2-results-panel {
  border-color: transparent;
  background: transparent;
}

.compare-v2-mode [data-compare-v2-root] :is(.compare-v2-transaction-group, .compare-v2-detail-list) {
  margin-inline: -15px;
}

.v2-result-grid,
.v2-result-grid * {
  box-sizing: border-box;
}

.v2-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 160.8px);
  justify-content: center;
  gap: 24px;
  width: 100%;
  max-width: 900px;
  min-width: 0;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

:is(.plus-v2-transaction-group, .plus-v2-detail-list) > .v2-result-grid,
.compare-v2-mode [data-compare-v2-root] :is(.compare-v2-transaction-group, .compare-v2-detail-list) > .v2-result-grid {
  position: relative;
  left: 50%;
  width: calc(100% + 2px);
  margin-inline: 0;
  transform: translateX(-50%);
}

.v2-result-card {
  min-width: 0;
  margin: 0;
  padding: 0;
}

.v2-result-link,
.v2-result-static {
  display: block;
  color: inherit;
  text-decoration: none;
}

.v2-result-grid .v2-result-link:hover {
  text-decoration: none;
}

.v2-result-link:focus-visible {
  outline: 3px solid #d9a31f;
  outline-offset: 3px;
}

.v2-result-media {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #f0f2f3;
  transition: box-shadow .15s ease;
}

.v2-result-link:hover .v2-result-media {
  box-shadow: 0 0 0 2px #648da3;
}

.v2-result-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.v2-result-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8c9aa2;
  background: #edf0f2;
  font-size: 13px;
  letter-spacing: .04em;
}

.v2-result-grid [hidden] {
  display: none;
}

.v2-result-price {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 1px;
  max-width: calc(100% - 8px);
  padding: 3px 9px 4px;
  border-radius: 0 7px 7px 0;
  color: #fff;
  background: rgba(0, 0, 0, .76);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.14;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .14);
  white-space: normal;
}

.v2-result-currency {
  flex: none;
  font-size: 17px;
}

.v2-result-amount {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.v2-result-price.is-long {
  font-size: 16px;
}

.v2-result-price.is-long .v2-result-currency {
  font-size: 14px;
}

.v2-result-grid .v2-result-card .v2-result-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  height: 42px;
  margin: 8px 4px 0;
  overflow: hidden;
  color: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 21px;
  overflow-wrap: anywhere;
}

.v2-result-message {
  grid-column: 1 / -1;
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

.v2-result-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.v2-result-sort,
.v2-result-toolbar .plus-v2-table-sort {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #c8dbe7;
  border-radius: 6px;
  background: #f7fafc;
  color: #48687c;
  font: inherit;
  font-size: 12px;
  line-height: normal;
  text-decoration: none;
  cursor: pointer;
}

.v2-result-sort[aria-pressed="true"],
.v2-result-toolbar .plus-v2-table-sort[aria-pressed="true"] {
  border-color: #89acbf;
  background: #fff;
  color: #24495e;
  box-shadow: 0 1px 2px #cfdee8;
}

.v2-result-sort:focus-visible,
.v2-result-toolbar .plus-v2-table-sort:focus-visible {
  outline: 3px solid #d9a31f;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  :is(.plus-v2-transaction-group, .plus-v2-detail-list) {
    margin-inline: -8px;
    padding-inline: 8px;
  }

  .compare-v2-mode [data-compare-v2-root] :is(.compare-v2-transaction-group, .compare-v2-detail-list) {
    margin-inline: -21px;
    padding: 12px 8px;
  }

  :is(.plus-v2-transaction-group, .plus-v2-detail-list) > :not(.v2-result-grid):not(h3),
  .compare-v2-mode [data-compare-v2-root] :is(.compare-v2-transaction-group, .compare-v2-detail-list) > :not(.v2-result-grid):not(h3) {
    margin-inline: 0;
  }

  :is(.plus-v2-transaction-group, .plus-v2-detail-list) > h3 {
    margin-inline: -8px;
  }

  .compare-v2-mode [data-compare-v2-root] :is(.compare-v2-transaction-group, .compare-v2-detail-list) > h3 {
    margin: -12px -8px 16px;
  }

  .v2-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: none;
    margin: 0;
  }

  .v1-result-grid {
    position: relative;
    left: 50%;
    width: calc(100% + 16px);
    margin-inline: 0;
    transform: translateX(-50%);
  }

  .v2-result-grid .v2-result-card .v2-result-title {
    display: none;
  }

  .v2-result-price {
    padding: 3px 7px 4px;
    font-size: 16px;
    line-height: 1.15;
  }

  .v2-result-currency {
    font-size: 14px;
  }

  .v2-result-price.is-long {
    font-size: 14px;
  }

  .v2-result-price.is-long .v2-result-currency {
    font-size: 12px;
  }

  .v2-result-fallback {
    font-size: 12px;
  }

  .v2-result-sort,
  .v2-result-toolbar .plus-v2-table-sort {
    padding: 7px 9px;
    font-size: 11px;
  }
}

@media (max-width: 390px) {
  :is(.plus-v2-transaction-group, .plus-v2-detail-list) {
    padding-block: 10px;
  }

  :is(.plus-v2-transaction-group, .plus-v2-detail-list) > h3 {
    margin-top: -10px;
  }
}
