:root{
  --green:#123f35;--green-dark:#0a3029;--green2:#16624f;--mint:#eafbf4;--mint2:#d7f7ea;
  --gold:#ffbc24;--gold2:#ffd66d;--ink:#102a2a;--muted:#71807d;--line:#dce7e4;
  --bg:#f3f7f5;--danger:#d74444;--blue:#2875e7;--shadow:0 10px 30px rgba(12,49,40,.10)
}
*{box-sizing:border-box}html,body{margin:0;font-family:Inter,"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--bg)}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}.muted{color:var(--muted)}.text-danger{color:var(--danger);font-weight:800}.empty-cell{text-align:center!important;color:var(--muted);padding:28px!important}.flash{padding:12px 14px;border-radius:12px;margin:10px 0}.flash-error{background:#fff1f1;color:#9d2828;border:1px solid #ffc5c5}.flash-success{background:#ecfff6;color:#126b49;border:1px solid #b7efd7}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid #d3dfdc;background:#fff;border-radius:11px;padding:10px 14px;cursor:pointer;font-weight:700}.btn:hover{border-color:#9fc0b8}.btn-primary{background:linear-gradient(180deg,#ffca50,var(--gold));border-color:#e7a500;font-weight:900}.btn-block{width:100%}.danger-link{color:#c63e3e!important}

/* AUTH */
.auth-page{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 20% 10%,#1d6d59 0,#0b4035 38%,#062720 100%);padding:25px}.auth-card{width:min(440px,100%);background:#fff;border-radius:24px;padding:30px;box-shadow:0 24px 70px #001c1740}.auth-wide{width:min(680px,100%)}.auth-brand{display:flex;flex-direction:column;gap:6px;color:var(--green);font-size:20px}.auth-brand small{font-size:13px;color:#6d7d79}.auth-card h1{margin:24px 0 14px}.form-grid{display:grid;gap:16px}.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid label{display:grid;gap:7px;font-weight:750}.form-grid label small{font-weight:400;color:var(--muted)}.form-grid input,.form-grid select,.form-grid textarea,.filter-bar input,.filter-bar select{width:100%;border:1px solid #cfdad7;border-radius:10px;padding:11px 12px;background:#fff;outline:none}.form-grid textarea{min-height:110px;resize:vertical}.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus{border-color:var(--green2);box-shadow:0 0 0 3px #0f5b4816}.full{grid-column:1/-1}.auth-foot{text-align:center;color:var(--muted)}.auth-foot a{color:var(--green2);font-weight:900}.check-line{display:flex!important;align-items:center;gap:9px}.check-line input{width:auto}

/* CHAT SHELL */
.chat-page{background:#eef3f1;padding:10px;min-height:100vh}.app-shell{height:calc(100vh - 20px);background:#fff;border:4px solid var(--green);border-radius:24px;overflow:hidden;box-shadow:var(--shadow);display:grid;grid-template-rows:78px 1fr}.chat-topbar{background:linear-gradient(105deg,#123f35,#082e27);color:#fff;padding:0 18px;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand-wrap,.header-tools,.tutor-head,.tutor-actions{display:flex;align-items:center}.brand-wrap{gap:11px;min-width:0}.brand-copy{min-width:0}.brand-wrap strong{font-size:19px;white-space:nowrap}.brand-wrap small{display:block;color:#ffd85d;font-weight:750;margin-top:4px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:520px}.brand-mark{font-size:28px}.icon-btn{border:1px solid #ccd8d5;background:#f7faf9;border-radius:12px;min-width:42px;width:42px;height:42px;display:grid;place-items:center;cursor:pointer}.menu-btn{background:linear-gradient(180deg,#ffd65f,var(--gold));border-color:#ffc23e;font-size:21px}.logout-btn{background:#ffffff12;border-color:#ffffff25;color:#fff}.header-tools{gap:8px;white-space:nowrap}.soft-btn{border:1px solid #9ebdb5;background:#ffffff11;color:inherit;padding:9px 12px;border-radius:11px;font-weight:850;cursor:pointer}.header-tools .soft-btn{color:white}.access-pill{background:#ffffff10;border:1px solid #ffffff20;border-radius:999px;padding:8px 11px;color:#ffe27b;font-weight:800;font-size:12px}.user-chip{padding:8px 11px;background:#ffffff0d;border-radius:999px;font-size:12px}.chat-body{display:grid;grid-template-columns:260px 1fr;min-height:0}

/* CHAT SIDEBAR */
.topic-sidebar{background:linear-gradient(180deg,#0e493c,#0a332c);color:#fff;border-right:1px solid #244b42;min-height:0;overflow:auto}.side-title{height:58px;padding:10px 14px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #ffffff1b;background:#ffffff05}.side-title>span{font-size:20px}.side-title b{display:block;font-size:12px;letter-spacing:.02em}.side-title small{display:block;color:#b9d6cf;font-size:10px;margin-top:2px}.topic-list{padding:7px 8px 16px}.topic-item{width:100%;height:40px;border:1px solid #ffffff17;background:#ffffff04;color:#fff;display:grid;grid-template-columns:24px 24px 1fr 14px;gap:3px;align-items:center;text-align:left;padding:0 9px;border-radius:10px;margin:3px 0;cursor:pointer;transition:.15s}.topic-item:hover{background:#ffffff0c}.topic-item .topic-icon{text-align:center}.topic-item .topic-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}.topic-item b{font-size:12px}.topic-item i{font-style:normal;color:#a9c7c0}.topic-item.active{background:linear-gradient(90deg,#ffd86f,var(--gold));color:#172a25;border-color:#ffc126;box-shadow:0 4px 12px #00150f22}.topic-item.active i{color:#173c33}

/* CHAT MAIN */
.chat-main{min-width:0;min-height:0;display:grid;grid-template-rows:auto minmax(140px,1fr) auto auto auto auto auto;background:#fbfcfc}.tutor-head{padding:11px 20px;border-bottom:1px solid #e2ebe8;gap:11px;background:#fff}.tutor-avatar,.mini-avatar{display:grid;place-items:center;background:#e5fff5;border:1px solid #8ee9c5;border-radius:50%}.tutor-avatar{width:56px;height:56px;font-size:28px;flex:0 0 auto}.mini-avatar{width:40px;height:40px;font-size:20px;flex:0 0 auto}.mini-avatar.student{background:#edf3ff;border-color:#bfd0f5}.eyebrow,.msg-label{font-family:Consolas,monospace;color:#72827f;font-size:10px;font-weight:850;letter-spacing:.04em}.tutor-copy{min-width:0}.tutor-head h2{margin:4px 0 2px;font-size:16px}.tutor-head h2 span{font-weight:800}.tutor-head p{margin:0;color:#14905f;font-weight:750;font-size:12px}.tutor-actions{margin-left:auto;gap:7px}.tutor-actions .soft-btn{font-size:12px;padding:8px 11px;color:#1d4cb3;background:#f7fbff;border-color:#9cc3ff}.tutor-actions .green{color:#08794f;background:#effff7;border-color:#79e4ba}.tutor-actions .blue{color:#0870b8;background:#eff9ff;border-color:#7bc9f4}
.messages{padding:14px 22px;overflow:auto;background:linear-gradient(180deg,#fff,var(--chat-bg,#fbfcfc))}.ai-row,.user-row{display:flex;gap:10px;align-items:flex-start;margin:0 0 14px}.user-row{justify-content:flex-end}.bubble-wrap{max-width:calc(100% - 50px);width:100%}.bubble{border-radius:18px;padding:13px 17px;line-height:1.55;font-size:14px}.ai-bubble{border:1.5px solid var(--ai-border,#17483e);background:#fff;box-shadow:0 3px 10px #0f362d0b}.ai-bubble mark{background:#ffe293;padding:2px 6px;border-radius:5px;font-weight:900}.user-bubble{max-width:78%;background:var(--user-bg,#eaf2ff);border:1px solid #c3d8fb}.msg-label{margin:0 0 5px 3px}.source-badge{display:inline-flex;align-items:center;gap:5px;margin:6px 0 0 5px;padding:4px 8px;border-radius:999px;font-size:10px;font-weight:800;border:1px solid #dbe5e2;color:#60706d;background:#f8faf9}.source-knowledge{color:#0a7049;background:#ebfff6;border-color:#a7e5c8}.source-ai{color:#54677d;background:#f3f7fb;border-color:#d5e1ef}.source-system{color:#725500;background:#fff9df;border-color:#eed477}

/* COMPACT CONTEXT + COACH */
.context-bar{display:flex;align-items:center;gap:8px;padding:7px 14px;border-top:1px solid #e4ece9;background:#fff;overflow-x:auto}.context-pill{height:34px;display:flex;align-items:center;gap:7px;border:1px solid #e0d397;background:#fff9e7;border-radius:10px;padding:0 11px;white-space:nowrap;font-size:12px}.mode-pill{flex:1;min-width:230px}.level-pill{background:#ecfff7;border-color:#9ee8ca}.level-pill select{border:0;background:transparent;font-weight:900;color:var(--ink);outline:none;max-width:120px}.topic-pill{flex:1;background:#fff7e9;border-color:#f2cf8a;min-width:180px}.coach-tools{display:flex;gap:6px;align-items:center;padding:6px 14px;border-top:1px solid #edf2f0;background:#fafcfb;overflow-x:auto}.coach-label{white-space:nowrap;font-weight:900;font-size:11px;color:#455c56;margin-right:2px}.coach-tools button{height:32px;white-space:nowrap;border:1px solid #d7e0de;background:#fff;border-radius:999px;padding:0 10px;cursor:pointer;font-size:11px;font-weight:750;box-shadow:0 1px 3px #00000008}.coach-tools button:hover{border-color:#9dbab2;background:#f8fbfa}.coach-tools button.ok{background:#effff6;border-color:#9bdfb8;color:#0c7d45}.coach-tools button.warn{background:#fff4f4;border-color:#efbbbb;color:#b23838}

/* IMAGE + COMPOSER */
.feature-disabled{opacity:.42;filter:grayscale(.7);cursor:not-allowed!important}.image-preview{margin:5px 14px 0;padding:7px 9px;border:1px solid #9ddfc4;background:#effff8;border-radius:12px;display:grid;grid-template-columns:56px 1fr 38px;gap:9px;align-items:center}.image-preview[hidden]{display:none}.image-preview img{width:56px;height:46px;object-fit:cover;border-radius:8px;border:1px solid #b5d8ca}.image-preview b,.image-preview small{display:block}.image-preview b{font-size:12px}.image-preview small{color:var(--muted);margin-top:2px;font-size:10px}.chat-image{display:block;max-width:min(420px,100%);max-height:270px;object-fit:contain;border-radius:12px;margin-bottom:8px;border:1px solid #c7d7ef;background:#fff}.composer{display:grid;grid-template-columns:42px 42px 42px 1fr auto;gap:7px;padding:8px 14px;border-top:1px solid #dfe8e5;background:#fff}.icon-btn.yellow{background:#fff5cd;border-color:#ffc531}.icon-btn.mint{background:#e8fff6;border-color:#6fe0b6}.composer textarea{resize:none;min-height:42px;max-height:96px;border:1px solid #ccd7d4;border-radius:13px;padding:10px 13px;outline:none;background:#f9fbfb;font-size:13px}.composer textarea:focus{border-color:#6bb9a3;box-shadow:0 0 0 3px #0f5b4810}.send-btn{border:0;background:linear-gradient(180deg,#ffcb50,#ffb918);border-radius:13px;padding:0 20px;font-weight:900;cursor:pointer;color:#22342f}.footer-tip{text-align:center;margin:0 14px 8px;padding:5px 10px;background:#effcf7;border:1px solid #a8e4cb;border-radius:9px;font-size:9.5px;font-weight:800;color:#37675a}.typing i{display:inline-block;width:7px;height:7px;background:#86a49c;border-radius:50%;margin:0 3px;animation:blink 1s infinite}.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}@keyframes blink{50%{opacity:.2;transform:translateY(-3px)}}.busy .send-btn{opacity:.5;pointer-events:none}

/* ADMIN */
.admin-body{background:#f2f6f4}.admin-topbar{height:66px;background:linear-gradient(100deg,#113f35,#0a3029);color:white;display:flex;align-items:center;justify-content:space-between;padding:0 22px;box-shadow:0 3px 10px #07291f1a}.admin-brand{display:flex;align-items:center;gap:8px}.admin-brand span{color:#abc6bf}.top-actions{display:flex;gap:14px;align-items:center}.top-actions a{color:#ffe071;font-weight:800}.admin-shell{display:grid;grid-template-columns:230px 1fr;min-height:calc(100vh - 66px)}.admin-sidebar{background:#0c352d;color:white;padding:16px 10px}.admin-sidebar a{display:block;padding:11px 13px;border-radius:9px;margin-bottom:4px;font-size:13px}.admin-sidebar a:hover{background:#ffffff12}.admin-main{padding:24px;min-width:0}.admin-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.admin-title h1{margin:0 0 5px;font-size:26px}.admin-title p{margin:0;color:var(--muted)}.stats-grid{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:12px}.stats-grid-six{grid-template-columns:repeat(6,minmax(130px,1fr))}.stat-card,.panel{background:white;border:1px solid #dee8e5;border-radius:15px;box-shadow:0 5px 18px #18382f0a}.stat-card{display:flex;gap:12px;align-items:center;padding:16px}.stat-card>span{font-size:25px}.stat-card b{display:block;font-size:25px}.stat-card small{color:var(--muted)}.panel{padding:18px;margin-top:16px}.panel h2{margin-top:0}.info-panel{border-left:4px solid #48ad83}.filter-bar{display:flex;gap:8px;margin:12px 0}.filter-wrap{flex-wrap:wrap}.filter-bar input{max-width:380px}.filter-bar select{width:auto;min-width:150px}.table-wrap{overflow:auto;background:#fff;border:1px solid #dee8e5;border-radius:13px;box-shadow:0 3px 12px #18382f08}.data-table{width:100%;border-collapse:collapse;min-width:980px}.data-table th,.data-table td{text-align:left;padding:11px;border-bottom:1px solid #edf1f0;vertical-align:top;font-size:13px}.data-table th{background:#f7faf9;font-size:12px;color:#4b625c}.data-table td small{display:block;color:var(--muted);margin-top:3px;line-height:1.35}.data-table tr:hover td{background:#fcfefd}.badge{display:inline-block;border-radius:999px;background:#edf3f1;padding:4px 8px;font-size:11px;font-weight:850}.scope-all{background:#eef8ff;color:#28608f}.status-active{background:#e9fff3;color:#087341}.status-locked{background:#fff0f0;color:#b83232}.status-pending{background:#fff8dd;color:#8f6c00}.actions{white-space:nowrap}.actions a,.actions button{border:0;background:none;color:#0f6f56;cursor:pointer;font-weight:850;margin-right:7px;padding:2px 0}.actions form{display:inline}.pagination{display:flex;gap:5px;margin-top:12px;flex-wrap:wrap}.pagination a{min-width:32px;height:32px;display:grid;place-items:center;background:#fff;border:1px solid #dae4e1;border-radius:8px;font-size:12px}.pagination a.active{background:var(--green);color:white;border-color:var(--green)}.permission-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:10px}.perm-card{display:flex!important;align-items:center;gap:10px;border:1px solid #dce5e2;border-radius:12px;padding:12px}.perm-card input{width:auto}.perm-card small{display:block}.api-note{border:1px solid #f0d27b;background:#fff9e6;border-radius:12px;padding:12px;color:#725300}.plan-chip{display:inline-block;padding:5px 9px;border-radius:999px;background:#fff3c6;color:#745400;font-weight:800}

@media(max-width:1200px){.access-pill:nth-of-type(2){display:none}.stats-grid-six{grid-template-columns:repeat(3,1fr)}}
@media(max-width:1050px){.chat-body{grid-template-columns:1fr}.topic-sidebar{position:fixed;z-index:20;top:88px;bottom:10px;left:10px;width:270px;transform:translateX(-290px);transition:.2s;border-radius:0 16px 16px 0;box-shadow:0 16px 35px #001c1730}.topic-sidebar.open{transform:translateX(0)}.tutor-actions{display:none}.stats-grid{grid-template-columns:repeat(2,1fr)}.stats-grid-six{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.chat-page{padding:0}.app-shell{height:100vh;border:0;border-radius:0;grid-template-rows:68px 1fr}.chat-topbar{padding:0 9px}.brand-wrap small,.access-pill,.user-chip{display:none}.brand-wrap strong{font-size:15px}.brand-mark{display:none}.chat-main{grid-template-rows:auto minmax(120px,1fr) auto auto auto auto auto}.tutor-head{padding:8px 10px}.tutor-avatar{width:44px;height:44px;font-size:22px}.tutor-head h2{font-size:13px}.tutor-head p{font-size:10px}.messages{padding:10px}.bubble{padding:11px 12px;font-size:13px}.mini-avatar{width:34px;height:34px;font-size:17px}.bubble-wrap{max-width:calc(100% - 42px)}.context-bar{padding:5px 8px}.context-pill{height:31px;font-size:10px;padding:0 8px}.mode-pill{min-width:190px}.topic-pill{min-width:140px}.coach-tools{padding:5px 8px}.coach-tools button{height:30px;font-size:10px}.composer{grid-template-columns:38px 38px 38px minmax(90px,1fr) auto;padding:7px 8px}.icon-btn{min-width:38px;width:38px;height:38px}.send-btn{padding:0 11px}.send-btn span{display:none}.footer-tip{display:none}.image-preview{margin:4px 8px 0}.chat-image{max-height:220px}.two-col{grid-template-columns:1fr}.admin-shell{grid-template-columns:1fr}.admin-sidebar{display:flex;overflow:auto;white-space:nowrap;padding:8px}.admin-sidebar a{margin:0 3px}.admin-main{padding:13px}.admin-topbar{padding:0 10px}.top-actions span{display:none}.stats-grid,.stats-grid-six{grid-template-columns:1fr 1fr}.permission-grid{grid-template-columns:1fr}.admin-title{align-items:flex-start;gap:10px}.admin-title .btn{white-space:nowrap}.filter-bar{flex-wrap:wrap}.filter-bar input,.filter-bar select{max-width:none;width:100%}}


/* V1.3 BRANDING + BEAUTIFUL TUTOR ANSWERS */
.brand-logo{width:46px;height:46px;object-fit:contain;border-radius:12px;background:#fff;padding:4px;box-shadow:0 2px 10px #0002}.home-btn{background:linear-gradient(180deg,var(--gold2),var(--gold))!important;color:#20352f!important;border-color:#f2ad0d!important}.admin-logo{width:36px;height:36px;object-fit:contain;border-radius:9px;background:#fff;padding:3px}.admin-logo-fallback{font-size:22px!important}.brand-preview{display:flex;align-items:center;gap:12px;border:1px solid #dce7e4;border-radius:14px;padding:12px;background:#fafcfb}.brand-preview img,.brand-preview-fallback{width:58px;height:58px;object-fit:contain;border-radius:12px;background:#fff;border:1px solid #dce7e4;display:grid;place-items:center;font-size:30px}.brand-preview b,.brand-preview small{display:block}.brand-preview small{margin-top:5px;color:var(--muted)}.color-field input[type=color]{height:48px;padding:4px;cursor:pointer}.theme-demo{border:1px dashed #bdcbc7;border-radius:14px;padding:14px;background:var(--chat-bg,#fbfcfc)}.theme-demo-head{background:linear-gradient(100deg,var(--green),var(--green-dark));color:#fff;padding:9px 12px;border-radius:9px;font-weight:900;margin-bottom:10px}.theme-demo-bubble{border:2px solid var(--ai-border,#17483e);background:#fff;border-radius:14px;padding:12px;display:grid;gap:5px}.theme-demo-bubble b{color:#6d5200}.theme-demo-bubble span{color:#50625d}

.tutor-answer{display:grid;gap:9px;color:#18332f}.tutor-answer>p{margin:0;line-height:1.7}.tutor-welcome{display:grid;gap:6px}.tutor-welcome>b{font-size:15px;color:var(--green)}.tutor-welcome span{display:block}.tutor-subtitle{margin:4px 0 0;padding:8px 11px;border-radius:10px;background:#edf7ff;border-left:4px solid #4d99e8;font-weight:900;color:#194f7a}.tutor-section{border-radius:13px;padding:11px 13px;border:1px solid #dce7e4;background:#f9fbfa}.tutor-section-title{display:flex;align-items:center;gap:7px;margin-bottom:6px}.tutor-section-title b{font-size:13px}.tutor-section p{margin:4px 0;line-height:1.65}.tutor-section.task{background:#edf7ff;border-color:#c6e1f7}.tutor-section.task .tutor-section-title{color:#1a6497}.tutor-section.hint{background:#fff8dc;border-color:#edd27a}.tutor-section.hint .tutor-section-title{color:#7c5c00}.tutor-section.tip{background:#fff3d2;border-color:#f3cf6e}.tutor-section.tip .tutor-section-title{color:#7a5700}.tutor-section.note{background:#fff0e7;border-color:#f0c1a4}.tutor-section.note .tutor-section-title{color:#9b4e1d}.tutor-section.example{background:#f4efff;border-color:#d7c7f5}.tutor-section.example .tutor-section-title{color:#6541a2}.tutor-section.practice{background:#eafff2;border-color:#b8e4c8}.tutor-section.practice .tutor-section-title{color:#087747}.tutor-section.question{background:#fff0f2;border-color:#f0bdc5}.tutor-section.question .tutor-section-title{color:#a33345}.tutor-list{margin:6px 0 2px;padding:0;list-style:none;display:grid;gap:6px}.tutor-list li{position:relative;padding-left:20px;line-height:1.6}.tutor-list li:before{content:'✓';position:absolute;left:0;top:0;color:#14a068;font-weight:900}.tutor-keyword{display:inline-block;background:#ffe596;border-radius:6px;padding:1px 5px;font-weight:850;color:#493800}.phonetic{display:inline-block;background:#eaf4ff;border:1px solid #c7dcf4;color:#15588b;border-radius:6px;padding:1px 5px;font-family:Georgia,serif;font-weight:800}.message-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:5px}.message-meta .source-badge{margin:0 0 0 5px}.msg-tool{border:1px solid #cfded9;background:#fff;border-radius:999px;padding:4px 9px;font-size:10px;font-weight:850;color:#27574b;cursor:pointer}.msg-tool:hover{background:#eff9f5;border-color:#a8cfc2}

@media(max-width:720px){.brand-logo{width:40px;height:40px}.home-btn{padding:8px!important;font-size:0}.home-btn:before{content:'🏠';font-size:16px}.tutor-section{padding:9px 10px}.tutor-answer{gap:7px}.tutor-subtitle{font-size:12px}}

.brand-title-row{display:flex;align-items:center;gap:8px;min-width:0}.header-badge{display:inline-flex;align-items:center;height:20px;padding:0 7px;border-radius:999px;background:var(--gold);color:#24342f;font-size:9px;font-weight:900;white-space:nowrap}.brand-title-row strong{min-width:0;overflow:hidden;text-overflow:ellipsis}.admin-brand{min-width:0}.admin-brand strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:720px){.header-badge{display:none}}


/* V1.4 - STUDENT/TEACHER REGISTRATION + FORUM */
.forum-header-btn{background:#ffffff12!important;border-color:#ffffff36!important;color:#fff!important}.forum-header-btn:hover{background:var(--gold)!important;color:#20352f!important;border-color:var(--gold)!important}
.account-type-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.account-type-card{display:grid!important;grid-template-columns:22px 46px 1fr;align-items:center;gap:9px;padding:13px;border:1px solid #d6e1de;border-radius:14px;background:#fafcfb;cursor:pointer}.account-type-card:has(input:checked){border-color:#e8af1e;background:#fff8df;box-shadow:0 0 0 3px #ffbc241c}.account-type-card input{width:auto!important}.account-type-card .account-icon{font-size:30px}.account-type-card b,.account-type-card small{display:block}.account-type-card small{margin-top:4px;font-weight:500;color:var(--muted);line-height:1.35}.teacher-intro-field textarea{min-height:82px}
.forum-page{min-height:100vh;background:#f2f6f4;color:var(--ink)}.forum-topbar{min-height:72px;background:linear-gradient(105deg,var(--green),var(--green-dark));color:#fff;padding:9px 22px;display:flex;align-items:center;justify-content:space-between;gap:18px;position:sticky;top:0;z-index:30;box-shadow:0 4px 16px #092d241f}.forum-brand-link{display:flex;align-items:center;gap:10px}.forum-brand img,.forum-logo-fallback{width:46px;height:46px;border-radius:12px;background:#fff;object-fit:contain;padding:4px;display:grid;place-items:center;font-size:25px}.forum-brand strong{display:block;font-size:16px}.forum-brand small{display:block;color:#ffd969;font-size:10px;font-weight:800;margin-top:3px}.forum-top-actions{display:flex;align-items:center;gap:7px;white-space:nowrap}.forum-top-actions>a{padding:9px 10px;border:1px solid #ffffff1f;border-radius:10px;font-size:11px;font-weight:850;color:#fff}.forum-top-actions>a:hover,.forum-top-actions>a.active{background:#ffffff13;border-color:#ffffff3c}.forum-user-chip{padding:9px 11px;border-radius:999px;background:#ffffff0d;color:#e8fff8;font-size:11px;font-weight:800}.forum-container{width:min(1320px,calc(100% - 28px));margin:18px auto 36px}.forum-hero{border-radius:20px;padding:24px 26px;background:linear-gradient(115deg,#0d4438,#176a56);color:#fff;display:flex;justify-content:space-between;align-items:center;gap:20px;box-shadow:0 12px 28px #123f3520;overflow:hidden;position:relative}.forum-hero:after{content:'💬';position:absolute;right:30%;top:-35px;font-size:130px;opacity:.055;transform:rotate(-12deg)}.forum-kicker{display:inline-block;color:#ffe070;font-size:10px;font-weight:950;letter-spacing:.08em}.forum-hero h1,.forum-form-head h1{margin:7px 0 7px;font-size:28px}.forum-hero p,.forum-form-head p{margin:0;max-width:760px;line-height:1.55;color:#d8ebe5;font-size:13px}.forum-hero-actions{display:flex;gap:8px;z-index:1}.forum-toolbar-card,.forum-list-card,.forum-editor-card,.forum-reply-box{background:#fff;border:1px solid #dbe6e3;border-radius:16px;box-shadow:0 6px 20px #163f3509}.forum-toolbar-card{margin-top:14px;padding:13px}.forum-filter{display:grid;grid-template-columns:minmax(260px,1fr) 210px 170px auto auto;gap:8px}.forum-filter input,.forum-filter select,.forum-editor-card input,.forum-editor-card select,.forum-editor-card textarea,.forum-reply-box textarea{width:100%;border:1px solid #cfdcd8;border-radius:10px;padding:10px 11px;background:#fff;outline:none}.forum-filter input:focus,.forum-filter select:focus,.forum-editor-card input:focus,.forum-editor-card select:focus,.forum-editor-card textarea:focus,.forum-reply-box textarea:focus{border-color:#2d8a6e;box-shadow:0 0 0 3px #2d8a6e12}.forum-category-strip{display:flex;gap:6px;overflow:auto;padding-top:10px}.forum-category-strip a{white-space:nowrap;border:1px solid #dce5e3;border-radius:999px;padding:7px 10px;font-size:10px;font-weight:800;background:#fafcfb}.forum-category-strip a.active{background:#fff3c7;border-color:#e8b533;color:#5b4700}.forum-list-card{margin-top:14px;overflow:hidden}.forum-list-head{display:flex;align-items:center;justify-content:space-between;padding:13px 16px;background:#f8fbfa;border-bottom:1px solid #e4ecea}.forum-list-head b,.forum-list-head small{display:block}.forum-list-head small{font-size:10px;color:var(--muted);margin-top:2px}.forum-mini-note{font-size:10px;color:#47605a;background:#fff;border:1px solid #dce5e3;padding:6px 9px;border-radius:999px}.forum-topic-row{display:grid;grid-template-columns:48px 1fr auto;gap:13px;padding:15px 16px;border-bottom:1px solid #edf2f0;align-items:center}.forum-topic-row:last-child{border-bottom:0}.forum-topic-row:hover{background:#fcfefd}.forum-topic-row.pinned{background:linear-gradient(90deg,#fffaf0,#fff)}.forum-topic-icon{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;font-size:21px;background:#edf7ff;border:1px solid #cfe4f5}.forum-topic-icon.lesson{background:#ebfff3;border-color:#b7e8c9}.forum-topic-icon.question{background:#fff5d7;border-color:#ecd078}.forum-topic-icon.discussion{background:#f4efff;border-color:#d8caf2}.forum-topic-main{min-width:0}.forum-topic-main h2{font-size:15px;margin:5px 0}.forum-topic-main h2 a:hover{color:#0b7757}.forum-topic-main p{margin:0;color:#64736f;font-size:11px;line-height:1.5}.forum-topic-badges{display:flex;gap:5px;flex-wrap:wrap}.mini-badge{display:inline-flex;align-items:center;height:22px;border-radius:999px;padding:0 7px;font-size:9px;font-weight:900;border:1px solid #dce5e2;background:#f8faf9}.mini-badge.pin{background:#fff2c9;border-color:#eccc61;color:#705400}.mini-badge.solved{background:#e8fff2;border-color:#afe0c2;color:#087342}.mini-badge.category{background:#eef7ff;border-color:#c9dff1;color:#2c607e}.mini-badge.locked{background:#f3f3f3;color:#666}.type-lesson{background:#eafff2!important;color:#0b7746!important;border-color:#b8e0c8!important}.type-question{background:#fff7d9!important;color:#765a00!important;border-color:#ecd57f!important}.type-discussion{background:#f4efff!important;color:#6744a1!important;border-color:#d8caf3!important}.forum-topic-meta{display:flex;gap:12px;flex-wrap:wrap;margin-top:7px;color:#7b8985;font-size:9px}.forum-topic-meta b{color:#3f5550}.forum-row-actions{display:grid;gap:6px;justify-items:end}.forum-row-actions form{margin:0}.forum-delete-btn{border:0;background:#fff0f0;color:#b53535;border-radius:9px;padding:7px 9px;font-size:10px;font-weight:850;cursor:pointer}.forum-delete-btn:hover{background:#ffe2e2}.forum-empty{padding:28px;text-align:center;color:#768580;background:#fbfdfc;border-radius:12px}.forum-pagination{justify-content:center;margin:14px 0}.forum-form-shell{max-width:980px;margin:0 auto}.forum-form-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin:8px 0 14px}.forum-form-head p{color:#667b75}.forum-editor-card{padding:18px}.forum-editor-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.forum-editor-grid label{display:grid;gap:6px;font-size:12px;font-weight:850}.forum-editor-grid label small{font-weight:500;color:var(--muted)}.forum-editor-card textarea{resize:vertical;min-height:210px;line-height:1.55}.forum-editor-tip{margin:14px 0;padding:11px 12px;border-radius:11px;background:#fff8dc;border:1px solid #ecd47e;color:#6b550b;font-size:11px}.forum-submit{min-width:220px}.forum-breadcrumb{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-bottom:12px;color:#647a74;font-size:11px}.forum-breadcrumb a{font-weight:850;color:#167458}.forum-thread-card{display:grid;grid-template-columns:160px 1fr;background:#fff;border:1px solid #dbe6e3;border-radius:16px;overflow:hidden;margin-bottom:12px;box-shadow:0 5px 18px #173f3508}.forum-thread-side{padding:16px 12px;background:#f7faf9;border-right:1px solid #e4ecea;text-align:center}.forum-author-avatar{width:58px;height:58px;border-radius:50%;display:grid;place-items:center;margin:0 auto 8px;background:#e9fff4;border:1px solid #b4e4cc;font-size:27px}.forum-thread-side>b,.forum-thread-side>small{display:block}.forum-thread-side>b{font-size:12px}.forum-thread-side>small{font-size:9px;color:#75837f;line-height:1.4;margin-top:7px}.role-badge,.teacher-answer-badge{display:inline-flex;margin-top:6px;border-radius:999px;padding:4px 7px;font-size:8px;font-weight:900}.role-badge.teacher,.teacher-answer-badge{background:#fff2bd;color:#6c5100;border:1px solid #e7c65d}.role-badge.student{background:#eef7ff;color:#32627b;border:1px solid #cce0ef}.forum-thread-content{padding:18px 20px;min-width:0}.forum-thread-content h1{font-size:22px;margin:7px 0 5px;line-height:1.3}.forum-post-time{font-size:9px;color:#81908b}.forum-post-body{font-size:13px;line-height:1.8;margin-top:16px;color:#203c35;overflow-wrap:anywhere}.forum-link{color:#187aaf;text-decoration:underline}.forum-attachment{display:flex;align-items:center;gap:10px;margin-top:15px;padding:10px 12px;border:1px solid #d8e5e1;border-radius:11px;background:#f8fbfa;max-width:520px}.forum-attachment>span{flex:1;min-width:0}.forum-attachment b,.forum-attachment small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.forum-attachment small{color:#7e8d88;font-size:9px;margin-top:2px}.forum-attachment strong{font-size:9px;color:#167458}.forum-post-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-top:15px}.forum-post-actions form{margin:0}.forum-replies-section{margin-top:18px}.forum-section-title{display:flex;align-items:center;justify-content:space-between;margin:0 0 10px}.forum-section-title h2{font-size:18px;margin:0}.forum-reply.accepted{border:2px solid #72c996;box-shadow:0 8px 24px #1a805315}.accepted-banner{display:inline-block;background:#eafff2;border:1px solid #9dd9b5;color:#087343;padding:6px 9px;border-radius:8px;font-size:9px;font-weight:950;margin-bottom:8px}.forum-reply-box{padding:17px;margin-top:18px}.forum-reply-box h2{margin:0 0 10px;font-size:17px}.forum-reply-box textarea{resize:vertical;min-height:130px}.forum-reply-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:9px}.forum-reply-tools label{font-size:10px;font-weight:800;color:#5d726c}.forum-reply-tools input{display:block;margin-top:5px}.forum-locked-note{background:#f3f4f4;border:1px solid #d9dede;border-radius:10px;padding:13px;color:#606866}.forum-footer{width:min(1320px,calc(100% - 28px));margin:0 auto 22px;padding:13px 16px;border-top:1px solid #d7e3df;display:flex;justify-content:space-between;color:#6e807a;font-size:10px}.forum-footer a{font-weight:900;color:#0e7153}.forum-admin-tabs{display:flex;gap:7px}.forum-admin-tabs a{padding:8px 12px;border-radius:9px;background:#f3f7f5;border:1px solid #dde6e3;font-size:11px;font-weight:850}.forum-admin-tabs a.active{background:var(--green);color:#fff;border-color:var(--green)}.forum-admin-table a{color:#0d6c52}.stats-grid-six:has(.stat-card:nth-child(7)){grid-template-columns:repeat(7,minmax(120px,1fr))}
@media(max-width:1100px){.forum-filter{grid-template-columns:1fr 1fr 1fr}.forum-filter .btn{width:100%}.forum-top-actions .forum-user-chip{display:none}.stats-grid-six:has(.stat-card:nth-child(7)){grid-template-columns:repeat(4,1fr)}}
@media(max-width:760px){.account-type-grid{grid-template-columns:1fr}.forum-topbar{padding:8px 10px}.forum-brand small,.forum-top-actions>a:nth-child(3),.forum-top-actions>a:nth-child(4){display:none}.forum-brand strong{font-size:13px}.forum-brand img,.forum-logo-fallback{width:40px;height:40px}.forum-top-actions>a{padding:8px;font-size:9px}.forum-container{width:calc(100% - 16px);margin-top:9px}.forum-hero{padding:17px;display:block}.forum-hero h1,.forum-form-head h1{font-size:21px}.forum-hero-actions{margin-top:13px}.forum-filter{grid-template-columns:1fr}.forum-topic-row{grid-template-columns:38px 1fr;padding:12px 10px}.forum-topic-icon{width:36px;height:36px}.forum-row-actions{grid-column:2;display:flex;justify-items:start}.forum-thread-card{grid-template-columns:1fr}.forum-thread-side{border-right:0;border-bottom:1px solid #e4ecea;display:flex;align-items:center;text-align:left;gap:8px;padding:10px}.forum-author-avatar{width:40px;height:40px;margin:0;font-size:20px}.forum-thread-side>small{display:none}.forum-thread-content{padding:14px}.forum-thread-content h1{font-size:18px}.forum-form-head{display:block}.forum-form-head>.btn,.forum-form-head>div:last-child{margin-top:10px}.forum-editor-grid{grid-template-columns:1fr}.forum-reply-tools{align-items:flex-end}.forum-footer{width:calc(100% - 16px);display:block}.forum-footer a{display:block;margin-top:5px}.forum-mini-note{display:none}.stats-grid-six:has(.stat-card:nth-child(7)){grid-template-columns:1fr 1fr}}
/* V1.6 - Kho sách */
.admin-book-summary{margin:10px 0 12px;font-size:13px;color:#557067}.admin-book-summary b{font-size:20px;color:var(--green)}.admin-books-table .admin-book-cover{width:58px;height:78px;object-fit:cover;border-radius:8px;border:1px solid #d6e4df;box-shadow:0 4px 10px #143d3020}.admin-book-cover.fallback{display:grid;place-items:center;background:#e9f5f0;font-size:27px}.book-cover-preview-wrap{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px;border:1px dashed #b9d7cb;border-radius:14px;background:#f6fbf9}.book-cover-preview-wrap b,.book-cover-preview-wrap small{display:block}.book-cover-preview-wrap small{margin-top:5px;color:#6c8179}.book-cover-preview{width:130px;aspect-ratio:3/4;border-radius:10px;overflow:hidden;background:linear-gradient(145deg,#e8f4ef,#d9eae3);display:grid;place-items:center;font-size:38px;border:1px solid #d3e2dc;flex:0 0 auto}.book-cover-preview img{width:100%;height:100%;object-fit:cover}.library-header-btn{background:#eaf8f3!important;border-color:#a7dac6!important;color:#0b7052!important}

/* V1.7 - Footer 4 cột + hỗ trợ online */
.site-footer-pro{margin-top:28px;background:linear-gradient(135deg,#0b372f,#124d41);color:#eaf8f3;border-top:4px solid var(--gold);font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif}.site-footer-grid{width:min(1460px,calc(100% - 36px));margin:auto;display:grid;grid-template-columns:1.25fr 1fr 1fr 1fr;gap:30px;padding:34px 0 28px}.site-footer-col h3{margin:0 0 14px;font-size:16px;color:#fff;letter-spacing:.01em}.site-footer-col a,.site-footer-col p{display:block;margin:0 0 9px;color:#cde5dc;font-size:13px;line-height:1.55;text-decoration:none}.site-footer-col a:hover{color:#ffd970;transform:translateX(2px)}.site-footer-bottom{border-top:1px solid #ffffff1c;width:min(1460px,calc(100% - 36px));margin:auto;padding:14px 0 18px;display:flex;justify-content:space-between;gap:18px;color:#a9ccc0;font-size:11px}.support-dock{position:fixed;z-index:120;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:9px;pointer-events:none}.support-dock-left{left:10px}.support-dock-right{right:10px}.support-dock a{pointer-events:auto;position:relative;width:48px;height:48px;border-radius:14px;display:grid;place-items:center;background:var(--support-color,#0f7055);color:#fff;text-decoration:none;box-shadow:0 9px 24px rgba(7,43,34,.18);border:2px solid #fff;transition:.18s}.support-dock a>span{font-size:20px;font-weight:950}.support-dock a>b{position:absolute;top:50%;transform:translateY(-50%);white-space:nowrap;background:#102e27;color:#fff;font-size:11px;padding:7px 9px;border-radius:8px;opacity:0;visibility:hidden;transition:.16s;box-shadow:0 6px 18px #0002}.support-dock-left a>b{left:56px}.support-dock-right a>b{right:56px}.support-dock a:hover{transform:translateY(-2px) scale(1.04)}.support-dock a:hover>b{opacity:1;visibility:visible}.support-config-grid{display:grid;grid-template-columns:70px 1fr 1.4fr 100px 120px 90px;gap:8px;align-items:end;padding:10px;border:1px solid #dde8e4;border-radius:12px;background:#fbfdfc}.support-config-grid label{font-size:11px}.support-config-grid input,.support-config-grid select{min-height:40px}.footer-config-area{min-height:120px;line-height:1.55}.settings-subnote{padding:11px 12px;border-radius:10px;background:#f5faf8;border:1px solid #dceae4;color:#587068;font-size:11px;line-height:1.6}
@media(max-width:900px){.site-footer-grid{grid-template-columns:1fr 1fr}.support-dock{top:auto;bottom:14px;transform:none;flex-direction:row}.support-dock-left{left:10px}.support-dock-right{right:10px}.support-dock a{width:44px;height:44px}.support-dock a>b{display:none}}
@media(max-width:560px){.site-footer-grid{grid-template-columns:1fr;gap:18px}.site-footer-bottom{display:block;line-height:1.7}.support-dock-right{display:none}.support-config-grid{grid-template-columns:1fr 1fr}}

/* =========================
   V1.8 - AI access gate + tutorial modal
   ========================= */
.modal-open{overflow:hidden}
.ai-access-modal,.tutorial-modal{position:fixed;inset:0;z-index:99999;display:none;align-items:center;justify-content:center;padding:20px}
.ai-access-modal.is-open,.tutorial-modal.is-open{display:flex}
.ai-access-backdrop,.tutorial-backdrop{position:absolute;inset:0;background:rgba(5,35,29,.68);backdrop-filter:blur(5px)}
.ai-access-dialog,.tutorial-dialog{position:relative;z-index:2;width:min(560px,96vw);background:#fff;border-radius:24px;border:1px solid #dbe9e4;box-shadow:0 26px 80px rgba(8,48,40,.28);padding:30px;text-align:center;font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif}
.ai-access-close,.tutorial-close{position:absolute;right:14px;top:12px;width:38px;height:38px;border:0;border-radius:50%;background:#f1f5f4;font-size:24px;cursor:pointer;color:#173f36}
.ai-access-icon{width:82px;height:82px;margin:0 auto 14px;border-radius:24px;display:grid;place-items:center;font-size:42px;background:linear-gradient(145deg,#e8fff5,#fff4ce);border:1px solid #c9eadc}
.ai-access-kicker{display:inline-block;font-size:12px;font-weight:900;letter-spacing:.12em;color:#11765d;margin-bottom:8px}
.ai-access-dialog h2{margin:4px 0 10px;font-size:28px;line-height:1.2;color:#0d342b}
.ai-access-dialog p{margin:0 auto 16px;max-width:470px;font-size:16px;line-height:1.65;color:#465c56}
.ai-access-note{background:#fff7db;border:1px solid #f1d372;border-radius:14px;padding:12px 14px;color:#6e5400;font-weight:700;font-size:14px}
.ai-access-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:20px}
.ai-access-contact,.ai-access-secondary{border:0;border-radius:13px;padding:12px 18px;font-weight:900;font-size:14px;text-decoration:none;cursor:pointer}
.ai-access-contact{background:var(--gold,#FFBC24);color:#17352e;box-shadow:0 6px 18px rgba(255,188,36,.28)}
.ai-access-secondary{background:#edf3f1;color:#173f36}
.chat-locked-main{display:grid;place-items:center;min-height:calc(100vh - 130px);padding:34px;background:var(--chat-bg,#fbfcfc)}
.chat-locked-card{width:min(680px,96%);background:#fff;border:1px solid #d8e6e1;border-radius:26px;padding:34px;text-align:center;box-shadow:0 18px 50px rgba(14,63,52,.12)}
.chat-locked-card .lock-visual{font-size:54px;margin-bottom:8px}.chat-locked-card h1{font-size:30px;margin:8px 0;color:#0e3d32}.chat-locked-card p{font-size:16px;line-height:1.7;color:#4d615c;max-width:560px;margin:0 auto 18px}.chat-locked-card .lock-help{display:inline-flex;gap:8px;align-items:center;background:#fff7dc;border:1px solid #efd06d;border-radius:14px;padding:11px 14px;font-weight:800;color:#695000;margin-bottom:18px}.chat-locked-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.chat-locked-actions a{padding:12px 18px;border-radius:13px;text-decoration:none;font-weight:900}.chat-locked-actions .primary{background:var(--gold,#FFBC24);color:#14372f}.chat-locked-actions .secondary{background:#edf4f1;color:#134f40}
.tutorial-btn{white-space:nowrap}
.tutorial-dialog{width:min(940px,96vw);padding:18px 18px 22px;text-align:left}
.tutorial-dialog h2{font-size:22px;margin:2px 44px 14px 2px;color:#0d3b31}.tutorial-video-frame{position:relative;width:100%;aspect-ratio:16/9;border-radius:18px;overflow:hidden;background:#071914}.tutorial-video-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
@media(max-width:700px){.ai-access-dialog{padding:25px 18px}.ai-access-dialog h2{font-size:23px}.chat-locked-main{padding:18px}.chat-locked-card{padding:26px 18px}.chat-locked-card h1{font-size:24px}}
.video-admin-thumb{width:110px;aspect-ratio:16/9;object-fit:cover;border-radius:9px;border:1px solid #dbe5e1;background:#eef4f1}.youtube-preview{max-width:480px;aspect-ratio:16/9;border-radius:14px;overflow:hidden;background:#eff4f2;margin-top:8px}.youtube-preview img{width:100%;height:100%;object-fit:cover}.video-preview-note{font-size:12px;color:#687a74;margin-top:6px}
/* V1.11 - chat history lazy loading */
.chat-history-tools{display:flex;align-items:center;justify-content:center;gap:10px;padding:7px 10px;border-bottom:1px solid #e4ece9;background:#f8fbfa}.chat-history-tools small{color:#6a7c76;font-size:11px}.chat-history-tools .soft-btn{padding:7px 11px;font-size:11px}

/* =========================================================
   V1.11.1 - RESPONSIVE CHAT SHELL / HEADER / COMPOSER
   Fixes: mobile overflow, wrong chat grid row, responsive nav
   ========================================================= */
html,body{max-width:100%;overflow-x:hidden}
body.chat-page{height:100dvh;overflow:hidden;padding:8px}
.chat-page .site-footer-pro{display:none}
.chat-page .app-shell{height:calc(100dvh - 16px);min-height:0;grid-template-rows:76px minmax(0,1fr);border-width:3px}
.chat-page .chat-body{min-height:0;height:100%;overflow:hidden}
.chat-page .chat-main{
  min-height:0;
  overflow:hidden;
  grid-template-rows:auto auto minmax(0,1fr) auto auto auto auto auto;
}
.chat-page .messages{min-height:0;display:flex;flex-direction:column;justify-content:flex-start;overscroll-behavior:contain;scrollbar-gutter:stable}
.chat-page .messages>*{flex:0 0 auto}
.chat-page .chat-history-tools{min-height:0}
.chat-page .chat-topbar{position:relative;z-index:85;min-width:0}
.chat-page .brand-wrap{flex:1 1 auto;overflow:hidden}
.chat-page .brand-copy{overflow:hidden}
.chat-page .brand-title-row{max-width:100%}
.chat-page .header-tools{flex:0 1 auto;min-width:0}
.chat-page .header-nav-toggle{display:none;width:42px;height:42px;border-radius:12px;border:1px solid #ffffff2d;background:#ffffff10;color:#fff;font-size:28px;font-weight:900;line-height:1;cursor:pointer;place-items:center;flex:0 0 auto}
.chat-page .header-nav-backdrop{display:none}
.chat-page .tutor-head{min-width:0}
.chat-page .tutor-copy{flex:1 1 auto}
.chat-page .tutor-copy h2,.chat-page .tutor-copy p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-page .tutor-actions{min-width:0;overflow-x:auto;scrollbar-width:none}
.chat-page .tutor-actions::-webkit-scrollbar,.chat-page .context-bar::-webkit-scrollbar,.chat-page .coach-tools::-webkit-scrollbar{display:none}
.chat-page .context-bar,.chat-page .coach-tools{scrollbar-width:none;overscroll-behavior-inline:contain}
.chat-page .bubble-wrap{min-width:0}
.chat-page .bubble{overflow-wrap:anywhere;word-break:normal}
.chat-page .composer{grid-template-areas:"clear camera mic input send";align-items:end}
.chat-page #clearChat{grid-area:clear}.chat-page #cameraBtn{grid-area:camera}.chat-page #micBtn{grid-area:mic}.chat-page #messageInput{grid-area:input}.chat-page .send-btn{grid-area:send;min-height:42px}

/* Laptop/tablet: navigation becomes a clean dropdown instead of overflowing */
@media(max-width:1540px){
  .chat-page .header-nav-toggle{display:grid}
  .chat-page .header-tools{
    display:none;position:fixed;z-index:1001;top:82px;right:12px;width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 96px);overflow:auto;
    padding:12px;background:linear-gradient(145deg,#103f35,#082c25);border:1px solid #ffffff2c;border-radius:18px;box-shadow:0 24px 70px #001e1850;
    grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;white-space:normal
  }
  .chat-page .header-tools.nav-open{display:grid}
  .chat-page .header-tools .soft-btn,.chat-page .header-tools .access-pill,.chat-page .header-tools .user-chip,.chat-page .header-tools .logout-btn{
    width:100%;min-height:44px;display:flex;align-items:center;justify-content:flex-start;border-radius:12px;padding:10px 12px;font-size:12px
  }
  .chat-page .header-tools .access-pill,.chat-page .header-tools .user-chip{background:#ffffff0d;border:1px solid #ffffff20}
  .chat-page .header-tools .logout-btn{height:44px;color:#fff}
  .chat-page .header-nav-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:1000;background:rgba(4,26,22,.46);backdrop-filter:none!important;-webkit-backdrop-filter:none!important;filter:none!important}
  body.header-nav-open{overflow:hidden}
  .chat-page .tutor-actions{display:flex!important;max-width:48vw}
}

@media(max-width:1050px){
  .chat-page .topic-sidebar{top:76px;bottom:8px;left:8px;z-index:1100;width:min(300px,84vw);transform:translateX(calc(-100% - 18px));border-radius:0 18px 18px 0}
  .chat-page .topic-sidebar.open{transform:translateX(0)}
  .chat-page .tutor-head{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 10px;padding:9px 12px}
  .chat-page .tutor-avatar{grid-row:1}.chat-page .tutor-copy{grid-column:2}.chat-page .tutor-actions{grid-column:1/-1;max-width:none;margin-left:0;width:100%;padding-top:2px}
  .chat-page .tutor-actions .soft-btn{flex:0 0 auto}
}

@media(max-width:760px){
  body.chat-page{padding:0}
  .chat-page .app-shell{height:100dvh;border:0;border-radius:0;grid-template-rows:62px minmax(0,1fr)}
  .chat-page .chat-topbar{height:62px;padding:0 8px;gap:7px}
  .chat-page .menu-btn{width:40px;min-width:40px;height:40px;border-radius:12px}
  .chat-page .brand-logo{width:36px;height:36px;border-radius:10px;padding:3px}
  .chat-page .brand-mark{display:none}
  .chat-page .brand-wrap{gap:7px}
  .chat-page .brand-copy small,.chat-page .header-badge{display:none}
  .chat-page .brand-wrap strong{display:block;font-size:15px;line-height:1.15;max-width:calc(100vw - 160px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .chat-page .header-nav-toggle{width:40px;height:40px;font-size:25px}
  .chat-page .header-tools{top:68px;right:8px;width:calc(100vw - 16px);max-height:calc(100dvh - 78px);grid-template-columns:1fr 1fr;padding:10px;border-radius:16px}
  .chat-page .header-tools .soft-btn,.chat-page .header-tools .access-pill,.chat-page .header-tools .user-chip,.chat-page .header-tools .logout-btn{min-height:42px;font-size:11px;padding:9px 10px}
  .chat-page .topic-sidebar{top:62px;bottom:0;left:0;border-radius:0 16px 16px 0}

  .chat-page .tutor-head{padding:7px 9px;gap:6px 8px}
  .chat-page .tutor-avatar{width:38px;height:38px;font-size:20px}
  .chat-page .eyebrow{font-size:8px}
  .chat-page .tutor-head h2{font-size:12.5px;margin:2px 0}.chat-page .tutor-head h2 span{font-size:11px}
  .chat-page .tutor-head p{font-size:9.5px}
  .chat-page .tutor-actions{gap:5px;padding-bottom:1px}
  .chat-page .tutor-actions .soft-btn{font-size:10px;padding:6px 9px;border-radius:9px}

  .chat-page .chat-history-tools{padding:3px 7px;min-height:0}.chat-page .chat-history-tools .soft-btn{padding:5px 8px;font-size:9px}.chat-page .chat-history-tools small{display:none}
  .chat-page .messages{padding:8px 8px 6px}
  .chat-page .ai-row,.chat-page .user-row{gap:7px;margin-bottom:10px}
  .chat-page .mini-avatar{width:30px;height:30px;font-size:16px}
  .chat-page .bubble-wrap{max-width:calc(100% - 37px)}
  .chat-page .bubble{border-radius:14px;padding:10px 11px;font-size:12.5px;line-height:1.5}
  .chat-page .user-bubble{max-width:90%}
  .chat-page .msg-label{font-size:8px;margin-bottom:3px}
  .chat-page .source-badge{font-size:8.5px;padding:3px 6px;margin-top:4px}

  .chat-page .context-bar{gap:5px;padding:4px 7px}
  .chat-page .context-pill{height:30px;font-size:9.5px;padding:0 7px;border-radius:9px}
  .chat-page .mode-pill{min-width:175px}.chat-page .topic-pill{min-width:125px}.chat-page .level-pill select{max-width:86px;font-size:10px}
  .chat-page .coach-tools{gap:5px;padding:4px 7px}
  .chat-page .coach-label{font-size:9.5px}.chat-page .coach-tools button{height:29px;padding:0 8px;font-size:9.5px}
  .chat-page .image-preview{margin:3px 7px 0;padding:5px 7px;grid-template-columns:44px 1fr 34px}.chat-page .image-preview img{width:44px;height:38px}

  .chat-page .composer{grid-template-columns:36px 36px 36px minmax(80px,1fr) 44px;gap:5px;padding:6px 7px;padding-bottom:max(6px,env(safe-area-inset-bottom));background:#fff}
  .chat-page .icon-btn{width:36px;min-width:36px;height:36px;border-radius:10px}
  .chat-page .composer textarea{min-height:38px;max-height:82px;border-radius:12px;padding:9px 10px;font-size:12px;line-height:1.35}
  .chat-page .send-btn{min-height:38px;padding:0 9px;border-radius:11px;font-size:14px}.chat-page .send-btn span{display:none}
  .chat-page .footer-tip{display:none}
  .chat-page .support-dock{display:none!important}
}

@media(max-width:480px){
  .chat-page .brand-logo{display:none}
  .chat-page .brand-wrap strong{max-width:calc(100vw - 116px);font-size:14px}
  .chat-page .header-tools{grid-template-columns:1fr}
  .chat-page .tutor-actions .soft-btn{font-size:9px;padding:6px 8px}
  .chat-page .composer{
    grid-template-columns:36px 36px 36px minmax(0,1fr) 44px;
    grid-template-areas:"input input input input send" "clear camera mic . .";
    align-items:center
  }
  .chat-page .composer textarea{min-height:40px}
  .chat-page .context-bar{padding-top:3px;padding-bottom:3px}
  .chat-page .coach-tools{padding-top:3px;padding-bottom:3px}
}

@media(max-width:360px){
  .chat-page .brand-wrap strong{font-size:13px;max-width:calc(100vw - 108px)}
  .chat-page .tutor-head h2{font-size:11.5px}.chat-page .tutor-head p{display:none}
  .chat-page .bubble{font-size:12px}
  .chat-page .coach-label{display:none}
}

/* Dynamic viewport fallback for older browsers */
@supports not (height:100dvh){
  body.chat-page{height:100vh}.chat-page .app-shell{height:calc(100vh - 16px)}
  @media(max-width:760px){.chat-page .app-shell{height:100vh}}
}

/* V1.11.2 - mobile navigation must stay sharp, never blur the page/menu */
@media(max-width:1540px){
  .chat-page .header-tools.nav-open{filter:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;opacity:1!important;background:#0b3a31!important}
  .chat-page .header-nav-backdrop:not([hidden]){backdrop-filter:none!important;-webkit-backdrop-filter:none!important;filter:none!important}
}

/* V1.13 - mobile header: link luôn click được, không có lớp mờ chặn tương tác */
@media(max-width:1540px){
  .chat-page .header-nav-backdrop:not([hidden]){background:rgba(4,26,22,.18)!important;pointer-events:auto!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  .chat-page .header-tools.nav-open{pointer-events:auto!important;z-index:2001!important;filter:none!important;opacity:1!important}
  .chat-page .header-tools.nav-open a,.chat-page .header-tools.nav-open button{pointer-events:auto!important;position:relative;z-index:2}
}

/* Generic admin cards for new V1.13 pages */
.admin-page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:16px}.admin-page-head h1{margin:0 0 5px;font-size:26px}.admin-page-head p{margin:0;color:var(--muted)}.admin-card{background:#fff;border:1px solid #dee8e5;border-radius:15px;box-shadow:0 5px 18px #18382f0a;padding:18px;margin:16px 0}.tag-admin-list{display:flex;gap:8px;flex-wrap:wrap}.admin-tag{display:inline-flex;align-items:center;gap:7px;border:1px solid #d8e4e0;border-radius:999px;background:#f7fbf9;padding:7px 10px;font-size:11px;font-weight:800}.admin-tag small{color:#75857f}.admin-tag form{display:inline}.admin-tag button{border:0;background:#ffe9e9;color:#b83333;width:22px;height:22px;border-radius:50%;cursor:pointer;font-weight:900}.seo-box{border-top:1px solid #e2ebe8;padding-top:8px;margin-top:4px}

/* =========================================================
   V1.13.1 - CKEditor visible + mobile nav click fix
   ========================================================= */
.ckeditor-load-alert{margin:0 0 8px;padding:10px 12px;border:1px solid #f0c66b;border-radius:10px;background:#fff8df;color:#6b5212;font-size:12px;line-height:1.45}
.ck.ck-editor{width:100%;border-radius:12px;overflow:visible}
.ck.ck-toolbar{border-color:#cfded9!important;border-radius:12px 12px 0 0!important;background:#f8fbfa!important;flex-wrap:wrap!important}
.ck.ck-editor__main>.ck-editor__editable{min-height:420px;max-height:70vh;overflow:auto;border-color:#cfded9!important;border-radius:0 0 12px 12px!important;box-shadow:none!important;font-family:Arial,"Segoe UI",Roboto,sans-serif;font-size:16px;line-height:1.7;color:#172e28}
.ck.ck-editor__main>.ck-editor__editable.ck-focused{border-color:#1a7b60!important;box-shadow:0 0 0 2px rgba(26,123,96,.10)!important}
.ck-content h2{font-size:26px}.ck-content h3{font-size:21px}.ck-content p{margin:.75em 0}.ck-content img{max-width:100%;height:auto}
@media(max-width:760px){.ck.ck-editor__main>.ck-editor__editable{min-height:320px;font-size:15px}.ck.ck-toolbar{position:sticky;top:0;z-index:3}}

/* Important: header is a stacking context. The backdrop must sit BELOW the header,
   otherwise it intercepts touches even when child links have a larger z-index. */
@media(max-width:1540px){
  .chat-page .chat-topbar{z-index:1400!important;overflow:visible!important}
  .chat-page .header-nav-backdrop:not([hidden]){z-index:1300!important;pointer-events:auto!important;background:rgba(4,26,22,.20)!important}
  .chat-page .header-tools{z-index:1401!important;pointer-events:none}
  .chat-page .header-tools.nav-open{z-index:1401!important;pointer-events:auto!important}
  .chat-page .header-tools.nav-open a,
  .chat-page .header-tools.nav-open button,
  .chat-page .header-tools.nav-open .access-pill,
  .chat-page .header-tools.nav-open .user-chip{pointer-events:auto!important}
}

/* V1.13.2 - TinyMCE 8 full editor */
.tinymce-load-alert{margin:0 0 8px;padding:10px 12px;border:1px solid #f0c66b;border-radius:10px;background:#fff8df;color:#6b5212;font-size:12px;line-height:1.45}
.tox.tox-tinymce{border:1px solid #cfddd8!important;border-radius:12px!important;overflow:hidden;box-shadow:none!important}
.tox .tox-toolbar-overlord,.tox .tox-toolbar__primary{background:#f8fbfa!important}
.tox .tox-statusbar{border-top:1px solid #e2ebe8!important}
@media(max-width:720px){.tox.tox-tinymce{min-height:420px}.tox .tox-toolbar__group{padding:0 2px!important}.tox .tox-tbtn{width:32px!important;height:32px!important}}

/* =========================================================
   V1.13.7 - Menu dùng chung mobile có nút TẮT / MỞ
   Mặc định thu gọn để không che khung chat; cùng một nút luôn xuất hiện ở mọi module.
   ========================================================= */
.site-mobile-nav-shell{display:none}
.site-mobile-nav{display:none}
@media(max-width:980px){
  .site-mobile-nav-shell{display:block;background:#0b3d33;color:#fff;border-bottom:1px solid rgba(255,255,255,.10);position:sticky;top:64px;z-index:1250;box-shadow:0 5px 14px rgba(4,36,29,.10)}
  .site-mobile-nav-toggle{width:100%;min-height:44px;border:0;background:linear-gradient(180deg,#0e493d,#0a382f);color:#fff;padding:8px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;font:inherit}
  .site-mobile-nav-toggle-left{display:flex;align-items:center;gap:7px;min-width:0}.site-mobile-nav-toggle-left>b{font-size:11px}.site-mobile-nav-toggle-left>small{color:#f7d86f;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.site-mobile-nav-chevron{font-size:18px;transition:transform .18s ease}.site-mobile-nav-shell.is-open .site-mobile-nav-chevron{transform:rotate(180deg)}
  .site-mobile-nav-shell.is-open .site-mobile-nav{display:grid}
  .site-mobile-nav{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px 10px 10px;background:linear-gradient(180deg,#0d4438,#0a372f);color:#fff}
  .site-mobile-nav-link,.site-mobile-nav-meta{min-height:42px;border:1px solid rgba(255,255,255,.24);border-radius:11px;display:flex;align-items:center;gap:7px;padding:8px 10px;color:#fff!important;text-decoration:none;font-size:10.5px;font-weight:900;line-height:1.2;background:rgba(255,255,255,.035)}
  .site-mobile-nav-link:hover,.site-mobile-nav-link:focus-visible{background:rgba(255,255,255,.11);outline:none}.site-mobile-nav-link.active{background:linear-gradient(180deg,#ffd14d,#f4b51d);border-color:#f5bd24;color:#173a31!important;box-shadow:0 4px 12px rgba(243,183,27,.24)}.site-mobile-nav-link.logout{background:rgba(255,255,255,.06)}
  .site-mobile-nav-meta{color:#d9eee8!important;font-weight:700;overflow:hidden}.site-mobile-nav-meta b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* Ẩn nav riêng của từng module để không có hai menu chồng nhau */
  .forum-main-nav,.forum-account-menu,.library-nav,.library-account,.video-nav,.video-account,.classroom-nav,.classroom-account,.exam-nav,.exam-account{display:none!important}
  .forum-topbar-inner,.library-topbar-inner,.video-topbar-inner,.classroom-topbar-inner,.exam-topbar-inner{min-height:64px!important}.forum-topbar-pro,.library-topbar,.video-topbar,.classroom-topbar,.exam-topbar{position:sticky!important;top:0!important;z-index:1260!important}

  /* Chat: menu thu gọn chỉ chiếm 44px; khi mở mới đẩy nội dung xuống, không overlay */
  .chat-page .app-shell{grid-template-rows:68px auto minmax(0,1fr)!important}.chat-page .chat-topbar{height:68px!important;z-index:1260!important}.chat-page .header-tools{display:none!important}.chat-page .site-mobile-nav-shell{position:relative;top:auto;z-index:20}.chat-page .chat-body{min-height:0}
}
@media(max-width:520px){.site-mobile-nav{gap:7px;padding:7px 8px 9px}.site-mobile-nav-link,.site-mobile-nav-meta{min-height:40px;padding:7px 9px;font-size:10px}.site-mobile-nav-toggle{min-height:42px;padding:7px 9px}.site-mobile-nav-toggle-left>small{max-width:190px}}
/* TinyMCE trong Forum */
.forum-editor-pro .tox.tox-tinymce,.forum-reply-editor .tox.tox-tinymce{border-color:#cbdcd6!important;border-radius:13px!important;box-shadow:0 4px 15px rgba(17,74,60,.05)!important}
.forum-editor-pro .tox-edit-area__iframe,.forum-reply-editor .tox-edit-area__iframe{background:#fff!important}
.forum-post-body-pro{font-size:15px;line-height:1.75;color:#203c34;overflow-wrap:anywhere}
.forum-post-body-pro img{max-width:100%;height:auto;border-radius:12px;margin:10px 0}
.forum-post-body-pro table{width:100%;border-collapse:collapse;margin:14px 0;display:block;overflow:auto}
.forum-post-body-pro th,.forum-post-body-pro td{border:1px solid #d7e4df;padding:8px 10px;min-width:90px}
.forum-post-body-pro blockquote{border-left:4px solid #f3b71b;background:#fff9e8;padding:9px 13px;margin:12px 0;border-radius:0 10px 10px 0}
.forum-post-body-pro iframe{width:100%;max-width:760px;aspect-ratio:16/9;border:0;border-radius:12px}

/* V1.13.4: nút hỗ trợ neo sát mép dưới thay vì giữa màn hình */
.support-dock{top:auto!important;bottom:max(12px,env(safe-area-inset-bottom));transform:none!important}
@media(min-width:901px){.support-dock{flex-direction:column}.support-dock-left{left:10px}.support-dock-right{right:10px}}

/* Admin - thumbnail Kho đề thi PDF */
.admin-main .exam-doc-title-cell{display:flex;align-items:center;gap:9px;min-width:220px}.admin-main .exam-pdf-thumb{width:38px;height:50px;object-fit:cover;border-radius:7px;border:1px solid #e1caca;box-shadow:0 2px 7px rgba(80,30,30,.10);flex:0 0 auto}.admin-main .exam-doc-file-icon{width:38px;height:46px;display:grid;place-items:center;border-radius:8px;background:#f4f8f6;border:1px solid #dce7e3;font-size:22px;flex:0 0 auto}.admin-main .exam-doc-title-cell>div{min-width:0}.admin-main .exam-doc-title-cell b,.admin-main .exam-doc-title-cell small{display:block}.admin-main .exam-doc-title-cell small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:300px}.admin-main .exam-admin-list-summary{margin:10px 0 12px;padding:9px 11px;border:1px solid #dce8e3;border-radius:10px;background:#f7fbf9;color:#587069;font-size:12px}.admin-main .exam-admin-list-summary span{margin-left:8px}.admin-main .exam-pagination .disabled{opacity:.42;pointer-events:none}

/* =========================================================
   V1.13.8 - Responsive Mobile Navigation / iPhone / Android
   - Menu dong mac dinh, khong che chat.
   - Khi mo: dropdown noi dep 2 cot, click ngoai de dong.
   - Cache busting duoc xu ly boi asset_url().
   ========================================================= */
@media (max-width:980px){
  html,body{max-width:100%;overflow-x:hidden}
  .site-mobile-nav-shell{
    display:block!important;
    position:sticky!important;
    top:0;
    z-index:1800!important;
    width:100%;
    padding:6px 8px;
    background:#f5f8f7!important;
    border-bottom:1px solid #dce7e3!important;
    box-shadow:0 4px 12px rgba(8,52,43,.08)!important;
    overflow:visible!important;
  }
  .site-mobile-nav-toggle{
    width:100%!important;
    min-height:46px!important;
    border:1px solid #c9ddd6!important;
    border-radius:13px!important;
    background:#fff!important;
    color:#123f35!important;
    padding:6px 9px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:10px!important;
    box-shadow:0 2px 7px rgba(13,61,50,.05)!important;
  }
  .site-mobile-nav-toggle-left{display:flex!important;align-items:center!important;gap:9px!important;min-width:0!important}
  .site-mobile-nav-menu-icon{
    width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex:0 0 auto;
    background:linear-gradient(180deg,#ffd35b,#ffb91f);color:#133d33;font-size:18px;font-weight:950;
    border:1px solid #efad11;
  }
  .site-mobile-nav-toggle-copy{display:flex;align-items:baseline;gap:7px;min-width:0;text-align:left}
  .site-mobile-nav-toggle-copy b{font-size:12px!important;line-height:1;white-space:nowrap;color:#153c33}
  .site-mobile-nav-toggle-copy small{font-size:11px!important;color:#687b76!important;font-weight:800!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:42vw!important}
  .site-mobile-nav-chevron{width:32px;height:32px;border-radius:9px;background:#edf4f1;display:grid;place-items:center;font-size:18px!important;color:#17483c;flex:0 0 auto;transition:transform .18s ease}
  .site-mobile-nav-shell.is-open .site-mobile-nav-chevron{transform:rotate(180deg)}

  .site-mobile-nav{
    display:none!important;
    position:absolute!important;
    left:8px!important;
    right:8px!important;
    top:calc(100% + 4px)!important;
    max-height:min(68dvh,560px)!important;
    overflow:auto!important;
    overscroll-behavior:contain;
    padding:10px!important;
    border:1px solid rgba(255,255,255,.16)!important;
    border-radius:17px!important;
    background:linear-gradient(160deg,#0c4438,#082f28)!important;
    color:#fff!important;
    box-shadow:0 18px 46px rgba(3,36,29,.30)!important;
    -webkit-overflow-scrolling:touch;
  }
  .site-mobile-nav-shell.is-open .site-mobile-nav{display:block!important}
  .site-mobile-nav-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 2px 10px;border-bottom:1px solid rgba(255,255,255,.12);margin-bottom:9px}
  .site-mobile-nav-head b{display:block;font-size:13px;color:#fff}.site-mobile-nav-head small{display:block;margin-top:3px;font-size:10px;color:#b9d8ce}
  .site-mobile-nav-close{width:34px;height:34px;border:1px solid rgba(255,255,255,.22);border-radius:10px;background:rgba(255,255,255,.08);color:#fff;font-size:22px;line-height:1;cursor:pointer}
  .site-mobile-nav-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .site-mobile-nav-link{
    min-width:0!important;min-height:48px!important;border:1px solid rgba(255,255,255,.22)!important;border-radius:12px!important;
    display:flex!important;align-items:center!important;gap:8px!important;padding:8px 10px!important;
    color:#fff!important;background:rgba(255,255,255,.035)!important;text-decoration:none!important;
    font-size:11px!important;font-weight:900!important;line-height:1.2!important;white-space:normal!important;
  }
  .site-mobile-nav-link-icon{width:24px;height:24px;border-radius:8px;display:grid;place-items:center;background:rgba(255,255,255,.08);font-size:14px;flex:0 0 auto}
  .site-mobile-nav-link-label{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .site-mobile-nav-link.active{background:linear-gradient(180deg,#ffd456,#ffb81f)!important;border-color:#ffc12b!important;color:#153c33!important;box-shadow:0 5px 14px rgba(255,186,31,.22)!important}
  .site-mobile-nav-link.active .site-mobile-nav-link-icon{background:rgba(255,255,255,.35)}
  .site-mobile-nav-account{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;margin-top:9px!important;padding-top:9px!important;border-top:1px solid rgba(255,255,255,.12)!important}
  .site-mobile-nav-meta,.site-mobile-nav-logout{
    min-width:0;min-height:38px;border:1px solid rgba(255,255,255,.14);border-radius:10px;padding:7px 9px;
    display:flex;align-items:center;gap:6px;color:#d9eee8!important;background:rgba(255,255,255,.04);font-size:10.5px;font-weight:700;text-decoration:none;
  }
  .site-mobile-nav-meta b{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.site-mobile-nav-meta.user{grid-column:1/2}.site-mobile-nav-logout{grid-column:2/3;color:#fff!important;font-weight:900;justify-content:center;background:rgba(255,255,255,.08)}

  /* Chi giu 1 he thong menu tren mobile */
  .forum-main-nav,.forum-account-menu,.library-nav,.library-account,.video-nav,.video-account,.classroom-nav,.classroom-account,.exam-nav,.exam-account{display:none!important}

  /* Header module gon, khong tran ngang */
  .forum-topbar-pro,.library-topbar,.video-topbar,.classroom-topbar,.exam-topbar{position:relative!important;top:auto!important;z-index:1700!important;width:100%!important}
  .forum-topbar-inner,.library-topbar-inner,.video-topbar-inner,.classroom-topbar-inner,.exam-topbar-inner{min-height:60px!important;height:auto!important;padding:7px 10px!important;gap:8px!important;overflow:hidden!important}
  .forum-brand-pro,.library-brand,.video-brand,.classroom-brand,.exam-brand{min-width:0!important;max-width:100%!important;flex:1 1 auto!important;gap:8px!important}
  .forum-brand-pro>div,.library-brand>div,.video-brand>div,.classroom-brand>div,.exam-brand>div{min-width:0!important}
  .forum-brand-pro strong,.library-brand strong,.video-brand strong,.classroom-brand strong,.exam-brand strong{display:block!important;max-width:72vw!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;font-size:13px!important}
  .forum-brand-pro small,.library-brand small,.video-brand small,.classroom-brand small,.exam-brand small{display:block!important;max-width:70vw!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;font-size:9px!important}
  .forum-brand-pro img,.library-brand img,.video-brand img,.classroom-brand img,.exam-brand img,.forum-logo-pro,.library-brand-mark{width:38px!important;height:38px!important;flex:0 0 38px!important;border-radius:10px!important;object-fit:cover!important}

  /* Chat: 64px header + 58px menu dong; phan con lai cho chat */
  body.chat-page{height:100dvh!important;min-height:100dvh!important;overflow:hidden!important;padding:0!important;background:#fff!important}
  .chat-page .app-shell{height:100dvh!important;width:100%!important;border:0!important;border-radius:0!important;grid-template-rows:64px auto minmax(0,1fr)!important;overflow:hidden!important}
  .chat-page .chat-topbar{height:64px!important;min-height:64px!important;padding:0 8px!important;z-index:1700!important;overflow:hidden!important}
  .chat-page .brand-wrap{gap:8px!important;min-width:0!important}.chat-page .brand-copy{min-width:0!important}.chat-page .brand-wrap strong{display:block!important;max-width:calc(100vw - 115px)!important;font-size:14px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.chat-page .brand-wrap small,.chat-page .header-badge{display:none!important}.chat-page .brand-logo{width:36px!important;height:36px!important;border-radius:9px!important}.chat-page .menu-btn{width:38px!important;min-width:38px!important;height:38px!important;border-radius:11px!important}.chat-page .header-tools{display:none!important}
  .chat-page .site-mobile-nav-shell{position:relative!important;top:auto!important;z-index:1600!important;padding:5px 7px!important;background:#f4f8f6!important}
  .chat-page .chat-body{min-height:0!important;overflow:hidden!important}

  /* Touch target / noi dung khong tran */
  .forum-container-pro,.forum-container,.library-container,.video-container,.classroom-container,.exam-container{max-width:100%!important;overflow-x:hidden!important}
  img,video,iframe{max-width:100%}
  .table-wrap,.admin-table-wrap,.forum-table-wrap{max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
}

@media (max-width:520px){
  .site-mobile-nav-shell{padding:5px 6px!important}
  .site-mobile-nav-toggle{min-height:44px!important;padding:5px 7px!important;border-radius:12px!important}
  .site-mobile-nav-menu-icon{width:32px;height:32px;border-radius:9px;font-size:17px}
  .site-mobile-nav-toggle-copy{gap:5px}.site-mobile-nav-toggle-copy b{font-size:11px!important}.site-mobile-nav-toggle-copy small{font-size:10px!important;max-width:38vw!important}
  .site-mobile-nav{left:6px!important;right:6px!important;padding:8px!important;border-radius:15px!important;max-height:70dvh!important}
  .site-mobile-nav-grid{gap:6px!important}.site-mobile-nav-link{min-height:46px!important;padding:7px 8px!important;font-size:10.5px!important}.site-mobile-nav-link-icon{width:22px;height:22px;font-size:13px}
  .site-mobile-nav-account{gap:6px!important}.site-mobile-nav-meta,.site-mobile-nav-logout{font-size:10px!important;padding:6px 7px!important}
  .forum-brand-pro small,.library-brand small,.video-brand small,.classroom-brand small,.exam-brand small{display:none!important}
  .forum-brand-pro strong,.library-brand strong,.video-brand strong,.classroom-brand strong,.exam-brand strong{max-width:74vw!important;font-size:12.5px!important}
}

@media (max-width:360px){
  .site-mobile-nav-grid{grid-template-columns:1fr!important}
  .site-mobile-nav-account{grid-template-columns:1fr!important}.site-mobile-nav-meta.user,.site-mobile-nav-logout{grid-column:auto!important}
  .site-mobile-nav-toggle-copy small{display:none!important}
}
