:root {
    --theme-accent: #24b7ff;
    --background-accent: #24b7ff;
    --background-accent-rgb: 36, 183, 255;
    --theme-hue-shift: 0deg;
    --background-hue-shift: 0deg;
    --theme-bg: #01030a;
    --theme-bg-soft: #061020;
    --theme-panel: #020917;
    --theme-panel-strong: #0a1b30;
    --theme-text: #eef6ff;
    --theme-muted: #8ca9c7;
    --theme-font-size: 16px;
    --theme-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --theme-letter-spacing: 0px;
    --type-page-heading-size: 1.62rem;
    --type-panel-heading-size: 1.12rem;
    --type-label-size: 0.68rem;
    --type-body-size: 0.88rem;
    --type-muted-size: 0.8rem;
    --type-number-size: 1.05rem;
    --type-button-size: 0.74rem;
    --type-page-heading-weight: 950;
    --type-panel-heading-weight: 950;
    --type-label-weight: 950;
    --type-body-weight: 750;
    --type-button-weight: 950;
    --type-heading-color: #eff6fb;
    --type-body-color: #eff6fb;
    --type-muted-color: #91a6b8;
    --type-label-color: #91a6b8;
    --type-number-color: #eff6fb;
    --theme-button-radius: 999px;
    --theme-widget-radius: 8px;
    --theme-card-shadow: 0 20px 58px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.025);
    --theme-panel-mix: 0.94;
    --theme-panel-padding: 18px;
    --theme-row-padding: 11px 12px;
    --theme-row-min-height: 26px;
    --theme-line-height: 1.42;
    --theme-section-gap: 14px;
    --theme-border-width: 1px;
    --theme-gap: 18px;
    --theme-page-width: min(100% - 44px, 1480px);
    --theme-border: rgba(36, 183, 255, 0.28);
    --theme-accent-alpha: 0.2;
    --theme-glow-strength: 0.2;
    --rae-panel-border: rgba(36, 183, 255, 0.46);
    --rae-panel-glow: 0 0 0 1px rgba(36, 183, 255, 0.08), 0 0 22px rgba(36, 183, 255, 0.1), 0 18px 54px rgba(0, 0, 0, 0.36);
}

body {
    color: var(--theme-text);
    background:
        radial-gradient(circle at 50% 8%, rgba(var(--background-accent-rgb), 0.12), transparent 36rem),
        radial-gradient(circle at 88% 72%, rgba(var(--background-accent-rgb), 0.08), transparent 28rem),
        linear-gradient(180deg, var(--theme-bg) 0%, #020711 100%);
    font-family: var(--theme-font-family);
    font-size: var(--theme-font-size);
    letter-spacing: var(--theme-letter-spacing);
}

body[data-background-mode="solid"] {
    background: var(--theme-bg);
}

body[data-background-mode="signalGrid"] {
    background:
        linear-gradient(rgba(var(--background-accent-rgb), 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--background-accent-rgb), 0.052) 1px, transparent 1px),
        radial-gradient(circle at 50% 8%, rgba(var(--background-accent-rgb), 0.16), transparent 36rem),
        var(--theme-bg);
    background-size: 34px 34px, 34px 34px, auto, auto;
}

body[data-background-mode="deepBlack"] {
    background:
        radial-gradient(circle at 50% 0%, rgba(var(--background-accent-rgb), 0.11), transparent 28rem),
        #000;
}

body[data-background-mode="commandGrid"] {
    background:
        linear-gradient(rgba(var(--background-accent-rgb), 0.095) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--background-accent-rgb), 0.075) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px),
        radial-gradient(circle at 18% 18%, rgba(var(--background-accent-rgb), 0.18), transparent 24rem),
        linear-gradient(180deg, var(--theme-bg), #01040a);
    background-size: 40px 40px, 40px 40px, 160px 160px, 160px 160px, auto, auto;
}

body[data-background-mode="blueprint"] {
    background:
        linear-gradient(rgba(var(--background-accent-rgb), 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--background-accent-rgb), 0.08) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 76% 16%, rgba(var(--background-accent-rgb), 0.18), transparent 26rem),
        linear-gradient(135deg, #02111f, var(--theme-bg));
    background-size: 28px 28px, 28px 28px, 140px 140px, 140px 140px, auto, auto;
}

body[data-background-mode="auroraVeil"] {
    background:
        radial-gradient(ellipse at 18% 12%, rgba(var(--background-accent-rgb), 0.22), transparent 30rem),
        radial-gradient(ellipse at 74% 18%, rgba(179, 107, 255, 0.2), transparent 32rem),
        radial-gradient(ellipse at 52% 88%, rgba(32, 240, 138, 0.1), transparent 34rem),
        linear-gradient(180deg, #01030a, var(--theme-bg-soft));
}

body[data-background-mode="neonHorizon"] {
    background:
        linear-gradient(rgba(var(--background-accent-rgb), 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--background-accent-rgb), 0.035) 1px, transparent 1px),
        radial-gradient(ellipse at 50% 52%, rgba(var(--background-accent-rgb), 0.24), transparent 22rem),
        linear-gradient(180deg, transparent 0 46%, rgba(var(--background-accent-rgb), 0.18) 47%, transparent 55%),
        linear-gradient(180deg, #01030a, #050616 62%, #02040a);
    background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

body[data-background-mode="oceanDepth"] {
    background:
        radial-gradient(circle at 16% 12%, rgba(25, 215, 255, 0.18), transparent 27rem),
        radial-gradient(circle at 88% 78%, rgba(11, 94, 132, 0.26), transparent 30rem),
        linear-gradient(135deg, #010a13, #031a28 48%, #01040a);
}

body[data-background-mode="cyberFrost"] {
    background:
        linear-gradient(120deg, rgba(125, 233, 255, 0.08) 1px, transparent 1px),
        linear-gradient(30deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 28% 10%, rgba(184, 243, 255, 0.22), transparent 24rem),
        linear-gradient(180deg, #031016, #061923 58%, #02060a);
    background-size: 58px 58px, 58px 58px, auto, auto;
}

body[data-background-mode="voltageField"] {
    background:
        linear-gradient(115deg, transparent 0 46%, rgba(255, 228, 92, 0.12) 47%, transparent 49% 100%),
        linear-gradient(70deg, transparent 0 63%, rgba(var(--background-accent-rgb), 0.1) 64%, transparent 66% 100%),
        radial-gradient(circle at 82% 16%, rgba(255, 228, 92, 0.2), transparent 23rem),
        linear-gradient(180deg, #090905, #070910 62%, #01030a);
    background-size: 260px 260px, 300px 300px, auto, auto;
}

body[data-background-mode="obsidianGlow"] {
    background:
        radial-gradient(circle at 22% 16%, rgba(245, 184, 75, 0.16), transparent 24rem),
        radial-gradient(circle at 78% 68%, rgba(var(--background-accent-rgb), 0.1), transparent 28rem),
        linear-gradient(145deg, #050302, #0b0907 48%, #01030a);
}

body[data-background-mode="emeraldCode"] {
    background:
        linear-gradient(rgba(31, 241, 139, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 241, 139, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 18% 14%, rgba(31, 241, 139, 0.18), transparent 22rem),
        linear-gradient(180deg, #010804, #03120a 56%, #01030a);
    background-size: 26px 26px, 52px 52px, auto, auto;
}

body[data-background-mode="rubyNebula"] {
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 77, 109, 0.22), transparent 25rem),
        radial-gradient(circle at 76% 34%, rgba(255, 126, 168, 0.14), transparent 29rem),
        radial-gradient(circle at 50% 86%, rgba(var(--background-accent-rgb), 0.12), transparent 34rem),
        linear-gradient(180deg, #0b0206, #040208 70%, #01030a);
}

body[data-background-mode="violetVoid"] {
    background:
        radial-gradient(circle at 76% 10%, rgba(143, 109, 255, 0.24), transparent 26rem),
        radial-gradient(circle at 22% 80%, rgba(36, 183, 255, 0.12), transparent 30rem),
        linear-gradient(135deg, #06020e, #0d0620 55%, #02030a);
}

body[data-background-mode="solarEmber"] {
    background:
        radial-gradient(circle at 30% 18%, rgba(255, 138, 61, 0.22), transparent 24rem),
        radial-gradient(circle at 84% 74%, rgba(255, 209, 102, 0.12), transparent 28rem),
        linear-gradient(145deg, #100501, #170904 48%, #02040a);
}

body[data-surface-depth="clean"] {
    --theme-card-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    --theme-panel-mix: 0.9;
}

body[data-surface-depth="clean"] .panel,
body[data-surface-depth="clean"] .stat-card,
body[data-surface-depth="clean"] .overview-banner,
body[data-surface-depth="clean"] .customisation-section,
body[data-surface-depth="clean"] .plan-card,
body[data-surface-depth="clean"] .profile-subscription-card > div,
body[data-surface-depth="clean"] .chat-panel,
body[data-surface-depth="clean"] .notification-dropdown {
    background: rgba(3, 10, 18, 0.96);
    border-color: rgba(var(--color-accent-rgb), 0.24);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.018);
}

body[data-surface-depth="layered"] .panel,
body[data-surface-depth="layered"] .stat-card,
body[data-surface-depth="layered"] .overview-banner,
body[data-surface-depth="layered"] .customisation-section,
body[data-surface-depth="layered"] .plan-card,
body[data-surface-depth="layered"] .profile-subscription-card > div,
body[data-surface-depth="layered"] .chat-panel,
body[data-surface-depth="layered"] .notification-dropdown {
    background: linear-gradient(145deg, rgba(var(--color-accent-rgb), 0.08), rgba(2, 9, 18, 0.93) 38%, rgba(4, 12, 24, 0.94));
    border-color: rgba(var(--color-accent-rgb), 0.42);
    box-shadow: var(--theme-card-shadow), 0 0 18px rgba(var(--color-accent-rgb), 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body[data-surface-depth="hologlow"] {
    --theme-border: rgba(var(--color-accent-rgb), 0.44);
    --theme-card-shadow: 0 18px 48px rgba(0, 0, 0, 0.4), 0 0 24px rgba(var(--color-accent-rgb), 0.16);
}

body[data-surface-depth="hologlow"] .panel,
body[data-surface-depth="hologlow"] .stat-card,
body[data-surface-depth="hologlow"] .overview-banner,
body[data-surface-depth="hologlow"] .customisation-section,
body[data-surface-depth="hologlow"] .plan-card,
body[data-surface-depth="hologlow"] .profile-subscription-card > div,
body[data-surface-depth="hologlow"] .chat-panel,
body[data-surface-depth="hologlow"] .notification-dropdown {
    background: linear-gradient(145deg, rgba(var(--color-accent-rgb), 0.14), rgba(3, 8, 18, 0.88) 40%, rgba(var(--color-accent-rgb), 0.07));
    border-color: rgba(var(--color-accent-rgb), 0.72);
    box-shadow: 0 0 0 1px rgba(var(--color-accent-rgb), 0.24), 0 0 30px rgba(var(--color-accent-rgb), 0.22), 0 18px 54px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chat-panel,
.notification-dropdown,
body[data-surface-depth="clean"] .chat-panel,
body[data-surface-depth="clean"] .notification-dropdown,
body[data-surface-depth="layered"] .chat-panel,
body[data-surface-depth="layered"] .notification-dropdown,
body[data-surface-depth="hologlow"] .chat-panel,
body[data-surface-depth="hologlow"] .notification-dropdown {
    background:
        radial-gradient(circle at 18% 0%, rgba(var(--color-accent-rgb), 0.14), transparent 16rem),
        linear-gradient(145deg, #03101f, #020917 54%, #01050d);
}

body[data-widget-shape="soft"] {
    --theme-widget-radius: 14px;
    --theme-button-radius: 14px;
}

body[data-widget-shape="minimal"] {
    --theme-widget-radius: 4px;
    --theme-button-radius: 6px;
}

body[data-data-density="compact"] {
    --theme-gap: 12px;
}

body[data-data-density="expanded"] {
    --theme-gap: 24px;
}

body[data-dashboard-frame="wide"] {
    --theme-page-width: min(100% - 36px, 1680px);
}

body[data-dashboard-frame="immersive"] {
    --theme-page-width: min(100% - 24px, 1880px);
}

body[data-navigation-style="compact"] .top-nav .nav-link {
    padding-inline: 10px;
    font-size: 0.76rem;
}

body[data-navigation-style="minimal"] .top-nav {
    display: none;
}

body[data-number-style] .stat-card strong,
body[data-number-style] .summary-mini strong,
body[data-number-style] .performance-metric strong,
body[data-number-style] .performance-value,
body[data-number-style] .performance-card-top strong,
body[data-number-style] .market-return-value,
body[data-number-style] .trade-result,
body[data-number-style] .detail-list dd,
body[data-number-style] .profile-subscription-card strong,
body[data-number-style] .plan-price,
body[data-number-style] .plan-details dd,
body[data-number-style] .admin-panel-metrics strong,
body[data-number-style] table td {
    font-variant-numeric: normal;
    letter-spacing: var(--theme-letter-spacing);
}

body[data-number-style="tabular"] .stat-card strong,
body[data-number-style="tabular"] .summary-mini strong,
body[data-number-style="tabular"] .performance-metric strong,
body[data-number-style="tabular"] .performance-value,
body[data-number-style="tabular"] .performance-card-top strong,
body[data-number-style="tabular"] .market-return-value,
body[data-number-style="tabular"] .trade-result,
body[data-number-style="tabular"] .detail-list dd,
body[data-number-style="tabular"] .profile-subscription-card strong,
body[data-number-style="tabular"] .plan-price,
body[data-number-style="tabular"] .plan-details dd,
body[data-number-style="tabular"] .admin-panel-metrics strong,
body[data-number-style="tabular"] table td {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.015em;
}

body[data-number-style="terminal"] .stat-card strong,
body[data-number-style="terminal"] .summary-mini strong,
body[data-number-style="terminal"] .performance-metric strong,
body[data-number-style="terminal"] .performance-value,
body[data-number-style="terminal"] .performance-card-top strong,
body[data-number-style="terminal"] .market-return-value,
body[data-number-style="terminal"] .trade-result,
body[data-number-style="terminal"] .detail-list dd,
body[data-number-style="terminal"] .profile-subscription-card strong,
body[data-number-style="terminal"] .plan-price,
body[data-number-style="terminal"] .plan-details dd,
body[data-number-style="terminal"] .admin-panel-metrics strong,
body[data-number-style="terminal"] table td {
    color: var(--theme-accent);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums slashed-zero;
    letter-spacing: 0.045em;
    text-shadow: 0 0 8px rgba(var(--color-accent-rgb), 0.32);
}

.dashboard-page .panel,
.settings-page .panel,
.admin-page .panel,
.stat-card,
.overview-banner,
.customisation-section,
.plan-card,
.profile-subscription-card > div,
.detail-list div,
.chat-panel,
.notification-dropdown {
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

body:not([data-motion="reduced"]) .dashboard-page .panel:hover,
body:not([data-motion="reduced"]) .settings-page .panel:hover,
body:not([data-motion="reduced"]) .admin-page .panel:hover,
body:not([data-motion="reduced"]) .stat-card:hover,
body:not([data-motion="reduced"]) .overview-banner:hover,
body:not([data-motion="reduced"]) .customisation-section:hover,
body:not([data-motion="reduced"]) .plan-card:hover,
body:not([data-motion="reduced"]) .profile-subscription-card > div:hover,
body:not([data-motion="reduced"]) .chat-panel:hover,
body:not([data-motion="reduced"]) .notification-dropdown:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--color-accent-rgb), 0.78);
    box-shadow:
        0 0 0 1px rgba(var(--color-accent-rgb), var(--theme-glow-strength)),
        0 0 30px rgba(var(--color-accent-rgb), var(--theme-glow-strength)),
        0 18px 54px rgba(0, 0, 0, 0.42),
        inset 0 0 20px rgba(var(--color-accent-rgb), 0.045);
}

body[data-motion="reduced"] *,
body[data-motion="reduced"] *::before,
body[data-motion="reduced"] *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
}

.settings-page .panel:hover,
.settings-page .customisation-section:hover {
    transform: none !important;
}

body:has(.history-modal:not([hidden])),
body:has(.tour-overlay:not([hidden])),
body:has(.risk-modal.open),
body.support-open,
body:has(.support-overlay:not([hidden])),
body:has(.chat-panel:not([hidden])),
body:has(.notification-dropdown:not([hidden])) {
    overflow: hidden;
}

.panel,
.stat-card,
.overview-banner,
.customisation-section,
.history-panel,
.tour-card,
.risk-modal-panel,
.chat-panel,
.notification-dropdown {
    border: var(--theme-border-width) solid rgba(var(--color-accent-rgb), 0.46);
    box-shadow:
        0 0 0 1px rgba(var(--color-accent-rgb), 0.08),
        0 0 22px rgba(var(--color-accent-rgb), var(--theme-glow-strength)),
        0 18px 54px rgba(0, 0, 0, 0.36),
        inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.app-header,
.dashboard-page,
.chat-widget {
    font-family: var(--theme-font-family, var(--font-family));
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(var(--color-accent-rgb), 0.18);
    background:
        radial-gradient(circle at 12% 0%, rgba(var(--color-accent-rgb), 0.11), transparent 20rem),
        rgba(1, 4, 10, 0.94);
    backdrop-filter: blur(18px);
}

.app-header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    width: var(--theme-page-width);
    min-height: 72px;
    margin: 0 auto;
}

.app-header-inner:has(.master-menu-shell) {
    grid-template-columns: auto auto auto minmax(0, 1fr) auto auto;
    gap: 14px;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-lockup img {
    width: 146px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.18));
}

.brand-lockup span {
    color: var(--theme-accent);
    font-size: 0.92rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(var(--color-accent-rgb), 0.5);
}

.app-header-inner:has(.master-menu-shell) .brand-lockup {
    grid-column: 1;
    grid-row: 1;
}

.master-menu-shell {
    position: relative;
    z-index: 90;
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    gap: 8px;
}

.master-menu-button,
.master-menu-stack .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    min-height: 36px;
    padding: 0;
    border: 1px solid rgba(var(--color-accent-rgb), 0.42);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.12), rgba(var(--color-accent-rgb), 0.035)),
        rgba(2, 9, 23, 0.96);
    box-shadow:
        0 0 0 1px rgba(var(--color-accent-rgb), 0.06),
        inset 0 0 14px rgba(var(--color-accent-rgb), 0.04);
}

.master-menu-button {
    color: var(--theme-text);
    cursor: pointer;
}

.master-menu-button:hover,
.master-menu-button[aria-expanded="true"],
.master-menu-stack .nav-link:hover,
.master-menu-stack .nav-link.active {
    border-color: rgba(var(--color-accent-rgb), 0.82);
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.22), rgba(var(--color-accent-rgb), 0.07)),
        rgba(2, 9, 23, 0.98);
    box-shadow:
        0 0 18px rgba(var(--color-accent-rgb), 0.18),
        inset 0 0 14px rgba(var(--color-accent-rgb), 0.07);
}

.master-menu-button .header-icon {
    width: 16px;
    height: 16px;
}

.master-menu-button svg,
.master-menu-logout svg {
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.master-menu-stack {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    padding: 0;
}

.master-menu-stack[hidden] {
    display: none;
}

.master-menu-logout .nav-icon {
    color: #ff5f72;
    stroke: #ff5f72;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    width: 44px;
    padding: 0;
    border: 1px solid rgba(var(--color-accent-rgb), 0.34);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.1), rgba(var(--color-accent-rgb), 0.025)),
        rgba(2, 9, 23, 0.72);
    color: var(--theme-text);
    box-shadow: inset 0 0 14px rgba(var(--color-accent-rgb), 0.035);
    font-size: 0.78rem;
    font-weight: 900;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.nav-icon,
.header-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-icon {
    filter: drop-shadow(0 0 8px rgba(var(--color-accent-rgb), 0.28));
}

.nav-link:hover,
.nav-link.active {
    border-color: rgba(var(--color-accent-rgb), 0.82);
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.22), rgba(var(--color-accent-rgb), 0.07)),
        rgba(2, 9, 23, 0.86);
    box-shadow: 0 0 18px rgba(var(--color-accent-rgb), 0.16), inset 0 0 14px rgba(var(--color-accent-rgb), 0.06);
    color: #ffffff;
}

body:not([data-motion="reduced"]) .nav-link:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(var(--color-accent-rgb), 0.14),
        0 0 24px rgba(var(--color-accent-rgb), 0.28),
        inset 0 0 16px rgba(var(--color-accent-rgb), 0.08);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header-inner:has(.master-menu-shell) .header-actions {
    display: contents;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.28);
    border-radius: 999px;
    background: rgba(2, 9, 23, 0.72);
    color: var(--theme-muted);
    font-size: 0.76rem;
    font-weight: 900;
}

.status-dot-only {
    width: 38px;
    justify-content: center;
    padding-inline: 0;
}

.app-header-inner:has(.master-menu-shell) .status-dot-only {
    grid-column: 5;
    grid-row: 1;
    justify-self: end;
}

.uptime-pill strong {
    color: var(--theme-accent);
}

.uptime-pill {
    gap: 7px;
}

.app-header-inner:has(.master-menu-shell) .uptime-pill {
    grid-column: 6;
    grid-row: 1;
    justify-self: end;
}

.icon-button {
    width: 40px;
    padding: 0;
}

.notification-shell {
    position: relative;
}

.app-header-inner:has(.master-menu-shell) .notification-shell {
    grid-column: 3;
    grid-row: 1;
    justify-self: start;
    margin-left: -2px;
}

.notification-button {
    position: relative;
    display: inline-grid;
    width: 48px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--theme-text);
    cursor: pointer;
    box-shadow: none;
    transition: transform 160ms ease, filter 160ms ease;
}

.notification-button:hover,
.notification-button:focus-visible,
.notification-button.has-unread,
.notification-button[aria-expanded="true"] {
    background: transparent;
    box-shadow: none;
    outline: none;
}

.notification-robot {
    width: 49px;
    height: 49px;
    object-fit: contain;
    transform: translateY(3px);
    filter: hue-rotate(var(--theme-hue-shift)) saturate(1.25) drop-shadow(0 0 12px rgba(var(--color-accent-rgb), 0.62));
    pointer-events: none;
    animation: notificationRobotFloat 2.4s ease-in-out infinite;
    transition: transform 160ms ease, filter 160ms ease;
}

body:not([data-motion="reduced"]) .notification-button:hover .notification-robot,
body:not([data-motion="reduced"]) .notification-button:focus-visible .notification-robot {
    animation: none;
    transform: translateY(1px) scale(1.1);
    filter: hue-rotate(var(--theme-hue-shift)) saturate(1.35) drop-shadow(0 0 18px rgba(var(--color-accent-rgb), 0.86));
}

body[data-motion="reduced"] .notification-robot {
    animation: none;
}

.notification-button.has-unread .notification-robot {
    filter: hue-rotate(var(--theme-hue-shift)) saturate(1.35) drop-shadow(0 0 10px rgba(var(--color-accent-rgb), 0.74));
}

.notification-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    padding: 0 5px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.55);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.95), rgba(var(--color-accent-rgb), 0.58)),
        rgba(2, 9, 23, 0.92);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 0 12px rgba(var(--color-accent-rgb), 0.4);
}

@keyframes notificationRobotFloat {
    0%,
    100% {
        transform: translateY(3px);
    }
    50% {
        transform: translateY(-4px);
    }
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 70;
    width: min(370px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid rgba(var(--color-accent-rgb), 0.42);
    border-radius: var(--theme-widget-radius);
    background:
        radial-gradient(circle at 20% 0%, rgba(var(--color-accent-rgb), 0.12), transparent 16rem),
        #020917;
    box-shadow: var(--theme-card-shadow), 0 0 22px rgba(var(--color-accent-rgb), 0.12);
}

.notification-dropdown header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px;
    border-bottom: 1px solid rgba(var(--color-accent-rgb), 0.18);
}

.notification-dropdown header strong {
    font-size: 0.9rem;
}

.notification-dropdown header div {
    display: flex;
    gap: 7px;
}

.notification-dropdown button {
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.28);
    border-radius: 999px;
    background: rgba(var(--color-accent-rgb), 0.07);
    color: var(--theme-text);
    font-size: 0.68rem;
    font-weight: 900;
    cursor: pointer;
}

.notification-list {
    display: grid;
    max-height: 360px;
    overflow-y: auto;
}

.notification-list > .empty-note {
    margin: 0;
    padding: 20px 18px;
    text-align: center;
    color: var(--theme-muted);
}

.notification-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 12px 13px;
    border-bottom: 1px solid rgba(140, 169, 199, 0.12);
}

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

.notification-item.unread {
    background: rgba(var(--color-accent-rgb), 0.08);
}

.notification-item strong,
.notification-item p,
.notification-item span {
    display: block;
    overflow-wrap: anywhere;
}

.notification-item strong {
    font-size: 0.82rem;
}

.notification-item p {
    margin: 4px 0;
    color: var(--theme-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.notification-item span {
    color: var(--theme-muted);
    font-size: 0.7rem;
}

.notification-read,
.notification-view-support {
    white-space: nowrap;
}

.dashboard-page {
    width: var(--theme-page-width);
    margin: 0 auto;
    padding: 22px 0 28px;
}

.narrow-page {
    width: min(100% - 44px, 900px);
}

.overview-banner {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 50px;
    margin-bottom: var(--theme-gap);
    padding: 0 16px;
    border: var(--theme-border-width) solid rgba(var(--color-accent-rgb), 0.46);
    border-radius: var(--theme-widget-radius);
    background:
        linear-gradient(90deg, rgba(var(--color-accent-rgb), 0.12), rgba(var(--color-accent-rgb), 0.035)),
        rgba(2, 9, 23, 0.9);
    box-shadow:
        0 0 0 1px rgba(var(--color-accent-rgb), 0.08),
        0 0 22px rgba(var(--color-accent-rgb), 0.1),
        0 18px 54px rgba(0, 0, 0, 0.36),
        inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.overview-banner div {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    align-items: center;
    min-width: 0;
}

.overview-banner strong {
    color: var(--theme-text);
    font-size: 0.9rem;
    line-height: 1.2;
}

.overview-banner .eyebrow {
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.overview-banner p {
    display: none;
}

.eyebrow {
    color: var(--theme-accent);
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--theme-gap);
    margin-bottom: var(--theme-gap);
}

.summary-strip.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
    display: grid;
    align-content: stretch;
    gap: 7px;
    min-height: 112px;
    padding: 10px 12px;
}

.stat-card-summary {
    grid-template-rows: auto auto 1fr;
}

.stat-label {
    color: var(--theme-muted);
    font-size: 0.62rem;
    font-weight: 950;
    text-transform: uppercase;
}

.stat-card strong {
    overflow-wrap: anywhere;
    color: var(--theme-text);
    font-family: var(--font-mono);
    font-size: 1.34rem;
    line-height: 1.1;
    text-shadow: 0 0 9px rgba(var(--color-accent-rgb), 0.38);
}

.summary-strip .stat-card strong,
body[data-number-style="terminal"] .summary-strip .stat-card strong,
body[data-number-style="tabular"] .summary-strip .stat-card strong {
    color: var(--theme-text);
    text-shadow: 0 0 9px rgba(var(--color-accent-rgb), 0.38);
}

.stat-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: auto;
    align-self: end;
}

.stat-mini-grid span,
.stat-balance-rows span {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.16);
    border-radius: calc(var(--theme-widget-radius) - 2px);
    background: rgba(var(--color-accent-rgb), 0.045);
}

.stat-mini-grid small,
.stat-balance-rows small,
.stat-inline span {
    color: var(--theme-accent);
    font-size: 0.54rem;
    font-weight: 950;
    text-transform: uppercase;
}

.stat-mini-grid b,
.stat-balance-rows b,
.stat-inline b {
    overflow-wrap: anywhere;
    color: var(--theme-text);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.1;
}

.stat-inline,
.stat-balance-rows {
    display: grid;
    gap: 5px;
}

.stat-inline {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.stat-inline b {
    color: var(--color-success);
}

.stat-sparkline {
    position: relative;
    min-height: 32px;
    overflow: hidden;
    border-radius: calc(var(--theme-widget-radius) - 3px);
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.08), transparent),
        rgba(0, 0, 0, 0.12);
}

.stat-sparkline svg {
    display: block;
    width: 100%;
    height: 32px;
    color: var(--theme-accent);
    filter: drop-shadow(0 0 8px rgba(var(--color-accent-rgb), 0.55));
}

.stat-card-balance strong {
    font-size: 1.16rem;
}

.stat-balance-rows {
    gap: 6px;
}

.stat-balance-rows span {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 5px 7px;
}

.stat-balance-rows small {
    font-size: 0.52rem;
}

.stat-balance-rows b {
    text-align: right;
    font-size: 0.72rem;
}

.stat-balance-rows span:last-child b {
    color: var(--color-success);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(270px, 320px);
    column-gap: max(var(--theme-gap), 22px);
    row-gap: max(var(--theme-gap), 18px);
    align-items: start;
}

.sidebar,
.main-column,
.right-column {
    display: grid;
    gap: max(var(--theme-gap), 18px);
}

.main-column {
    min-width: 0;
}

.main-column > .overview-banner,
.main-column > .summary-strip {
    margin-bottom: 0;
}

section[data-custom-section="userPanel"] {
    padding: 13px 14px;
}

section[data-custom-section="userPanel"] .panel-heading {
    margin-bottom: 8px;
}

section[data-custom-section="userPanel"] .detail-list {
    display: grid;
    gap: 5px;
    margin: 0;
}

section[data-custom-section="userPanel"] .detail-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(140, 169, 199, 0.1);
}

section[data-custom-section="userPanel"] .detail-list div:last-child {
    border-bottom: 0;
}

section[data-custom-section="userPanel"] .detail-list dt {
    color: var(--theme-muted);
    font-size: 0.72rem;
    font-weight: 900;
}

section[data-custom-section="userPanel"] .detail-list dd {
    margin: 0;
    color: var(--theme-accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 950;
    text-align: right;
}

.bot-panel {
    display: grid;
    gap: 12px;
}

.bot-panel .panel-heading {
    margin-bottom: 0;
}

.bot-mode-stack {
    display: grid;
    gap: 8px;
}

.bot-toggle-pill {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 7px 9px 7px 12px;
    border: 1px solid rgba(255, 95, 114, 0.45);
    border-radius: var(--theme-widget-radius);
    background:
        linear-gradient(180deg, rgba(255, 95, 114, 0.1), rgba(255, 95, 114, 0.035)),
        rgba(2, 9, 23, 0.82);
    color: #ff9baa;
    cursor: pointer;
    text-align: left;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.bot-toggle-pill.on {
    border-color: rgba(32, 240, 138, 0.56);
    background:
        linear-gradient(180deg, rgba(32, 240, 138, 0.12), rgba(32, 240, 138, 0.04)),
        rgba(2, 9, 23, 0.86);
    color: var(--color-success);
    box-shadow: 0 0 18px rgba(32, 240, 138, 0.12);
}

.bot-toggle-pill.live {
    border-color: rgba(255, 196, 87, 0.42);
    color: #ffc457;
}

.bot-toggle-pill.live.on {
    border-color: rgba(32, 240, 138, 0.62);
    color: var(--color-success);
}

.bot-toggle-pill.locked {
    color: var(--theme-muted);
    cursor: pointer;
    opacity: 0.78;
}

.bot-toggle-pill:disabled {
    cursor: wait;
    opacity: 0.72;
}

.bot-toggle-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.bot-toggle-copy small {
    color: var(--theme-muted);
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
}

.bot-toggle-copy strong {
    color: currentColor;
    font-size: 0.82rem;
    font-weight: 950;
}

.bot-toggle-copy em {
    display: block;
    overflow: hidden;
    color: var(--theme-muted);
    font-size: 0.6rem;
    font-style: normal;
    font-weight: 800;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bot-toggle-track {
    position: relative;
    display: block;
    justify-self: end;
    width: 58px;
    height: 26px;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
}

.bot-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 18px currentColor;
    transition: transform var(--transition);
}

.bot-toggle-pill.on .bot-toggle-knob {
    transform: translateX(32px);
}

.bot-toggle-pill.locked .bot-toggle-knob {
    opacity: 0.62;
    box-shadow: none;
}

.bot-mode-notice {
    margin: 0;
    color: var(--theme-muted);
    font-size: 0.66rem;
    font-weight: 850;
    line-height: 1.35;
}

.bot-mode-notice.error {
    color: #ff9baa;
}

.equity-panel {
    min-height: 260px;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.equity-panel:has(.equity-tooltip:not([hidden])) {
    z-index: 8;
}

.equity-plot {
    position: relative;
    display: grid;
    min-height: 0;
    place-items: stretch;
    overflow: visible;
    border: 1px solid rgba(var(--color-accent-rgb), 0.12);
    border-radius: var(--theme-widget-radius);
    background: rgba(0, 0, 0, 0.16);
    color: var(--theme-accent);
    touch-action: none;
}

.equity-plot svg {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
}

.equity-line {
    fill: none;
    stroke: url(#equityStroke);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 3px rgba(var(--color-accent-rgb), 0.34));
}

.equity-line-glow {
    fill: none;
    stroke: currentColor;
    stroke-width: 4.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.08;
    filter: blur(1px);
}

.equity-fill {
    fill: url(#equityFill);
}

.equity-grid-line {
    display: none;
}

.equity-zero-line {
    stroke: rgba(var(--color-accent-rgb), 0.24);
    stroke-dasharray: 4 7;
    stroke-width: 1;
}

.equity-axis-label {
    fill: var(--theme-muted);
    font-family: var(--font-mono);
    font-size: 0.56rem;
    font-weight: 850;
}

.equity-date-label {
    fill: var(--theme-muted);
}

.equity-point {
    fill: var(--theme-accent);
    stroke: rgba(238, 246, 255, 0.62);
    stroke-width: 0.8;
    filter: drop-shadow(0 0 3px rgba(var(--color-accent-rgb), 0.42));
}

.equity-point.positive {
    fill: var(--color-success);
    filter: drop-shadow(0 0 3px rgba(31, 241, 139, 0.38));
}

.equity-point.negative {
    fill: var(--color-danger);
    filter: drop-shadow(0 0 3px rgba(255, 95, 114, 0.38));
}

.equity-crosshair line {
    stroke: rgba(238, 246, 255, 0.92);
    stroke-width: 1.45;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 5px rgba(var(--color-accent-rgb), 0.72));
}

.equity-crosshair {
    pointer-events: none;
}

.equity-crosshair circle {
    fill: var(--theme-accent);
    stroke: rgba(238, 246, 255, 0.82);
    stroke-width: 1;
    filter: drop-shadow(0 0 6px rgba(var(--color-accent-rgb), 0.5));
}

.equity-crosshair circle.positive {
    fill: var(--color-success);
}

.equity-crosshair circle.negative {
    fill: var(--color-danger);
}

.equity-tooltip {
    position: absolute;
    z-index: 12;
    display: grid;
    gap: 4px;
    min-width: 164px;
    max-width: min(220px, calc(100% - 24px));
    padding: 9px 10px;
    transform: translate(10px, -50%);
    border: 1px solid rgba(var(--color-accent-rgb), 0.38);
    border-radius: var(--theme-widget-radius);
    background: #020917;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), 0 0 18px rgba(var(--color-accent-rgb), 0.16);
    color: var(--theme-text);
    pointer-events: none;
}

.equity-tooltip.is-left {
    transform: translate(calc(-100% - 10px), -50%);
}

.equity-tooltip strong {
    font-size: 0.72rem;
    line-height: 1.1;
}

.equity-tooltip > span {
    color: var(--theme-muted);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 800;
}

.equity-tooltip dl {
    display: grid;
    gap: 3px;
    margin: 0;
}

.equity-tooltip div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.equity-tooltip dt,
.equity-tooltip dd {
    margin: 0;
    font-size: 0.6rem;
    font-weight: 850;
}

.equity-tooltip dt {
    color: var(--theme-muted);
}

.panel-actions,
.tour-actions,
.history-footer,
.history-header,
.history-tabs,
.history-filters,
.range-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-actions {
    justify-content: flex-end;
}

.range-actions,
.history-filters {
    flex-wrap: wrap;
}

.history-filters {
    justify-content: flex-start;
}

.history-reset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.history-reset-actions .btn {
    min-height: 24px;
    padding-inline: 8px;
    border-radius: 8px;
    font-size: 0.58rem;
}

.history-page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.48);
    border-radius: var(--theme-button-radius);
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.13), rgba(var(--color-accent-rgb), 0.035)),
        rgba(2, 10, 22, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 0 12px rgba(var(--color-accent-rgb), 0.08);
}

.date-pill span {
    color: var(--theme-text);
    font-size: 0.76rem;
    font-weight: 950;
    text-transform: uppercase;
}

.compact-select,
.compact-date {
    appearance: none;
    -webkit-appearance: none;
    min-height: 32px;
    max-width: 170px;
    padding: 0 12px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.32);
    border-radius: var(--theme-button-radius);
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.12), rgba(var(--color-accent-rgb), 0.03)),
        rgba(2, 9, 23, 0.84);
    color: var(--theme-text);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 900;
}

.compact-date {
    width: 108px;
    min-height: 26px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    color: var(--theme-text);
    color-scheme: dark;
}

.compact-date::-webkit-calendar-picker-indicator {
    cursor: pointer;
    width: 15px;
    height: 15px;
    opacity: 1;
    background-color: var(--theme-accent);
    background-image: none;
    filter: drop-shadow(0 0 6px rgba(var(--color-accent-rgb), 0.62));
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h3V2Zm13 8H4v10h16V10ZM4 8h16V7H4v1Z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h3V2Zm13 8H4v10h16V10ZM4 8h16V7H4v1Z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}

.market-list {
    display: grid;
    gap: 0;
}

.market-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 26px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(140, 169, 199, 0.12);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.15;
}

.market-row:last-child {
    border-bottom: 0;
}

.market-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--theme-muted);
}

.market-row strong {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 950;
}

.market-row-featured {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "rank name total"
        "rank meta total";
    gap: 2px 10px;
    min-height: 36px;
    padding-block: 8px;
}

.market-rank {
    grid-area: rank;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    align-self: center;
    border: 1px solid rgba(var(--color-accent-rgb), 0.22);
    border-radius: 999px;
    background: rgba(var(--color-accent-rgb), 0.08);
    color: var(--theme-muted);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 950;
}

.market-row-featured .market-name {
    grid-area: name;
    color: var(--theme-text);
}

.market-meta {
    grid-area: meta;
    color: var(--theme-muted);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 850;
}

.market-row-featured strong {
    grid-area: total;
    align-self: center;
}

.market-returns-panel {
    width: min(880px, 100%);
}

.market-returns-panel table {
    min-width: 760px;
}

.performance-panel {
    min-height: 154px;
}

.performance-body {
    display: grid;
    min-height: 94px;
    align-items: stretch;
}

.performance-card {
    display: grid;
    gap: 9px;
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.22);
    border-radius: var(--theme-widget-radius);
    background:
        linear-gradient(135deg, rgba(var(--color-accent-rgb), 0.12), rgba(2, 9, 23, 0.68) 44%, rgba(3, 14, 30, 0.78)),
        rgba(2, 9, 23, 0.74);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 20px rgba(var(--color-accent-rgb), 0.08);
}

.performance-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.performance-card-top span {
    color: var(--theme-muted);
    font-size: 0.68rem;
    font-weight: 950;
    text-transform: uppercase;
}

.performance-card-top strong {
    font-family: var(--font-mono);
    font-size: 1.28rem;
    font-weight: 950;
    line-height: 1;
}

.performance-split-bar {
    position: relative;
    overflow: hidden;
    height: 9px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.2);
    border-radius: 999px;
    background: rgba(255, 95, 114, 0.18);
}

.performance-win-bar {
    display: block;
    width: var(--win-share, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--theme-accent), var(--color-success));
    box-shadow: 0 0 16px rgba(var(--color-accent-rgb), 0.22);
}

.performance-list {
    display: grid;
    gap: 1px;
    margin: 0;
}

.performance-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 12px;
    min-height: 22px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(140, 169, 199, 0.12);
}

.performance-list dt {
    color: var(--theme-muted);
    font-size: 0.72rem;
    font-weight: 900;
}

.performance-list dd {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 950;
}

.right-column .recent-trades-panel {
    display: grid;
    grid-template-rows: auto minmax(178px, 1fr);
    min-height: 258px;
}

.right-column .recent-trades-panel .panel-heading {
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.right-column .recent-trades-panel .panel-actions {
    gap: 8px;
}

.panel-count {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: var(--theme-border-width) solid rgba(var(--color-accent-rgb), 0.22);
    border-radius: var(--theme-button-radius);
    background: rgba(var(--color-accent-rgb), 0.06);
    color: var(--theme-muted);
    font-size: var(--type-button-size);
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.panel-count strong {
    margin-right: 4px;
    color: var(--theme-accent);
    font-family: var(--font-mono);
}

.right-column .recent-trades-panel .btn {
    min-height: 26px;
    padding-inline: 10px;
    font-size: 0.6rem;
}

section[data-custom-section="marketReturns"] .panel-actions {
    margin-left: auto;
}

section[data-custom-section="marketReturns"] .panel-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

section[data-custom-section="marketReturns"] .panel-heading h2 {
    min-width: 0;
    font-size: 1rem;
    line-height: 1;
    white-space: nowrap;
}

section[data-custom-section="marketReturns"] .btn {
    min-height: 26px;
    min-width: 58px;
    padding-inline: 9px;
    font-size: 0.6rem;
    white-space: nowrap;
}

.right-column .recent-trades-panel .table-wrap {
    min-height: 178px;
    max-height: none;
    overflow: hidden;
}

.right-column .recent-trades-panel table {
    table-layout: fixed;
    width: 100%;
}

.right-column .recent-trades-panel th,
.right-column .recent-trades-panel td {
    padding-inline: 8px;
    font-size: 0.72rem;
}

.right-column .recent-trades-panel td {
    height: 24px;
}

[data-custom-section="activePositions"] {
    min-height: 154px;
}

[data-custom-section="activePositions"] .panel-heading {
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

[data-custom-section="activePositions"] .panel-actions {
    gap: 8px;
    margin-left: auto;
}

[data-custom-section="activePositions"] .btn {
    min-height: 26px;
    padding-inline: 10px;
    font-size: 0.6rem;
}

[data-custom-section="activePositions"] .table-wrap {
    min-height: 90px;
    max-height: none;
    overflow: hidden;
}

[data-custom-section="activePositions"] table {
    table-layout: fixed;
    width: 100%;
}

[data-custom-section="activePositions"] th,
[data-custom-section="activePositions"] td,
.right-column .recent-trades-panel th,
.right-column .recent-trades-panel td {
    color: var(--theme-muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.15;
    padding: 4px 8px;
    vertical-align: middle;
}

[data-custom-section="activePositions"] td,
.right-column .recent-trades-panel td {
    color: var(--theme-text);
    font-family: var(--font-mono);
    height: 24px;
}

[data-custom-section="activePositions"] td.buy,
.right-column .recent-trades-panel td.buy,
.dashboard-page .buy {
    color: var(--color-success);
    text-shadow: 0 0 10px rgba(31, 241, 139, 0.18);
}

[data-custom-section="activePositions"] td.sell,
.right-column .recent-trades-panel td.sell,
.dashboard-page .sell {
    color: var(--color-danger);
    text-shadow: 0 0 10px rgba(255, 95, 114, 0.18);
}

[data-custom-section="activePositions"] td.positive,
.right-column .recent-trades-panel td.positive,
.market-row strong.positive,
.stat-inline b.positive,
.stat-balance-rows b.positive,
.performance-list dd.positive,
.dashboard-page .positive {
    color: var(--color-success);
    text-shadow: 0 0 10px rgba(31, 241, 139, 0.18);
}

[data-custom-section="activePositions"] td.negative,
.right-column .recent-trades-panel td.negative,
.market-row strong.negative,
.stat-inline b.negative,
.stat-balance-rows b.negative,
.performance-list dd.negative,
.dashboard-page .negative {
    color: var(--color-danger);
    text-shadow: 0 0 10px rgba(255, 95, 114, 0.18);
}

[data-custom-section="activePositions"] .empty-cell,
.right-column .recent-trades-panel .empty-cell {
    padding: 9px 8px;
    color: var(--theme-accent);
    font-size: 0.72rem;
    font-weight: 850;
    line-height: 1.2;
}

.right-column .recent-trades-panel th:nth-child(3),
.right-column .recent-trades-panel td:nth-child(3),
.right-column .recent-trades-panel th:nth-child(5),
.right-column .recent-trades-panel td:nth-child(5) {
    display: none;
}

.right-column .recent-trades-panel th:nth-child(1),
.right-column .recent-trades-panel td:nth-child(1) {
    width: 52%;
    text-align: left;
}

.right-column .recent-trades-panel th:nth-child(2),
.right-column .recent-trades-panel td:nth-child(2) {
    width: 20%;
    text-align: center;
}

.right-column .recent-trades-panel th:nth-child(4),
.right-column .recent-trades-panel td:nth-child(4) {
    width: 28%;
    text-align: right;
}

.mobile-result {
    display: none;
}

.mobile-result.positive {
    color: var(--color-success);
}

.mobile-result.negative {
    color: var(--color-danger);
}

.settings-list {
    margin-top: 12px;
}

.settings-page {
    display: grid;
    gap: var(--theme-gap);
    width: min(100% - 44px, 1080px);
}

.settings-page .panel,
.admin-page .panel {
    padding: var(--theme-panel-padding);
}

.settings-page .panel-heading,
.admin-page .panel-heading {
    margin-bottom: 10px;
}

.settings-page .broker-form,
.settings-page .customisation-form,
.admin-page .admin-form {
    gap: 10px;
}

.settings-page .broker-form-grid {
    gap: 10px;
}

.profile-subscription-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.profile-subscription-card div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.18);
    border-radius: var(--theme-widget-radius);
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.08), rgba(var(--color-accent-rgb), 0.025)),
        rgba(2, 9, 23, 0.72);
}

.profile-subscription-card span {
    color: var(--theme-muted);
    font-size: var(--type-body-size);
    font-weight: 750;
    text-transform: none;
}

.profile-subscription-card strong {
    overflow-wrap: anywhere;
    color: var(--theme-text);
    font-family: var(--theme-font-family, var(--font-family));
    font-size: var(--type-body-size);
    font-weight: 750;
}

.profile-subscription-manage {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(var(--color-accent-rgb), 0.16);
}

.compact-heading {
    margin-bottom: 0;
}

.compact-heading h2 {
    font-size: 1rem;
}

.profile-plans-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-plans-grid .plan-card {
    position: relative;
    grid-template-rows: auto auto auto auto;
    gap: 7px;
    min-height: 136px;
    padding: 10px 12px;
}

.profile-plans-grid .plan-price {
    font-size: 0.98rem;
}

.profile-plans-grid .plan-details {
    gap: 2px;
}

.profile-plans-grid .plan-details div {
    grid-template-columns: minmax(54px, 1fr) auto;
    padding: 3px 0;
}

.profile-plans-grid .plan-details dt,
.profile-plans-grid .plan-details dd {
    font-size: 0.68rem;
}

.profile-plans-grid .plan-actions .btn {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.68rem;
}

.profile-plans-grid .plan-card-heading {
    position: relative;
    min-height: 24px;
    padding-right: 74px;
}

.profile-plans-grid .plan-card-heading h2 {
    font-size: 0.95rem;
}

.profile-plans-grid .plan-current-badge {
    position: absolute;
    top: 0;
    right: 0;
}

.broker-panel {
    min-width: 0;
}

.broker-form {
    display: grid;
    gap: 14px;
}

.broker-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.broker-form label,
.admin-form label {
    display: grid;
    gap: 7px;
    color: var(--theme-muted);
    font-size: 0.76rem;
    font-weight: 900;
}

.broker-form input,
.broker-form select,
.admin-form input,
.admin-form select,
.risk-confirm input,
.chat-input input {
    width: 100%;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.32);
    border-radius: var(--theme-button-radius);
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.09), rgba(var(--color-accent-rgb), 0.025)),
        rgba(2, 9, 23, 0.86);
    color: var(--theme-text);
    outline: none;
    box-shadow: inset 0 0 12px rgba(var(--color-accent-rgb), 0.035);
}

.broker-form select,
.admin-form select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--theme-accent) 50%),
        linear-gradient(135deg, var(--theme-accent) 50%, transparent 50%),
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.14), rgba(var(--color-accent-rgb), 0.035));
    background-position:
        calc(100% - 18px) 18px,
        calc(100% - 13px) 18px,
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    padding-right: 36px;
}

.broker-form input:focus,
.broker-form select:focus,
.admin-form input:focus,
.admin-form select:focus,
.risk-confirm input:focus,
.chat-input input:focus {
    border-color: rgba(var(--color-accent-rgb), 0.86);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.12), inset 0 0 16px rgba(var(--color-accent-rgb), 0.06);
}

.settings-page .broker-form input,
.settings-page .broker-form select,
.admin-page .admin-form input,
.admin-page .admin-form select {
    min-height: 34px;
    padding-inline: 11px;
}

.settings-page .broker-form select,
.admin-page .admin-form select {
    background-position:
        calc(100% - 18px) 14px,
        calc(100% - 13px) 14px,
        0 0;
}

.settings-page .broker-actions .btn,
.admin-page .admin-form .btn {
    min-height: 34px;
    padding-inline: 14px;
}

.broker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.alert-support-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.sound-toggle {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(var(--color-accent-rgb), 0.24);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.16);
}

.settings-page .broker-form .sound-toggle input,
.sound-toggle input {
    appearance: none;
    display: grid;
    width: 13px;
    height: 13px;
    min-height: 0;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(238, 246, 255, 0.86);
    border-radius: 3px;
    background: #eef6ff;
    cursor: pointer;
    flex: 0 0 auto;
}

.sound-toggle input:checked::before {
    content: "";
    width: 7px;
    height: 4px;
    transform: translateY(-1px) rotate(-45deg);
    border-bottom: 1.5px solid #03101d;
    border-left: 1.5px solid #03101d;
}

.alert-support-actions {
    margin: 0;
}

.broker-message,
.subscription-message,
.admin-message {
    margin: 0;
    color: var(--color-success);
    font-size: 0.84rem;
    font-weight: 900;
}

.broker-message {
    margin-top: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(32, 240, 138, 0.28);
    border-radius: var(--theme-widget-radius);
    background: rgba(32, 240, 138, 0.09);
}

.broker-message.error,
.subscription-message.error,
.admin-message.error {
    color: #ff9baa;
}

.broker-message.error {
    border-color: rgba(255, 95, 114, 0.34);
    background: rgba(255, 95, 114, 0.1);
}

.customisation-panel {
    border-color: rgba(var(--color-accent-rgb), 0.44);
}

.customisation-heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.customisation-form {
    display: grid;
    gap: var(--theme-section-gap);
}

.customisation-section {
    display: grid;
    gap: var(--theme-section-gap);
    padding: var(--theme-row-padding);
    border: 1px solid rgba(var(--color-accent-rgb), 0.18);
    border-radius: var(--theme-widget-radius);
    background: rgba(2, 9, 23, 0.58);
}

.customisation-section h2 {
    font-size: 0.94rem;
}

.customisation-form label {
    display: grid;
    grid-template-columns: minmax(120px, 0.85fr) minmax(150px, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.visual-control-grid,
.visual-color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 10px 18px;
}

.visual-control-grid-weights {
    padding-top: 10px;
    border-top: 1px solid rgba(var(--color-accent-rgb), 0.12);
}

.customisation-form select,
.accent-slider-control {
    min-height: 32px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.36);
    border-radius: var(--theme-button-radius);
    background-color: rgba(2, 9, 23, 0.88);
    color: var(--theme-text);
    box-shadow: inset 0 0 10px rgba(var(--color-accent-rgb), 0.035), 0 0 10px rgba(var(--color-accent-rgb), 0.035);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.customisation-form select {
    appearance: none;
    min-width: 146px;
    width: min(220px, 100%);
    padding: 0 30px 0 12px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--theme-accent) 50%),
        linear-gradient(135deg, var(--theme-accent) 50%, transparent 50%),
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.13), rgba(var(--color-accent-rgb), 0.035));
    background-position:
        calc(100% - 16px) 16px,
        calc(100% - 11px) 16px,
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    font-size: var(--type-button-size);
    font-weight: 850;
}

.customisation-form select:hover,
.customisation-form select:focus,
.accent-preview:hover,
.accent-preview:focus-visible,
.accent-slider-control:hover,
.accent-slider-control:focus-within {
    border-color: rgba(var(--color-accent-rgb), 0.9);
    background-color: rgba(5, 18, 34, 0.96);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1), inset 0 0 14px rgba(var(--color-accent-rgb), 0.05);
    outline: none;
}

.customisation-form select option {
    background: #061020;
    color: var(--theme-text);
}

.accent-slider-control {
    display: grid;
    grid-template-columns: minmax(140px, 210px) 24px;
    gap: 10px;
    align-items: center;
    width: min(260px, 100%);
    padding: 0 6px 0 10px;
}

.accent-slider-control input[type="range"] {
    --tone-base: var(--theme-accent);
    --tone-result: var(--theme-accent);
    width: 100%;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: linear-gradient(90deg, #ffffff 0%, var(--tone-base) 50%, #000000 100%);
    cursor: pointer;
}

.accent-slider-control input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    border: 2px solid #dff4ff;
    border-radius: 50%;
    appearance: none;
    background: var(--tone-result);
    box-shadow: 0 0 10px rgba(var(--color-accent-rgb), 0.42);
}

.accent-slider-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid #dff4ff;
    border-radius: 50%;
    background: var(--tone-result);
    box-shadow: 0 0 10px rgba(var(--color-accent-rgb), 0.42);
}

.accent-preview {
    display: block;
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 50%;
    background: var(--theme-accent);
    cursor: pointer;
    box-shadow: 0 0 12px rgba(var(--color-accent-rgb), 0.38);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

.accent-preview:hover,
.accent-preview:focus-visible {
    transform: scale(1.08);
    border-color: rgba(238, 246, 255, 0.82);
}

.customisation-form input[type="range"] {
    accent-color: var(--theme-accent);
}

.rae-color-picker {
    position: fixed;
    z-index: 1400;
    display: grid;
    gap: 10px;
    width: min(280px, calc(100vw - 20px));
    padding: 12px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.72);
    border-radius: var(--theme-widget-radius);
    background:
        linear-gradient(145deg, rgba(var(--color-accent-rgb), 0.16), rgba(3, 10, 20, 0.98) 34%, rgba(4, 15, 30, 0.98)),
        #030a14;
    box-shadow:
        0 22px 70px rgba(0, 0, 0, 0.56),
        0 0 26px rgba(var(--color-accent-rgb), 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.rae-color-picker[hidden] {
    display: none;
}

.rae-color-picker-head,
.rae-color-picker-foot,
.rae-hue-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.rae-color-picker-head strong {
    font-size: 0.82rem;
    line-height: 1.1;
}

.rae-color-field {
    --picker-color: hsl(198 100% 50%);
    position: relative;
    height: 152px;
    overflow: hidden;
    border: 1px solid rgba(var(--color-accent-rgb), 0.36);
    border-radius: 7px;
    background:
        linear-gradient(180deg, transparent, #000),
        linear-gradient(90deg, #fff, var(--picker-color));
    cursor: crosshair;
    touch-action: none;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.38);
}

.rae-color-field:focus-visible {
    outline: 2px solid rgba(var(--color-accent-rgb), 0.7);
    outline-offset: 2px;
}

.rae-color-field-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #f4fbff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.64), 0 0 12px rgba(255, 255, 255, 0.32);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.rae-hue-control {
    grid-template-columns: 42px minmax(0, 1fr);
    color: var(--theme-muted);
    font-size: 0.66rem;
    font-weight: 950;
    text-transform: uppercase;
}

.rae-hue-control input {
    width: 100%;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: linear-gradient(90deg, #ff3b5c, #ffdd4a, #2dff89, #24d7ff, #8f5cff, #ff4f9d, #ff3b5c);
    cursor: pointer;
}

.rae-hue-control input::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    border: 2px solid #e6f7ff;
    border-radius: 50%;
    appearance: none;
    background: var(--theme-panel);
    box-shadow: 0 0 10px rgba(var(--color-accent-rgb), 0.42);
}

.rae-hue-control input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid #e6f7ff;
    border-radius: 50%;
    background: var(--theme-panel);
    box-shadow: 0 0 10px rgba(var(--color-accent-rgb), 0.42);
}

.rae-color-preview {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(238, 246, 255, 0.58);
    border-radius: 50%;
    background: var(--theme-accent);
    box-shadow: 0 0 18px rgba(var(--color-accent-rgb), 0.26);
}

.rae-color-hex {
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.36);
    border-radius: var(--theme-button-radius);
    background: rgba(2, 9, 23, 0.92);
    color: var(--theme-text);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.rae-color-hex:focus {
    border-color: rgba(var(--color-accent-rgb), 0.9);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.customisation-save-bar {
    position: static;
    justify-content: flex-end;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.app-build-version {
    margin: 0;
    color: var(--theme-muted);
    font-size: 0.68rem;
    font-weight: 850;
    text-align: right;
}

.customisation-save-bar .btn {
    min-height: 32px;
    padding-inline: 14px;
    font-size: 0.68rem;
}

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

.visibility-grid label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.26);
    border-radius: var(--theme-button-radius);
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.08), rgba(var(--color-accent-rgb), 0.025)),
        rgba(2, 9, 23, 0.72);
    color: var(--theme-text);
    font-size: 0.82rem;
    font-weight: 900;
}

.visibility-grid input {
    width: 16px;
    height: 16px;
    accent-color: var(--theme-accent);
}

.subscription-page {
    width: min(100% - 44px, 1180px);
}

.subscription-summary .stat-card strong {
    font-size: 1.25rem;
}

.subscription-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: var(--theme-gap);
    align-items: start;
}

.subscription-current-panel {
    position: sticky;
    top: 92px;
}

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

.plan-card {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 16px;
    min-height: 280px;
    padding: 18px;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-widget-radius);
    background: linear-gradient(180deg, rgba(7, 19, 38, 0.94), rgba(2, 9, 23, 0.98));
    box-shadow: var(--theme-card-shadow);
}

.plan-card.current {
    border-color: rgba(var(--color-accent-rgb), 0.76);
    box-shadow: 0 0 24px rgba(var(--color-accent-rgb), 0.14), var(--theme-card-shadow);
}

.plan-price {
    font-size: 1.45rem;
    line-height: 1.1;
}

.plan-details {
    display: grid;
    gap: 10px;
    margin: 0;
}

.plan-details div {
    display: grid;
    grid-template-columns: minmax(70px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(140, 169, 199, 0.12);
}

.plan-details div:last-child {
    border-bottom: 0;
}

.plan-details dt {
    color: var(--theme-muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.plan-details dd {
    margin: 0;
    font-weight: 900;
}

.admin-page {
    width: min(100% - 44px, 1480px);
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.admin-toolbar h1 {
    margin-bottom: 6px;
}

.admin-actions,
.admin-user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.system-control-panel {
    margin-bottom: 14px;
}

.system-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.system-control-row strong {
    display: block;
    margin-bottom: 4px;
    font-size: var(--type-body-size);
}

.system-control-row .empty-note {
    margin: 0;
}

.users-panel-heading {
    align-items: flex-start;
    gap: 16px;
}

.admin-panel-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.admin-panel-metrics span {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-width: 132px;
    gap: 10px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.24);
    border-radius: var(--theme-button-radius);
    background: linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.12), rgba(2, 12, 26, 0.52));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.admin-panel-metrics small {
    color: var(--color-muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-panel-metrics strong {
    color: var(--color-accent);
    font-size: 1.05rem;
    line-height: 1;
}

.admin-panel-metrics-inline {
    justify-content: flex-start;
    margin: 0 0 16px;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-bottom: 14px;
}

.create-user-panel {
    padding: 14px;
}

.admin-logs-grid,
.admin-logs-grid.stacked {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.admin-form {
    display: grid;
    gap: 10px;
}

.create-user-panel .panel-heading {
    margin-bottom: 12px;
}

.create-user-panel .admin-form label {
    gap: 5px;
}

.create-user-panel .admin-form input,
.create-user-panel .admin-form select {
    min-height: 34px;
}

.create-user-panel .admin-form select {
    background-position:
        calc(100% - 18px) 14px,
        calc(100% - 13px) 14px,
        0 0;
}

.create-user-panel .admin-form .btn {
    min-height: 34px;
}

.user-detail-page,
.event-list {
    display: grid;
    gap: var(--theme-gap);
}

.user-detail-title {
    display: grid;
    gap: 7px;
}

.user-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--theme-muted);
    font-size: 0.86rem;
    font-weight: 850;
}

.user-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--theme-gap);
}

.user-detail-page .detail-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.user-detail-page .detail-list div {
    display: grid;
    grid-template-columns: minmax(120px, 0.75fr) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 38px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(140, 169, 199, 0.12);
}

.user-detail-page .detail-list div:last-child {
    border-bottom: 0;
}

.user-detail-page .detail-list dt {
    color: var(--theme-muted);
    font-size: 0.76rem;
    font-weight: 950;
}

.user-detail-page .detail-list dd {
    min-width: 0;
    margin: 0;
    color: var(--theme-text);
    font-weight: 900;
    overflow-wrap: anywhere;
}

.event-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(140, 169, 199, 0.12);
}

.event-list article:last-child {
    border-bottom: 0;
}

.support-widget,
.chat-widget {
    position: fixed;
    bottom: 22px;
    z-index: 60;
}

.support-widget {
    left: 22px;
}

.chat-widget {
    right: 22px;
}

.floating-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    width: 82px;
    height: 34px;
    padding: 0 12px;
    border-color: rgba(var(--color-accent-rgb), 0.58);
    border-radius: var(--theme-button-radius);
    background:
        linear-gradient(180deg, rgba(var(--color-accent-rgb), 0.3), rgba(var(--color-accent-rgb), 0.18)),
        rgba(2, 9, 23, 0.9);
    color: var(--theme-text);
    text-decoration: none;
}

.chat-toggle,
.support-toggle {
    box-shadow: 0 10px 20px rgba(var(--color-accent-rgb), 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.chat-toggle {
    position: relative;
    gap: 5px;
}

.chat-unread-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff5f72;
    color: #ffffff;
    font-size: 0.54rem;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 0 10px rgba(255, 95, 114, 0.38);
}

.chat-unread-badge[hidden] {
    display: none;
}

.support-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 22px;
    overflow: hidden;
    overscroll-behavior: contain;
}

.support-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 5, 10, 0.78);
    backdrop-filter: blur(10px);
}

.support-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(980px, calc(100vw - 30px));
    max-height: min(760px, calc(100vh - 34px));
    padding: 0;
    overflow: hidden;
    overscroll-behavior: contain;
    background: #020917;
}

.support-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(var(--color-accent-rgb), 0.18);
}

.support-header div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.support-header h2 {
    margin: 0;
    color: var(--theme-text);
    font-size: clamp(1.4rem, 3vw, 2.35rem);
    font-weight: 950;
    letter-spacing: 0;
}

.support-faq-view,
.support-ticket-view {
    display: grid;
    min-height: 0;
}

.support-faq-view {
    grid-template-rows: minmax(0, 1fr) auto;
}

.support-faq-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    min-height: 0;
    padding: 22px 24px;
    overflow: auto;
}

.support-faq-sidebar {
    display: grid;
    align-content: start;
    gap: 9px;
}

.support-faq-sidebar strong {
    color: var(--theme-muted);
    font-size: 0.68rem;
    font-weight: 950;
    text-transform: uppercase;
}

.support-topic {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.22);
    border-radius: var(--theme-button-radius);
    background: rgba(2, 9, 23, 0.72);
    color: var(--theme-muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
}

.support-topic.active,
.support-topic:hover {
    border-color: rgba(var(--color-accent-rgb), 0.58);
    color: var(--theme-text);
    background: rgba(var(--color-accent-rgb), 0.12);
}

.support-faq-list {
    display: grid;
    align-content: start;
}

.support-faq-item {
    border-bottom: 1px solid rgba(140, 169, 199, 0.16);
}

.support-faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    color: var(--theme-text);
    font-size: 0.96rem;
    font-weight: 850;
    cursor: pointer;
    list-style: none;
}

.support-faq-item summary::-webkit-details-marker {
    display: none;
}

.support-faq-item summary::after {
    content: "+";
    color: var(--theme-accent);
    font-family: var(--font-mono);
    font-weight: 950;
}

.support-faq-item[open] summary::after {
    content: "-";
}

.support-faq-item p {
    margin: 0;
    padding: 0 28px 16px 0;
    color: var(--theme-muted);
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.55;
}

.support-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding: 14px 24px 18px;
    border-top: 1px solid rgba(var(--color-accent-rgb), 0.18);
    background: rgba(1, 7, 16, 0.78);
}

.support-footer span {
    color: var(--theme-muted);
    font-size: 0.8rem;
    font-weight: 850;
}

.support-ticket-view {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    padding: 18px 20px 20px;
}

.support-ticket-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
}

.support-ticket-heading div {
    display: grid;
    gap: 4px;
}

.support-ticket-heading strong {
    color: var(--theme-text);
    font-size: 1rem;
    font-weight: 950;
}

.support-ticket-heading span {
    color: var(--theme-accent);
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
}

.support-messages {
    display: grid;
    align-content: start;
    gap: 9px;
    min-height: 220px;
    max-height: min(430px, calc(100vh - 260px));
    padding: 12px;
    overflow-y: auto;
    border: 1px solid rgba(var(--color-accent-rgb), 0.16);
    border-radius: var(--theme-widget-radius);
    background: rgba(1, 7, 16, 0.58);
}

.support-message {
    display: grid;
    gap: 6px;
    width: min(78%, 560px);
    padding: 10px 11px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.16);
    border-radius: var(--theme-widget-radius);
    background: rgba(var(--color-accent-rgb), 0.055);
}

.support-message.mine {
    justify-self: end;
    border-color: rgba(32, 240, 138, 0.26);
    background: rgba(32, 240, 138, 0.08);
}

.support-message-top {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.support-message-top strong {
    color: var(--theme-accent);
    font-size: 0.78rem;
}

.support-message-top span,
.support-message-top time {
    color: var(--theme-muted);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.support-message p {
    margin: 0;
    color: var(--theme-text);
    font-size: 0.84rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.support-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 8px;
    padding-top: 12px;
}

.support-input input {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.32);
    border-radius: var(--theme-button-radius);
    background: rgba(2, 9, 23, 0.88);
    color: var(--theme-text);
    outline: none;
}

.chat-message.support-ticket-notice {
    border-color: rgba(32, 240, 138, 0.28);
    background: rgba(32, 240, 138, 0.075);
}

.chat-panel {
    position: absolute;
    right: 0;
    bottom: 56px;
    display: flex;
    flex-direction: column;
    width: min(390px, calc(100vw - 32px));
    height: auto;
    max-height: min(430px, calc(100vh - 120px));
    padding: 0;
    overflow: hidden;
    overscroll-behavior: contain;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid rgba(var(--color-accent-rgb), 0.18);
}

.chat-header div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.chat-header span {
    color: var(--theme-muted);
    font-size: 0.74rem;
    font-weight: 900;
}

.chat-pinned {
    margin: 12px 12px 0;
    padding: 10px 11px;
    border: 1px solid rgba(255, 209, 102, 0.3);
    border-radius: var(--theme-widget-radius);
    background: rgba(255, 209, 102, 0.09);
    color: var(--color-warning);
    font-size: 0.82rem;
}

.chat-messages {
    display: grid;
    flex: 0 1 auto;
    align-content: start;
    gap: 8px;
    min-height: 58px;
    max-height: 86px;
    padding: 10px 12px;
    overflow-y: auto;
}

.chat-panel.has-messages .chat-messages {
    min-height: 252px;
    max-height: 300px;
}

.chat-message {
    display: grid;
    gap: 5px;
    padding: 9px 10px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.16);
    border-radius: var(--theme-widget-radius);
    background: rgba(var(--color-accent-rgb), 0.045);
}

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

.chat-author {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    min-width: 0;
}

.chat-role-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.42);
    border-radius: 999px;
    color: var(--theme-accent);
    background: rgba(var(--color-accent-rgb), 0.12);
    box-shadow: inset 0 0 10px rgba(var(--color-accent-rgb), 0.12);
    font-size: 0.62rem;
    font-weight: 950;
    line-height: 1;
}

.chat-role-mark.master {
    border-color: rgba(32, 240, 138, 0.48);
    color: var(--color-success);
    background: rgba(32, 240, 138, 0.12);
}

.chat-role-mark.admin {
    border-color: rgba(255, 209, 102, 0.48);
    color: var(--color-warning);
    background: rgba(255, 209, 102, 0.12);
}

.chat-author strong {
    color: var(--theme-accent);
    font-size: 0.82rem;
}

.chat-time {
    color: var(--theme-muted);
    font-size: 0.7rem;
    font-weight: 900;
}

.chat-message-text {
    color: var(--theme-text);
    font-size: 0.84rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.chat-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.chat-actions .btn {
    min-height: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 8px;
    font-size: 0.58rem;
}

.chat-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 7px;
    padding: 10px 12px;
    border-top: 1px solid rgba(var(--color-accent-rgb), 0.18);
}

.chat-input input,
.chat-input .btn {
    min-height: 34px;
    height: 34px;
}

.chat-input .btn {
    padding-inline: 10px;
}

.chat-notice {
    margin: 0;
    padding: 0 12px 12px;
    color: #ff9baa;
    font-size: 0.78rem;
    font-weight: 900;
}

.tour-overlay,
.history-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.tour-overlay {
    align-items: end;
    padding-bottom: 34px;
}

.tour-backdrop,
.history-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 5, 10, 0.72);
    backdrop-filter: blur(8px);
}

.tour-card,
.history-panel {
    position: relative;
    z-index: 1;
    overscroll-behavior: contain;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-widget-radius);
    background: rgba(2, 9, 23, 0.97);
    box-shadow: var(--theme-card-shadow), 0 0 28px rgba(var(--color-accent-rgb), 0.18);
}

.tour-card {
    display: grid;
    gap: 14px;
    width: min(560px, calc(100vw - 32px));
    padding: 22px;
}

.tour-card p {
    margin: 0;
    color: var(--theme-muted);
}

.tour-highlight {
    position: relative;
    z-index: 81;
    outline: 2px solid var(--theme-accent);
    box-shadow: 0 0 0 8px rgba(var(--color-accent-rgb), 0.13), var(--theme-card-shadow);
}

.history-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 16px;
    width: min(1120px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    padding: 22px;
}

.history-header {
    justify-content: space-between;
}

.history-header p {
    margin: 4px 0 0;
}

.history-tabs {
    flex-wrap: wrap;
}

.history-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.history-export-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.history-export-message {
    margin-top: -2px;
}

.history-tab,
.history-sort {
    border: 1px solid rgba(var(--color-accent-rgb), 0.28);
    border-radius: var(--theme-button-radius);
    background: rgba(2, 9, 23, 0.72);
    color: var(--theme-text);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.history-tab {
    min-height: 34px;
    padding: 0 14px;
}

.history-tab.active {
    border-color: rgba(var(--color-accent-rgb), 0.78);
    background: rgba(var(--color-accent-rgb), 0.14);
    color: var(--theme-accent);
}

.history-sort {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
}

.history-table-wrap {
    min-height: 220px;
    overflow: auto;
    overscroll-behavior: contain;
}

.history-footer {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.history-footer .btn {
    min-height: 26px;
    padding-inline: 9px;
    font-size: 0.62rem;
}

.history-footer .history-reset-actions .btn {
    min-height: 24px;
    padding-inline: 8px;
    font-size: 0.58rem;
}

.risk-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 5, 10, 0.76);
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.risk-modal.open {
    display: flex;
}

.risk-modal-panel {
    display: grid;
    gap: 18px;
    width: min(720px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    padding: 24px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-widget-radius);
    background: rgba(2, 9, 23, 0.98);
    box-shadow: var(--theme-card-shadow);
}

.risk-text {
    max-height: 320px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    white-space: pre-wrap;
    border: 1px solid rgba(var(--color-accent-rgb), 0.22);
    border-radius: var(--theme-widget-radius);
    background: rgba(0, 0, 0, 0.22);
    color: var(--theme-muted);
    font: inherit;
    line-height: 1.55;
}

.risk-check,
.risk-confirm {
    display: grid;
    gap: 8px;
    color: var(--theme-muted);
    font-size: 0.9rem;
}

.risk-check {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.risk-actions {
    justify-content: flex-start;
}

.danger-zone {
    border-color: rgba(255, 95, 114, 0.38);
}

.legal-page {
    width: min(100% - 44px, 900px);
    padding-block: 36px;
}

.legal-copy {
    display: grid;
    gap: 14px;
    color: var(--theme-muted);
    line-height: 1.65;
}

.legal-copy h2 {
    margin-top: 10px;
}

.legal-updated,
.legal-links {
    color: var(--theme-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.dashboard-page h1,
.settings-page h1,
.admin-page h1,
.legal-page h1 {
    color: var(--type-heading-color);
    font-size: var(--type-page-heading-size);
    font-weight: var(--type-page-heading-weight);
    line-height: 1.1;
}

.panel-heading h2,
.customisation-section h2,
.history-header h2,
.chat-header strong,
.plan-card-heading h2 {
    color: var(--type-heading-color);
    font-size: var(--type-panel-heading-size);
    font-weight: var(--type-panel-heading-weight);
    line-height: 1.15;
}

.dashboard-page,
.settings-page,
.admin-page,
.history-panel,
.chat-panel,
.risk-modal-panel {
    color: var(--type-body-color);
    font-size: var(--type-body-size);
    font-weight: var(--type-body-weight);
    line-height: var(--theme-line-height);
}

.stat-label,
.stat-mini-grid small,
.stat-balance-rows small,
.stat-inline span,
.detail-list dt,
.performance-list dt,
.plan-details dt,
.admin-panel-metrics small,
.market-row span:first-child,
.broker-form label > span,
.admin-form label > span,
.customisation-form label > span,
.history-sort,
th,
.eyebrow {
    color: var(--type-label-color);
    font-size: var(--type-label-size);
    font-weight: var(--type-label-weight);
}

.empty-note,
.muted-count,
.notification-item p,
.notification-item span,
.chat-header span,
.chat-time,
.legal-updated,
.legal-links,
.broker-message,
.admin-message {
    color: var(--type-muted-color);
    font-size: var(--type-muted-size);
}

.stat-card > strong,
.admin-panel-metrics strong {
    color: var(--type-number-color);
    font-size: var(--type-number-size);
}

.dashboard-page .buy,
.dashboard-page td.buy {
    color: var(--color-success);
    text-shadow: 0 0 10px rgba(31, 241, 139, 0.18);
}

.dashboard-page .sell,
.dashboard-page td.sell {
    color: var(--color-danger);
    text-shadow: 0 0 10px rgba(255, 95, 114, 0.18);
}

.dashboard-page .positive,
.dashboard-page td.positive,
.market-row strong.positive {
    color: var(--color-success);
    text-shadow: 0 0 10px rgba(31, 241, 139, 0.18);
}

.dashboard-page .negative,
.dashboard-page td.negative,
.market-row strong.negative {
    color: var(--color-danger);
    text-shadow: 0 0 10px rgba(255, 95, 114, 0.18);
}

.btn,
.nav-link,
.history-tab,
.notification-dropdown button,
.floating-action-button,
button,
select {
    font-size: var(--type-button-size);
    font-weight: var(--type-button-weight);
}

.broker-form input,
.admin-form input,
.history-filters input,
.date-pill input,
textarea {
    font-size: var(--type-body-size);
    line-height: var(--theme-line-height);
}

.table-wrap th,
.table-wrap td,
.history-table th,
.history-table td {
    height: var(--theme-row-min-height);
    padding: var(--theme-row-padding);
    line-height: var(--theme-line-height);
}

@media (max-width: 1180px) {
    .dashboard-layout {
        display: grid;
        grid-template-columns: 1fr;
    }

    .sidebar,
    .main-column,
    .right-column {
        display: contents;
    }

    .overview-banner {
        order: 1;
    }

    .bot-panel {
        order: 2;
    }

    .performance-panel {
        order: 3;
    }

    .summary-strip {
        order: 4;
    }

    .equity-panel {
        order: 5;
    }

    [data-custom-section="activePositions"] {
        order: 6;
    }

    [data-custom-section="recentTrades"] {
        order: 7;
    }

    [data-custom-section="marketReturns"] {
        order: 8;
    }

    [data-custom-section="userPanel"] {
        order: 9;
    }

    .right-column {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 820px) {
    :root {
        --theme-page-width: min(100% - 32px, 1480px);
    }

    .app-header-inner:not(:has(.master-menu-shell)) {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px 0;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .top-nav,
    .app-header-inner:not(:has(.master-menu-shell)) .header-actions {
        justify-content: space-between;
    }

    .summary-strip,
    .summary-strip.two-up,
    .dashboard-layout,
    .right-column,
    .subscription-layout,
    .user-detail-grid {
        grid-template-columns: 1fr;
    }

    .broker-form-grid,
    .visual-control-grid,
    .visual-color-grid {
        grid-template-columns: 1fr;
    }

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

    .customisation-form label {
        grid-template-columns: 1fr;
    }

    .subscription-current-panel {
        position: static;
    }

    .admin-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-actions {
        justify-content: space-between;
    }

    .users-panel-heading,
    .admin-panel-metrics {
        justify-content: flex-start;
    }

    .performance-body {
        min-height: 88px;
    }

    .notification-dropdown {
        position: fixed;
        top: clamp(78px, 12vh, 104px);
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        z-index: 1000;
        width: auto;
        max-height: min(390px, calc(100vh - 118px));
        overflow: auto;
        transform: none;
    }

    .notification-dropdown:hover {
        transform: none;
    }

    .history-panel {
        width: min(720px, calc(100vw - 20px));
        max-height: calc(100vh - 20px);
        gap: 12px;
        padding: 16px;
    }

    .history-header {
        align-items: flex-start;
        gap: 10px;
    }

    .history-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
    }

    .history-table-wrap {
        min-height: 180px;
    }

    .history-panel table {
        min-width: 720px;
    }

    .history-panel th,
    .history-panel td {
        padding: 7px 9px;
        font-size: 0.68rem;
        line-height: 1.2;
        white-space: nowrap;
    }

    .history-sort {
        font-size: 0.62rem;
        white-space: nowrap;
    }

    .support-widget {
        left: 16px;
        bottom: 16px;
    }

    .chat-widget {
        right: 16px;
        bottom: 16px;
    }
}

.legal-actions {
    justify-content: flex-end;
}

@media (max-width: 520px) {
    .brand-lockup img {
        width: 108px;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .nav-link {
        padding: 0 10px;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .top-nav {
        flex-wrap: wrap;
    }

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

    .overview-banner {
        grid-template-columns: 1fr;
    }

    .floating-action-button {
        width: 76px;
        min-width: 76px;
        height: 34px;
        padding: 0 10px;
    }

    .chat-panel {
        right: -4px;
        bottom: 54px;
        height: auto;
        max-height: min(420px, calc(100vh - 100px));
    }
}

@media (max-width: 760px) {
    :root {
        --theme-page-width: min(100% - 18px, 760px);
        --theme-gap: 10px;
        --theme-panel-padding: 11px;
        --theme-row-padding: 8px 9px;
        --type-panel-heading-size: 0.92rem;
        --type-body-size: 0.76rem;
        --type-muted-size: 0.68rem;
        --type-number-size: 0.86rem;
        --type-button-size: 0.64rem;
    }

    .dashboard-page {
        display: grid;
        gap: var(--theme-gap);
        width: var(--theme-page-width);
        max-width: var(--theme-page-width);
        padding-top: 12px;
        overflow-x: hidden;
    }

    .dashboard-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--theme-gap);
    }

    .sidebar,
    .main-column,
    .right-column {
        display: contents;
    }

    .dashboard-page .panel,
    .dashboard-page .overview-banner,
    .dashboard-page .stat-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: var(--theme-panel-padding);
        border-radius: 7px;
    }

    .panel-heading {
        min-height: 0;
        gap: 9px;
        margin-bottom: 9px;
    }

    .panel-heading h1,
    .panel-heading h2 {
        line-height: 1.15;
    }

    .summary-strip {
        grid-template-columns: 1fr;
        gap: var(--theme-gap);
    }

    .stat-card {
        min-height: 0;
    }

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

    .right-column .recent-trades-panel,
    [data-custom-section="activePositions"] {
        min-height: 0;
    }

    .table-wrap,
    .recent-trades-panel .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .recent-trades-panel table,
    [data-custom-section="activePositions"] table {
        min-width: 520px;
    }

    .market-row,
    .detail-list div,
    .performance-list div {
        min-width: 0;
    }
}

@media (min-width: 560px) and (max-width: 760px) {
    .summary-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    :root {
        --theme-page-width: min(100% - 14px, 640px);
        --theme-panel-padding: 9px;
        --theme-gap: 9px;
        --type-page-heading-size: 1rem;
        --type-panel-heading-size: 0.82rem;
        --type-body-size: 0.7rem;
        --type-muted-size: 0.64rem;
        --type-number-size: 0.76rem;
        --type-button-size: 0.58rem;
    }

    body {
        overflow-x: hidden;
    }

    .app-header {
        z-index: 120;
        overflow: visible;
    }

    .app-header-inner:not(:has(.master-menu-shell)) {
        position: relative;
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        grid-template-areas:
            "robot brand logout"
            "controls controls controls";
        justify-items: center;
        align-items: center;
        gap: 10px 10px;
        min-height: auto;
        width: min(100% - 14px, 640px);
        padding: 10px 0 12px;
    }

    .app-header-inner:has(.master-menu-shell) {
        position: relative;
        grid-template-columns: 38px 48px minmax(0, 1fr) 38px minmax(66px, auto);
        grid-template-areas:
            "brand brand brand brand brand"
            "menu robot spacer status uptime";
        gap: 12px 10px;
        justify-items: center;
        align-items: center;
        width: min(100% - 44px, 640px);
        min-height: auto;
        padding: 10px 0 12px;
    }

    .app-header-inner:has(.master-menu-shell) .brand-lockup {
        grid-area: brand;
        justify-content: center;
        justify-self: center;
        gap: 8px;
        width: max-content;
        max-width: 100%;
        min-width: 0;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .brand-lockup {
        grid-area: brand;
        justify-content: center;
        gap: 8px;
        width: auto;
        min-width: 0;
    }

    .brand-lockup img {
        width: 118px;
    }

    .brand-lockup span {
        font-size: 0.58rem;
        letter-spacing: 0.08em;
    }

    .app-header-inner:has(.master-menu-shell) .master-menu-shell {
        grid-area: menu;
        justify-self: start;
        width: 38px;
        height: 32px;
        place-content: center;
    }

    .app-header-inner:has(.master-menu-shell) .master-menu-button,
    .app-header-inner:has(.master-menu-shell) .master-menu-stack .nav-link {
        width: 38px;
        height: 32px;
        min-width: 38px;
        min-height: 32px;
    }

    .app-header-inner:has(.master-menu-shell) .master-menu-stack {
        position: absolute;
        top: calc(100% + 8px);
        left: 50%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
        transform: translateX(-50%);
    }

    .app-header-inner:has(.master-menu-shell) .master-menu-stack[hidden] {
        display: none;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .top-nav {
        grid-area: controls;
        display: flex;
        flex-wrap: nowrap;
        justify-self: start;
        justify-content: flex-start;
        width: auto;
        min-width: 0;
        gap: clamp(10px, 4vw, 18px);
        margin: 0;
        padding: 0 0 0 56px;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .nav-link {
        width: 32px;
        min-height: 32px;
        padding: 0;
    }

    .nav-icon {
        width: 15px;
        height: 15px;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .header-actions {
        grid-area: controls;
        display: flex;
        flex-wrap: nowrap;
        justify-self: end;
        justify-content: flex-end;
        align-items: center;
        width: auto;
        min-width: 0;
        gap: clamp(10px, 4vw, 18px);
        margin: 0;
        padding: 0 56px 0 0;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .header-actions .icon-button:only-child {
        margin-left: 0;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .notification-shell {
        position: absolute;
        left: 0;
        top: 2px;
        width: 44px;
        height: 44px;
    }

    .app-header-inner:has(.master-menu-shell) .notification-shell {
        grid-area: robot;
        justify-self: start;
        width: 48px;
        height: 44px;
        margin-left: 0;
    }

    .notification-button {
        width: 48px;
        height: 44px;
        min-width: 48px;
        min-height: 44px;
    }

    #logoutBtn.icon-button {
        position: absolute;
        top: 2px;
        right: 0;
        width: 38px;
        min-width: 38px;
        min-height: 38px;
    }

    .status-pill {
        min-height: 32px;
        padding-inline: 8px;
        font-size: 0.6rem;
    }

    .status-dot {
        width: 8px;
        height: 8px;
    }

    .app-header-inner:has(.master-menu-shell) .status-dot-only {
        grid-area: status;
        justify-self: end;
    }

    .status-dot-only,
    .icon-button {
        width: 32px;
        min-width: 32px;
        min-height: 32px;
    }

    .app-header-inner:has(.master-menu-shell) .uptime-pill {
        grid-area: uptime;
        justify-self: end;
    }

    .uptime-pill {
        justify-content: center;
        min-width: 84px;
        max-width: 92px;
        gap: 4px;
    }

    .uptime-pill strong {
        font-size: 0.62rem;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .header-icon {
        width: 14px;
        height: 14px;
    }

    .notification-robot {
        width: 49px;
        height: 49px;
    }

    .notification-dropdown {
        position: fixed;
        top: clamp(78px, 12vh, 104px);
        left: max(8px, env(safe-area-inset-left));
        right: max(8px, env(safe-area-inset-right));
        z-index: 1000;
        width: auto;
        max-height: min(360px, calc(100vh - 130px));
        overflow: auto;
        transform: none;
    }

    .notification-dropdown:hover {
        transform: none;
    }

    .dashboard-page,
    .settings-page,
    .admin-page {
        width: var(--theme-page-width);
        max-width: var(--theme-page-width);
        padding-top: 10px;
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
        overflow-x: hidden;
    }

    .dashboard-page .panel,
    .dashboard-page .stat-card,
    .dashboard-page .overview-banner,
    .settings-page .panel,
    .admin-page .panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-width: var(--theme-border-width);
        border-radius: 7px;
    }

    .dashboard-layout,
    .main-column,
    .right-column {
        gap: var(--theme-gap);
    }

    .overview-banner {
        min-height: 38px;
        margin-bottom: 0;
        padding: 7px 9px;
        overflow: hidden;
    }

    .overview-banner div {
        gap: 6px;
        flex-wrap: wrap;
        overflow: hidden;
    }

    .overview-banner .eyebrow {
        font-size: 0.64rem;
        letter-spacing: 0.04em;
    }

    .overview-banner strong {
        min-width: 0;
        overflow: hidden;
        font-size: 0.68rem;
        line-height: 1.25;
        text-overflow: clip;
        white-space: normal;
    }

    .summary-strip {
        gap: 12px;
    }

    .stat-card {
        min-height: 0;
        padding: var(--theme-row-padding);
    }

    .stat-card > strong {
        margin-top: 3px;
        margin-bottom: 6px;
    }

    .stat-mini-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .stat-mini-grid span,
    .stat-balance-rows span {
        min-height: 29px;
        padding: 5px 7px;
    }

    .equity-panel {
        min-height: 0;
        padding-bottom: var(--theme-panel-padding);
    }

    .equity-panel .panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .equity-panel .range-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 7px;
    }

    .date-pill {
        width: 100%;
        min-height: 28px;
        padding: 0 7px;
        overflow: hidden;
    }

    .compact-date {
        width: 100%;
        max-width: none;
        min-height: 26px;
        color: var(--theme-text);
        font-size: 0.62rem;
        text-align: center;
    }

    .equity-plot {
        min-height: 0;
        align-items: stretch;
    }

    .equity-plot svg {
        height: auto;
    }

    .equity-axis-label {
        font-size: 0.68rem;
        letter-spacing: 0;
    }

    .history-panel {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        max-height: calc(100vh - 16px);
        padding: 12px;
        gap: 10px;
        overflow: hidden;
    }

    .history-modal {
        box-sizing: border-box;
        width: 100vw;
        max-width: 100vw;
        padding: 8px;
        overflow-y: auto;
        overflow-x: hidden;
        place-items: center;
    }

    .history-panel > *,
    .history-header,
    .history-header > div,
    .history-tabs-row,
    .history-tabs,
    .history-export-actions,
    .history-filters,
    .history-footer,
    .history-page-actions,
    .history-reset-actions {
        min-width: 0;
        max-width: 100%;
    }

    .history-header {
        flex-direction: column;
    }

    .history-header h2 {
        font-size: 1rem;
    }

    .history-header p {
        font-size: 0.68rem;
        line-height: 1.3;
    }

    .history-tabs {
        gap: 6px;
    }

    .history-tabs-row {
        align-items: stretch;
        flex-direction: column;
    }

    .history-export-actions {
        justify-content: flex-end;
        margin-left: 0;
    }

    .history-tab {
        min-height: 28px;
        padding: 0 9px;
        font-size: 0.62rem;
    }

    .history-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .history-table-wrap {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-height: 180px;
        max-height: calc(100vh - 285px);
        overflow-y: auto;
        overflow-x: hidden;
    }

    .history-panel table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }

    .history-panel th,
    .history-panel td {
        padding: 6px 8px;
        font-size: 0.62rem;
        line-height: 1.18;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .history-panel th:nth-child(n+5),
    .history-panel td:nth-child(n+5) {
        display: none;
    }

    .history-panel th:nth-child(1),
    .history-panel td:nth-child(1) {
        width: 42%;
        text-align: left;
    }

    .history-panel th:nth-child(2),
    .history-panel td:nth-child(2) {
        width: 16%;
        text-align: center;
    }

    .history-panel th:nth-child(3),
    .history-panel td:nth-child(3),
    .history-panel th:nth-child(4),
    .history-panel td:nth-child(4) {
        width: 21%;
        text-align: right;
    }

    .history-sort {
        display: block;
        max-width: 100%;
        overflow: hidden;
        font-size: 0.58rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .history-footer {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
        justify-items: start;
        gap: 8px;
        width: 100%;
    }

    .history-page-actions,
    .history-reset-actions {
        max-width: 100%;
    }

    .history-reset-actions {
        justify-content: start;
    }

    .panel-heading {
        gap: 10px;
        margin-bottom: 8px;
    }

    .panel-heading h1,
    .panel-heading h2 {
        font-size: var(--type-panel-heading-size);
    }

    .bot-toggle-pill {
        grid-template-columns: minmax(0, 1fr) 52px;
        min-height: 44px;
        padding: 6px 8px 6px 10px;
        gap: 7px;
    }

    .bot-toggle-copy small {
        font-size: 0.58rem;
    }

    .bot-toggle-copy strong {
        font-size: 0.74rem;
    }

    .bot-toggle-copy em {
        font-size: 0.58rem;
    }

    .bot-mode-notice {
        font-size: 0.64rem;
    }

    .bot-toggle-track {
        width: 52px;
        height: 24px;
    }

    .bot-toggle-knob {
        top: 2px;
        left: 2px;
        width: 18px;
        height: 18px;
    }

    .bot-toggle-pill.on .bot-toggle-knob {
        transform: translateX(28px);
    }

    .performance-body {
        min-height: 92px;
    }

    .performance-card {
        gap: 8px;
        padding: 9px;
    }

    .performance-card-top strong {
        font-size: 1.08rem;
    }

    .performance-list div {
        min-height: 19px;
        padding: 2px 0;
    }

    .detail-list div {
        min-height: 30px;
        padding: 5px 0;
    }

    .table-wrap {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .history-panel .history-table-wrap {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    [data-custom-section="activePositions"] table,
    .right-column .recent-trades-panel table {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        table-layout: fixed;
    }

    .desktop-result {
        display: none;
    }

    .mobile-result {
        display: inline;
    }

    [data-custom-section="activePositions"] th,
    [data-custom-section="activePositions"] td,
    .right-column .recent-trades-panel th,
    .right-column .recent-trades-panel td {
        padding-inline: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    [data-custom-section="activePositions"] th:nth-child(4),
    [data-custom-section="activePositions"] td:nth-child(4) {
        display: none;
    }

    [data-custom-section="activePositions"] th:nth-child(1),
    [data-custom-section="activePositions"] td:nth-child(1) {
        width: 40%;
        text-align: left;
    }

    [data-custom-section="activePositions"] th:nth-child(2),
    [data-custom-section="activePositions"] td:nth-child(2) {
        width: 16%;
        text-align: center;
    }

    [data-custom-section="activePositions"] th:nth-child(3),
    [data-custom-section="activePositions"] td:nth-child(3) {
        width: 22%;
        text-align: right;
    }

    [data-custom-section="activePositions"] th:nth-child(5),
    [data-custom-section="activePositions"] td:nth-child(5) {
        width: 22%;
        text-align: right;
    }

    [data-custom-section="activePositions"] th:nth-child(5) {
        font-size: 0;
    }

    [data-custom-section="activePositions"] th:nth-child(5)::after {
        content: "RESULT";
        font-size: 0.64rem;
    }

    .active-positions-panel th:nth-child(4),
    .active-positions-panel td:nth-child(4) {
        display: none;
    }

    .active-positions-panel th:nth-child(5),
    .active-positions-panel td:nth-child(5) {
        display: table-cell;
        width: 21%;
        text-align: right;
    }

    .active-positions-panel th:nth-child(5) {
        font-size: 0;
    }

    .active-positions-panel th:nth-child(5)::after {
        content: "P/L";
        font-size: 0.58rem;
    }

    .right-column .recent-trades-panel th:nth-child(1),
    .right-column .recent-trades-panel td:nth-child(1) {
        width: 40%;
        text-align: left;
    }

    .right-column .recent-trades-panel th:nth-child(2),
    .right-column .recent-trades-panel td:nth-child(2) {
        width: 16%;
        text-align: center;
    }

    .right-column .recent-trades-panel th:nth-child(3),
    .right-column .recent-trades-panel td:nth-child(3) {
        display: table-cell;
        width: 22%;
        text-align: right;
    }

    .right-column .recent-trades-panel th:nth-child(4),
    .right-column .recent-trades-panel td:nth-child(4) {
        width: 22%;
        text-align: right;
    }

    .right-column .recent-trades-panel th:nth-child(5),
    .right-column .recent-trades-panel td:nth-child(5) {
        display: none;
    }

    .support-widget {
        left: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .chat-widget {
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .floating-action-button {
        width: 58px;
        min-width: 58px;
        height: 26px;
        padding: 0 7px;
        font-size: 0.58rem;
    }

    .chat-panel {
        right: -2px;
        bottom: 46px;
        width: min(360px, calc(100vw - 28px));
        max-height: min(410px, calc(100vh - 118px));
    }

    .chat-input input {
        font-size: 16px;
    }

    .support-overlay {
        padding: 8px;
        place-items: start center;
        align-items: start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .support-panel {
        width: calc(100vw - 16px);
        max-height: none;
        min-height: 0;
        overflow: visible;
    }

    .support-faq-view,
    .support-ticket-view {
        min-height: 0;
        overflow: visible;
    }

    .support-header {
        align-items: start;
        gap: 10px;
        padding: 11px 12px 10px;
    }

    .support-header h2 {
        font-size: 1rem;
        line-height: 1.08;
    }

    .support-header .empty-note {
        font-size: 0.66rem;
        line-height: 1.2;
    }

    .support-header .btn {
        min-height: 30px;
        padding-inline: 10px;
    }

    .support-faq-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        min-height: 0;
        padding: 12px;
        overflow: visible;
    }

    .support-faq-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .support-faq-sidebar strong {
        grid-column: 1 / -1;
    }

    .support-faq-item summary {
        min-height: 44px;
        font-size: 0.82rem;
    }

    .support-faq-item p {
        padding-right: 0;
        font-size: 0.74rem;
    }

    .support-footer {
        align-items: stretch;
        flex-direction: column;
        padding: 12px 14px;
    }

    .support-ticket-view {
        padding: 12px;
    }

    .support-messages {
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .support-message {
        width: 92%;
    }

    .support-input {
        grid-template-columns: 1fr;
    }

    .support-input input {
        font-size: 16px;
    }

    .settings-page .panel,
    .admin-page .panel,
    .customisation-section {
        padding: var(--theme-panel-padding);
        max-width: 100%;
        min-width: 0;
    }

    .settings-page .broker-form-grid,
    .settings-page .visual-control-grid,
    .settings-page .visual-control-grid-weights,
    .settings-page .visual-color-grid,
    .admin-grid,
    .admin-logs-grid,
    .broker-form-grid {
        grid-template-columns: 1fr !important;
    }

    .settings-page .visibility-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px;
    }

    .settings-page .visibility-grid label {
        min-height: 42px;
        padding: 8px 9px;
        gap: 8px;
    }

    .settings-page .visibility-grid label span {
        min-width: 0;
        font-size: 0.64rem;
        line-height: 1.15;
    }

    .settings-page .broker-form label,
    .settings-page .customisation-form label,
    .admin-page .admin-form label {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: stretch;
        gap: 7px;
        min-width: 0;
    }

    .profile-subscription-card span,
    .profile-subscription-card strong {
        font-size: 0.68rem;
        text-transform: none;
    }

    .settings-page .broker-form input,
    .settings-page .broker-form select,
    .settings-page .customisation-form select,
    .admin-page .admin-form input,
    .admin-page .admin-form select,
    .accent-slider-control {
        width: 100%;
        max-width: none;
    }

    .accent-slider-control {
        grid-template-columns: minmax(0, 1fr) 24px;
    }

    .visual-color-grid {
        gap: 12px;
    }

    .visual-color-grid label {
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center;
    }

    .admin-toolbar {
        align-items: stretch;
        gap: 12px;
    }

    .admin-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .system-control-row {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-panel-metrics {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .users-panel .table-wrap,
    .admin-logs-grid .table-wrap {
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
    }

    .users-panel table,
    .admin-logs-grid table,
    .users-panel thead,
    .admin-logs-grid thead,
    .users-panel tbody,
    .admin-logs-grid tbody,
    .users-panel tr,
    .admin-logs-grid tr,
    .users-panel td,
    .admin-logs-grid td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .users-panel thead,
    .admin-logs-grid thead {
        display: none;
    }

    .users-panel tr,
    .admin-logs-grid tr {
        margin-bottom: 8px;
        padding: 8px;
        border: 1px solid rgba(var(--color-accent-rgb), 0.16);
        border-radius: 7px;
        background: rgba(2, 9, 23, 0.42);
    }

    .users-panel td,
    .admin-logs-grid td {
        display: grid;
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        min-height: 25px;
        padding: 4px 0;
        border-bottom: 1px solid rgba(140, 169, 199, 0.08);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .users-panel td:last-child,
    .admin-logs-grid td:last-child {
        border-bottom: 0;
    }

    .users-panel td::before,
    .admin-logs-grid td::before {
        color: var(--type-label-color);
        font-size: 0.58rem;
        font-weight: 950;
        text-transform: uppercase;
    }

    .users-panel td:nth-child(1)::before { content: "ID"; }
    .users-panel td:nth-child(2)::before { content: "Email"; }
    .users-panel td:nth-child(3)::before { content: "Username"; }
    .users-panel td:nth-child(4)::before { content: "Role"; }
    .users-panel td:nth-child(5)::before { content: "Status"; }
    .users-panel td:nth-child(6)::before { content: "Plan"; }
    .users-panel td:nth-child(7)::before { content: "Charts"; }
    .users-panel td:nth-child(8)::before { content: "Actions"; }

    .admin-logs-grid td:nth-child(1)::before { content: "Time"; }
    .admin-logs-grid td:nth-child(2)::before { content: "User"; }
    .admin-logs-grid td:nth-child(3)::before { content: "Type"; }
    .admin-logs-grid td:nth-child(4)::before { content: "Message"; }

    .users-panel .empty-cell,
    .admin-logs-grid .empty-cell {
        display: block;
        text-align: center;
    }

    .users-panel .empty-cell::before,
    .admin-logs-grid .empty-cell::before {
        content: "";
    }

    .rae-color-picker {
        right: auto;
        box-sizing: border-box;
        width: min(236px, calc(100vw - 32px));
        max-height: min(350px, calc(100vh - 120px));
        gap: 8px;
        padding: 10px;
        overflow: auto;
        overscroll-behavior: contain;
    }

    .rae-color-field {
        height: 116px;
    }

    .rae-color-picker-head strong {
        font-size: 0.74rem;
    }

    .rae-color-picker-head .btn {
        min-height: 28px;
        padding-inline: 9px;
    }

    .rae-color-preview {
        width: 28px;
        height: 28px;
    }

    .rae-color-hex {
        min-height: 30px;
        font-size: 0.68rem;
    }
}

@media (max-width: 390px) {
    .brand-lockup img {
        width: 104px;
    }

    .brand-lockup span {
        display: inline;
        font-size: 0.52rem;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .nav-link,
    .app-header-inner:not(:has(.master-menu-shell)) .status-dot-only,
    .app-header-inner:not(:has(.master-menu-shell)) .icon-button,
    .app-header-inner:not(:has(.master-menu-shell)) .notification-button {
        width: 30px;
        min-width: 30px;
        min-height: 30px;
    }

    .app-header-inner:not(:has(.master-menu-shell)) .top-nav,
    .app-header-inner:not(:has(.master-menu-shell)) .header-actions {
        gap: 10px;
    }

    .uptime-pill {
        min-width: 82px;
        max-width: 90px;
    }
}
