[data-bs-theme="light"] {
    .tab-home-tab {
        background: linear-gradient(135deg, #eeedea, #f9faff, #f7fff9);
    }

    .tab-search-tab {
        background: linear-gradient(135deg, #eef5f1, #f3f0ff, #f7fbff);
    }

    .tab-apps-tab {
        background: linear-gradient(135deg, #fffaf2, #f6fbff, #fff7fc);
    }

    .tab-docs-tab,
    .tab-wallet-tab,
    .tab-support-tab {
        background: linear-gradient(135deg, #fffdf8, #f9faff, #f7fff9);
    }

    .tab-notifications-tab {
        background: linear-gradient(135deg, #f5eeef, #f3f8ff, #f6fff4);
    }

    .tab-setting-tab {
        background: linear-gradient(135deg, #ecf1f4, #faf7ff, #f9fff6);
    }

    .layout-main main {
        background-color: var(--bs-gray-100);
    }
}

[data-bs-theme="dark"] {
    .layout-main {
        background: linear-gradient(135deg, #251f19, #141c26, #271921);
    }

    .layout-main main {
        background-color: var(--bs-black);
    }
}

/* Card lists/tables: do not use page-black (--bs-body-bg) on #171717 cards */
html[data-bs-theme] .layout-main .list-group {
    --bs-list-group-bg: transparent;
    --bs-list-group-color: inherit;
    --bs-list-group-border-color: var(--bs-border-color);
    width: 100%;
    max-width: none;
}

html[data-bs-theme] .layout-main .list-group-item {
    background-color: transparent;
    color: inherit;
}

html[data-bs-theme] .layout-main .list-group-item-action:hover,
html[data-bs-theme] .layout-main .list-group-item-action:focus {
    background-color: var(--field);
    color: inherit;
}

html[data-bs-theme] .layout-main .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: color-mix(in srgb, var(--field) 55%, transparent);
    --bs-table-hover-bg: color-mix(in srgb, var(--field) 80%, transparent);
    --bs-table-border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] .layout-main .card .bg-body-tertiary,
html[data-bs-theme="dark"] .layout-main .modal .bg-body-tertiary {
    background-color: var(--field) !important;
}

/* =============== grid layout css */
.layout-main .app-wrapper {
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: auto 1fr auto;
    padding: 0;
    gap: 0;
    grid-template-areas:
        "header"
        "main"
        "footer";
}

.layout-main aside {
    grid-area: aside;
}

.layout-main main {
    grid-area: main;
}

.page-header {
    position: relative;
    z-index: 1030;
    min-width: 0;
    max-width: 100%;
}

.page-header .avatar.avatar-text {
    overflow: hidden;
}

.page-header [data-theme-toggle] {
    width: 2rem;
    height: 2rem;
    padding: 0;
    line-height: 1;
}

.page-header .page-header-balance {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 575.98px) {
    .page-header .btn-group-sm>.btn {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
        font-size: 0.75rem;
    }

    .page-header #accountReplenishBtn,
    .page-header #accountDepositBtn {
        width: 2rem;
        height: 2rem;
        padding: 0;
        border-radius: 50%;
    }
}

.layout-main footer {
    grid-area: footer;
}

/* ============================= */
.layout-main aside .main-menu {
    height: 100%;
    min-height: 100vh;
}

.layout-main aside .main-menu .tab-content {
    overflow-y: auto;
    flex-grow: 1;
}

.tab-menu {
    position: fixed;
    bottom: 10px;
    width: min(440px, calc(100vw - 16px));
    background: var(--app-border);
    transform: translateX(-50%);
    left: 50%;
    z-index: 999;
    overflow: visible;
}

.tab-menu #themeToggle:hover {
    background: rgba(var(--bs-primary-rgb), .2) !important;
}

.tab-menu #themeToggle,
.tab-menu .nav-link {
    width: auto;
    height: auto;
    min-width: 0;
    padding: 4px 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    color: inherit;
    border: 0;
}

.tab-menu .nav-link.active {
    background: transparent !important;
    color: var(--bs-primary);
}

.tab-menu .tab-menu-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    transition: width .15s ease, height .15s ease, margin .15s ease, background .15s ease, box-shadow .15s ease, font-size .15s ease;
}

.tab-menu .nav-link.active .tab-menu-icon {
    width: 44px;
    height: 44px;
    margin-top: -14px;
    background: var(--bs-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), .35);
    font-size: 1.15rem;
}

.tab-menu-label {
    font-size: 10px;
    line-height: 1.15;
    font-weight: 600;
    max-width: 4.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-link {
    color: inherit;
    text-decoration: none;
}

/* =============== App menu   */
.app-menu .app-card {
    letter-spacing: 0.05em;
    overflow: hidden;
    display: flex;
    width: 80px;
    height: 80px;
    align-items: center;
    justify-content: center;
}

.app-menu a.active .app-card,
.app-menu a:hover .app-card {
    box-shadow: inset 0px -3px 0 1px var(--bs-primary);
    color: var(--bs-primary) !important;
    transition: var(--transition-3s);
}


/* ============= */
.vendor-list .sidebar-link {
    background-color: var(--app-border);
    border: 1px solid var(--bs-border-color);
}

.vendor-list .sidebar-link.active,
.vendor-list .sidebar-link:hover {
    background: var(--bs-primary);
    color: var(--bs-white);
    border-color: var(--bs-primary);
}

@media (min-width: 992px) {
    .layout-main .app-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }

    .layout-main main {
        height: calc(100vh - 88px);
        overflow-y: auto;
        border-radius: 28px;
        border: 5px solid var(--app-border);
        box-shadow: var(--bs-box-shadow-sm);
    }
}

@media (min-width: 1200px) {

    .layout-main .app-wrapper {
        grid-template-columns: 260px 1fr;
        grid-template-rows: auto 1fr;
        grid-template-areas:
            "aside header"
            "aside main"
            "aside footer";
    }

    .layout-main aside {
        padding: 0;
    }

    .layout-main aside .main-menu {
        width: 260px;
    }

    body:not(.layout-desk) .sidebar-toggle,
    body:not(.layout-desk) .page-header .header-brand {
        display: none !important;
    }

}

@media (min-width: 1471px) {
    .layout-main .app-wrapper {
        grid-template-columns: 260px 1fr;
    }
}

@media (max-width: 767.98px) {
    .layout-main footer {
        padding-bottom: 16px;
    }
}

@media (max-width: 1199.98px) {
    .layout-main aside {
        position: absolute;
    }
}

.layout-main.layout-desk .app-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header"
        "main"
        "footer";
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

body.layout-desk {
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
}

.layout-main.layout-desk header,
.layout-main.layout-desk main,
.layout-main.layout-desk footer {
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .layout-main.layout-desk aside {
        position: absolute;
        padding: 0;
    }
}

.layout-main.layout-desk aside .main-menu {
    width: auto;
}

.layout-main.layout-desk .tab-menu {
    position: fixed;
    bottom: 10px;
    width: min(440px, calc(100% - 16px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1040;
}

.layout-main.layout-desk main {
    min-width: 0;
    overflow-x: clip;
}

.layout-main.layout-desk .container-fluid,
.layout-main.layout-desk .row,
#baBinaryDesk,
#baBinaryDesk .row>[class*="col-"],
#baBinaryDesk .card,
#baBinaryDesk .card-body {
    min-width: 0;
    max-width: 100%;
}

.ba-desk-toolbar {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.ba-desk-toolbar .input-group,
.ba-desk-toolbar .form-select {
    min-width: 0;
}

.ba-desk-market {
    width: 100%;
    min-width: 0;
}

.ba-desk-tfs {
    min-width: 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.ba-trade-notif {
    width: max-content;
    max-width: min(14rem, calc(100% - 1rem));
    z-index: 5;
    pointer-events: none;
}

.ba-trade-notif.position-fixed {
    top: 4.5rem !important;
    z-index: 1080;
}

.ba-binary-chart {
    position: relative;
    min-height: 180px;
    height: 36vh;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* One thin scrollbar on ticket body only — no main scroll, no nested pos scroll.
 * Desktop xl: chart card fills leftover height beside the ticket. */
@media (min-width: 1200px) {
    .layout-main.layout-desk main {
        overflow: hidden;
    }

    #baBinaryDesk > .row {
        min-height: calc(100vh - 88px - 2.5rem);
        min-height: calc(100dvh - 88px - 2.5rem);
        align-items: stretch;
    }

    #baBinaryDesk > .row > [class*="col-"] {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    #baBinaryDesk #baTradeChartFocus {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
        margin-bottom: 0 !important;
    }

    #baBinaryDesk #baTradeChartFocus > .card-body.border-bottom {
        flex: 0 0 auto;
    }

    #baBinaryDesk #baTradeChartFocus > .position-relative.overflow-hidden {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    #baBinaryDesk .ba-binary-chart {
        flex: 1 1 auto;
        width: 100%;
        min-height: 240px;
        height: auto;
    }

    #baBinaryDesk #baDigitRow {
        flex-shrink: 0;
    }

    #baTradeTicket {
        position: sticky;
        top: 0.5rem;
        max-height: calc(100vh - 88px - 2.5rem);
        max-height: calc(100dvh - 88px - 2.5rem);
        overflow: hidden;
        flex: 1 1 auto;
        height: 100%;
    }

    #baTradeTicket > #baTicketHead {
        flex-shrink: 0;
    }

    #baTradeTicket > #baTicketBody {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
    }

    #baTradeTicket > #baTicketBody::-webkit-scrollbar {
        width: 6px;
    }

    #baTradeTicket > #baTicketBody::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.25);
        border-radius: 999px;
    }

    #baTradeTicket > #baTicketBody::-webkit-scrollbar-track {
        background: transparent;
    }
}

/* Phone/tablet: leave room for ticket stacked under chart */
@media (max-width: 1199.98px) {
    #baBinaryDesk .ba-binary-chart {
        min-height: 140px;
        height: clamp(140px, calc(100vh - 88px - 18rem), 280px);
        height: clamp(140px, calc(100dvh - 88px - 18rem), 280px);
    }
}

#baBinaryChartCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.ba-binary-chart svg {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

#baDigitCircles {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

#baDigitCircles>[data-digit] {
    min-width: 0;
    flex: 1 1 0;
}

#baDigitArrowTrack {
    height: 14px;
}

.ba-digit-svg {
    width: min(40px, 100%);
    max-width: 100%;
    height: auto;
    display: block;
}

.ba-digit-pct {
    font-size: 0.75rem;
    line-height: 1.1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 767.98px) {
    .ba-digit-svg {
        width: min(28px, 100%);
    }

    .ba-digit-pct {
        font-size: 0.55rem;
        letter-spacing: -0.04em;
        margin-top: 0.12rem !important;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .ba-binary-chart {
        min-height: 260px;
        height: 42vh;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .ba-binary-chart {
        min-height: 320px;
        height: min(48vh, 460px);
    }
}

.layout-main.layout-public .app-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header"
        "main"
        "footer";
}

.layout-main.layout-public footer {
    margin-bottom: 0;
}

@media (min-width: 992px) {
    .layout-main.layout-public main {
        height: auto;
        min-height: calc(100vh - 88px);
    }
}

/* Match auth-page fields (login/register): 48px bar, unified fill, centered icons */
html[data-bs-theme] .layout-main .form-control,
html[data-bs-theme] .layout-main .form-select {
    height: 48px;
    min-height: 48px;
    padding: 0 14px;
    font-size: 16px;
    line-height: 1.25;
    background-color: var(--field);
    border: 1px solid var(--field-line);
    border-radius: 12px;
    color: var(--field-text);
    box-shadow: none;
}

/* Native lists ignore the closed-field color. Use system canvas so options stay readable. */
html[data-bs-theme] .layout-main select option,
html[data-bs-theme] .layout-main select optgroup {
    color: #121212 !important;
    background-color: #ffffff !important;
}

html[data-bs-theme] .layout-main .tw-icon-field {
    position: relative;
}

html[data-bs-theme] .layout-main .tw-icon-field-mark {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 48px;
    color: var(--field-muted);
    pointer-events: none;
}

html[data-bs-theme] .layout-main .tw-icon-field>.form-select {
    padding-left: 44px;
}

html[data-bs-theme] .layout-main textarea.form-control {
    height: auto;
    min-height: 96px;
    padding: 12px 14px;
    line-height: 1.45;
}

html[data-bs-theme] .layout-main input.form-control[type="file"] {
    height: auto;
    min-height: 48px;
    padding: 10px 14px;
}

html[data-bs-theme] .layout-main .form-control:focus,
html[data-bs-theme] .layout-main .form-select:focus,
html[data-bs-theme] .layout-main .form-control:focus-visible,
html[data-bs-theme] .layout-main .form-select:focus-visible {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .18);
    background-color: var(--field);
    color: var(--field-text);
    outline: none;
}

html[data-bs-theme] .layout-main .form-control::placeholder {
    color: var(--field-soft);
    font-size: 14px;
    line-height: 1.25;
}

html[data-bs-theme] .layout-main .form-control:disabled,
html[data-bs-theme] .layout-main .form-select:disabled,
html[data-bs-theme] .layout-main .form-control[readonly] {
    background-color: var(--field);
    color: var(--field-muted);
    opacity: .85;
}

html[data-bs-theme] .layout-main .form-floating>.form-control,
html[data-bs-theme] .layout-main .form-floating>.form-select {
    height: 48px;
    min-height: 48px;
}

html[data-bs-theme] .layout-main .form-floating>label {
    color: var(--field-muted);
}

html[data-bs-theme] .layout-main .input-group:not(.input-group-sm) {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    height: 48px;
    min-height: 48px;
    border: 1px solid var(--field-line);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--field);
}

html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.form-control,
html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.form-select,
html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.input-group-text,
html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.btn {
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    border: 0;
    box-shadow: none;
    font-size: 16px;
    line-height: 1.25;
}

html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.form-control,
html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.form-select,
html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.input-group-text {
    background-color: transparent;
    color: var(--field-text);
}

html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.form-control,
html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.form-select {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-radius: 0;
}

html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--field-muted);
    padding: 0 .85rem;
}

html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.input-group-text:has(.bi),
html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>[data-password-toggle] {
    width: 44px;
    padding: 0;
    cursor: pointer;
}

html[data-bs-theme] .layout-main .input-group:not(.input-group-sm)>.btn {
    border-radius: 0;
    display: inline-flex;
    align-items: center;
}

html[data-bs-theme] .layout-main .input-group:not(.input-group-sm):focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .18);
}

html[data-bs-theme] .layout-main .input-group:not(.input-group-sm) .form-control:focus,
html[data-bs-theme] .layout-main .input-group:not(.input-group-sm) .form-select:focus,
html[data-bs-theme] .layout-main .input-group:not(.input-group-sm) .form-control:focus-visible,
html[data-bs-theme] .layout-main .input-group:not(.input-group-sm) .form-select:focus-visible {
    box-shadow: none;
    border-color: transparent;
    outline: none;
}

html[data-bs-theme] .layout-main .form-control:-webkit-autofill,
html[data-bs-theme] .layout-main .form-control:-webkit-autofill:hover,
html[data-bs-theme] .layout-main .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--field-text);
    caret-color: var(--field-text);
    box-shadow: 0 0 0 1000px var(--field) inset;
    transition: background-color 9999s ease-out;
}

html[data-bs-theme] .layout-main .iti {
    width: 100%;
    display: block;
}

html[data-bs-theme] .layout-main .iti input.form-control,
html[data-bs-theme] .layout-main .iti .iti__tel-input {
    width: 100%;
    height: 48px;
    min-height: 48px;
    font-size: 16px;
    background-color: var(--field);
    border: 1px solid var(--field-line);
    border-radius: 12px;
    color: var(--field-text);
}

html[data-bs-theme] .layout-main .form-control-sm,
html[data-bs-theme] .layout-main .form-select-sm,
html[data-bs-theme] .layout-main .input-group-sm>.form-control,
html[data-bs-theme] .layout-main .input-group-sm>.form-select,
html[data-bs-theme] .layout-main .input-group-sm>.input-group-text {
    height: auto;
    min-height: calc(1.5em + .5rem + 2px);
    max-height: none;
    font-size: .875rem;
    padding: .25rem .5rem;
    line-height: 1.5;
}

/* Keep the trade ticket compact */
html[data-bs-theme] .layout-desk #baBinaryDesk .form-control,
html[data-bs-theme] .layout-desk #baBinaryDesk .form-select,
html[data-bs-theme] .layout-desk .ba-desk-toolbar .form-control,
html[data-bs-theme] .layout-desk .ba-desk-toolbar .form-select {
    height: auto;
    min-height: calc(1.5em + .75rem + 2px);
    max-height: none;
    font-size: inherit;
    padding: .375rem .75rem;
    line-height: 1.5;
    border-radius: var(--bs-border-radius);
}

/* Vertical list sidebar */
.layout-main aside.app-sidebar {
    background: #101114;
    color: rgba(255, 255, 255, .78);
}

[data-bs-theme="light"] .layout-main aside.app-sidebar {
    background: #f6f7f9;
    color: #1c1c1c;
}

.layout-main aside.app-sidebar .offcanvas,
.layout-main aside.app-sidebar .offcanvas-body,
.layout-main aside.app-sidebar .main-menu {
    background: transparent;
    height: 100%;
}

.layout-main aside.app-sidebar .main-menu {
    min-height: 100%;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-height: 64px;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

[data-bs-theme="light"] .sidebar-brand {
    border-bottom-color: rgba(0, 0, 0, .08);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.sidebar-brand-link img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.sidebar-brand-name {
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: -.02em;
    color: #fff;
    white-space: nowrap;
}

[data-bs-theme="light"] .sidebar-brand-name {
    color: #121212;
}

.sidebar-brand-name span {
    color: var(--bs-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .75rem .65rem 1.25rem;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-heading {
    list-style: none;
    margin: .85rem 0 .2rem;
    padding: .35rem .75rem .2rem;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .46);
}

.sidebar-heading::marker {
    content: '';
}

[data-bs-theme="light"] .sidebar-heading {
    color: rgba(0, 0, 0, .45);
}

.sidebar-menu .menu-item {
    margin-bottom: 2px;
}

.sidebar-menu .menu-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    padding: .48rem .75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
}

.sidebar-menu .menu-link i {
    width: 1.15rem;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-menu .menu-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

[data-bs-theme="light"] .sidebar-menu .menu-link:hover {
    background: rgba(0, 0, 0, .05);
    color: #121212;
}

.sidebar-menu .menu-link.active {
    background: var(--bs-primary);
    color: #fff;
}

.sidebar-menu .menu-badge {
    margin-left: auto;
    min-width: 1.25rem;
    padding: .1rem .4rem;
    border-radius: 99px;
    background: var(--bs-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.sidebar-menu .menu-link.active .menu-badge {
    background: #fff;
    color: var(--bs-primary);
}

.sidebar-toggle {
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1;
}

body.layout-desk #offcanvasSidebar {
    width: min(280px, 88vw);
}

/* Trade desk: slim icon rail, same idea as the green desk. The chart keeps the rest of the width. */
@media (min-width: 992px) {
    .layout-main.layout-desk .app-wrapper {
        grid-template-columns: 104px minmax(0, 1fr);
        grid-template-rows: auto 1fr auto;
        grid-template-areas:
            "aside header"
            "aside main"
            "aside footer";
        min-height: 100dvh;
    }

    .layout-main.layout-desk.desk-nav-open .app-wrapper {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .layout-main.layout-desk aside {
        position: relative;
        width: auto;
        min-height: 0;
        height: 100%;
        border-right: 1px solid rgba(255, 255, 255, .08);
    }

    .layout-main.layout-desk:not(.desk-nav-open) aside {
        overflow: hidden;
    }

    .layout-main.layout-desk aside .main-menu {
        width: auto;
        min-height: 0;
        height: 100%;
    }

    body.layout-desk #offcanvasSidebar.offcanvas {
        position: static;
        z-index: auto;
        visibility: visible;
        transform: none;
        width: 104px;
        max-width: 104px;
        height: 100%;
        border: 0;
        background: transparent;
        box-shadow: none;
        transition: none;
    }

    body.layout-desk.desk-nav-open #offcanvasSidebar.offcanvas {
        width: 260px;
        max-width: 260px;
    }

    .layout-main.layout-desk .offcanvas-body {
        overflow: hidden;
        padding: 0;
        height: 100%;
    }

    .layout-main.layout-desk .sidebar-brand {
        display: none;
    }

    .layout-main.layout-desk .sidebar-nav {
        height: 100%;
        padding: .25rem .2rem;
        scrollbar-width: thin;
    }

    .layout-main.layout-desk:not(.desk-nav-open) .sidebar-nav {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        scrollbar-width: none;
    }

    .layout-main.layout-desk:not(.desk-nav-open) .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .layout-main.layout-desk:not(.desk-nav-open) .sidebar-heading {
        display: none;
    }

    .layout-main.layout-desk:not(.desk-nav-open) .sidebar-menu {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
    }

    .layout-main.layout-desk:not(.desk-nav-open) .sidebar-menu .menu-item {
        display: flex;
        flex: 1 1 0;
        max-height: 52px;
        min-height: 0;
        margin: 0;
    }

    .layout-main.layout-desk:not(.desk-nav-open) .sidebar-menu .menu-link {
        position: relative;
        flex: 1;
        flex-direction: column;
        justify-content: center;
        gap: .05rem;
        height: 100%;
        padding: .1rem .1rem;
        font-size: 10px;
        line-height: 1.05;
        text-align: center;
    }

    .layout-main.layout-desk:not(.desk-nav-open) .sidebar-menu .menu-link i {
        width: auto;
        font-size: 16px;
    }

    .layout-main.layout-desk:not(.desk-nav-open) .sidebar-menu .menu-text {
        display: block;
        max-width: 100%;
        overflow: hidden;
        font-size: 10px;
        line-height: 1.05;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .layout-main.layout-desk:not(.desk-nav-open) .sidebar-menu .menu-badge {
        position: absolute;
        top: .15rem;
        right: .2rem;
        margin: 0;
    }
}

@media (min-width: 1200px) {
    body:not(.layout-desk) .layout-main aside.app-sidebar .offcanvas {
        width: 260px;
        max-width: 260px;
    }

    body:not(.layout-desk) .layout-main aside.app-sidebar .main-menu {
        height: 100vh;
    }
}

/* Dialogs sit in the center and share one ticket frame. */
.modal .modal-content {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: #141416;
    color: #f5f5f5;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .55);
}

.modal .modal-content::before {
    content: "";
    display: block;
    height: 3px;
    background: var(--bs-primary, #f90b0b);
}

.modal .modal-header,
.modal .modal-footer {
    border: 0;
}

.modal .modal-header {
    align-items: center;
    padding: 1rem 1.15rem .35rem;
}

.modal .modal-title {
    font-weight: 700;
    letter-spacing: -.02em;
}

.modal .modal-body {
    padding: .35rem 1.15rem 1.15rem;
}

.modal .modal-footer {
    justify-content: flex-start;
    gap: .5rem;
    padding: 0 1.15rem 1.15rem;
}

.modal-backdrop.show {
    opacity: .72;
}

[data-bs-theme="light"] .modal .modal-content {
    background: #fff;
    color: #121212;
    border-color: #e4e0da;
    box-shadow: 0 24px 60px rgba(18, 18, 18, .16);
}

.modal .notif-item + .notif-item {
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.modal .notif-item.is-unread .fw-semibold::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: .4rem;
    border-radius: 50%;
    background: var(--bs-primary, #f90b0b);
    vertical-align: middle;
}

[data-bs-theme="light"] .modal .notif-item + .notif-item {
    border-top-color: #e4e0da;
}