/* Overlay */
.custom-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(2, 6, 23, 0.72); backdrop-filter: blur(2px); z-index: 1000; }
.custom-modal.open { display: flex; }

/* Panel — smaller width & limited height */
.custom-modal-content { position: relative; width: min(92vw, 420px); max-height: 68vh; overflow: auto; background: #0b1220; color: #e5e7eb; border: 1px solid #1e293b; border-radius: 14px; box-shadow: 0 20px 60px rgba(2,6,23,.55); padding: 20px; }

/* Close */
.custom-modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: #94a3b8; font-size: 22px; line-height: 1; cursor: pointer; }
.custom-modal-close:hover { color: #cbd5e1; }
.custom-modal-close:focus-visible { outline: 2px solid #60a5fa; border-radius: 8px; }

/* Title */
.custom-modal-content h3 { margin: 0 28px 12px 0; font-size: 18px; font-weight: 700; color: #e5edff; }

/* Options */
.custom-modal-options { display: grid; grid-template-columns: 1fr; gap: 8px; }
.custom-modal-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid #1f2937; background: #0f172a; color: #e5e7eb; cursor: pointer; transition: transform .05s ease, background .2s ease, border-color .2s ease; }
.custom-modal-option:hover { background: #111827; border-color: #334155; }
.custom-modal-option:active { transform: translateY(1px); }
.custom-modal-option:focus-visible { outline: 2px solid #60a5fa; }
.custom-modal-icon { width: 24px; height: 24px; }

/* Connecting state */
.custom-modal-status { display: none; margin-top: 10px; font-weight: 600; color: #cbd5e1; }
.custom-modal.is-connecting .custom-modal-status { display: block; }
.custom-modal.is-connecting .custom-modal-options { display: none; }
.custom-modal.is-connecting .custom-modal-close { display: none; }

/* Phone-blocked state (Android/iOS) */
.custom-modal-warning { display: none; margin-top: 10px; padding: 12px; border-radius: 12px; background: #0a1a33; border: 1px solid #1e3a8a; color: #e5edff; }
.custom-modal-warning h4 { margin: 0 0 6px; font-size: 16px; color: #bfdbfe; }
.custom-modal-warning p { margin: 0; font-size: 14px; color: #e5e7eb; }
.custom-modal.is-blocked .custom-modal-warning { display: block; }
.custom-modal.is-blocked .custom-modal-options, .custom-modal.is-blocked .custom-modal-status { display: none; }
.custom-modal.is-blocked .custom-modal-close { display: inline-block; }

/* Dots animation: shows ". .. ..." loop */
.dots { display: inline-flex; gap: 2px; margin-left: 2px; color: #93c5fd; }
.dots span { opacity: .25; animation: dotBlink 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotBlink { 0%, 20% { opacity: .25 } 30%, 50% { opacity: 1 } 60%, 100% { opacity: .25 } }

/* Mobile */
@media (max-width: 420px) {
  .custom-modal-content { padding: 16px; border-radius: 12px; }
}