/**
 * Общие UI-компоненты (фидбек-правки): тосты (красный/зелёный/белый с тенью) +
 * стилизованные модалки confirm/alert взамен нативных окон браузера.
 */

/* ── Тосты ── */
.ibd-toasts {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    /* Поверх всех app-слоёв (модалки claim/contact 100050, select2 100120), чтобы
       подтверждения/ошибки не тонули под оверлеем открытой модалки. */
    z-index: 100200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    max-width: 92vw;
}
.ibd-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 18px 12px 14px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    background: #fff;
    color: #1E2A32;
    border: 1px solid #E3ECF2;
    box-shadow: 0 18px 50px rgba(24, 60, 90, .18);
    opacity: 0;
    transform: translateY(12px) scale(.97);
    transition: opacity .24s ease, transform .24s ease;
    max-width: 420px;
}
.ibd-toast.is-in { opacity: 1; transform: translateY(0) scale(1); }
.ibd-toast-ic {
    flex: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.ibd-toast-ic svg { width: 14px; height: 14px; }
.ibd-toast--success .ibd-toast-ic { background: #2E8B57; }
.ibd-toast--error .ibd-toast-ic { background: #B42318; }
.ibd-toast--info .ibd-toast-ic { background: #F5820A; }
.ibd-toast--success { border-color: #a7f3d0; }
.ibd-toast--error { border-color: #fecaca; }

/* ── Модалка confirm/alert ── */
.ibd-ui-overlay {
    position: fixed;
    inset: 0;
    /* Модалка confirm/alert - верхний слой среди всех модалок/оверлеев/тостов приложения. */
    z-index: 100200;
    display: flex;
    /* SCRUM-126: скролл на оверлее, окно своей высоты. */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    background: rgba(30, 42, 50, .55);
    opacity: 0;
    transition: opacity .2s ease;
}
.ibd-ui-overlay.is-in { opacity: 1; }
.ibd-ui-modal {
    width: 100%;
    max-width: 420px;
    margin: auto;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 18px 50px rgba(24, 60, 90, .18);
    transform: translateY(14px) scale(.97);
    transition: transform .22s ease;
}
.ibd-ui-overlay.is-in .ibd-ui-modal { transform: translateY(0) scale(1); }
.ibd-ui-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1E2A32;
    margin: 0 0 8px;
    letter-spacing: -.01em;
}
.ibd-ui-modal--danger .ibd-ui-modal-title { color: #b91c1c; }
.ibd-ui-modal--success .ibd-ui-modal-title { color: #047857; }
.ibd-ui-modal--success .ibd-ui-modal-title::before {
    content: "";
    display: inline-block;
    width: 20px; height: 20px;
    margin-inline-end: 8px;
    vertical-align: -4px;
    border-radius: 50%;
    background: #10b981 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12l5 5L20 6'/%3E%3C/svg%3E") center/13px no-repeat;
}
.ibd-ui-modal-body {
    font-size: 15px;
    color: #39505E;
    line-height: 1.55;
    white-space: pre-wrap;
}
.ibd-ui-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}
/* Кнопки модалки - система макетов: 44px, 12px, 15px; без подпрыгивания. */
.ibd-ui-btn {
    min-height: 44px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    padding: 0 20px;
    border-radius: 12px;
    transition: background-color .15s ease, border-color .15s ease;
}
/* outline: рамку рисует inset-тень (sunday-unify.css ставит её с !important), border прозрачный -
   иначе вышло бы две линии. */
.ibd-ui-btn--ghost { background: #fff; color: #1E2A32; box-shadow: inset 0 0 0 1px #F5820A; }
.ibd-ui-btn--ghost:hover { background: #FFF7EC; color: #1E2A32; }
.ibd-ui-btn--primary { background: #F5820A; color: #fff; font-weight: 800; text-shadow: 0 1px 1px rgba(120, 50, 0, .35); }
.ibd-ui-btn--primary:hover { background: #DC7000; }
.ibd-ui-btn--danger { background: #B42318; color: #fff; }
.ibd-ui-btn--danger:hover { background: #912018; }
.ibd-ui-btn:focus-visible { outline: 2px solid #2E86C1; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .ibd-toast, .ibd-ui-overlay, .ibd-ui-modal, .ibd-ui-btn { transition: none !important; }
}

/* ── Чип участника: аватар + имя + ссылка на профиль (includes/user-chip.php) ── */
.ibd-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    max-width: 100%;
    color: inherit;
    text-decoration: none;
}
/* Глобальный a:hover темы (специфичность 0,1,1) перебил бы color у .ibd-chip (0,1,0),
   поэтому цвет наведения задаём явно и на самом чипе, и на вложенном имени. */
.ibd-chip:hover,
.ibd-chip:hover .ibd-chip__name { color:#b45309; }
.ibd-chip:focus-visible { outline: 2px solid #f5820a; outline-offset: 2px; border-radius: 8px; }
.ibd-chip__av {
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}
.ibd-chip__av--ghost { display: inline-block; }
.ibd-chip__text { min-width: 0; display: inline-flex; align-items: center; flex-wrap: wrap; }
.ibd-chip__name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ibd-chip__sub { flex-basis: 100%; font-size: 12px; color: #9ca3af; }
.ibd-chip--off { opacity: .6; }
.ibd-chip--off .ibd-chip__name { text-decoration: line-through; }

/* Чипы контактов в шапке публичного профиля (themes/tusovka/author.php).
   Живут здесь, а не в CSS темы: sunday-skin.css правит параллельная сессия.
   Глобальный a:hover темы (0,1,1) иначе перекрасил бы текст - цвет задаём явно. */
.tus-contact-chip:hover,
.tus-contact-chip:focus-visible { color:#b45309; border-color: #f5cf9e; }
