.clp-lives-app {
    --clp-bg: #050505;
    --clp-panel: #101010;
    --clp-panel-soft: #161616;
    --clp-border: rgba(212, 175, 55, 0.22);
    --clp-border-strong: rgba(212, 175, 55, 0.52);
    --clp-text: #ffffff;
    --clp-muted: rgba(255, 255, 255, 0.68);
    --clp-gold: #d4af37;
    --clp-gold-soft: rgba(212, 175, 55, 0.14);
    --clp-radius: 22px;
    --clp-section-alpha: 0.95;

    color: var(--clp-text);
    background:
        radial-gradient(circle at top left, rgba(212, 175, 55, 0.12), transparent 34%),
        linear-gradient(180deg, #080808 0%, #050505 100%);
    padding: clamp(18px, 3vw, 34px);
    border-radius: 28px;
    font-family: inherit;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.clp-lives-app * {
    box-sizing: border-box;
}

.clp-hero,
.clp-panel {
    border: 1px solid var(--clp-border);
    background: linear-gradient(145deg, rgba(20, 20, 20, var(--clp-section-alpha)), rgba(8, 8, 8, var(--clp-section-alpha)));
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.clp-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: clamp(22px, 4vw, 40px);
    border-radius: var(--clp-radius);
    margin-bottom: 22px;
    overflow: hidden;
    position: relative;
}

.clp-hero::after {
    content: '';
    position: absolute;
    inset: auto -80px -130px auto;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.22), transparent 64%);
    pointer-events: none;
}

.clp-hero h1,
.clp-panel h2,
.clp-panel h3,
.clp-live-detail h2,
.clp-live-detail h3 {
    color: var(--clp-text);
    margin: 0;
    line-height: 1.15;
}

.clp-hero h1 {
    font-size: clamp(28px, 5vw, 48px);
    letter-spacing: -0.04em;
    margin-top: 8px;
}

.clp-hero p,
.clp-panel p,
.clp-live-detail p {
    color: var(--clp-muted);
    margin: 10px 0 0;
}

.clp-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--clp-gold);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.16em;
    font-weight: 800;
}

.clp-kicker::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--clp-gold);
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.9);
}

.clp-hero__badge {
    min-width: 140px;
    border: 1px solid var(--clp-border-strong);
    background: var(--clp-gold-soft);
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.clp-hero__badge span {
    display: block;
    color: var(--clp-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.clp-hero__badge strong {
    display: block;
    color: var(--clp-gold);
    font-size: 24px;
    margin-top: 3px;
}

.clp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 22px;
}

.clp-grid--top {
    align-items: stretch;
}

.clp-panel {
    border-radius: var(--clp-radius);
    padding: clamp(18px, 2.4vw, 26px);
    min-width: 0;
}

.clp-selected-panel {
    margin-top: 22px;
}

.clp-panel__title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.clp-panel__title h2 {
    font-size: clamp(22px, 3vw, 30px);
    margin-top: 5px;
    letter-spacing: -0.03em;
}

.clp-card-list {
    display: grid;
    gap: 12px;
}

.clp-live-card {
    width: 100%;
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    color: var(--clp-text);
    border-radius: 16px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: 180ms ease;
}

.clp-live-card:hover,
.clp-live-card.is-active {
    border-color: var(--clp-border-strong);
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-1px);
}

.clp-live-card strong {
    display: block;
    color: var(--clp-text);
    font-size: 16px;
    margin-top: 6px;
}

.clp-live-card__date,
.clp-live-card__material {
    display: inline-flex;
    color: var(--clp-muted);
    font-size: 13px;
}

.clp-live-card__material {
    margin-top: 10px;
    color: var(--clp-gold);
    font-weight: 700;
}

.clp-calendar-header {
    align-items: flex-start;
}

.clp-calendar-nav {
    display: inline-flex;
    gap: 8px;
}

.clp-calendar-nav button {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--clp-border);
    background: rgba(212, 175, 55, 0.08);
    color: var(--clp-gold);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.clp-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.clp-calendar__weekday,
.clp-calendar__day {
    min-height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    text-align: center;
}

.clp-calendar__weekday {
    min-height: 28px;
    color: var(--clp-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.clp-calendar__day {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
    color: rgba(255, 255, 255, 0.78);
    font-weight: 700;
}

.clp-calendar__day--empty {
    opacity: 0;
}

.clp-calendar__day--has-live {
    border-color: var(--clp-border-strong);
    background: rgba(212, 175, 55, 0.12);
    color: var(--clp-gold);
    cursor: pointer;
}

.clp-calendar__day--has-live::after {
    content: attr(data-count);
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--clp-gold);
    color: #111;
    font-size: 11px;
    font-weight: 900;
}

.clp-calendar__day--today {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.clp-day-lives {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.clp-day-lives .clp-card-list {
    gap: 10px;
}

.clp-live-detail__header {
    margin-bottom: 18px;
}

.clp-live-detail__header h2 {
    font-size: clamp(24px, 4vw, 38px);
    margin-top: 8px;
    letter-spacing: -0.04em;
}

.clp-live-player-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 18px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.clp-live-player-grid--no-chat {
    grid-template-columns: 1fr;
}

.clp-live-player,
.clp-live-chat,
.clp-material-box,
.clp-empty-state {
    min-width: 0;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    border-radius: 18px;
    padding: 16px;
}

.clp-live-player h3,
.clp-live-chat h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--clp-gold);
}

.clp-embed-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
    min-height: 260px;
    isolation: isolate;
}

.clp-live-player .clp-embed-wrap {
    aspect-ratio: 16 / 9;
    min-height: 0;
}

@supports not (aspect-ratio: 16 / 9) {
    .clp-live-player .clp-embed-wrap {
        height: 0;
        padding-bottom: 56.25%;
    }
}

.clp-chat-wrap {
    min-height: 460px;
}

.clp-embed-wrap iframe {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: 0;
    display: block;
}

/*
 * Camada responsiva para embeds simples ou envolvidos por DIV proporcional.
 * As classes são aplicadas pelo frontend.js somente aos elementos com iframe,
 * preservando outros conteúdos permitidos no campo de embed.
 */
.clp-embed-wrap > .clp-responsive-embed-inner,
.clp-chat-embed-wrap > .clp-responsive-embed-inner {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.clp-responsive-iframe {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}

.clp-empty-embed {
    min-height: inherit;
    display: grid;
    place-items: center;
    color: var(--clp-muted);
    padding: 20px;
    text-align: center;
}

.clp-material-box {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.clp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--clp-gold);
    color: #0c0c0c !important;
    text-decoration: none !important;
    font-weight: 900;
    border: 1px solid rgba(255, 255, 255, 0.14);
    white-space: nowrap;
}

.clp-empty-state {
    text-align: center;
}

.clp-empty-state--compact {
    padding: 22px;
}

.clp-empty-state h2,
.clp-empty-state h3 {
    color: var(--clp-text);
    margin: 0;
}

.clp-loading {
    color: var(--clp-muted);
    text-align: center;
    padding: 18px;
}

.clp-login-message {
    max-width: 780px;
    margin: 0 auto;
}

@media (max-width: 980px) {
    .clp-grid,
    .clp-live-player-grid {
        grid-template-columns: 1fr;
    }

    .clp-chat-wrap {
        min-height: 360px;
    }
}

@media (max-width: 620px) {
    .clp-lives-app {
        padding: 14px;
        border-radius: 20px;
    }

    .clp-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .clp-hero__badge {
        width: 100%;
    }

    .clp-panel__title,
    .clp-material-box {
        flex-direction: column;
        align-items: stretch;
    }

    .clp-calendar {
        gap: 5px;
    }

    .clp-calendar__day {
        min-height: 38px;
        font-size: 13px;
    }

    .clp-button {
        width: 100%;
    }

}

.clp-course-notice {
    margin: 0 0 24px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(12, 12, 12, 0.92));
    color: var(--clp-text, #ffffff);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.clp-course-notice__head h3 {
    margin: 6px 0 6px;
    color: var(--clp-text, #ffffff);
    font-size: 20px;
    line-height: 1.25;
}

.clp-course-notice__head p {
    margin: 0;
    color: var(--clp-muted, #b7b7b7);
}

.clp-course-notice__list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.clp-course-notice__item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.clp-course-notice__item strong {
    color: var(--clp-text, #ffffff);
    font-weight: 800;
}

.clp-course-notice__item span {
    color: var(--clp-gold, #d4af37);
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 620px) {
    .clp-course-notice__item {
        align-items: flex-start;
        flex-direction: column;
    }

    .clp-course-notice__item span {
        white-space: normal;
    }
}

/* Chat nativo dos grupos de estudo */
.clp-native-chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 460px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
}

.clp-native-chat__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 2px 2px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.clp-native-chat__top span {
    color: var(--clp-gold);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.clp-native-chat__top small {
    color: var(--clp-muted);
    text-align: right;
}

.clp-native-chat__messages {
    flex: 1;
    min-height: 260px;
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 4px 8px;
    scrollbar-width: thin;
}

.clp-chat-empty {
    margin: auto;
    color: var(--clp-muted);
    text-align: center;
    padding: 18px;
}

.clp-chat-message {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
}

.clp-chat-message.is-mine {
    grid-template-columns: minmax(0, 1fr) 34px;
}

.clp-chat-message.is-mine .clp-chat-message__avatar {
    grid-column: 2;
    grid-row: 1;
}

.clp-chat-message.is-mine .clp-chat-message__body {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    background: rgba(212, 175, 55, 0.14);
    border-color: rgba(212, 175, 55, 0.35);
}

.clp-chat-message__avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(212, 175, 55, 0.18);
    color: var(--clp-gold);
    font-size: 12px;
    font-weight: 900;
    border: 1px solid rgba(212, 175, 55, 0.24);
}

.clp-chat-message__body {
    max-width: 100%;
    padding: 9px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.clp-chat-message__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.clp-chat-message__meta strong {
    color: var(--clp-text);
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clp-chat-message__meta span {
    color: var(--clp-muted);
    font-size: 11px;
    white-space: nowrap;
}

.clp-chat-message__text {
    color: var(--clp-text);
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.clp-native-chat__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.clp-native-chat__form textarea {
    width: 100%;
    resize: vertical;
    min-height: 56px;
    max-height: 140px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.065);
    color: var(--clp-text);
    padding: 11px 12px;
    outline: none;
    box-shadow: none;
}

.clp-native-chat__form textarea:focus {
    border-color: rgba(212, 175, 55, 0.55);
}

.clp-native-chat__form textarea::placeholder {
    color: var(--clp-muted);
}

.clp-native-chat__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.clp-native-chat__actions small {
    color: var(--clp-muted);
}

.clp-chat-send-button {
    border: 0;
    border-radius: 999px;
    background: var(--clp-gold);
    color: #111;
    font-weight: 900;
    padding: 9px 16px;
    cursor: pointer;
}

.clp-chat-send-button:disabled {
    opacity: 0.65;
    cursor: progress;
}

.clp-native-chat__status {
    min-height: 17px;
    color: var(--clp-muted);
    font-size: 12px;
}

.clp-native-chat__status.is-error {
    color: #ffb4b4;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

@media (max-width: 980px) {
    .clp-native-chat {
        min-height: 380px;
    }

    .clp-native-chat__messages {
        max-height: 320px;
    }
}

@media (max-width: 620px) {
    .clp-native-chat__top,
    .clp-native-chat__actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .clp-chat-send-button {
        width: 100%;
        justify-content: center;
    }
}


.clp-chat-embed-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 460px;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.45);
}

.clp-chat-embed-wrap iframe {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: 0;
    display: block;
}
