/* Hero EXP Calculator */

.he-page .hero {
  padding-bottom: 12px;
}

.he-page .hero .sub {
  max-width: 52rem;
}

.he-sticky-totals {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(160px, 1.2fr);
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(116, 192, 252, 0.28);
  border-radius: 12px;
  background: rgba(8, 16, 25, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.he-sticky-totals .he-stat {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(12, 24, 37, 0.9);
  border: 1px solid var(--line);
}

.he-sticky-totals .he-stat-key {
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.he-sticky-totals .he-stat-value {
  margin-top: 1px;
  font-size: 0.98rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.he-sticky-totals .he-stat.is-zero {
  opacity: 0.42;
}

.he-sticky-next {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(116, 192, 252, 0.28);
  background: rgba(18, 35, 53, 0.9);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.he-sticky-next strong {
  color: var(--accent);
  flex: 0 0 auto;
}

.he-sticky-next span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.he-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 14px;
  align-items: start;
}

.he-main,
.he-side {
  min-width: 0;
}

.he-side {
  position: sticky;
  top: 72px;
}

.he-side .card,
.he-main .card {
  padding: 14px 16px 16px;
}

.he-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.he-range-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 16, 25, 0.55);
}

.he-range-bar .field {
  margin-bottom: 0;
}

.he-inventory-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(116, 192, 252, 0.22);
  border-radius: 10px;
  background: rgba(18, 35, 53, 0.45);
}

.he-inventory-bar .field {
  margin-bottom: 0;
}

.he-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.he-actions-inline .action-button {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.he-actions-inline .action-button.action-button--quiet {
  background: transparent;
  box-shadow: none;
}

.he-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.he-quick-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 2px;
}

.he-chip-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 24, 37, 0.9);
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
}

.he-chip-btn:hover,
.he-chip-btn.active {
  border-color: rgba(116, 192, 252, 0.55);
  color: var(--accent);
}

.he-progress-bar {
  height: 8px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: rgba(12, 24, 37, 0.95);
  border: 1px solid var(--line);
  overflow: hidden;
}

.he-progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(77, 171, 247, 0.85), rgba(81, 207, 102, 0.85));
}

.he-table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  max-height: min(55vh, 520px);
  background: rgba(8, 16, 25, 0.55);
}

.he-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 420px;
}

.he-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  background: #0d1a28;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}

.he-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.84rem;
}

.he-table tbody tr.is-in-range td {
  background: rgba(116, 192, 252, 0.1);
}

.he-table tbody tr.is-filtered-out {
  display: none;
}

.he-summary-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.he-tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 16, 25, 0.72);
  padding: 10px;
}

.he-tile-key {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.he-tile-value {
  margin-top: 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.he-tile-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.he-copy-row {
  margin-bottom: 10px;
}

.he-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin: 0 0 8px;
}

.he-toolbar .field {
  flex: 1 1 140px;
  margin-bottom: 0;
}

@media (max-width: 920px) {
  .he-layout {
    grid-template-columns: 1fr;
  }

  .he-side {
    position: static;
  }

  .he-sticky-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .he-sticky-next {
    grid-column: 1 / -1;
  }

  .he-range-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .he-summary-tiles,
  .he-inventory-bar {
    grid-template-columns: 1fr;
  }
}
