@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&display=swap');

:root {
    --bg-0: #eef2f8;
    --bg-1: #f5f7fb;
    --bg-2: #e9eef6;
    --surface: #ffffff;
    --surface-2: #f8fbff;
    --line: #d9e2ef;
    --line-strong: #b8c7da;
    --title: #10243a;
    --text: #354a63;
    --muted: #7187a1;
    --primary: #4f7cff;
    --primary-2: #3b63d8;
    --accent: #0f8a6b;
    --accent-2: #0b6a52;
    --danger: #cc4f68;
    --panel-shadow: 0 12px 28px rgba(14, 30, 52, 0.08);
    --button-shadow: 0 8px 20px rgba(24, 49, 81, 0.14);
}

html[data-theme="dark"] {
    --bg-0: #0d1522;
    --bg-1: #121c2d;
    --bg-2: #1a273b;
    --surface: #162338;
    --surface-2: #1e2e46;
    --line: #304865;
    --line-strong: #47678b;
    --title: #f2f8ff;
    --text: #c4d5ea;
    --muted: #91a8c3;
    --primary: #66c7ff;
    --primary-2: #2d9de0;
    --accent: #f0c46a;
    --accent-2: #d79f37;
    --danger: #ff8198;
    --panel-shadow: 0 20px 40px rgba(2, 10, 22, 0.45);
    --button-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html,
body {
    background:
        radial-gradient(circle at 10% 8%, rgba(79, 124, 255, 0.12), transparent 28%),
        radial-gradient(circle at 88% 84%, rgba(15, 138, 107, 0.11), transparent 30%),
        linear-gradient(150deg, var(--bg-0), var(--bg-1) 55%, var(--bg-2)) !important;
    color: var(--text) !important;
}

body {
    font-family: "Sora", "Plus Jakarta Sans", "Manrope", "Poppins", "Segoe UI", sans-serif !important;
}

.shell,
.page-shell {
    width: min(1440px, calc(100% - 34px)) !important;
    gap: 18px !important;
}

@keyframes aeroFlow {
    0%, 100% {
        transform: translateX(-8%) translateY(0);
    }
    50% {
        transform: translateX(6%) translateY(-3%);
    }
}

@keyframes aeroRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.topbar,
.header,
.hero,
.main-panel,
.menu-panel,
.chapter-list,
.preview-panel,
.chat-panel,
.content-canvas,
.support-panel,
.map-panel,
.overlay-card,
.video-card,
.story-card,
.team-card,
.stat-card,
.summary-card,
.setting-card,
.sidebar,
.canvas-card,
.editor-card,
.footer-panel > section,
.page-head,
.card {
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.34), transparent 48%),
        linear-gradient(165deg, var(--surface), var(--surface-2)) !important;
    border: 1px solid var(--line) !important;
    border-radius: 16px !important;
    box-shadow: var(--panel-shadow) !important;
}

.topbar,
.header,
.hero {
    border-top: 3px solid var(--accent) !important;
}

.topbar,
.header,
.hero,
.main-panel,
.menu-panel,
.chapter-list,
.preview-panel,
.chat-panel,
.content-canvas,
.support-panel,
.map-panel,
.overlay-card,
.video-card,
.story-card,
.team-card,
.stat-card,
.summary-card,
.setting-card,
.canvas-card,
.editor-card,
.footer-panel > section,
.page-head,
.card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.topbar::before,
.header::before,
.hero::before,
.main-panel::before,
.menu-panel::before,
.chapter-list::before,
.preview-panel::before,
.chat-panel::before,
.content-canvas::before,
.support-panel::before,
.map-panel::before,
.overlay-card::before,
.video-card::before,
.story-card::before,
.team-card::before,
.stat-card::before,
.summary-card::before,
.setting-card::before,
.canvas-card::before,
.editor-card::before,
.footer-panel > section::before,
.page-head::before,
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 24% 34%, rgba(255, 255, 255, 0.26), transparent 42%),
        linear-gradient(112deg, transparent 14%, rgba(255, 255, 255, 0.2) 44%, transparent 82%);
    opacity: 0.85;
    animation: aeroFlow 8.4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.topbar::after,
.header::after,
.hero::after,
.main-panel::after,
.menu-panel::after,
.chapter-list::after,
.preview-panel::after,
.chat-panel::after,
.content-canvas::after,
.support-panel::after,
.map-panel::after,
.overlay-card::after,
.video-card::after,
.story-card::after,
.team-card::after,
.stat-card::after,
.summary-card::after,
.setting-card::after,
.canvas-card::after,
.editor-card::after,
.footer-panel > section::after,
.page-head::after,
.card::after {
    content: "";
    position: absolute;
    inset: -30% -22%;
    background:
        conic-gradient(from 215deg at 65% 60%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 32%, rgba(194, 234, 255, 0.18) 58%, rgba(255, 255, 255, 0.05) 82%, rgba(255, 255, 255, 0.1));
    mix-blend-mode: screen;
    animation: aeroRotate 16s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.topbar > *,
.header > *,
.hero > *,
.main-panel > *,
.menu-panel > *,
.chapter-list > *,
.preview-panel > *,
.chat-panel > *,
.content-canvas > *,
.support-panel > *,
.map-panel > *,
.overlay-card > *,
.video-card > *,
.story-card > *,
.team-card > *,
.stat-card > *,
.summary-card > *,
.setting-card > *,
.canvas-card > *,
.editor-card > *,
.footer-panel > section > *,
.page-head > *,
.card > * {
    position: relative;
    z-index: 1;
}

h1,
h2,
h3,
h4,
h5,
.menu-button strong,
.chapter-title,
.video-title {
    color: var(--title) !important;
}

p,
span,
li,
small,
label,
.hero-meta,
.header-meta,
.chapter-meta,
.composer-status {
    color: var(--text) !important;
}

.muted,
.hint,
.helper,
.meta,
.status-note {
    color: var(--muted) !important;
}

.highlight,
.footer-quote,
.sidebar__footer {
    background: linear-gradient(160deg, #0f8a6b, #0b6a52) !important;
    border: 1px solid rgba(15, 138, 107, 0.35) !important;
    color: #f4fffb !important;
}

html[data-theme="dark"] .highlight,
html[data-theme="dark"] .footer-quote,
html[data-theme="dark"] .sidebar__footer {
    background: linear-gradient(160deg, #11243a, #0e1d31) !important;
    border-color: #325578 !important;
}

.highlight h2,
.footer-quote h3,
.sidebar__footer h3,
.sidebar__footer strong,
.highlight p,
.footer-quote p {
    color: #f4fffb !important;
}

html:not([data-theme="dark"]) .footer-panel .highlight,
html:not([data-theme="dark"]) .footer-panel .footer-quote {
    background: linear-gradient(160deg, #0f8a6b, #0b6a52) !important;
    border-color: rgba(15, 138, 107, 0.35) !important;
    color: #f4fffb !important;
}

html:not([data-theme="dark"]) .footer-panel .highlight h2,
html:not([data-theme="dark"]) .footer-panel .footer-quote h2,
html:not([data-theme="dark"]) .footer-panel .footer-quote h3,
html:not([data-theme="dark"]) .footer-panel .highlight p,
html:not([data-theme="dark"]) .footer-panel .footer-quote p {
    color: #f4fffb !important;
}

.menu-button,
.page-tab,
.reader-button,
.watch-button,
.send-button,
.ghost-button,
.solid-button,
.sidebar__site-link,
.sidebar__logout-button,
button,
.user-menu-button {
    border: 1px solid var(--line-strong) !important;
    border-radius: 12px !important;
    background: linear-gradient(160deg, var(--surface), var(--surface-2)) !important;
    color: var(--title) !important;
    box-shadow: var(--button-shadow) !important;
    transition: transform 0.16s ease, border-color 0.16s ease, filter 0.16s ease !important;
}

.menu-button:hover,
.page-tab:hover,
.reader-button:hover,
.watch-button:hover,
.send-button:hover,
.ghost-button:hover,
.solid-button:hover,
.sidebar__site-link:hover,
.sidebar__logout-button:hover,
button:hover,
.user-menu-button:hover {
    transform: translateY(-2px);
    border-color: var(--primary) !important;
    filter: brightness(1.03);
}

.theme-mode-button,
.theme-mode-button:hover,
.theme-mode-button:focus,
.theme-mode-button:active {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
    filter: none !important;
    color: var(--title) !important;
    width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    font-size: 1.55rem !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.solid-button,
.send-button,
.reader-button,
.watch-button,
button[type="submit"] {
    background: linear-gradient(145deg, var(--primary), var(--primary-2)) !important;
    color: #f8fcff !important;
    border-color: rgba(59, 99, 216, 0.6) !important;
}

.sidebar__logout-button {
    background: linear-gradient(145deg, #fce4ea, #f7d4dc) !important;
    color: #8c3148 !important;
    border-color: #e6b5c2 !important;
}

html[data-theme="dark"] .sidebar__logout-button {
    background: linear-gradient(145deg, #412033, #311825) !important;
    border-color: #9e4d63 !important;
    color: #ffd7e0 !important;
}

.menu-panel .menu-button {
    border-radius: 18px !important;
}

.menu-button__icon {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.menu-button__code,
.chapter-badge,
.chip,
.status-chip {
    background: rgba(79, 124, 255, 0.12) !important;
    color: #3558c9 !important;
    border: 1px solid rgba(79, 124, 255, 0.35) !important;
    border-radius: 999px !important;
}

html[data-theme="dark"] .menu-button__code,
html[data-theme="dark"] .chapter-badge,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .status-chip {
    color: #8edbff !important;
    border-color: rgba(102, 199, 255, 0.36) !important;
}

.editor-input,
.editor-select,
.editor-textarea,
.editor-file,
input,
textarea,
select {
    background: #ffffff !important;
    color: #1f3b58 !important;
    border: 1px solid #c4d3e5 !important;
    border-radius: 12px !important;
    box-shadow: inset 0 0 0 1px rgba(62, 130, 189, 0.08) !important;
}

html[data-theme="dark"] .editor-input,
html[data-theme="dark"] .editor-select,
html[data-theme="dark"] .editor-textarea,
html[data-theme="dark"] .editor-file,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: #0f1e30 !important;
    color: #e7f2ff !important;
    border: 1px solid #3d6185 !important;
    box-shadow: inset 0 0 0 1px rgba(102, 199, 255, 0.12) !important;
}

.editor-input::placeholder,
.editor-textarea::placeholder,
input::placeholder,
textarea::placeholder {
    color: #8ba1bb !important;
}

.editor-input:focus,
.editor-select:focus,
.editor-textarea:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.18) !important;
}

a { color: #3567d6 !important; }
a:hover { color: #294fa8 !important; }

html[data-theme="dark"] a { color: #87daff !important; }
html[data-theme="dark"] a:hover { color: #f4cf7f !important; }

.back-link {
    position: fixed;
    top: 18px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    color: var(--accent-deep) !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-size: 2.3rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    -webkit-text-stroke: 0.4px currentColor;
    z-index: 40;
}

.page-tab.is-active,
.page-tab[aria-current="page"],
.menu-button.is-active {
    background: linear-gradient(145deg, var(--primary), var(--primary-2)) !important;
    border-color: rgba(59, 99, 216, 0.65) !important;
    color: #ffffff !important;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(243, 249, 255, 0.88));
    width: fit-content;
    max-width: 100%;
}

html[data-theme="dark"] .site-brand {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)) !important;
}

.site-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(194, 213, 232, 0.8);
    padding: 4px;
}

html[data-theme="dark"] .site-brand img {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.site-brand span {
    color: var(--title) !important;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.4;
}

.sidebar {
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.14), transparent 35%),
        linear-gradient(180deg, rgba(90, 139, 224, 0.22), rgba(42, 85, 164, 0.22)),
        linear-gradient(160deg, var(--surface), var(--surface-2)) !important;
}

html[data-theme="dark"] .sidebar {
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.1), transparent 35%),
        linear-gradient(180deg, rgba(48, 89, 153, 0.36), rgba(22, 46, 84, 0.46)),
        linear-gradient(160deg, #132033, #1a2a41) !important;
}

/* Strong aero override for pages with highly-specific inline CSS */
body .shell .header,
body .shell .topbar,
body .shell .menu-panel,
body .shell .chapter-list,
body .shell .preview-panel,
body .shell .chat-panel,
body .shell .footer-panel > section,
body .page-shell .topbar,
body .page-shell .hero,
body .page-shell .content-canvas,
body .page-shell .support-panel,
body .page-shell .summary-card,
body .page-shell .canvas-card,
body .page-shell .card,
body .page-shell .page-head {
    background:
        radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.5), transparent 36%),
        radial-gradient(circle at 88% 86%, rgba(169, 218, 255, 0.34), transparent 40%),
        linear-gradient(132deg, rgba(131, 182, 255, 0.72) 0%, rgba(104, 151, 232, 0.78) 46%, rgba(71, 112, 198, 0.82) 100%) !important;
    border-color: rgba(166, 207, 245, 0.52) !important;
    box-shadow: 0 18px 34px rgba(28, 63, 120, 0.2) !important;
}

html[data-theme="dark"] body .shell .header,
html[data-theme="dark"] body .shell .topbar,
html[data-theme="dark"] body .shell .menu-panel,
html[data-theme="dark"] body .shell .chapter-list,
html[data-theme="dark"] body .shell .preview-panel,
html[data-theme="dark"] body .shell .chat-panel,
html[data-theme="dark"] body .shell .footer-panel > section,
html[data-theme="dark"] body .page-shell .topbar,
html[data-theme="dark"] body .page-shell .hero,
html[data-theme="dark"] body .page-shell .content-canvas,
html[data-theme="dark"] body .page-shell .support-panel,
html[data-theme="dark"] body .page-shell .summary-card,
html[data-theme="dark"] body .page-shell .canvas-card,
html[data-theme="dark"] body .page-shell .card,
html[data-theme="dark"] body .page-shell .page-head {
    background:
        radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.24), transparent 34%),
        radial-gradient(circle at 88% 86%, rgba(118, 188, 255, 0.28), transparent 38%),
        linear-gradient(132deg, rgba(33, 67, 122, 0.9) 0%, rgba(27, 54, 101, 0.94) 46%, rgba(20, 41, 78, 0.96) 100%) !important;
    border-color: rgba(86, 130, 188, 0.5) !important;
    box-shadow: 0 20px 38px rgba(4, 12, 26, 0.4) !important;
}

body .shell .header::before,
body .shell .topbar::before,
body .shell .menu-panel::before,
body .shell .chapter-list::before,
body .shell .preview-panel::before,
body .shell .chat-panel::before,
body .shell .footer-panel > section::before,
body .page-shell .topbar::before,
body .page-shell .hero::before,
body .page-shell .content-canvas::before,
body .page-shell .support-panel::before,
body .page-shell .summary-card::before,
body .page-shell .canvas-card::before,
body .page-shell .card::before,
body .page-shell .page-head::before {
    opacity: 0.95 !important;
}

/* Full component harmonization (all active pages) */
body .shell .chapter-card,
body .shell .preview-copy,
body .shell .preview-copy p,
body .shell .preview-stats article,
body .shell .reader-modal,
body .shell .reader-book,
body .shell .reader-page,
body .shell .video-modal,
body .shell .video-frame,
body .shell .chat-window,
body .shell .message,
body .shell .sidebar-card,
body .shell .shortcut,
body .shell .footer-quote,
body .shell .hero-chip,
body .shell .summary-card,
body .shell .canvas-card,
body .shell .support-card,
body .shell .button-editor-item,
body .shell .editor-sheet-wrap,
body .shell .editor-marker-card,
body .shell .recording-upload-item,
body .shell table,
body .shell th,
body .shell td,
body .page-shell .card,
body .page-shell table,
body .page-shell th,
body .page-shell td,
body .page-shell .topbar,
body .page-shell .hero,
body .page-shell .summary-card,
body .page-shell .canvas-card,
body .page-shell .support-card,
body .page-shell .page-head {
    border-color: rgba(160, 202, 242, 0.44) !important;
    box-shadow: 0 12px 26px rgba(28, 63, 120, 0.16) !important;
}

body .shell .chapter-card,
body .shell .preview-stats article,
body .shell .message,
body .shell .shortcut,
body .shell .sidebar-card,
body .shell .hero-chip,
body .shell .summary-card,
body .shell .canvas-card,
body .shell .support-card,
body .shell .button-editor-item,
body .shell .editor-marker-card,
body .shell .recording-upload-item,
body .page-shell .card,
body .page-shell .summary-card,
body .page-shell .canvas-card,
body .page-shell .support-card {
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.36), transparent 42%),
        linear-gradient(132deg, rgba(118, 173, 255, 0.54) 0%, rgba(103, 149, 226, 0.58) 50%, rgba(72, 112, 194, 0.64) 100%) !important;
}

body .shell .preview-copy,
body .shell .video-frame,
body .shell .chat-window,
body .shell .reader-book,
body .shell .editor-sheet-wrap,
body .page-shell table,
body .shell table {
    background:
        radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.32), transparent 44%),
        linear-gradient(132deg, rgba(138, 186, 255, 0.42) 0%, rgba(116, 160, 234, 0.48) 52%, rgba(84, 123, 203, 0.54) 100%) !important;
}

body .shell .preview-copy p,
body .shell .reader-page,
body .shell .video-modal,
body .shell .reader-modal,
body .page-shell th,
body .page-shell td,
body .shell th,
body .shell td {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(224, 241, 255, 0.3)) !important;
}

body .shell .reader-modal,
body .shell .video-modal,
body .shell .reader-page,
body .shell .video-frame,
body .shell .chat-window,
body .shell .message,
body .shell .editor-sheet-wrap,
body .shell .editor-marker-card,
body .shell .recording-upload-item,
body .page-shell .card {
    border-radius: 14px !important;
}

body .shell .chapter-meta span,
body .shell .chip,
body .shell .status-chip,
body .shell .reader-page__label,
body .shell .reader-audio-kind,
body .page-shell .badge {
    background: rgba(45, 120, 216, 0.24) !important;
    border: 1px solid rgba(163, 209, 255, 0.46) !important;
    color: #eef7ff !important;
}

body .shell .reader-button,
body .shell .watch-button,
body .shell .reader-nav,
body .shell .send-button,
body .shell .shortcut,
body .page-shell button,
body .page-shell .button {
    background: linear-gradient(145deg, rgba(79, 124, 255, 0.95), rgba(60, 99, 212, 0.95)) !important;
    border-color: rgba(147, 192, 255, 0.52) !important;
    color: #f7fcff !important;
}

body .shell .watch-button {
    background: linear-gradient(145deg, rgba(57, 194, 181, 0.92), rgba(39, 153, 151, 0.95)) !important;
}

body .shell .reader-close,
body .shell .video-close {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body .shell input,
body .shell textarea,
body .shell select,
body .page-shell input,
body .page-shell textarea,
body .page-shell select {
    background: rgba(255, 255, 255, 0.86) !important;
    border: 1px solid rgba(160, 202, 242, 0.52) !important;
    color: #1f3c59 !important;
}

body .shell input:focus,
body .shell textarea:focus,
body .shell select:focus,
body .page-shell input:focus,
body .page-shell textarea:focus,
body .page-shell select:focus {
    border-color: rgba(79, 124, 255, 0.78) !important;
    box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.2) !important;
}

html[data-theme="dark"] body .shell .chapter-card,
html[data-theme="dark"] body .shell .preview-copy,
html[data-theme="dark"] body .shell .preview-copy p,
html[data-theme="dark"] body .shell .preview-stats article,
html[data-theme="dark"] body .shell .reader-modal,
html[data-theme="dark"] body .shell .reader-book,
html[data-theme="dark"] body .shell .reader-page,
html[data-theme="dark"] body .shell .video-modal,
html[data-theme="dark"] body .shell .video-frame,
html[data-theme="dark"] body .shell .chat-window,
html[data-theme="dark"] body .shell .message,
html[data-theme="dark"] body .shell .sidebar-card,
html[data-theme="dark"] body .shell .shortcut,
html[data-theme="dark"] body .shell .hero-chip,
html[data-theme="dark"] body .shell .summary-card,
html[data-theme="dark"] body .shell .canvas-card,
html[data-theme="dark"] body .shell .support-card,
html[data-theme="dark"] body .shell .button-editor-item,
html[data-theme="dark"] body .shell .editor-sheet-wrap,
html[data-theme="dark"] body .shell .editor-marker-card,
html[data-theme="dark"] body .shell .recording-upload-item,
html[data-theme="dark"] body .page-shell .card,
html[data-theme="dark"] body .page-shell table,
html[data-theme="dark"] body .page-shell th,
html[data-theme="dark"] body .page-shell td {
    border-color: rgba(91, 135, 194, 0.5) !important;
    box-shadow: 0 14px 28px rgba(4, 12, 26, 0.35) !important;
}

/* Additional hard reset to suppress local themes (all pages/components) */
body .shell .panel,
body .shell .main-grid > section,
body .shell .video-button,
body .shell .map-stage,
body .shell .map-shell,
body .shell .overlay-card,
body .shell .video-overlay .video-card,
body .shell .video-overlay .video-frame,
body .shell .reader-overlay .reader-modal,
body .shell .reader-overlay .reader-book,
body .shell .reader-overlay .reader-page,
body .shell .chat-layout,
body .shell .chat-layout .sidebar,
body .shell .chat-layout .chat-panel,
body .shell .story-card,
body .shell .story-media,
body .shell .a2-frame,
body .shell .footer-panel,
body .shell .footer-panel > div,
body .shell .login-shell,
body .shell .login-hero,
body .shell .login-card,
body .page-shell .main,
body .page-shell .toolbar,
body .page-shell .tabbar,
body .page-shell .flash,
body .page-shell .modal-card,
body .page-shell .user-popover,
body .page-shell .summary-grid > *,
body .page-shell .workspace,
body .page-shell .workspace > *,
body .page-shell .editor-panel,
body .page-shell .editor-form,
body .page-shell .editor-submit-card,
body .page-shell .button-editor-item,
body .page-shell .mission-grid-editor,
body .page-shell .marker-overlay__dialog {
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.38), transparent 44%),
        linear-gradient(132deg, rgba(128, 179, 255, 0.5) 0%, rgba(110, 154, 230, 0.56) 52%, rgba(76, 116, 197, 0.62) 100%) !important;
    border: 1px solid rgba(161, 204, 245, 0.44) !important;
    box-shadow: 0 12px 24px rgba(26, 59, 112, 0.16) !important;
}

html[data-theme="dark"] body .shell .panel,
html[data-theme="dark"] body .shell .main-grid > section,
html[data-theme="dark"] body .shell .video-button,
html[data-theme="dark"] body .shell .map-stage,
html[data-theme="dark"] body .shell .map-shell,
html[data-theme="dark"] body .shell .overlay-card,
html[data-theme="dark"] body .shell .video-overlay .video-card,
html[data-theme="dark"] body .shell .video-overlay .video-frame,
html[data-theme="dark"] body .shell .reader-overlay .reader-modal,
html[data-theme="dark"] body .shell .reader-overlay .reader-book,
html[data-theme="dark"] body .shell .reader-overlay .reader-page,
html[data-theme="dark"] body .shell .chat-layout,
html[data-theme="dark"] body .shell .chat-layout .sidebar,
html[data-theme="dark"] body .shell .chat-layout .chat-panel,
html[data-theme="dark"] body .shell .story-card,
html[data-theme="dark"] body .shell .story-media,
html[data-theme="dark"] body .shell .a2-frame,
html[data-theme="dark"] body .shell .footer-panel,
html[data-theme="dark"] body .shell .footer-panel > div,
html[data-theme="dark"] body .shell .login-shell,
html[data-theme="dark"] body .shell .login-hero,
html[data-theme="dark"] body .shell .login-card,
html[data-theme="dark"] body .page-shell .main,
html[data-theme="dark"] body .page-shell .toolbar,
html[data-theme="dark"] body .page-shell .tabbar,
html[data-theme="dark"] body .page-shell .flash,
html[data-theme="dark"] body .page-shell .modal-card,
html[data-theme="dark"] body .page-shell .user-popover,
html[data-theme="dark"] body .page-shell .summary-grid > *,
html[data-theme="dark"] body .page-shell .workspace,
html[data-theme="dark"] body .page-shell .workspace > *,
html[data-theme="dark"] body .page-shell .editor-panel,
html[data-theme="dark"] body .page-shell .editor-form,
html[data-theme="dark"] body .page-shell .editor-submit-card,
html[data-theme="dark"] body .page-shell .button-editor-item,
html[data-theme="dark"] body .page-shell .mission-grid-editor,
html[data-theme="dark"] body .page-shell .marker-overlay__dialog {
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.2), transparent 44%),
        linear-gradient(132deg, rgba(36, 68, 122, 0.88) 0%, rgba(28, 54, 101, 0.92) 52%, rgba(19, 40, 79, 0.94) 100%) !important;
    border-color: rgba(88, 132, 192, 0.5) !important;
    box-shadow: 0 14px 26px rgba(4, 12, 26, 0.36) !important;
}

/* Explicit header aero override (all pages) */
body .shell .header,
body .shell .hero,
body .shell .topbar,
body .shell header,
body .page-shell .page-head,
body .page-shell .topbar,
body .page-shell header {
    background:
        radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.52), transparent 40%),
        radial-gradient(circle at 88% 86%, rgba(170, 220, 255, 0.38), transparent 44%),
        linear-gradient(132deg, rgba(127, 183, 255, 0.82) 0%, rgba(102, 149, 229, 0.86) 52%, rgba(72, 112, 198, 0.9) 100%) !important;
    border-color: rgba(171, 210, 246, 0.62) !important;
    box-shadow: 0 18px 34px rgba(29, 64, 121, 0.24) !important;
}

html[data-theme="dark"] body .shell .header,
html[data-theme="dark"] body .shell .hero,
html[data-theme="dark"] body .shell .topbar,
html[data-theme="dark"] body .shell header,
html[data-theme="dark"] body .page-shell .page-head,
html[data-theme="dark"] body .page-shell .topbar,
html[data-theme="dark"] body .page-shell header {
    background:
        radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.24), transparent 38%),
        radial-gradient(circle at 88% 86%, rgba(113, 189, 255, 0.28), transparent 42%),
        linear-gradient(132deg, rgba(41, 76, 134, 0.92) 0%, rgba(30, 60, 112, 0.94) 52%, rgba(22, 45, 87, 0.96) 100%) !important;
    border-color: rgba(92, 136, 196, 0.6) !important;
    box-shadow: 0 20px 38px rgba(4, 12, 26, 0.42) !important;
}

body .shell .header::before,
body .shell .hero::before,
body .shell .topbar::before,
body .shell header::before,
body .page-shell .page-head::before,
body .page-shell .topbar::before,
body .page-shell header::before {
    content: "" !important;
    background-image: none !important;
    background:
        radial-gradient(circle at 22% 34%, rgba(255, 255, 255, 0.34), transparent 42%),
        linear-gradient(112deg, transparent 14%, rgba(255, 255, 255, 0.28) 44%, transparent 82%) !important;
    opacity: 0.92 !important;
}

body .shell .header::after,
body .shell .hero::after,
body .shell .topbar::after,
body .shell header::after,
body .page-shell .page-head::after,
body .page-shell .topbar::after,
body .page-shell header::after {
    content: "" !important;
    position: absolute;
    inset: -30% -22%;
    background:
        conic-gradient(from 215deg at 65% 60%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 32%, rgba(194, 234, 255, 0.2) 58%, rgba(255, 255, 255, 0.06) 82%, rgba(255, 255, 255, 0.14)) !important;
    mix-blend-mode: screen;
    animation: aeroRotate 16s linear infinite;
    pointer-events: none;
    z-index: 0;
}

body .shell .header > *,
body .shell .hero > *,
body .shell .topbar > *,
body .shell header > *,
body .page-shell .page-head > *,
body .page-shell .topbar > *,
body .page-shell header > * {
    position: relative;
    z-index: 1;
}

/* Remove only Footer card frame, keep wrapper and Copyright card frame */
body .shell .footer-panel .highlight {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body .shell .footer-panel .highlight::before,
body .shell .footer-panel .highlight::after {
    content: none !important;
    display: none !important;
}

body .shell .footer-panel .highlight h2,
body .shell .footer-panel .highlight h3,
body .shell .footer-panel .highlight p {
    color: var(--title) !important;
}

/* E7 Footer card (first block) without frame; keep Copyright card framed */
body .shell .footer-panel > div:first-child:not(.footer-quote) {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body .shell .footer-panel > div:first-child:not(.footer-quote)::before,
body .shell .footer-panel > div:first-child:not(.footer-quote)::after {
    content: none !important;
    display: none !important;
}

/* Hide Copyright label title, keep note text */
body .shell .footer-quote h2,
body .shell .footer-quote h3 {
    display: none !important;
}

/* Normalize copyright note typography on all pages */
body .shell .footer-quote p {
    font-family: "Plus Jakarta Sans", "Manrope", "Poppins", "Segoe UI", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
    color: var(--text) !important;
    letter-spacing: 0 !important;
}

/* Temporarily hide communication labels across all pages */
.section-label,
.item-code,
.code-tag,
.canvas-card__code {
    display: none !important;
}

/* =========================================================
   Global 3-tier responsive system
   1) PC      : >= 1025px
   2) Tablet  : 768px - 1024px
   3) Mobile  : <= 767px
   ========================================================= */

/* Desktop */
@media (min-width: 1025px) {
    .shell,
    .page-shell {
        width: min(100% - 28px, 1440px) !important;
    }

    .chat-layout {
        grid-template-columns: 320px minmax(0, 1fr) !important;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .shell,
    .page-shell {
        width: min(100% - 24px, 1200px) !important;
        gap: 14px !important;
    }

    h1 {
        font-size: clamp(2rem, 4.2vw, 3rem) !important;
    }

    .main,
    .main-grid,
    .content-grid,
    .video-grid,
    .menu-grid,
    .chat-layout {
        grid-template-columns: 1fr !important;
    }

    .sidebar,
    .chat-panel,
    .main-panel,
    .preview-panel,
    .chapter-list,
    .footer-panel {
        padding: 18px !important;
    }

    .reader-modal,
    .video-modal,
    .video-card {
        width: min(100%, 980px) !important;
        max-height: 88vh !important;
    }

    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .chat-layout {
        grid-template-columns: 1fr !important;
    }

    .chat-window {
        height: min(52vh, 560px) !important;
    }

    .map-stage {
        min-height: 500px !important;
    }

    .video-button__thumb {
        height: 170px !important;
    }

    .video-frame {
        max-height: 56vh !important;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .shell,
    .page-shell {
        width: calc(100% - 12px) !important;
        margin: 8px auto !important;
        gap: 10px !important;
    }

    h1 {
        font-size: clamp(1.5rem, 7vw, 2.1rem) !important;
        line-height: 1.1 !important;
    }

    h2 {
        font-size: clamp(1.15rem, 5.2vw, 1.5rem) !important;
        line-height: 1.2 !important;
    }

    p,
    li,
    input,
    textarea,
    button {
        font-size: 14px !important;
    }

    .main,
    .main-grid,
    .content-grid,
    .video-grid,
    .menu-grid,
    .chat-layout,
    .footer-panel,
    .preview-stats {
        grid-template-columns: 1fr !important;
    }

    .topbar,
    .hero,
    .header,
    .main-panel,
    .menu-panel,
    .preview-panel,
    .chapter-list,
    .chat-panel,
    .sidebar,
    .footer-panel,
    .canvas-card,
    .editor-panel,
    .button-editor-item {
        padding: 14px !important;
        border-radius: 14px !important;
    }

    .menu-button,
    .video-button,
    .shortcut,
    .send-button,
    .reader-nav,
    .watch-button {
        min-height: 42px !important;
    }

    .reader-modal,
    .video-modal,
    .video-card {
        width: 100% !important;
        max-height: 92vh !important;
        padding: 14px !important;
        border-radius: 16px !important;
    }

    .reader-book,
    .video-frame {
        border-radius: 12px !important;
    }

    .reader-pages {
        max-height: 58vh !important;
    }

    .menu-grid {
        grid-template-columns: 1fr !important;
    }

    .chat-window {
        height: min(50vh, 460px) !important;
        padding: 14px !important;
    }

    .map-stage {
        min-height: 380px !important;
    }

    .map-button__image {
        width: 68px !important;
        height: 68px !important;
    }

    .map-stage .map-button__badge {
        width: 52px !important;
        height: 52px !important;
        font-size: 1.3rem !important;
    }

    .video-button__thumb {
        height: 148px !important;
    }

    .video-frame {
        max-height: 48vh !important;
    }
}

/* =========================================================
   Global Theme Refresh: Modern Professional
   (non-functional visual override)
   ========================================================= */
:root {
    --bg-0: #f4f7fc;
    --bg-1: #edf2f9;
    --bg-2: #e4ebf6;
    --surface: #ffffff;
    --surface-2: #f8fbff;
    --line: #d7e1ef;
    --line-strong: #b4c4db;
    --title: #0f2138;
    --text: #3a4f67;
    --muted: #6f859f;
    --primary: #2f6fed;
    --primary-2: #2258c7;
    --accent: #0f8f7a;
    --accent-2: #0b7463;
    --panel-shadow: 0 10px 26px rgba(14, 31, 60, 0.08);
    --button-shadow: 0 8px 18px rgba(21, 47, 89, 0.12);
}

html[data-theme="dark"] {
    --bg-0: #0b1320;
    --bg-1: #101a2b;
    --bg-2: #16243a;
    --surface: #162438;
    --surface-2: #1c2d45;
    --line: #2d4664;
    --line-strong: #416188;
    --title: #eef5ff;
    --text: #c2d3e8;
    --muted: #8ea4bf;
    --primary: #6ab7ff;
    --primary-2: #3f9ce8;
    --accent: #40c7a8;
    --accent-2: #2ca28a;
    --panel-shadow: 0 18px 36px rgba(3, 10, 20, 0.42);
    --button-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

html,
body {
    background:
        radial-gradient(circle at 14% 8%, rgba(92, 137, 233, 0.11), transparent 34%),
        radial-gradient(circle at 90% 92%, rgba(43, 173, 150, 0.1), transparent 36%),
        linear-gradient(155deg, var(--bg-0) 0%, var(--bg-1) 56%, var(--bg-2) 100%) !important;
    color: var(--text) !important;
}

.topbar,
.header,
.hero,
.main-panel,
.menu-panel,
.chapter-list,
.preview-panel,
.chat-panel,
.content-canvas,
.support-panel,
.map-panel,
.overlay-card,
.video-card,
.story-card,
.team-card,
.stat-card,
.summary-card,
.setting-card,
.sidebar,
.canvas-card,
.editor-card,
.footer-panel > section,
.page-head,
.card,
.panel,
.main-grid > .panel {
    background: linear-gradient(165deg, var(--surface), var(--surface-2)) !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    box-shadow: var(--panel-shadow) !important;
}

.topbar::before,
.header::before,
.hero::before,
.main-panel::before,
.menu-panel::before,
.chapter-list::before,
.preview-panel::before,
.chat-panel::before,
.content-canvas::before,
.support-panel::before,
.map-panel::before,
.overlay-card::before,
.video-card::before,
.story-card::before,
.team-card::before,
.stat-card::before,
.summary-card::before,
.setting-card::before,
.canvas-card::before,
.editor-card::before,
.footer-panel > section::before,
.page-head::before,
.card::before,
.topbar::after,
.header::after,
.hero::after,
.main-panel::after,
.menu-panel::after,
.chapter-list::after,
.preview-panel::after,
.chat-panel::after,
.content-canvas::after,
.support-panel::after,
.map-panel::after,
.overlay-card::after,
.video-card::after,
.story-card::after,
.team-card::after,
.stat-card::after,
.summary-card::after,
.setting-card::after,
.canvas-card::after,
.editor-card::after,
.footer-panel > section::after,
.page-head::after,
.card::after {
    content: none !important;
}

.menu-button,
.page-tab,
.reader-button,
.watch-button,
.send-button,
.ghost-button,
.solid-button,
.sidebar__site-link,
.sidebar__logout-button,
button,
.user-menu-button {
    border-radius: 12px !important;
}

.solid-button,
.send-button,
.reader-button,
.watch-button,
button[type="submit"] {
    background: linear-gradient(145deg, var(--primary), var(--primary-2)) !important;
    color: #f7fbff !important;
    border-color: rgba(47, 111, 237, 0.55) !important;
}

.menu-button {
    border-color: #c8d7ec !important;
    box-shadow: 0 10px 24px rgba(18, 43, 84, 0.12) !important;
}

.menu-button strong,
.sidebar__item,
.sidebar__site-link,
.sidebar__logout-button,
h1, h2, h3, h4, h5 {
    color: var(--title) !important;
}

p,
li,
small,
label,
input,
textarea,
select {
    color: var(--text) !important;
}

.hero p,
.topbar p,
.header p {
    border-top-color: rgba(7, 22, 45, 0.22) !important;
}

.footer-panel,
.footer-quote {
    border-radius: 14px !important;
}

.map-stage,
.chat-window,
.video-frame,
.reader-book,
.story-media {
    border-radius: 12px !important;
}

@media (min-width: 768px) and (max-width: 1024px) {
    .topbar,
    .hero,
    .header,
    .menu-panel,
    .main-panel,
    .chat-panel,
    .sidebar,
    .footer-panel {
        border-radius: 12px !important;
    }
}

@media (max-width: 767px) {
    .topbar,
    .hero,
    .header,
    .main-panel,
    .menu-panel,
    .preview-panel,
    .chapter-list,
    .chat-panel,
    .sidebar,
    .footer-panel,
    .canvas-card,
    .editor-panel,
    .button-editor-item {
        border-radius: 10px !important;
    }
}
