/* Shared tabbed help modal (How Indemption Works, How QR Codes Work, etc.) */

.how-indemption-modal {
  width: min(1500px, calc(100vw - 48px));
  max-width: 1500px;
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
}

.how-indemption-modal .bw-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.how-indemption-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow-x: visible;
  padding: 2px 2px 10px;
  margin: 0 0 2px;
  border-bottom: 1px solid rgba(255, 170, 60, 0.16);
}

/* Desktop: wide modal fits all 8 topics on one row — no horizontal scroll */
@media (min-width: 1100px) {
  .how-indemption-tabs {
    flex-wrap: nowrap;
    overflow-x: visible;
  }
}

/* Narrow phones only: allow horizontal scroll if wrapping still overflows */
@media (max-width: 480px) {
  .how-indemption-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .how-indemption-tabs::-webkit-scrollbar {
    height: 6px;
  }
}

.how-indemption-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 170, 60, 0.18);
  background: rgba(12, 10, 14, 0.72);
  color: rgba(245, 230, 207, 0.82);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.how-indemption-tab:hover {
  border-color: rgba(255, 170, 60, 0.32);
  color: rgba(245, 230, 207, 0.96);
}

.how-indemption-tab.is-active {
  background: rgba(255, 120, 20, 0.18);
  border-color: rgba(255, 140, 40, 0.55);
  color: rgba(255, 210, 160, 0.98);
  box-shadow: 0 8px 22px rgba(255, 120, 20, 0.12);
}

.how-indemption-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 140, 26, 0.4);
}

.how-indemption-panels {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.how-indemption-panel {
  display: none;
  gap: 8px;
}

.how-indemption-panel.is-active {
  display: grid;
}

.how-indemption-panel[hidden] {
  display: none !important;
}

.how-indemption-panel h4 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
}

.how-indemption-panel > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.how-indemption-bullets {
  margin: 2px 0 0;
  padding: 0 0 0 1.15rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.how-indemption-bullets li + li {
  margin-top: 4px;
}

.how-indemption-example {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 170, 60, 0.2);
  background: rgba(255, 138, 31, 0.08);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.4;
}

.how-indemption-example strong {
  color: var(--orange2);
}

.how-indemption-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.how-indemption-cta {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.how-indemption-cta.is-fallback {
  cursor: pointer;
}

@media (max-width: 640px) {
  .how-indemption-modal {
    max-height: min(92vh, 760px);
  }

  .how-indemption-footer {
    justify-content: stretch;
  }

  .how-indemption-footer .bw-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* Contextual help opener (pill link next to page actions) */
.how-topic-help-link {
  border: 1px solid rgba(255, 170, 60, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 7px 12px;
  min-height: 36px;
}

.how-topic-help-link:hover {
  border-color: rgba(255, 170, 60, 0.34);
  color: var(--text);
}

.how-indemption-modal .bw-modal-header {
  align-items: flex-start;
}

.how-indemption-modal .bw-modal-header > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.how-topic-modal-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.how-connections-footer {
  flex-wrap: wrap;
}

.how-connections-docs-note {
  flex: 1 0 100%;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}
