.ndw-catalog {
    display: grid;
    gap: 24px;
    width: 100%;
}
.ndw-columns-1 { grid-template-columns: 1fr; }
.ndw-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ndw-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ndw-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.ndw-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(26, 35, 74, 0.12);
    transition: transform .2s ease, box-shadow .2s ease;
}
.ndw-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 45px rgba(26, 35, 74, 0.18);
}
.ndw-card-image {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eef1f7;
}
.ndw-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ndw-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(112, 70, 255, .92);
    color: #fff;
    font-size: 25px;
    padding-left: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.22);
}
.ndw-card-body { padding: 20px; }
.ndw-card-title {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.25;
}
.ndw-card-title a {
    color: #171a2b;
    text-decoration: none;
}
.ndw-card-excerpt { color: #596174; }
.ndw-card-author {
    font-size: 14px;
    color: #676e7d;
    margin-bottom: 18px;
}
.ndw-card-button,
.ndw-partner-button,
.ndw-start-button,
.ndw-chat-submit,
.ndw-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 13px 20px;
    background: linear-gradient(135deg, #6b4eff, #9c4dff);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(101, 78, 255, .28);
}
.ndw-card-actions {
    margin-top: 14px;
}
.ndw-empty { grid-column: 1 / -1; text-align: center; padding: 30px; }

.ndw-room-page {
    background: #eef1f7;
    padding: 34px 14px 70px;
}
.ndw-room-shell {
    max-width: 1500px;
    margin: 0 auto;
}
.ndw-stage-card {
    background: transparent;
}
.ndw-stage-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
}
.ndw-stage-title {
    margin: 8px 0 6px;
    font-size: clamp(28px, 3.4vw, 46px);
    line-height: 1.15;
}
.ndw-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(107, 78, 255, .11);
    color: #5f4bde;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ndw-stage-author {
    color: #646d7d;
    font-size: 16px;
}
.ndw-stage-status {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #5f54b8;
    color: #fff;
    font-weight: 700;
    padding: 10px 18px;
}
.ndw-stage-room {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 442px;
    gap: 18px;
    align-items: stretch;
}
.ndw-stage-media {
    position: relative;
    overflow: visible;
    border-radius: 24px;
    background: radial-gradient(circle at top right, #423d78, #171a2f 58%, #0d1020);
    aspect-ratio: 16 / 9;
    min-height: 0;
    box-shadow: 0 22px 58px rgba(20, 25, 55, .20);
}
.ndw-stage-poster,
.ndw-video-wrap,
.ndw-video,
.ndw-countdown-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.ndw-stage-poster,
.ndw-video-wrap,
.ndw-countdown-overlay {
    overflow: hidden;
    border-radius: 24px;
}
.ndw-stage-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ndw-stage-poster::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 12, 27, .1), rgba(8, 12, 27, .4));
}
.ndw-countdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(5, 7, 15, .90);
    backdrop-filter: blur(8px);
}
.ndw-overlay-box {
    text-align: center;
    color: #fff;
    max-width: 720px;
}
.ndw-overlay-label {
    font-size: clamp(26px, 4vw, 56px);
    font-weight: 700;
}
.ndw-overlay-number {
    font-size: clamp(120px, 18vw, 230px);
    line-height: .92;
    font-weight: 800;
    margin: 18px 0 24px;
}
.ndw-overlay-note {
    margin-top: 18px;
    font-size: 15px;
    opacity: .82;
}
.ndw-start-button:disabled {
    opacity: .8;
    cursor: default;
}
.ndw-video-wrap {
    background: #000;
    z-index: 2;
}
.ndw-video {
    object-fit: contain;
    background: #000;
}
.ndw-no-video {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 24px;
}

.ndw-chat-panel {
    background: #fff;
    border-radius: 22px;
    height: 100%;
    min-height: 0;
    box-shadow: 0 18px 42px rgba(21, 31, 58, .12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ndw-chat-head {
    padding: 20px 18px 16px;
    border-bottom: 1px solid #eceff5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ndw-viewers {
    color: #5f6677;
    font-size: 12px;
    white-space: nowrap;
    padding-top: 3px;
}
.ndw-viewers span {
    color: #6b4eff;
}
.ndw-chat-message-simulated {
    background: #f3f5fa;
}

.ndw-chat-head h2 {
    margin: 0 0 6px;
    font-size: 20px;
}
.ndw-chat-subtitle {
    color: #7c8495;
    font-size: 14px;
}
.ndw-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px;
    background: #fafbfe;
}
.ndw-chat-message {
    margin-bottom: 12px;
    padding: 14px 14px;
    border-radius: 16px;
    background: #f1efff;
    color: #23273a;
}
.ndw-chat-message-host {
    background: #efeafe;
}
.ndw-chat-message-name {
    font-weight: 700;
    margin-bottom: 4px;
}
.ndw-chat-message-text {
    line-height: 1.5;
}
.ndw-chat-form {
    padding: 14px 14px 16px;
    border-top: 1px solid #eceff5;
    background: #fff;
}
.ndw-chat-input {
    width: 100%;
    border: 1px solid #d8dcea;
    border-radius: 14px;
    padding: 14px 15px;
    resize: vertical;
    min-height: 84px;
    font-size: 15px;
    margin-bottom: 12px;
    outline: none;
}
.ndw-chat-input:focus {
    border-color: #8e73ff;
    box-shadow: 0 0 0 3px rgba(107, 78, 255, .12);
}
.ndw-chat-submit {
    width: 100%;
}

.ndw-partner-block {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -84px;
    z-index: 6;
    text-align: center;
    padding-top: 18px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .35s ease, transform .35s ease;
}
.ndw-partner-block.ndw-partner-visible {
    opacity: 1;
    transform: translateY(0);
}
.ndw-partner-button {
    font-size: 18px;
    padding: 16px 28px;
}

.ndw-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}
.ndw-auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 11, 20, .66);
}
.ndw-auth-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, calc(100vw - 24px));
    margin: 8vh auto 0;
    background: #fff;
    border-radius: 24px;
    padding: 28px 24px 24px;
    box-shadow: 0 28px 80px rgba(12, 18, 42, .30);
}
.ndw-auth-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f2f4fa;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.ndw-auth-dialog h3 {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.2;
}
.ndw-auth-text {
    color: #687181;
    margin-bottom: 18px;
}
.ndw-auth-form label {
    display: block;
    margin-bottom: 14px;
}
.ndw-auth-form span {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}
.ndw-auth-form input {
    width: 100%;
    border: 1px solid #d8dcea;
    border-radius: 14px;
    padding: 14px 15px;
    font-size: 15px;
}
.ndw-auth-submit {
    width: 100%;
    margin-top: 6px;
}
.ndw-consent-row {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin: 2px 0 14px !important;
    cursor: pointer;
}
.ndw-consent-row input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: #6b4eff;
}
.ndw-consent-text {
    display: inline !important;
    margin: 0 !important;
    color: #2f3440;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 400 !important;
}
.ndw-privacy-open {
    display: inline;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: #2f6df6;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.ndw-privacy-open:hover,
.ndw-privacy-open:focus-visible {
    text-decoration: underline;
}
.ndw-consent-error {
    margin: -6px 0 12px;
    color: #d93025;
    font-size: 13px;
}
.ndw-privacy-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
}
.ndw-privacy-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 11, 20, .76);
    backdrop-filter: blur(3px);
}
.ndw-privacy-dialog {
    position: relative;
    z-index: 1;
    width: min(860px, calc(100vw - 24px));
    max-height: min(82vh, 900px);
    margin: 6vh auto 0;
    background: #fff;
    border-radius: 24px;
    padding: 28px 24px 24px;
    box-shadow: 0 28px 80px rgba(12, 18, 42, .34);
    display: flex;
    flex-direction: column;
}
.ndw-privacy-dialog h3 {
    margin: 0 48px 16px 0;
    font-size: 28px;
    line-height: 1.2;
}
.ndw-privacy-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f2f4fa;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.ndw-privacy-content {
    overflow-y: auto;
    padding-right: 10px;
    color: #343946;
    font-size: 15px;
    line-height: 1.55;
}
.ndw-privacy-content p {
    margin: 0 0 14px;
}

[hidden] { display: none !important; }

@media (max-width: 1100px) {
    .ndw-stage-room {
        grid-template-columns: 1fr;
    }
    .ndw-stage-media {
        aspect-ratio: 16 / 9;
    }
    .ndw-chat-panel {
        min-height: 520px;
    }
}
@media (max-width: 900px) {
    .ndw-columns-3,
    .ndw-columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .ndw-columns-2,
    .ndw-columns-3,
    .ndw-columns-4 { grid-template-columns: 1fr; }
    .ndw-room-page { padding-left: 10px; padding-right: 10px; }
    .ndw-stage-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .ndw-stage-media {
        min-height: 0;
    }
    .ndw-chat-panel {
        min-height: 420px;
    }
    .ndw-overlay-label { font-size: 24px; }
    .ndw-overlay-number { font-size: 110px; }
    .ndw-auth-dialog h3 { font-size: 22px; }
}

html.ndw-countdown-active,
html.ndw-countdown-active body {
    overflow: hidden !important;
}

/* На широком экране высота комнаты всегда определяется только блоком 16:9.
   Чат получает фиксированную высоту в два раза больше видео через JavaScript.
   Страница может прокручиваться, а при переполнении сообщения прокручиваются внутри чата. */
.ndw-stage-room {
    align-items: start;
}
.ndw-chat-panel {
    align-self: start;
    min-height: 0;
    max-height: none;
}
.ndw-chat-messages {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
.ndw-chat-panel.ndw-chat-ended .ndw-chat-form {
    opacity: .68;
}
.ndw-chat-ended-note {
    padding: 12px 16px;
    border-top: 1px solid #eceff5;
    background: #f5f2ff;
    color: #5f4bde;
    font-weight: 700;
    text-align: center;
}
.ndw-chat-input:disabled,
.ndw-chat-submit:disabled {
    cursor: not-allowed;
}

@media (min-width: 1101px) {
    .ndw-stage-media {
        width: 100%;
    }
    .ndw-chat-panel {
        height: var(--ndw-stage-height, 600px);
        max-height: var(--ndw-stage-height, 600px);
    }
}


.ndw-package-player {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(220px, .75fr);
    width: 100%;
    min-height: 420px;
    background: linear-gradient(135deg, #102552 0%, #173b75 55%, #0e244d 100%);
    color: #fff;
}
.ndw-package-slide { padding: 48px 42px; display: flex; flex-direction: column; justify-content: center; }
.ndw-package-kicker { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; opacity: .72; margin-bottom: 14px; }
.ndw-package-title { color: #fff; font-size: clamp(26px, 3vw, 44px); line-height: 1.1; margin: 0 0 24px; }
.ndw-package-points { margin: 0; padding-left: 24px; font-size: clamp(16px, 1.45vw, 22px); line-height: 1.5; }
.ndw-package-points li + li { margin-top: 10px; }
.ndw-package-counter { margin-top: 28px; font-weight: 700; opacity: .72; }
.ndw-package-avatar { min-width: 0; background: #091a39; display: flex; align-items: stretch; overflow: hidden; }
.ndw-package-avatar .ndw-video { width: 100%; height: 100%; min-height: 420px; object-fit: cover; background: #091a39; }
@media (max-width: 780px) {
    .ndw-package-player { grid-template-columns: 1fr; }
    .ndw-package-slide { padding: 30px 24px; }
    .ndw-package-avatar .ndw-video { min-height: 360px; max-height: 520px; object-fit: contain; }
}

/* Imported school webinar: keep the avatar video inside its grid column. */
.ndw-package-player {
    height: 100%;
    min-height: 0;
}
.ndw-package-avatar {
    position: relative;
    min-height: 0;
}
.ndw-package-avatar .ndw-video {
    position: static;
    inset: auto;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
}


/* Browser autoplay fallback for imported webinar packages.
   The launch gate covers the entire 16:9 webinar stage. */
.ndw-package-play-gate {
    position: absolute;
    inset: 0;
    z-index: 40;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: inherit;
    padding: 32px;
    background: rgba(5, 14, 35, .72);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: center;
    font: inherit;
    cursor: pointer;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.ndw-package-play-gate[hidden] { display: none !important; }
.ndw-package-play-icon {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    padding-left: 6px;
    background: linear-gradient(135deg, #7652ff, #914cff);
    box-shadow: 0 16px 42px rgba(0,0,0,.38);
    font-size: 40px;
    line-height: 1;
    transition: transform .18s ease, box-shadow .18s ease;
}
.ndw-package-play-gate:hover .ndw-package-play-icon,
.ndw-package-play-gate:focus-visible .ndw-package-play-icon {
    transform: scale(1.06);
    box-shadow: 0 18px 48px rgba(0,0,0,.46);
}
.ndw-package-play-gate:focus-visible {
    outline: 3px solid rgba(255,255,255,.95);
    outline-offset: -6px;
}
.ndw-package-play-text {
    display: block;
    max-width: 720px;
    font-size: clamp(18px, 2vw, 28px);
    line-height: 1.3;
    font-weight: 800;
    text-shadow: 0 3px 14px rgba(0,0,0,.55);
}
@media (max-width: 780px) {
    .ndw-package-play-gate { padding: 22px; gap: 14px; }
    .ndw-package-play-icon { width: 76px; height: 76px; font-size: 32px; }
    .ndw-package-play-text { font-size: 18px; }
}


.ndw-chat-message-moderator {
    background: linear-gradient(135deg, #e8f7ff, #eef2ff);
    border-left: 4px solid #4f7cff;
}
.ndw-chat-message-moderator .ndw-chat-message-name {
    color: #2859c5;
}


/* Moderator personal reply and typing animation */
.ndw-chat-message-temporary {
    opacity: .82;
}
.ndw-moderator-typing {
    min-height: 70px;
}
.ndw-moderator-typing-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: #4b5872;
    font-size: 14px;
    line-height: 1.45;
}
.ndw-typing-pencil {
    display: inline-block;
    color: #4f7cff;
    font-size: 21px;
    line-height: 1;
    animation: ndw-pencil-write .8s ease-in-out infinite alternate;
    transform-origin: 50% 100%;
}
.ndw-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 30px;
}
.ndw-typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4f7cff;
    animation: ndw-typing-dot 1.15s infinite ease-in-out;
}
.ndw-typing-dots i:nth-child(2) { animation-delay: .16s; }
.ndw-typing-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes ndw-typing-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: .35; }
    30% { transform: translateY(-5px); opacity: 1; }
}
@keyframes ndw-pencil-write {
    from { transform: rotate(-12deg) translateX(-1px); }
    to { transform: rotate(8deg) translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
    .ndw-typing-pencil,
    .ndw-typing-dots i { animation: none; }
}
