:root {
    --bg: #f6f8fc;
    --surface: #ffffff;
    --surface-2: #eef2f7;
    --text: #172033;
    --muted: #64748b;
    --border: #dce3ec;
    --red: #ff0000;
    --red-dark: #cf0000;
    --yellow: #ffd400;
    --top: #1a1025;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
}

html[data-theme="dark"] {
    --bg: #090d16;
    --surface: #111827;
    --surface-2: #182235;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --border: #334155;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Lato, Arial, sans-serif;
    transition: background 0.35s, color 0.35s;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

.skip-link {
    position: fixed;
    left: 10px;
    top: -100px;
    z-index: 9999;
    background: #000;
    color: #fff;
    padding: 10px;
}

.skip-link:focus {
    top: 10px;
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.12);
}

.utility-bar {
    height: 34px;
    background: var(--top);
    color: #fff;
    font-size: 13px;
}

.utility-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.utility-contact,
.utility-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.utility-bar a {
    text-decoration: none;
    color: #fff;
    opacity: 0.95;
    transition: 0.25s;
}

.utility-bar a:hover {
    color: var(--yellow);
    transform: translateY(-1px);
}

.utility-contact img {
    width: 15px;
    height: 15px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 5px;
}

.language-switcher {
    display: flex;
    gap: 4px;
}

.language-switcher a {
    padding: 2px 5px;
    border-radius: 4px;
}

.language-switcher a.active {
    background: var(--red);
    color: #fff;
}

.theme-toggle {
    width: 30px;
    height: 26px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    transition: 0.25s;
}

.theme-toggle:hover {
    transform: rotate(8deg) scale(1.08);
    background: rgba(255, 255, 255, 0.14);
}

.theme-sun {
    display: none;
}

html[data-theme="dark"] .theme-moon {
    display: none;
}

html[data-theme="dark"] .theme-sun {
    display: inline;
}

/* =========================================================
   MAIN NAVIGATION
   ========================================================= */

.main-nav {
    height: 90px;
    background: var(--red);
    color: #fff;
}

.nav-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: max-content;
}

.brand img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand span {
    display: flex;
    flex-direction: column;
    font-family: Nunito, sans-serif;
}

.brand strong {
    font-size: 16px;
    color: var(--yellow);
    line-height: 1.15;
}

.brand small {
    font-size: 14px;
    color: #fff;
    margin-top: 4px;
}

.main-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link,
.dropdown-trigger {
    border: 0;
    background: none;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    padding: 12px 10px;
    border-radius: 9px;
    transition: 0.25s;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active,
.dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.10);
    color: var(--yellow) !important;
    transform: translateY(-2px);
}

.nav-dropdown {
    position: relative;
}

.dropdown-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 255px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 12px;
    padding: 8px;
    z-index: 1100;
}

.nav-dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 8px;
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
    display: flex;
    flex-direction: column;
    animation: drop 0.18s ease;
}

.dropdown-panel a {
    padding: 10px 12px;
    text-decoration: none;
    border-radius: 8px;
    color: var(--text);
    transition: 0.2s;
}

.dropdown-panel a:hover {
    background: var(--red);
    color: #fff;
    transform: translateX(5px);
}

.flag-links {
    display: flex;
    gap: 7px;
    align-items: center;
    margin: 0 3px;
}

.flag-links a {
    display: block;
    transition: 0.25s;
}

.flag-links a:hover {
    transform: translateY(-4px) scale(1.07);
}

.flag-links img {
    width: 38px;
    height: 28px;
    object-fit: cover;
    border-radius: 3px;
}

.nav-search {
    display: flex;
    position: relative;
    margin-left: 5px;
}

.nav-search input {
    width: 155px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: #fff;
    color: #111;
    padding: 9px 34px 9px 11px;
    border-radius: 9px;
    outline: none;
}

.nav-search button {
    position: absolute;
    right: 3px;
    top: 3px;
    border: 0;
    background: transparent;
    color: #111;
    font-size: 22px;
    cursor: pointer;
}

.mobile-menu-button {
    display: none;
    margin-left: auto;
    border: 0;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 9px;
    padding: 8px;
    cursor: pointer;
}

.mobile-menu-button span {
    display: block;
    width: 26px;
    height: 2px;
    background: #fff;
    margin: 5px;
}

/* =========================================================
   FLASH
   ========================================================= */

.flash-stack {
    position: fixed;
    right: 18px;
    top: 135px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    padding: 13px 18px;
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--red);
    animation: toast 0.3s ease;
}

.flash-success {
    border-color: #16a34a;
}

.flash-danger {
    border-color: #dc2626;
}

/* =========================================================
   GLOBAL CONTENT
   ========================================================= */

.page-content {
    min-height: 65vh;
    padding-top: 124px;
}

.legacy-content {
    overflow: hidden;
}

.legacy-content main {
    padding-top: 0 !important;
}

.legacy-content h1,
.legacy-content h2,
.legacy-content h3,
.legacy-content h4,
.legacy-content h5 {
    font-family: Nunito, sans-serif;
    color: var(--text);
}

.legacy-content p,
.legacy-content li,
.legacy-content span,
.legacy-content label,
.legacy-content div {
    color: var(--text);
}

.legacy-content .text-primary {
    color: var(--red) !important;
}

.legacy-content a {
    transition: 0.25s;
}

.legacy-content img {
    max-width: 100%;
    height: auto;
}

.legacy-content iframe {
    max-width: 100%;
    border: 0;
}

.legacy-content [style*="color: black"],
.legacy-content [style*="color:black"] {
    color: var(--text) !important;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

.mce-js-ready .reveal,
.mce-js-ready .legacy-content section,
.mce-js-ready .legacy-content article,
.mce-js-ready .legacy-content .card,
.mce-js-ready .legacy-content .grammar-item {
    transition:
        opacity 0.7s ease,
        transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.mce-js-ready .reveal,
.mce-js-ready .legacy-content section,
.mce-js-ready .legacy-content article,
.mce-js-ready .legacy-content .card,
.mce-js-ready .legacy-content .grammar-item {
    opacity: 1;
    transform: none;
}

.mce-js-ready .reveal-left {
    transform: translateX(-70px);
}

.mce-js-ready .reveal-right {
    transform: translateX(70px);
}

.mce-js-ready .is-visible,
.mce-js-ready .reveal.visible {
    opacity: 1 !important;
    transform: translate(0) !important;
}

.legacy-content section:nth-of-type(even) article:nth-child(odd),
.legacy-content article:nth-child(even) {
    transition-delay: 0.05s;
}

.hover-lift {
    transition:
        transform 0.25s,
        box-shadow 0.25s;
}

.hover-lift:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow);
}

.content-card,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

.search-results {
    display: grid;
    gap: 15px;
}

.section-heading span {
    display: inline-block;
    color: var(--red);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.section-heading h1 {
    font-family: Nunito, sans-serif;
    font-weight: 900;
    margin-top: 5px;
}

.search-page {
    min-height: 65vh;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    background: #0d1320;
    color: #e5e7eb;
    padding: 55px 0 20px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    padding-bottom: 35px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-brand img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.footer-brand div {
    display: flex;
    flex-direction: column;
}

.footer-brand strong {
    color: var(--yellow);
    font-family: Nunito, sans-serif;
    font-size: 18px;
}

.footer-brand span {
    font-size: 16px;
}

.footer-partner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-partner img {
    width: 55px;
    height: 55px;
    object-fit: contain;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 1fr 0.8fr;
    gap: 35px;
    padding: 25px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.footer-grid h4 {
    font-family: Nunito, sans-serif;
    color: #fff;
    margin-bottom: 15px;
}

.footer-grid a,
.footer-grid span {
    display: block;
    color: #dbe4ef;
    text-decoration: none;
    margin: 8px 0;
}

.footer-grid a:hover {
    color: var(--yellow);
    transform: translateX(4px);
}

.footer-social {
    text-align: right;
}

.footer-social div {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.footer-social img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    transition: 0.25s;
}

.footer-social a:hover img {
    transform: scale(1.15) rotate(-5deg);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
    padding-top: 20px;
    color: #aeb8c7;
}

/* =========================================================
   BACK TO TOP
   ========================================================= */

#back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 24px;
    display: none;
    z-index: 900;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.20);
    transition: 0.25s;
    cursor: pointer;
}

#back-to-top:hover {
    transform: translateY(-5px) scale(1.05);
}

/* =========================================================
   ACCOUNT
   ========================================================= */

.dashboard-shell {
    padding: 45px 0 70px;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 25px;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-hero h1 {
    font: 900 34px Nunito, sans-serif;
    margin: 0;
}

.eyebrow {
    color: var(--red);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 12px;
}

.dashboard-hero p {
    color: var(--muted);
    margin: 8px 0;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-mce {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 16px;
    border-radius: 11px;
    text-decoration: none;
    border: 1px solid transparent;
    background: var(--red);
    color: #fff;
    font-weight: 800;
    transition: 0.25s;
}

.btn-mce:hover {
    background: var(--red-dark);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 0, 0, 0.20);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
    transition: 0.3s;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}

.stat-card .icon {
    font-size: 28px;
}

.stat-card strong {
    display: block;
    font: 900 29px Nunito, sans-serif;
    margin-top: 5px;
}

.stat-card span {
    color: var(--muted);
    font-size: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 20px;
    margin-top: 20px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
}

.panel h2 {
    font: 800 21px Nunito, sans-serif;
    margin: 0 0 17px;
}

.message-preview {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.message-preview:last-child {
    border-bottom: 0;
}

.message-preview small {
    color: var(--muted);
}

.quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    text-decoration: none;
    background: var(--surface-2);
    transition: 0.25s;
}

.quick-card:hover {
    transform: translateY(-4px);
    border-color: var(--red);
    color: var(--text);
}

.account-page {
    padding: 40px 0 70px;
}

.form-card {
    max-width: 650px;
    margin: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.form-label {
    display: block;
    font-weight: 800;
    margin: 0 0 7px;
}

.form-control,
.form-select,
.form-input {
    width: 100%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 13px;
    margin-bottom: 15px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.11);
}

.auth-page {
    min-height: calc(100vh - 124px);
    display: grid;
    place-items: center;
    padding: 45px 15px;
}

.auth-card {
    width: min(470px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    font: 900 29px Nunito, sans-serif;
}

.auth-logo {
    display: block;
    width: 72px;
    margin: 0 auto 12px;
}

.auth-card .links {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
}

.auth-card a {
    color: var(--red);
    text-decoration: none;
    font-weight: 700;
}

.errors {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.dark-note {
    color: var(--muted);
}

/* =========================================================
   ADMIN
   ========================================================= */

.admin-shell {
    padding: 40px 0 70px;
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.admin-head h1 {
    font: 900 34px Nunito, sans-serif;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

.table-wrap {
    overflow: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.admin-table th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge-ok {
    background: #dcfce7;
    color: #166534;
}

.badge-ban {
    background: #fee2e2;
    color: #991b1b;
}

.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.admin-actions {
    display: flex;
    gap: 6px;
}

.mini-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    padding: 7px 9px;
    cursor: pointer;
    text-decoration: none;
}

.mini-btn:hover {
    transform: translateY(-2px);
    border-color: var(--red);
}

.danger {
    color: #dc2626;
}

.log-item {
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.log-item small {
    display: block;
    color: var(--muted);
}

/* =========================================================
   MESSAGING
   ========================================================= */

.messaging-shell {
    padding: 40px 0 70px;
}

.message-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 650px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.contacts {
    border-right: 1px solid var(--border);
    padding: 18px;
}

.contact-link {
    display: block;
    text-decoration: none;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 5px;
}

.contact-link:hover,
.contact-link.active {
    background: var(--surface-2);
    color: var(--red);
}

.conversation {
    display: flex;
    flex-direction: column;
}

.conversation-head {
    padding: 18px;
    border-bottom: 1px solid var(--border);
    font: 800 20px Nunito, sans-serif;
}

.messages-box {
    flex: 1;
    padding: 20px;
    overflow: auto;
    max-height: 540px;
}

.bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 15px;
    margin: 8px 0;
    background: var(--surface-2);
}

.bubble.mine {
    margin-left: auto;
    background: var(--red);
    color: #fff;
}

.bubble small {
    display: block;
    opacity: 0.7;
    margin-top: 4px;
}

.composer {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid var(--border);
}

.composer textarea {
    flex: 1;
    resize: none;
    min-height: 50px;
}

.group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.group-messages {
    min-height: 450px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.meet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.meet-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    transition: 0.3s;
}

.meet-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow);
    border-color: var(--red);
}

/* =========================================================
   DASHBOARD MCE V2
   ========================================================= */

.mce-dashboard-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    width: 100%;
    min-height: calc(100vh - 124px);
}

.mce-sidebar {
    position: sticky;
    top: 124px;
    width: 270px;
    height: calc(100vh - 124px);
    overflow-y: auto;
    background: #111827;
    color: #d1d5db;
    z-index: 40;
    padding: 24px 16px;
    scrollbar-width: thin;
}

.mce-sidebar::-webkit-scrollbar {
    width: 5px;
}

.mce-sidebar::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 10px;
}

.mce-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 22px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mce-sidebar-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.mce-sidebar-brand strong {
    display: block;
    color: #fff;
    font-family: Nunito, sans-serif;
    font-size: 15px;
    line-height: 1.2;
}

.mce-sidebar-brand span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #9ca3af;
}

.mce-sidebar-section {
    margin: 22px 0 8px;
    padding: 0 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 900;
    color: #6b7280;
}

.mce-sidebar-nav {
    display: grid;
    gap: 5px;
}

.mce-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 11px;
    color: #d1d5db;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: 0.2s;
}

.mce-sidebar-nav a:hover,
.mce-sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    transform: translateX(3px);
}

.mce-sidebar-nav .mce-danger {
    color: #fca5a5;
}

.mce-main {
    min-width: 0;
    width: 100%;
    padding: 28px;
    position: relative;
}

.mce-topbar {
    position: sticky;
    top: 124px;
    z-index: 30;
    margin: -28px -28px 30px;
    padding: 18px 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.mce-page-title {
    min-width: 0;
}

.mce-page-title h1 {
    margin: 0;
    font: 900 27px Nunito, sans-serif;
    color: var(--text);
}

.mce-page-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.mce-user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mce-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--red);
    color: #fff;
    font-weight: 900;
}

.mce-user-mini strong {
    display: block;
    color: var(--text);
    font-size: 14px;
}

.mce-user-mini span {
    color: var(--muted);
    font-size: 12px;
}

.mce-mobile-menu {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
}

.mce-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    z-index: 35;
}

.mce-welcome {
    position: relative;
    overflow: hidden;
    padding: 30px;
    margin-bottom: 22px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.20), transparent 30%),
        linear-gradient(135deg, #991b1b, #dc2626);
    box-shadow: 0 18px 45px rgba(153, 27, 27, 0.22);
}

.mce-welcome::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -90px;
    bottom: -120px;
    border: 35px solid rgba(255, 255, 255, 0.10);
    border-radius: 50%;
}

.mce-welcome small {
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-weight: 900;
    font-size: 11px;
    opacity: 0.80;
}

.mce-welcome h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    font: 900 30px Nunito, sans-serif;
}

.mce-welcome p {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 8px 0 0;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.90);
}

.mce-welcome-actions {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.mce-welcome-actions a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.20);
    font-size: 13px;
    font-weight: 800;
    transition: 0.2s;
}

.mce-welcome-actions a:hover {
    background: #fff;
    color: #991b1b;
    transform: translateY(-2px);
}

.mce-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.mce-stat-card {
    min-width: 0;
    padding: 21px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.04);
    transition: 0.25s;
}

.mce-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.mce-stat-icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface-2);
    font-size: 21px;
}

.mce-stat-card strong {
    display: block;
    margin-top: 13px;
    color: var(--text);
    font: 900 28px Nunito, sans-serif;
}

.mce-stat-card span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
}

.mce-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
    gap: 20px;
    margin-bottom: 20px;
}

.mce-panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.04);
}

.mce-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

.mce-panel-header h2 {
    margin: 0;
    font: 900 20px Nunito, sans-serif;
    color: var(--text);
}

.mce-panel-header a {
    color: var(--red);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.mce-course-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.mce-course-card {
    min-width: 0;
    padding: 17px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: 0.25s;
}

.mce-course-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 0, 0, 0.35);
}

.mce-course-card h3 {
    margin: 0 0 6px;
    color: var(--text);
    font: 800 16px Nunito, sans-serif;
}

.mce-course-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.mce-progress {
    height: 7px;
    overflow: hidden;
    margin-top: 13px;
    background: rgba(100, 116, 139, 0.20);
    border-radius: 999px;
}

.mce-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--red);
}

.mce-quick-grid {
    display: grid;
    gap: 10px;
}

.mce-quick-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
    transition: 0.22s;
}

.mce-quick-card:hover {
    transform: translateX(4px);
    border-color: var(--red);
}

.mce-quick-icon {
    width: 39px;
    height: 39px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--surface);
    font-size: 18px;
}

.mce-quick-card strong {
    display: block;
    font-size: 14px;
}

.mce-quick-card span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.mce-session {
    padding: 17px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.mce-session-date {
    color: var(--red);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.mce-session h3 {
    margin: 5px 0;
    font: 800 17px Nunito, sans-serif;
}

.mce-session p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.mce-empty {
    padding: 28px 15px;
    text-align: center;
    color: var(--muted);
}

.mce-empty-icon {
    font-size: 35px;
    margin-bottom: 8px;
    opacity: 0.75;
}

.mce-message-list {
    display: grid;
}

.mce-message-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.mce-message-item:last-child {
    border-bottom: 0;
}

.mce-message-item strong {
    color: var(--text);
    font-size: 14px;
}

.mce-message-item p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.mce-message-item time {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.mce-group-list {
    display: grid;
    gap: 10px;
}

.mce-group-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 13px;
    text-decoration: none;
    transition: 0.22s;
}

.mce-group-card:hover {
    transform: translateX(4px);
    border-color: var(--red);
}

.mce-group-card strong {
    display: block;
    color: var(--text);
    font-size: 14px;
}

.mce-group-card span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.mce-delay-1 {
    transition-delay: 0.05s;
}

.mce-delay-2 {
    transition-delay: 0.10s;
}

.mce-delay-3 {
    transition-delay: 0.15s;
}

.mce-delay-4 {
    transition-delay: 0.20s;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes drop {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {
    .main-menu {
        gap: 0;
    }

    .nav-link,
    .dropdown-trigger {
        padding: 10px 6px;
    }

    .nav-search input {
        width: 120px;
    }

    .brand strong {
        font-size: 14px;
    }

    .brand small {
        font-size: 12px;
    }

    .mce-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mce-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .utility-contact a:first-child {
        display: none;
    }

    .mobile-menu-button {
        display: block;
    }

    .main-menu {
        display: none;
        position: absolute;
        left: 10px;
        right: 10px;
        top: 124px;
        background: var(--red);
        padding: 15px;
        border-radius: 0 0 16px 16px;
        flex-direction: column;
        align-items: stretch;
        box-shadow: var(--shadow);
    }

    .main-menu.open {
        display: flex;
    }

    .flag-links {
        justify-content: center;
        margin-bottom: 5px;
    }

    .nav-link,
    .dropdown-trigger {
        text-align: center;
        width: 100%;
    }

    .dropdown-panel {
        position: static;
        display: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.12);
        border: 0;
        margin: 2px 0;
    }

    .nav-dropdown.open .dropdown-panel {
        display: flex;
    }

    .nav-search {
        margin-top: 5px;
    }

    .nav-search input {
        width: 100%;
    }

    .dashboard-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-social {
        text-align: left;
    }

    .footer-social div {
        justify-content: flex-start;
    }

    .mce-dashboard-layout {
        display: block;
    }

    .mce-sidebar {
        position: fixed;
        top: 124px;
        left: -285px;
        width: 270px;
        height: calc(100vh - 124px);
        z-index: 950;
        transition: left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .mce-sidebar.open {
        left: 0;
    }

    .mce-overlay {
        display: block;
        opacity: 0;
        visibility: hidden;
        transition: 0.25s;
    }

    .mce-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .mce-main {
        width: 100%;
        padding: 20px;
    }

    .mce-topbar {
        top: 124px;
        margin: -20px -20px 24px;
        padding: 14px 20px;
    }

    .mce-mobile-menu {
        display: inline-grid;
        place-items: center;
    }

    .mce-page-title {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 10px;
        align-items: center;
    }

    .mce-page-title h1 {
        font-size: 23px;
    }

    .mce-page-title p {
        grid-column: 2;
    }

    .mce-user-mini {
        display: none;
    }
}

@media (max-width: 650px) {
    .utility-inner {
        padding: 0 10px;
    }

    .utility-contact {
        display: none;
    }

    .utility-actions {
        margin-left: auto;
    }

    .main-nav {
        height: 90px;
    }

    .nav-inner {
        padding: 0 12px;
    }

    .brand img {
        width: 52px;
        height: 52px;
    }

    .brand strong {
        font-size: 12px;
    }

    .brand small {
        font-size: 10px;
    }

    .flash-stack {
        right: 10px;
        left: 10px;
    }

    .dashboard-hero,
    .footer-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-hero h1,
    .admin-head h1 {
        font-size: 27px;
    }

    .stats-grid,
    .admin-stat-grid,
    .meet-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .message-layout {
        grid-template-columns: 1fr;
    }

    .contacts {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .footer-top {
        gap: 20px;
    }

    .footer-partner {
        align-self: flex-start;
    }

    .legacy-content .container {
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    .mce-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .mce-course-list {
        grid-template-columns: 1fr;
    }

    .mce-welcome {
        padding: 23px;
    }

    .mce-welcome h2 {
        font-size: 25px;
    }

    .mce-main {
        padding: 15px;
    }

    .mce-topbar {
        margin: -15px -15px 20px;
        padding: 12px 15px;
    }
}

@media (max-width: 420px) {
    .mce-stat-grid {
        grid-template-columns: 1fr;
    }

    .mce-welcome-actions {
        flex-direction: column;
    }

    .mce-welcome-actions a {
        justify-content: center;
    }
}

/* =========================================================
   RESPONSIVE HARDENING / IMAGE PRESERVATION
   ========================================================= */

.flag-links a.active {
    padding: 3px;
    border-radius: 6px;
    background: rgba(255,255,255,.18);
    box-shadow: 0 0 0 2px rgba(255,255,255,.65), 0 5px 18px rgba(0,0,0,.18);
}

@media (min-width: 1400px) {
    .mce-main {
        padding: 32px 36px;
    }

    .mce-topbar {
        margin: -32px -36px 32px;
        padding: 18px 36px;
    }

    .mce-main-inner {
        max-width: 1800px;
    }
}

@media (min-width: 1600px) {
    .mce-main {
        padding-left: 48px;
        padding-right: 48px;
    }

    .mce-topbar {
        margin-left: -48px;
        margin-right: -48px;
        padding-left: 48px;
        padding-right: 48px;
    }
}

@media (max-width: 1100px) and (min-width: 901px) {
    .brand strong { font-size: 13px; }
    .brand small { font-size: 11px; }
    .brand img { width: 54px; height: 54px; }
    .nav-inner { gap: 10px; padding: 0 12px; }
    .main-menu { gap: 1px; }
    .nav-link, .dropdown-trigger { padding: 10px 7px; font-size: 13px; }
    .flag-links img { width: 32px; height: 24px; }
    .nav-search input { width: 115px; }
}

@media (max-width: 900px) {
    .legacy-content #topics .topic-fluid {
        flex-direction: column !important;
    }

    .legacy-content #topics .topic-fluid > img {
        width: 100% !important;
        max-width: 100% !important;
        height: 270px !important;
        min-height: 220px !important;
        max-height: 270px !important;
        object-fit: contain !important;
    }

    .legacy-content .containerg {
        flex-direction: column !important;
    }

    .legacy-content .containerg .section3,
    .legacy-content .containerg .section4 {
        width: 100% !important;
    }

    .legacy-content .containerg iframe,
    .legacy-content .containerg .section4 img {
        height: 300px !important;
    }
}

@media (max-width: 600px) {
    .legacy-content #topics .topic-fluid > img {
        height: 230px !important;
        min-height: 190px !important;
    }

    .legacy-content .containerg iframe,
    .legacy-content .containerg .section4 img {
        height: 250px !important;
    }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
   PUBLIC PAGES / LEGACY CONTENT FIXES
   ========================================================= */
.page-banner {
    position: relative;
    min-height: 320px;
    background-image: var(--banner-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.page-banner-small {
    min-height: 250px;
}

.page-banner-overlay {
    min-height: inherit;
    display: flex;
    align-items: stretch;
    background: linear-gradient(90deg, rgba(7, 12, 24, .82) 0%, rgba(7, 12, 24, .52) 45%, rgba(7, 12, 24, .18) 100%);
}

.page-banner-inner {
    display: flex;
    align-items: center;
    padding: 38px 20px;
}

.page-banner-card {
    max-width: 760px;
    color: #fff;
}

.page-banner-card > span {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--yellow);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.page-banner-card h1 {
    margin: 0 0 14px;
    color: #fff !important;
    font-family: Nunito, sans-serif;
    font-size: clamp(30px, 5vw, 58px);
    font-weight: 900;
    line-height: 1.05;
    text-shadow: 0 3px 20px rgba(0,0,0,.28);
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    color: rgba(255,255,255,.88);
    font-size: 14px;
}

.page-breadcrumb a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.page-breadcrumb a:hover {
    color: var(--yellow);
}

.page-breadcrumb strong {
    color: var(--yellow);
}

/* The old templates were designed around the original stylesheet. Keep that
   layout responsive while preventing the new shell from clipping it. */
.legacy-content {
    width: 100%;
    min-width: 0;
    overflow: visible;
    padding-bottom: 20px;
}

.legacy-content > section:first-child {
    margin-top: 0 !important;
}

/* Never hide page sections while waiting for JavaScript. */
.legacy-content section,
.legacy-content article,
.legacy-content .card,
.legacy-content .grammar-item {
    opacity: 1;
    transform: none;
}

/* Desktop: hover is enough to open Cours and Actualités. The panel touches
   the trigger so the pointer cannot fall through a gap. */
@media (min-width: 901px) {
    .nav-dropdown {
        position: relative;
    }

    .nav-dropdown .dropdown-panel {
        top: 100%;
        right: 0;
        margin-top: 0;
        min-width: 270px;
        max-height: min(70vh, 520px);
        overflow-y: auto;
    }

    .nav-dropdown:hover .dropdown-panel,
    .nav-dropdown:focus-within .dropdown-panel {
        display: flex;
    }

    .nav-dropdown.current > .dropdown-trigger {
        background: rgba(255,255,255,.14);
        color: var(--yellow) !important;
    }
}

@media (max-width: 900px) {
    .page-banner {
        min-height: 250px;
    }

    .page-banner-inner {
        padding: 30px 15px;
    }

    .page-banner-card h1 {
        font-size: clamp(28px, 9vw, 42px);
    }

    .legacy-content .container {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 650px) {
    .page-banner {
        min-height: 220px;
    }

    .page-banner-overlay {
        background: linear-gradient(90deg, rgba(7, 12, 24, .82), rgba(7, 12, 24, .48));
    }
}

/* =========================================================
   MCE PROFESSIONAL PUBLIC CONTENT POLISH
   ========================================================= */

/* Public content must remain readable on desktop and mobile. */
.legacy-content {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding: 18px 0 50px;
}

.legacy-content > * {
    min-width: 0;
}

/* Keep the public banner compact and professional. */
.page-banner {
    min-height: clamp(220px, 28vw, 330px);
}

.page-banner-inner {
    min-height: inherit;
}

.page-banner-card {
    padding: 22px 26px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(7,12,24,.76), rgba(7,12,24,.32));
    box-shadow: 0 18px 50px rgba(0,0,0,.20);
    backdrop-filter: blur(5px);
}

/* HOME: medium-size image/text feature cards. */
.legacy-content #topics {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.legacy-content #topics .topics-box {
    display: grid;
    gap: 22px;
}

.legacy-content #topics .topic-fluid {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: 280px;
    margin-top: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(100,116,139,.16);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 14px 40px rgba(15,23,42,.08);
    transition: transform .35s cubic-bezier(.2,.75,.2,1), box-shadow .35s ease, border-color .35s ease;
}

.legacy-content #topics .topic-fluid:hover {
    transform: translateY(-7px);
    border-color: rgba(255,0,0,.28);
    box-shadow: 0 22px 55px rgba(15,23,42,.15), 0 0 0 1px rgba(255,0,0,.06);
}

.legacy-content #topics .topic-fluid > img {
    flex: 0 0 42% !important;
    width: 42% !important;
    height: 320px !important;
    min-height: 260px !important;
    max-height: 360px !important;
    max-width: 42% !important;
    object-fit: contain !important;
    object-position: center;
    align-self: center;
    background: var(--surface-2);
    padding: 10px;
    margin: 0 !important;
    border-radius: 0 !important;
    transition: transform .6s cubic-bezier(.2,.75,.2,1), filter .35s ease;
}

.legacy-content #topics .topic-fluid:hover > img {
    transform: scale(1.045);
    filter: saturate(1.08) contrast(1.03);
}

.legacy-content #topics .topic-fluid > div {
    flex: 1 1 58%;
    min-width: 0;
    padding: 28px !important;
    justify-content: center;
}

.legacy-content #topics .topic-fluid h4 {
    margin-bottom: 12px;
    color: var(--red) !important;
    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.2;
}

.legacy-content #topics .topic-fluid p {
    max-width: 680px;
    margin-bottom: 10px;
    color: var(--text) !important;
    font-size: 15px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.legacy-content #topics .topic-fluid p:first-child {
    font-weight: 800;
}

/* Home cards: controlled image height instead of full intrinsic image size. */
.legacy-content #grammar {
    max-width: 1180px;
}

.legacy-content #grammar > h3 {
    margin-bottom: 8px;
    font-size: clamp(23px, 3vw, 32px);
}

.legacy-content #grammar > h4 {
    margin-bottom: 24px;
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.6;
}

.legacy-content #grammar .grammar-box {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    padding: 0 !important;
    margin: 0 0 22px;
}

.legacy-content #grammar .grammar-item {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(100,116,139,.16);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 12px 34px rgba(15,23,42,.08);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.legacy-content #grammar .grammar-item:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(255,0,0,.25);
    box-shadow: 0 24px 50px rgba(15,23,42,.15), 0 0 25px rgba(255,0,0,.06);
}

.legacy-content #grammar .grammar-item > img {
    display: block;
    width: 100% !important;
    height: 210px !important;
    max-height: 210px !important;
    object-fit: contain !important;
    object-position: center;
    background: var(--surface-2);
    padding: 8px;
    margin: 0 !important;
    transition: transform .55s ease, filter .35s ease;
}

.legacy-content #grammar .grammar-item:hover > img {
    transform: scale(1.05);
    filter: saturate(1.08);
}

.legacy-content #grammar .grammar-item .card-body {
    padding: 20px !important;
}

.legacy-content #grammar .grammar-item .opr {
    margin: 0 0 8px;
    color: var(--text) !important;
    font-size: 14px;
    line-height: 1.7;
}

/* ABOUT: readable two-column sections, medium team portraits. */
.legacy-content .containerf {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 24px;
    max-width: 1180px;
    margin: 34px auto 0;
    padding: 0 20px;
}

.legacy-content .containerf > .section1,
.legacy-content .containerf > .section2 {
    width: auto !important;
    padding: 28px !important;
    margin: 0 !important;
    border: 1px solid rgba(100,116,139,.16);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 14px 38px rgba(15,23,42,.08);
}

.legacy-content .containerf h3,
.legacy-content .section3 + .section4,
.legacy-content section > h3 {
    line-height: 1.2;
}

.legacy-content .containerf p {
    margin-bottom: 14px;
    color: var(--text) !important;
    font-size: 15px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.legacy-content .containerg {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    gap: 24px;
}

.legacy-content .containerg .section3,
.legacy-content .containerg .section4 {
    width: 50% !important;
    padding: 18px !important;
}

.legacy-content .containerg iframe {
    display: block;
    width: min(100%, 520px) !important;
    height: 340px !important;
    margin: auto;
    border-radius: 16px !important;
}

.legacy-content .containerg .section4 img {
    display: block;
    width: 100% !important;
    height: 340px !important;
    object-fit: contain !important;
    background: var(--surface-2);
    padding: 8px;
    border-radius: 16px !important;
}

.legacy-content > section:not(#topics):not(#grammar) {
    max-width: 1180px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Team cards. */
.legacy-content .row > .card {
    overflow: hidden;
    border: 1px solid rgba(100,116,139,.16);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 12px 34px rgba(15,23,42,.08);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.legacy-content .row > .card:hover {
    transform: translateY(-8px);
    border-color: rgba(255,0,0,.28);
    box-shadow: 0 24px 50px rgba(15,23,42,.16), 0 0 28px rgba(255,0,0,.07);
}

.legacy-content .row > .card .card-img,
.legacy-content .row > .card .card-img-top {
    width: 100% !important;
    height: 300px !important;
    max-height: 300px !important;
    object-fit: contain !important;
    object-position: center;
    background: var(--surface-2);
    padding: 8px;
    transition: transform .55s ease;
}

.legacy-content .row > .card:hover .card-img,
.legacy-content .row > .card:hover .card-img-top {
    transform: scale(1.04);
}

.legacy-content .row > .card .card-body {
    padding: 18px;
}

/* Presentation cards. */
.legacy-content .vocabulary-box {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: stretch;
}

.legacy-content .vocabulary-card {
    position: relative;
    width: min(100%, 350px);
    min-height: 100%;
    overflow: hidden;
    padding: 0 0 20px;
    border: 1px solid rgba(100,116,139,.16);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 14px 38px rgba(15,23,42,.08);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.legacy-content .vocabulary-card:hover {
    transform: translateY(-9px);
    border-color: rgba(255,0,0,.30);
    box-shadow: 0 26px 55px rgba(15,23,42,.17), 0 0 30px rgba(255,0,0,.08);
}

.legacy-content .vocabulary-card > img {
    display: block;
    width: 100% !important;
    height: 270px !important;
    max-height: 270px !important;
    object-fit: contain !important;
    object-position: center;
    background: var(--surface-2);
    padding: 8px;
    margin: 0 !important;
    transition: transform .55s ease, filter .35s ease;
}

.legacy-content .vocabulary-card:hover > img {
    transform: scale(1.045);
    filter: saturate(1.08) contrast(1.03);
}

.legacy-content .vocabulary-card > p {
    padding-left: 20px !important;
    padding-right: 20px !important;
    color: var(--text) !important;
    line-height: 1.65 !important;
    overflow-wrap: anywhere;
}

/* Professional "magic" hover: subtle light sweep without obscuring text. */
.legacy-content #topics .topic-fluid,
.legacy-content #grammar .grammar-item,
.legacy-content .row > .card,
.legacy-content .vocabulary-card {
    position: relative;
}

.legacy-content #topics .topic-fluid::after,
.legacy-content #grammar .grammar-item::after,
.legacy-content .row > .card::after,
.legacy-content .vocabulary-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.22) 48%, transparent 70%);
    transform: translateX(-110%);
    transition: opacity .2s ease;
}

.legacy-content #topics .topic-fluid:hover::after,
.legacy-content #grammar .grammar-item:hover::after,
.legacy-content .row > .card:hover::after,
.legacy-content .vocabulary-card:hover::after {
    opacity: 1;
    animation: mceMagicSweep .9s ease forwards;
}

@keyframes mceMagicSweep {
    to { transform: translateX(110%); }
}

/* Scroll reveal: JS adds data-scroll-reveal; without JS content stays visible. */
.mce-js-ready .legacy-content [data-scroll-reveal] {
    opacity: 0;
    transform: translateY(42px) scale(.985);
    transition: opacity .72s ease, transform .78s cubic-bezier(.2,.78,.2,1);
}

.mce-js-ready .legacy-content [data-scroll-reveal].is-visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 900px) {
    .legacy-content #topics .topic-fluid {
        min-height: 0;
    }

    .legacy-content #topics .topic-fluid > img {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 250px !important;
        min-height: 220px !important;
    }

    .legacy-content #topics .topic-fluid > div {
        padding: 22px !important;
    }

    .legacy-content #grammar .grammar-box {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .legacy-content .containerf {
        grid-template-columns: 1fr;
    }

    .legacy-content .containerg .section3,
    .legacy-content .containerg .section4 {
        width: 100% !important;
    }
}

@media (max-width: 600px) {
    .page-banner {
        min-height: 220px;
    }

    .page-banner-card {
        padding: 18px;
    }

    .legacy-content #topics .topic-fluid > img {
        height: 230px !important;
        min-height: 210px !important;
    }

    .legacy-content #topics .topic-fluid > div {
        padding: 18px !important;
    }

    .legacy-content #topics .topic-fluid p {
        font-size: 14px;
        line-height: 1.65;
    }

    .legacy-content #grammar .grammar-box {
        grid-template-columns: 1fr;
    }

    .legacy-content #grammar .grammar-item > img {
        height: 220px !important;
        max-height: 220px !important;
    }

    .legacy-content .containerf,
    .legacy-content .containerg,
    .legacy-content .vocabulary-box {
        padding-left: 12px;
        padding-right: 12px;
    }

    .legacy-content .containerf > .section1,
    .legacy-content .containerf > .section2 {
        padding: 20px !important;
    }

    .legacy-content .row > .card .card-img,
    .legacy-content .row > .card .card-img-top,
    .legacy-content .vocabulary-card > img {
        height: 250px !important;
        max-height: 250px !important;
    }
}

/* Dashboard safety: never allow a global/public animation rule to hide the account area. */
.mce-dashboard .mce-reveal {
    opacity: 1 !important;
    transform: none !important;
}
.mce-dashboard .mce-reveal-left,
.mce-dashboard .mce-reveal-right {
    transform: none !important;
}

/* =========================================================
   MCE - Chinese + Cart + Responsive Checkout
   ========================================================= */
.language-switcher a.active { font-weight: 900; box-shadow: 0 0 0 2px rgba(255,255,255,.35) inset; }
.cart-nav-link { display:inline-flex; align-items:center; gap:.4rem; color:inherit; text-decoration:none; font-weight:800; white-space:nowrap; }
.cart-nav-link:hover { color:#ffd700; transform:translateY(-1px); }

.course-buy-card {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,0,0,.055));
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1.5rem;
    box-shadow:0 18px 50px rgba(0,0,0,.14);
}
.course-buy-copy { min-width:0; }
.course-buy-kicker { font-size:.72rem; letter-spacing:.16em; text-transform:uppercase; opacity:.7; }
.course-buy-card h2 { margin:.25rem 0 .4rem; }
.course-buy-card p { margin:0; opacity:.82; }
.course-buy-action { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; justify-content:flex-end; }
.course-buy-action strong { font-size:1.2rem; white-space:nowrap; }
.checkout-button { border:0; border-radius:14px; padding:.85rem 1.1rem; background:linear-gradient(135deg,#ff2020,#c60000); color:#fff; font-weight:900; box-shadow:0 12px 28px rgba(255,0,0,.22); cursor:pointer; transition:.25s ease; }
.checkout-button:hover { transform:translateY(-2px) scale(1.01); box-shadow:0 16px 34px rgba(255,0,0,.30); }

.cart-page { max-width:1200px; }
.cart-hero { margin:1rem 0 2rem; padding:2rem; border-radius:24px; background:linear-gradient(135deg,rgba(255,0,0,.12),rgba(255,215,0,.06)); border:1px solid rgba(255,255,255,.10); }
.cart-hero span { font-size:.75rem; letter-spacing:.15em; opacity:.7; }
.cart-hero h1 { margin:.3rem 0; font-size:clamp(2rem,4vw,3.2rem); }
.cart-hero p { max-width:800px; margin:0; opacity:.82; }
.cart-layout { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(300px,.8fr); gap:1.5rem; align-items:start; }
.glass-card { background:rgba(18,27,45,.82); border:1px solid rgba(255,255,255,.10); border-radius:22px; box-shadow:0 20px 55px rgba(0,0,0,.18); backdrop-filter:blur(12px); }
.cart-items { padding:1rem; }
.cart-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto auto auto; gap:1rem; align-items:center; padding:1rem; border-bottom:1px solid rgba(255,255,255,.08); }
.cart-item:last-of-type { border-bottom:0; }
.cart-item-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:14px; background:linear-gradient(135deg,#d90000,#ffcf00); color:#fff; font-weight:900; }
.cart-item-main { min-width:0; }
.cart-item-main h2 { font-size:1.05rem; margin:0 0 .25rem; }
.cart-item-main a { font-size:.85rem; opacity:.75; }
.cart-item-price { font-weight:900; white-space:nowrap; }
.cart-item label { display:flex; flex-direction:column; gap:.25rem; font-size:.7rem; opacity:.75; }
.cart-item input { width:72px; border-radius:10px; border:1px solid rgba(255,255,255,.14); background:#0c1321; color:inherit; padding:.55rem; }
.cart-remove { border:0; background:transparent; color:#ff6b6b; font-size:1.6rem; cursor:pointer; }
.cart-summary { padding:1.5rem; position:sticky; top:calc(var(--mce-global-header-height, 124px) + 1rem); }
.cart-summary h2 { margin-top:0; }
.cart-total { font-size:2rem; font-weight:900; color:#ffd000; }
.checkout-form { display:grid; gap:.8rem; }
.checkout-form label { display:grid; gap:.35rem; font-weight:700; font-size:.85rem; }
.checkout-form input { width:100%; box-sizing:border-box; border:1px solid rgba(255,255,255,.14); border-radius:12px; padding:.75rem .8rem; background:#0b1220; color:#fff; }
.checkout-form .checkout-button { width:100%; margin-top:.4rem; }
.cart-empty, .payment-result { padding:3rem 1.5rem; text-align:center; }
.cart-empty-icon, .payment-result-icon { font-size:3rem; margin-bottom:1rem; }
.payment-result.is-success .payment-result-icon { color:#39d98a; }
.payment-result.is-failure .payment-result-icon { color:#ff6767; }

@media (max-width: 1000px) {
    .cart-layout { grid-template-columns:1fr; }
    .cart-summary { position:static; }
}
@media (max-width: 760px) {
    .course-buy-card { flex-direction:column; align-items:flex-start; }
    .course-buy-action { width:100%; justify-content:space-between; }
    .cart-item { grid-template-columns:auto minmax(0,1fr) auto; }
    .cart-item-price { grid-column:2; }
    .cart-item label { grid-column:2; }
    .cart-remove { grid-column:3; grid-row:1 / span 3; }
    .cart-nav-link span { display:none; }
}
@media (max-width: 480px) {
    .cart-hero { padding:1.25rem; }
    .cart-item { gap:.65rem; padding:.8rem .35rem; }
    .course-buy-card { padding:1rem; }
}

/* =========================================================
   MCE BANNER REFRESH — ONE CONSISTENT MCE BANNER ON ALL PAGES
   The supplied 1920x1272 image is displayed completely (contain)
   while a soft enlarged copy fills the surrounding banner area.
   This avoids cropping important parts of the image.
   ========================================================= */
.page-banner {
    position: relative;
    min-height: clamp(300px, 34vw, 640px);
    overflow: hidden;
    isolation: isolate;
    background: #111827;
    background-image: none !important;
}

.page-banner-backdrop {
    position: absolute;
    inset: -28px;
    z-index: -2;
    background-image: var(--banner-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(18px) brightness(.48) saturate(.92);
    transform: scale(1.06);
}

.page-banner-media {
    position: absolute;
    inset: 0;
    z-index: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.page-banner-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.page-banner-overlay {
    position: relative;
    z-index: 2;
    min-height: inherit;
    display: flex;
    align-items: stretch;
    background: linear-gradient(90deg, rgba(4,8,18,.46) 0%, rgba(4,8,18,.10) 28%, rgba(4,8,18,.02) 58%, rgba(4,8,18,.18) 100%);
}

.page-banner-inner {
    width: 100%;
    min-height: inherit;
    display: flex;
    align-items: center;
    padding: 28px 20px;
}

.page-banner-card {
    width: min(420px, 100%);
    max-width: 420px;
    padding: 18px 21px;
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(7,12,24,.82), rgba(7,12,24,.58));
    box-shadow: 0 18px 45px rgba(0,0,0,.24);
    backdrop-filter: blur(7px);
}

.page-banner-card h1 {
    font-size: clamp(27px, 3.4vw, 46px);
    margin-bottom: 10px;
}

/* Course/legacy images: keep large source files visually medium-sized. */
.legacy-content .card-image-top,
.legacy-content .first-image {
    display: block;
    width: min(100%, 380px) !important;
    max-width: 380px !important;
    height: 220px !important;
    max-height: 220px !important;
    object-fit: contain !important;
    object-position: center;
    margin-left: auto !important;
    margin-right: auto !important;
    background: var(--surface-2);
    padding: 8px;
    border-radius: 12px !important;
}

/* Medium images in ordinary course/article content. */
.legacy-content section img.img-fluid:not(.card-image-top):not(.first-image) {
    max-height: 360px;
    object-fit: contain;
    object-position: center;
}

/* Dropdown itself stays compact even when the viewport is large. */
@media (min-width: 901px) {
    .nav-dropdown .dropdown-panel {
        min-width: 250px;
        width: min(290px, calc(100vw - 30px));
        max-height: min(65vh, 480px);
        padding: 7px;
        border-radius: 12px;
    }

    .dropdown-panel a {
        min-height: 40px;
        padding: 9px 11px;
        font-size: 14px;
        line-height: 1.25;
    }
}

@media (max-width: 900px) {
    .page-banner {
        min-height: 360px;
    }

    .page-banner-inner {
        padding: 20px 15px;
        align-items: flex-end;
    }

    .page-banner-card {
        width: min(100%, 500px);
        max-width: 500px;
        padding: 14px 16px;
        margin-bottom: 4px;
    }

    .page-banner-media img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .legacy-content .card-image-top,
    .legacy-content .first-image {
        width: min(100%, 330px) !important;
        max-width: 330px !important;
        height: 200px !important;
        max-height: 200px !important;
    }
}

@media (max-width: 600px) {
    .page-banner {
        min-height: 300px;
    }

    .page-banner-overlay {
        background: linear-gradient(180deg, rgba(4,8,18,.05), rgba(4,8,18,.56));
    }

    .page-banner-card {
        padding: 12px 14px;
        border-radius: 13px;
    }

    .page-banner-card h1 {
        font-size: clamp(24px, 8vw, 34px);
    }

    .page-breadcrumb {
        font-size: 12px;
    }

    .legacy-content .card-image-top,
    .legacy-content .first-image {
        width: min(100%, 290px) !important;
        max-width: 290px !important;
        height: 180px !important;
        max-height: 180px !important;
    }

    .legacy-content section img.img-fluid:not(.card-image-top):not(.first-image) {
        max-height: 280px;
    }
}
