/* Hero Awakening Calculator */

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

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

.ha-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.ha-tab {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 24, 37, 0.92);
  color: var(--muted);
  padding: 8px 14px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.ha-tab:hover {
  border-color: rgba(116, 192, 252, 0.45);
  color: var(--text);
}

.ha-tab.active {
  color: var(--accent);
  border-color: rgba(116, 192, 252, 0.65);
  background: rgba(18, 42, 64, 0.96);
}

.ha-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);
}

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

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

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

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

.ha-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;
}

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

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

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

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

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

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

.ha-section {
  display: none;
}

.ha-section.active {
  display: block;
}

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

.ha-setup-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.ha-setup-bar .field {
  margin-bottom: 0;
}

.ha-range-bar {
  display: grid;
  grid-template-columns: repeat(4, 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);
}

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

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

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

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

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

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

.ha-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;
}

.ha-chip-btn:hover {
  border-color: rgba(116, 192, 252, 0.45);
  color: var(--text);
}

.ha-inventory-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) repeat(2, minmax(120px, 0.8fr));
  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);
}

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

.ha-prereq-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.ha-prereq {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 16, 25, 0.55);
}

.ha-prereq.is-pass {
  border-color: rgba(81, 207, 102, 0.45);
  background: rgba(81, 207, 102, 0.08);
}

.ha-prereq.is-fail {
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.08);
}

.ha-prereq-icon {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 0.9rem;
}

.ha-prereq.is-pass .ha-prereq-icon {
  color: #51cf66;
}

.ha-prereq.is-fail .ha-prereq-icon {
  color: #ff6b6b;
}

.ha-prereq-body strong {
  display: block;
  font-size: 0.88rem;
}

.ha-prereq-body span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

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

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

.ha-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;
}

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

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

.ha-table tbody tr.is-current td {
  box-shadow: inset 3px 0 0 rgba(116, 192, 252, 0.85);
}

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

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

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

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

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

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

.ha-source-list {
  display: grid;
  gap: 8px;
  max-height: min(42vh, 360px);
  overflow: auto;
}

.ha-source-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 16, 25, 0.62);
  padding: 10px;
}

.ha-source-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.ha-source-head strong {
  font-size: 0.86rem;
}

.ha-source-yield {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.ha-source-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.ha-source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ha-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ha-gap-banner {
  margin: 0 0 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(18, 35, 53, 0.55);
  font-size: 0.88rem;
  line-height: 1.45;
}

.ha-gap-banner.is-ready {
  border-color: rgba(81, 207, 102, 0.45);
  background: rgba(81, 207, 102, 0.08);
}

.ha-gap-banner.is-short {
  border-color: rgba(255, 146, 43, 0.45);
  background: rgba(255, 146, 43, 0.08);
}

.ha-gap-banner strong {
  display: block;
  margin-bottom: 4px;
}

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

  .ha-side {
    position: static;
  }

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

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

  .ha-range-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ha-inventory-bar {
    grid-template-columns: 1fr 1fr;
  }
}

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