/**
 * Общие 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: 13px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    background: #fff;
    color: #1f2937;
    border: 1px solid #eef0f6;
    box-shadow: 0 16px 40px -12px rgba(17, 24, 39, .4);
    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: linear-gradient(135deg, #10b981, #22c55e); }
.ibd-toast--error .ibd-toast-ic { background: linear-gradient(135deg, #ef4444, #f97316); }
.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(17, 24, 39, .5);
    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: 18px;
    padding: 24px;
    box-shadow: 0 30px 70px -20px rgba(17, 24, 39, .6);
    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: 17px;
    font-weight: 800;
    color: #1f2937;
    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: 14.5px;
    color: #4b5563;
    line-height: 1.55;
    white-space: pre-wrap;
}
.ibd-ui-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}
.ibd-ui-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    padding: 11px 18px;
    border-radius: 12px;
    transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.ibd-ui-btn:hover { transform: translateY(-1px); }
.ibd-ui-btn--ghost { background: #e2edf8; color: #374151; }
.ibd-ui-btn--ghost:hover { background: #e5e7eb; }
.ibd-ui-btn--primary { background: #F5820A; color: #fff; }
.ibd-ui-btn--danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.ibd-ui-btn:focus-visible { outline: 2px solid #f5820a; 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; }
