/* ===========================================================
   Plataforma Mhk — área do aluno
   Identidade fiel ao Manual de Marca (Magda Helena Kindler).
   Cores via variáveis do tema (App\Support\Theme).
   =========================================================== */

:root {
    --paper: #f7f7f1;
    --card: #ffffff;
    --ink: #20302b;
    --ink-soft: #586962;
    --line: #ebe9e0;
    --line-mint: #dceee5;
    --radius: 20px;
    --radius-sm: 13px;
    --shadow: 0 1px 2px rgba(40, 70, 58, .04), 0 12px 34px rgba(40, 70, 58, .07);
    --shadow-sm: 0 1px 2px rgba(40, 70, 58, .05), 0 5px 16px rgba(40, 70, 58, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: 'Nunito Sans', system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(1100px 460px at 100% -8%, var(--mint-wash), transparent 60%),
        radial-gradient(820px 460px at -8% 2%, var(--peach-wash), transparent 58%),
        var(--paper);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: 'Nunito', 'Nunito Sans', system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--ink);
    margin: 0;
    line-height: 1.15;
}

a { color: var(--deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 5vw, 48px); background: rgba(255,255,255,.72); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 38px; width: auto; display: block; }

.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { font-weight: 700; color: var(--ink-soft); font-size: 15px; }
.topnav a:hover { color: var(--deep); text-decoration: none; }
.inline { display: inline; margin: 0; }
.link-btn { background: none; border: none; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink-soft); padding: 0; }
.link-btn:hover { color: var(--deep); }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--deep); color: var(--on-deep); border: none; border-radius: 999px; padding: 12px 24px; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; box-shadow: 0 6px 16px rgba(35,75,66,.18); }
.btn:hover { filter: brightness(1.05); text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(35,75,66,.24); }
.btn-sm { padding: 9px 18px; font-size: 14px; box-shadow: none; }
.btn-peach { background: var(--peach); color: var(--on-peach); box-shadow: 0 6px 16px rgba(255,170,119,.35); }
.btn-peach:hover { box-shadow: 0 10px 22px rgba(255,170,119,.45); }
.btn-ghost { background: transparent; color: var(--deep); border: 1.5px solid var(--line-mint); box-shadow: none; }
.btn-ghost:hover { background: var(--mint-wash); filter: none; }
.btn-block { width: 100%; }

/* Layout */
.page { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 5vw, 48px) 64px; }
.site-footer { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px; color: var(--ink-soft); font-size: 14px; border-top: 1px solid var(--line); }
.site-footer .footer-logo { height: 26px; width: auto; opacity: .9; }
.site-footer .dot { opacity: .4; }

/* Saudação */
.greeting { margin-bottom: 28px; }
.greeting .eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; color: var(--lotus); }
.greeting h1 { font-size: clamp(28px, 4vw, 42px); margin-top: 8px; }
.greeting p { color: var(--ink-soft); margin-top: 8px; font-size: 16px; }

/* Continue assistindo */
.continue { background: linear-gradient(120deg, var(--mint-wash), var(--peach-wash)); border: 1px solid var(--line-mint); border-radius: var(--radius); padding: clamp(20px, 3vw, 30px); display: flex; align-items: center; justify-content: space-between; gap: 24px; box-shadow: var(--shadow-sm); margin-bottom: 38px; flex-wrap: wrap; position: relative; overflow: hidden; }
.continue::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, var(--lotus-soft), transparent 70%); opacity: .7; }
.continue .ct-label { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; color: var(--lotus); }
.continue h3 { color: var(--ink); font-size: 23px; margin-top: 8px; }
.continue .ct-course { color: var(--ink-soft); margin-top: 4px; font-weight: 700; }
.continue .btn { position: relative; z-index: 1; }

/* Seções */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 18px; }
.section-head h2 { font-size: 25px; }
.section-head .muted { color: var(--ink-soft); font-size: 14px; font-weight: 700; }

/* Grid de cursos */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.course-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px; transition: transform .14s ease, box-shadow .14s ease; position: relative; overflow: hidden; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.course-card .accent-bar { position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--course-color, var(--deep)); }
.course-card .symbol { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--course-color, var(--lotus)) 12%, white); color: var(--course-color, var(--lotus)); }
.course-card .symbol svg { width: 30px; height: 30px; }
.course-card h3 { font-size: 20px; }
.course-card .subtitle { color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

.progress { margin-top: auto; }
.progress .bar { height: 9px; border-radius: 999px; background: var(--mint-wash); overflow: hidden; }
.progress .bar > span { display: block; height: 100%; background: var(--course-color, var(--deep)); border-radius: 999px; }
.progress .meta { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--ink-soft); margin-top: 8px; }

/* Curso (detalhe) */
.course-hero { background: linear-gradient(125deg, var(--course-color, var(--deep)), color-mix(in srgb, var(--course-color, var(--deep)) 62%, black)); color: #fff; border-radius: var(--radius); padding: clamp(24px, 4vw, 42px); margin-bottom: 28px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.course-hero .hero-symbol { position: absolute; right: 24px; bottom: -10px; width: 130px; height: 130px; opacity: .18; color: #fff; }
.course-hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; opacity: .9; }
.course-hero h1 { color: #fff; font-size: clamp(26px, 4vw, 40px); margin-top: 8px; }
.course-hero p { opacity: .92; margin-top: 8px; max-width: 60ch; position: relative; z-index: 1; }

.module { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.module > header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.module > header h3 { font-size: 18px; }
.module > header .badge { font-size: 12px; font-weight: 800; padding: 4px 11px; border-radius: 999px; background: var(--mint-wash); color: var(--on-mint); }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line); transition: background .12s ease; }
.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: var(--mint-wash); text-decoration: none; }
.lesson-row .check { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--line-mint); display: grid; place-items: center; }
.lesson-row.done .check { background: var(--deep); border-color: var(--deep); color: var(--on-deep); }
.lesson-row .title { flex: 1; font-weight: 700; color: var(--ink); }
.lesson-row .dur { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.lesson-row .preview-tag { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--peach-wash); color: var(--peach-ink); }

/* Player / aula */
.player-wrap { background: #0c0f0e; border-radius: var(--radius); aspect-ratio: 16 / 9; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 22px; display: grid; place-items: center; }
.player-wrap iframe, .player-wrap video { width: 100%; height: 100%; border: 0; display: block; }
.player-empty { color: #cfe6dc; text-align: center; padding: 24px; font-weight: 700; }

.lesson-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.lesson-head .eyebrow { color: var(--lotus); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
.lesson-head h1 { font-size: clamp(24px, 3.5vw, 32px); margin-top: 6px; }
.lesson-body { color: var(--ink-soft); line-height: 1.7; font-size: 16px; max-width: 70ch; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--mint-wash); color: var(--on-mint); font-weight: 700; margin-bottom: 18px; border: 1px solid var(--mint); }

/* Login */
.auth-shell { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 430px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(28px, 5vw, 42px); box-shadow: var(--shadow); text-align: center; }
.auth-logo { height: 56px; width: auto; margin: 0 auto 22px; display: block; }
.auth-card h1 { font-size: 26px; }
.auth-card .sub { color: var(--ink-soft); margin: 8px 0 26px; }
.auth-card form { text-align: left; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field input[type=email], .field input[type=password], .field input[type=text] { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line-mint); border-radius: var(--radius-sm); font: inherit; font-size: 15px; background: #fff; color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease; }
.field input:focus { outline: none; border-color: var(--deep); box-shadow: 0 0 0 3px var(--mint-wash); }
.field-row { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.field-row label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink-soft); margin: 0; }

.form-error { background: var(--lotus-soft); color: #8e1257; border: 1px solid #eecbdd; border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 700; font-size: 14px; margin-bottom: 16px; }

/* Landing */
.landing { min-height: calc(100vh - 76px); display: grid; place-items: center; text-align: center; padding: 48px 20px; }
.landing-inner { max-width: 660px; }
.landing-logo { height: 96px; width: auto; margin: 0 auto 28px; display: block; }
.landing h1 { font-size: clamp(32px, 6vw, 52px); }
.landing p { color: var(--ink-soft); font-size: 18px; margin: 18px 0 30px; line-height: 1.6; }
.landing .soon { display: inline-block; margin-top: 26px; font-size: 12px; font-weight: 800; color: var(--lotus); background: var(--lotus-soft); padding: 6px 16px; border-radius: 999px; text-transform: uppercase; letter-spacing: .12em; }

.empty-state { text-align: center; padding: 48px 24px; background: var(--card); border: 1px dashed var(--line-mint); border-radius: var(--radius); color: var(--ink-soft); }
.empty-state h3 { color: var(--deep); margin-bottom: 8px; }

@media (max-width: 560px) {
    .continue { flex-direction: column; align-items: flex-start; }
    .topnav { gap: 14px; }
    .brand-logo { height: 32px; }
}

/* ===========================================================
   Camada 2 — avatar/menu, perfil, anotações, relatórios
   =========================================================== */

/* ---- Avatar + menu ---- */
.avatar-menu { position: relative; }
.avatar-btn { border: none; background: none; cursor: pointer; padding: 0; border-radius: 50%; line-height: 0; }
.avatar-img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line-mint); display: block; }
.avatar-initials { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--deep); color: var(--on-deep); font-weight: 800; font-size: 14px; font-family: 'Nunito', sans-serif; }
.avatar-img--lg, .avatar-initials--lg { width: 46px; height: 46px; font-size: 16px; }
.avatar-btn:hover .avatar-img, .avatar-btn:hover .avatar-initials { box-shadow: 0 0 0 3px var(--mint-wash); }

.avatar-dropdown {
    position: absolute; right: 0; top: calc(100% + 10px);
    width: 250px; background: var(--card); border: 1px solid var(--line);
    border-radius: 16px; box-shadow: var(--shadow); padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .14s ease, transform .14s ease, visibility .14s; z-index: 40;
}
.avatar-menu.open .avatar-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.avatar-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.avatar-id { overflow: hidden; }
.avatar-id strong { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-id small { color: var(--ink-soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.avatar-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 10px; border-radius: 10px; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink); background: none; border: none; cursor: pointer; text-align: left; }
.avatar-item:hover { background: var(--mint-wash); text-decoration: none; color: var(--deep); }
.avatar-item--btn { color: #a3402e; }
.avatar-item--btn:hover { background: #fdecea; color: #a3402e; }
.avatar-item svg { color: var(--ink-soft); flex-shrink: 0; }

/* ---- Perfil ---- */
.profile-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 28px); box-shadow: var(--shadow-sm); }
.panel-title { font-size: 19px; margin-bottom: 18px; }
.avatar-editor { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.avatar-preview { width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0; overflow: hidden; display: grid; place-items: center; background: var(--deep); color: var(--on-deep); font-weight: 800; font-size: 28px; font-family: 'Nunito', sans-serif; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; flex-direction: column; gap: 8px; }
.remove-avatar { font-size: 13px; color: var(--ink-soft); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.hint { font-size: 12px; color: var(--ink-soft); margin: 2px 0 0; }
textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line-mint); border-radius: var(--radius-sm); font: inherit; font-size: 15px; background: #fff; color: var(--ink); resize: vertical; transition: border-color .12s ease, box-shadow .12s ease; }
textarea:focus { outline: none; border-color: var(--deep); box-shadow: 0 0 0 3px var(--mint-wash); }
.file-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-field label { margin: 0; cursor: pointer; }
.file-list { font-size: 13px; color: var(--ink-soft); font-weight: 600; }

/* ---- Anotações (diário) ---- */
.notes { margin-top: 36px; }
.muted-link { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.muted-link:hover { color: var(--deep); }
.note-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.note-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.note-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.note-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.note-date { font-size: 13px; font-weight: 800; color: var(--peach-ink); }
.note-del { background: none; border: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: #b06; opacity: .65; }
.note-del:hover { opacity: 1; text-decoration: underline; }
.note-body { color: var(--ink); line-height: 1.6; }
.note-attachments { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.att-thumb { width: 84px; height: 84px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); display: block; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb:hover { box-shadow: var(--shadow-sm); }
.att-file { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--mint-wash); color: var(--deep); font-weight: 700; font-size: 13px; }
.att-file:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.att-file small { color: var(--ink-soft); font-weight: 600; }
.notes-empty { color: var(--ink-soft); background: var(--card); border: 1px dashed var(--line-mint); border-radius: var(--radius); padding: 22px; text-align: center; }
.course-toolbar { margin: 4px 0 18px; }

/* ---- Relatório (web) ---- */
.report-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.report-actions-btns { display: flex; gap: 10px; }
.report { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow); }
.report-head { display: flex; align-items: center; gap: 18px; border-bottom: 2px solid var(--deep); padding-bottom: 18px; margin-bottom: 22px; }
.report-logo { height: 50px; width: auto; }
.report-meta h1 { font-size: clamp(22px, 3vw, 30px); margin-top: 4px; }
.report-meta p { color: var(--ink-soft); margin-top: 4px; font-size: 14px; }
.report-group { margin-bottom: 26px; }
.report-group h2 { font-size: 19px; border-left: 4px solid var(--peach); padding-left: 10px; }
.report-module { color: var(--ink-soft); font-size: 13px; margin: 2px 0 12px 14px; }
.report-note { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.report-note-date { color: var(--peach-ink); font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.report-note-body { line-height: 1.6; }
.report-atts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.report-att-img { max-width: 260px; max-height: 200px; border-radius: 10px; border: 1px solid var(--line); }
.report-att-file { display: inline-block; color: var(--deep); font-weight: 700; font-size: 13px; }

@media print {
    .topbar, .site-footer, .no-print, .report-actions { display: none !important; }
    body { background: #fff !important; }
    .page { padding: 0 !important; max-width: 100% !important; }
    .report { border: none !important; box-shadow: none !important; padding: 0 !important; }
}

@media (max-width: 720px) {
    .profile-grid { grid-template-columns: 1fr; }
}

/* ===========================================================
   Comunidade do curso — bubble flutuante + painel/tela cheia
   =========================================================== */

/* Botão flutuante */
.chat-bubble-btn {
    position: fixed; bottom: 24px; right: 24px; z-index: 55;
    display: inline-flex; align-items: center; gap: 9px;
    padding: 13px 20px 13px 16px; border: none; cursor: pointer;
    border-radius: 999px; background: var(--deep); color: var(--on-deep);
    font: inherit; font-weight: 800; font-size: 15px;
    box-shadow: 0 12px 30px rgba(35,75,66,.38);
    transition: transform .15s ease, box-shadow .15s ease;
}
.chat-bubble-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(35,75,66,.45); }
.chat-bubble-btn.hidden { display: none; }
.chat-bubble-label { line-height: 1; }

/* Painel (drawer lateral por padrão) */
.chat-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(420px, 100vw); z-index: 60;
    background: var(--card); display: flex;
    transform: translateX(100%); transition: transform .25s ease;
    box-shadow: -14px 0 50px rgba(40,70,58,.22);
}
.chat-panel[hidden] { display: none; }
.chat-panel.open { transform: translateX(0); }

/* Tela cheia: ocupa tudo e revela o sidebar de aulas */
.chat-panel.fullscreen { left: 0; width: auto; box-shadow: none; }

.chat-shell { display: flex; width: 100%; height: 100%; min-height: 0; }

/* Sidebar de aulas (só na tela cheia) */
.chat-lessons {
    display: none; width: 320px; flex-shrink: 0;
    flex-direction: column; background: var(--paper);
    border-right: 1px solid var(--line); overflow-y: auto;
}
.chat-panel.fullscreen .chat-lessons { display: flex; }
.chat-lessons-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.chat-lessons-head .muted-link { color: var(--ink-soft); font-weight: 700; font-size: 13px; text-decoration: none; }
.chat-lessons-head h3 { margin: 8px 0 0; font-size: 16px; color: var(--ink); }
.chat-lessons-list { padding: 8px; }
.cl-module { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); padding: 14px 8px 6px; }
.cl-lesson { display: flex; align-items: center; gap: 9px; padding: 9px 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.cl-lesson:hover { background: var(--mint-wash); }
.cl-check { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--line-mint); display: grid; place-items: center; color: #fff; }
.cl-lesson.done .cl-check { background: var(--deep); border-color: var(--deep); }
.cl-title { flex: 1; font-size: 14px; font-weight: 600; }
.cl-dur { font-size: 11px; color: var(--ink-soft); flex-shrink: 0; }

/* Coluna do chat */
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--card); }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.chat-h-title { font-weight: 800; color: var(--ink); font-family: 'Nunito', sans-serif; }
.chat-h-sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.chat-h-actions { display: flex; gap: 6px; }
.chat-icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 10px; color: var(--ink-soft); cursor: pointer; transition: all .15s ease; }
.chat-icon-btn:hover { background: var(--mint-wash); color: var(--deep); border-color: var(--line-mint); }

/* Participantes */
.members { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.member { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--course-color, var(--deep)); color: #fff; font-weight: 800; font-size: 12px; font-family: 'Nunito', sans-serif; border: 2px solid #fff; box-shadow: var(--shadow-sm); }
.member img { width: 100%; height: 100%; object-fit: cover; }

/* Feed */
.chat-feed {
    flex: 1; min-height: 0; overflow-y: auto; padding: 16px;
    background:
        radial-gradient(700px 280px at 100% 0, var(--mint-wash), transparent 60%),
        radial-gradient(600px 280px at 0 100%, var(--peach-wash), transparent 60%),
        var(--paper);
    display: flex; flex-direction: column; gap: 10px;
}
.chat-loading, .chat-empty { margin: auto; color: var(--ink-soft); font-weight: 600; font-size: 14px; text-align: center; }

.chat-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.chat-row.mine { justify-content: flex-end; }
.chat-row.theirs { justify-content: flex-start; }
.chat-av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; object-fit: cover; display: grid; place-items: center; background: var(--deep); color: #fff; font-size: 11px; font-weight: 800; font-family: 'Nunito', sans-serif; }
.chat-av-i { background: var(--course-color, var(--deep)); }

.chat-bubble { max-width: 78%; padding: 9px 13px; border-radius: 16px; box-shadow: 0 1px 1px rgba(40,70,58,.08); }
.chat-row.theirs .chat-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.chat-row.mine .chat-bubble { background: var(--mint-light); border-bottom-right-radius: 5px; }
.chat-name { font-size: 12px; font-weight: 800; color: var(--course-color, var(--deep)); margin-bottom: 2px; }
.chat-text { color: var(--ink); line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-time { font-size: 10px; color: var(--ink-soft); text-align: right; margin-top: 3px; opacity: .8; }

.chat-form { display: flex; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--line); background: #fff; }
.chat-form input { flex: 1; padding: 11px 15px; border: 1.5px solid var(--line-mint); border-radius: 999px; font: inherit; font-size: 15px; background: #fff; color: var(--ink); }
.chat-form input:focus { outline: none; border-color: var(--deep); box-shadow: 0 0 0 3px var(--mint-wash); }
.chat-form .btn { border-radius: 999px; }

@media (max-width: 640px) {
    .chat-panel { width: 100vw; }
    .chat-panel.fullscreen .chat-lessons { display: none; }
    .chat-bubble-label { display: none; }
    .chat-bubble-btn { padding: 14px; }
}
