/* ==========================================================================
   Banrox mobile layer, September 2026.
   Every rule below lives inside a max-width media query, so nothing here
   changes a desktop render (1025px and wider) by construction. Design tokens,
   colours, fonts and radii are the ones already in style.css / dashboard.css
   (01-STANDART-KACHESTVA): bg #080814, card #090C21, blue #264BFF,
   lilac #8585E9, border rgba(255,255,255,.10) 1.5px, radii 24/16/12,
   motion 300ms cubic-bezier(.2,.8,.2,1), 44px tap targets, 16px inputs.
   The only unconditional rules hide the two elements that exist for the
   phone layout alone (dashboard top bar and the drawer overlay).
   ========================================================================== */

.bx-mtop,
.bx-nav-overlay {
    display: none;
}

/* --------------------------------------------------------------------------
   1. Dashboard frame (personal-lk and business-lk share these classes)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
    .dashboard {
        padding: 0 0 24px;
    }
    .container--dashboard {
        padding: 0 16px;
    }

    /* Top bar: logo, burger. Sticky, blurred page background, hairline. */
    .bx-mtop {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 60;
        height: 64px;
        margin: 0 -16px 8px;
        padding: 0 8px 0 16px;
        background: rgba(8, 8, 20, 0.88);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        border-bottom: 1.5px solid rgba(255, 255, 255, 0.10);
    }
    .bx-mtop__logo {
        display: flex;
        align-items: center;
        min-height: 44px;
    }
    .bx-mtop__logo img {
        display: block;
        height: 28px;
        width: auto;
    }
    .bx-mtop__burger {
        appearance: none;
        -webkit-appearance: none;
        background: transparent;
        border: 0;
        margin: 0;
        padding: 0;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        cursor: pointer;
        transition: background-color 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .bx-mtop__burger:active {
        background: rgba(255, 255, 255, 0.06);
        transition-duration: 75ms;
    }
    .bx-mtop__burger:focus-visible {
        outline: 2px solid #264BFF;
        outline-offset: 2px;
    }
    /* the site burger (.menu_btn from style.css) is display:none above 1170px; force it on inside the bar */
    .bx-mtop__burger .menu_btn {
        display: block;
    }

    /* Two columns become one: the sidebar turns into an off-canvas drawer. */
    .dashboard_cols {
        display: block;
    }
    .dashboard_col_left {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(320px, 86vw);
        z-index: 80;
        transform: translateX(-104%);
        visibility: hidden;   /* closed drawer leaves the tab order and the accessibility tree */
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.3s;
        will-change: transform;
    }
    body.bx-nav-open .dashboard_col_left {
        transform: translateX(0);
        visibility: visible;
        transition-delay: 0s;
    }
    .dashboard_col_left .dashboard_sidebar {
        height: 100%;
        min-height: 0;
        border-radius: 0 24px 24px 0;
        border-left: 0;
        display: flex;
        flex-direction: column;
        background-color: #090C21;   /* card token: the desktop sidebar is translucent over the page glow, the drawer sits over content */
    }
    .dashboard_col_left .dashboard_sidebar_inside {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    .dashboard_col_left .dashboard_menus {
        overflow: visible;
        flex: none;
    }
    .dashboard_menu li a,
    .dashboard_logout_link {
        min-height: 44px;
    }
    .bx-nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 70;
        background: rgba(8, 8, 20, 0.62);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    body.bx-nav-open .bx-nav-overlay {
        opacity: 1;
        pointer-events: auto;
    }
    body.bx-nav-open {
        overflow: hidden;
    }

    .dashboard_col_right {
        width: 100%;
        padding-left: 0;
        min-width: 0;
    }

    /* Page head: greeting or title on the left, avatar on the right. */
    .dashboard_head {
        gap: 16px;
        flex-wrap: wrap;
    }
    .dashboard_head_left {
        min-width: 0;
        flex: 1 1 200px;
    }
    .dashboard_head_title {
        font-size: 18px;
        overflow-wrap: anywhere;
    }
    .dashboard_head_profile_avatar {
        height: 44px;
        width: 44px;
    }
    .dashboard_head_btns {
        flex-wrap: wrap;
    }
    .dashboard_head_btn .btn {
        min-height: 44px;
    }

    /* Generic dashboard grid: three-up becomes two-up on tablets. */
    .dashboard .row .col-3,
    .dashboard .row .col-32,
    .dashboard .row .col-34,
    .dashboard .row .col-36,
    .dashboard .row .col-30 {
        width: 50%;
    }
    .dashboard .row .col-64,
    .dashboard .row .col-66,
    .dashboard .row .col-68,
    .dashboard .row .col-60,
    .dashboard .row .col-70 {
        width: 100%;
    }
    .dashboard .row .col-4 {
        width: 50%;
    }
    /* Wide tables scroll inside their own wrapper instead of pushing the page sideways.
       The table stays a real table, so header and body columns keep lining up. */
    .dashboard_transactions,
    .dashboard_basic_table,
    .dashboard_expand_table_outer,
    .dashboard_repayment_top {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .dashboard_transactions table,
    .dashboard_basic_table table,
    .dashboard_expand_table {
        min-width: 560px;
    }
    .dashboard_repayment_bottom,
    .dashboard_repayment_actions,
    .dashboard_section_head {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media screen and (max-width: 768px) {
    .dashboard .row .col-2,
    .dashboard .row .col-3,
    .dashboard .row .col-30,
    .dashboard .row .col-32,
    .dashboard .row .col-34,
    .dashboard .row .col-36,
    .dashboard .row .col-40 {
        width: 100%;
    }
    .dashboard .row {
        margin-bottom: -24px;
    }
    .dashboard .row .col {
        margin-bottom: 24px;
    }
    .dashboard_blocks_head {
        flex-wrap: wrap;
        gap: 12px;
    }
    .dashboard_overview_items .col-3 {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .container--dashboard {
        padding: 0 12px;
    }
    .bx-mtop {
        margin: 0 -12px 8px;
        padding: 0 4px 0 12px;
    }
    .dashboard_head_title {
        font-size: 17px;
    }
    .dashboard_block_inside,
    .dashboard_identity {
        padding: 16px;
    }
    .dashboard_block,
    .dashboard_identity {
        border-radius: 20px;
    }
    .dashboard_blocks_title {
        font-size: 20px;
    }
    .dashboard .row .col-4 {
        width: 100%;
    }
    .dashboard_transactions th {
        font-size: 15px;
    }
}

/* --------------------------------------------------------------------------
   2. Personal dashboard home (.dashboard-home, inline CSS in dashboard_home.html)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
    .dashboard-home .home-duo {
        flex-direction: column;
    }
    .dashboard-home .hcard {
        min-width: 0 !important;   /* inline style="min-width:340px" on the cards panel */
    }
    /* The bureau gauge is drawn in fixed pixels (360 x 130) for desktop. Below the
       breakpoint it becomes fluid: percentages of the same 360 x 130 box, so the arcs
       and the needle keep their exact proportions at any width. */
    .dashboard-home .gauge {
        width: 100%;
        max-width: 360px;
        height: auto;
        aspect-ratio: 360 / 130;
    }
    .dashboard-home .gauge .arc.outer {
        left: 8.61%;
        top: -7.31%;
        width: 82.78%;
        height: 131.54%;
    }
    .dashboard-home .gauge .arc.main {
        left: 13.06%;
        top: -2.31%;
        width: 73.89%;
        height: 106.92%;
    }
    .dashboard-home .gauge .arc.inner {
        left: 20.42%;
        top: 18.08%;
        width: 59.17%;
        height: 82.69%;
    }
    .dashboard-home .needle {
        width: 100%;
        height: 100%;
    }
    .dashboard-home .gauge-labels {
        padding: 0 15.5%;
    }
}

@media screen and (max-width: 768px) {
    .dashboard-home .scores {
        flex-direction: column;
        flex-wrap: nowrap;
    }
    .dashboard-home .score-card {
        width: 100%;
    }
    .dashboard-home .score-cta {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px 24px;
    }
    .dashboard-home .score-cta .btn-brand {
        width: 100%;
        justify-content: center;
    }
    .dashboard-home .title-row h1 {
        font-size: 28px;
    }
}

@media screen and (max-width: 480px) {
    .dashboard-home {
        gap: 16px;
    }
    .dashboard-home .score-card,
    .dashboard-home .hcard,
    .dashboard-home .score-cta {
        padding: 20px 16px;
        border-radius: 24px;
    }
    .dashboard-home .score-card {
        gap: 24px;
    }
    .dashboard-home .score-value {
        font-size: 40px;
    }
    .dashboard-home .title-row h1 {
        font-size: 24px;
    }
    .dashboard-home .score-power {
        flex-wrap: wrap;
        gap: 8px 16px;
    }
    .dashboard-home .score-power a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    .dashboard-home .score-updbox > div {
        padding: 10px 12px;
    }
    /* One card per row: art on top, balance and limit side by side beneath. */
    .dashboard-home .mc-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .dashboard-home .mc-visual {
        width: 100%;
        max-width: 300px;
        height: auto;
        aspect-ratio: 210 / 120;
    }
    .dashboard-home .mc-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        grid-auto-flow: column;
        gap: 4px 16px;
    }
    .dashboard-home .mc-stats .v {
        font-size: 20px;
    }
    .dashboard-home .sp-chip {
        min-width: 0;
        flex: 1 1 calc(50% - 6px);
    }
    .dashboard-home .sp-chip .v {
        font-size: 20px;
    }
    .dashboard-home .hcard-head a {
        width: 44px;
        height: 44px;
    }
    .dashboard-home .spend-chart svg {
        min-height: 150px;
    }
}

/* --------------------------------------------------------------------------
   3. Public site: card marketplace toolbar (/marketplace)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 640px) {
    .cc_catalog_head_top {
        flex-wrap: wrap;
        gap: 16px;
    }
    .cc_catalog_sorts_outer,
    .cc_catalog_sorts {
        width: 100%;
        flex-wrap: wrap;
        gap: 12px;
    }
    .cc_catalog_sort {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }
    .cc_catalog_sort .form_select,
    .cc_catalog_sort .choices {
        width: 100%;
    }
    .cc_catalog_head_bottom {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px;
    }
    .cc_catalog_qfilters_title {
        width: 100%;
    }
    .cc_catalog_qfilters_radios {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .cc_catalog_qfilters_radios .form_field_radio {
        margin: 0;
    }
    .cc_catalog_qfilters_radios .form_field_radio_box_txt {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

@media screen and (max-width: 400px) {
    .cc_catalog_sort {
        flex-basis: 100%;
    }
}

/* --------------------------------------------------------------------------
   3b. Public site frame: forms and the mobile menu
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1170px) {
    /* The off-canvas menu rows keep their 64px / 48px rhythm, but the whole row is
       now the tap target (was a 16px text line inside a 48px margin). */
    .mobile_header_menu > ul {
        margin-top: -24px;
    }
    .mobile_header_menu > ul > li {
        margin-bottom: 0;
    }
    .mobile_header_menu > ul > li > a {
        padding-top: 24px;
        padding-bottom: 24px;
    }
    .mobile_header_menu > ul > li > ul {
        padding-top: 16px;
    }
    .mobile_header_menu > ul > li > ul > li {
        margin-bottom: 0;
    }
    .mobile_header_menu > ul > li > ul > li > a {
        padding-top: 16px;
        padding-bottom: 16px;
    }
    .mobile_header_menu li a > span {
        height: 44px;
        width: 44px;
        right: -22px;
    }
}

@media screen and (max-width: 768px) {
    /* 16px is the smallest input font iOS Safari leaves alone (no zoom on focus). */
    .form_fields_small .form_field_inside input,
    .form_fields_small .form_field_inside select,
    .form_fields_small .form_field_inside textarea,
    .form_fields_tiny .form_field_inside input,
    .form_fields_tiny .form_field_inside select,
    .dashboard .form_dashboard_field input,
    .dashboard .form_dashboard_field select,
    .dashboard .form_dashboard_field textarea,
    .dashboard input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]),
    .dashboard select,
    .dashboard textarea {
        font-size: 16px;
    }
    .form_field_remember_checkbox .form_field_checkbox,
    .form_field_checkbox {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .form_dashboard_field_submit .btn,
    .form_dashboard_field_submit button {
        min-height: 44px;
    }
}

/* --------------------------------------------------------------------------
   4. Motion: the standard requires prefers-reduced-motion everywhere.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .dashboard_col_left,
    .bx-nav-overlay,
    .bx-mtop__burger {
        transition: none;
    }
}
