/*
 * boost-modal.css — styles for the dialog `static/js/boosts/boost-modal.js`
 * builds. The JS was ported from bab-django but its stylesheet never came
 * along, so until 2026-10-25 the dialog rendered as unstyled elements at
 * the bottom of the page. Mobile-first: a bottom sheet on phones, a
 * centered card from 640px up.
 *
 * Inputs use 16px text on purpose: iOS Safari zooms the whole page when a
 * focused field is under 16px, and the zoom doesn't reset on blur.
 */

/* Above .player-overlay (z-index 50), since Boost opens from it. */
.boost-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
}

.boost-modal {
  position: relative;
  width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-bottom: none;
  border-top: 4px solid var(--accent-amber);
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  color: var(--text-primary);
}

.boost-modal h3 {
  margin: 0 3rem 0.75rem 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.boost-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.75rem;
  height: 2.75rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.boost-modal-recipients {
  border: 1px solid var(--border);
  background: var(--bg-panel-raised);
  margin-bottom: 0.9rem;
  max-height: 9rem;
  overflow-y: auto;
}

.boost-modal-recipient {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px dotted var(--border);
  font-size: 0.85rem;
}

.boost-modal-recipient:last-child {
  border-bottom: none;
}

.boost-modal-recipient .name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.boost-modal-recipient .split {
  flex-shrink: 0;
  color: var(--text-dim);
}

.boost-modal-recipient.is-hub-tip .name {
  color: var(--accent-amber);
}

.boost-modal-field {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.boost-modal-field input[type='number'],
.boost-modal-field input[type='text'] {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.25rem;
  padding: 0.5rem 0.6rem;
  background: var(--bg-void);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font: inherit;
  font-size: 1rem;
}

/* The hub-tip row is a checkbox + inline percent, not a stacked field. */
.boost-modal-hubtip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.boost-modal-hubtip input[type='checkbox'] {
  width: 1.4rem;
  height: 1.4rem;
  accent-color: var(--accent-amber);
}

.boost-modal-hubtip input[type='number'] {
  display: inline-block;
  width: 5rem;
  margin-top: 0;
}

.boost-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.boost-modal-connect,
.boost-modal-pay,
.boost-modal-nwc-save,
.boost-modal-qr-btn {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  cursor: pointer;
}

.boost-modal-pay {
  flex: 1 1 9rem;
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: var(--bg-void);
  font-weight: 700;
}

.boost-modal-connect {
  flex: 1 1 9rem;
}

.boost-modal-connect:hover,
.boost-modal-nwc-save:hover,
.boost-modal-qr-btn:hover {
  border-color: var(--accent-amber);
}

.boost-modal-nwc {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.boost-modal-nwc .boost-modal-field {
  flex: 1 1 14rem;
  margin-bottom: 0;
}

.boost-modal-qr-toggle {
  margin-bottom: 0.6rem;
}

.boost-modal-qr-row {
  border-top: 1px dotted var(--border);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
  overflow-wrap: anywhere;
}

/* The QR is drawn by qrcode.js as a canvas/img at a fixed pixel size. */
.boost-modal-qr-code canvas,
.boost-modal-qr-code img {
  max-width: 100%;
  height: auto;
  background: #fff;
  padding: 0.5rem;
}

.boost-modal-qr-link,
.boost-modal-qr-error {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.boost-modal-qr-error {
  color: var(--accent-red);
}

.boost-modal-status {
  min-height: 1.3rem;
  font-size: 0.85rem;
  color: var(--accent-green);
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .boost-modal-overlay {
    align-items: center;
    padding: 1rem;
  }

  .boost-modal {
    max-width: 30rem;
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent-amber);
  }
}
