/* ---- modals ----
   Centred on wide screens; on phones they come up from the bottom as a
   sheet. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(20, 16, 10, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  animation: fade-in 0.2s var(--ease);
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  width: 440px;
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: rise-in 0.3s var(--spring);
}
.modal-box header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.modal-box h2 {
  font-size: 1.5rem;
  line-height: 1.2;
}
.modal-box .facts > div {
  padding: 10px 0;
  font-size: 0.9rem;
}

/* ask() and tell(): a short question or notice, with its answers below. */
.ask-box {
  width: 380px;
}
.ask-box h2 {
  font-size: 1.3rem;
}
.ask-box #ask-text:empty {
  display: none;
}
.ask-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
/* On phones the answers fill the width, the main one nearest the thumb. */
@media (max-width: 899px) {
  .ask-actions {
    flex-direction: column-reverse;
  }
  .ask-actions .btn {
    width: 100%;
  }
}

/* QR codes need dark-on-light to scan reliably, so the code sits on white. */
.qr-box {
  text-align: center;
}
#qr-code {
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  animation: pop-in 0.45s var(--ease);
}
#qr-code svg {
  display: block;
  width: 100%;
  height: auto;
}
