/* =========================================================
   Bizmantra - Header (top bar + main bar + multilevel menu)
   Colors sampled from the logo: blue #5A82E8, green #9ACD4F
   Logo = icon image + live text (name + short tagline)
   ========================================================= */
:root {
    --bm-deep: #1F3573;
    --bm-blue: #5A82E8;
    --bm-blue-d: #3A5FC7;
    --bm-green: #9ACD4F;
    --bm-green-d: #86B83F;
    --bm-green-t: #EAF4D8;
    --bm-green-x: #90ce36;
    --bm-wa: #128C7E;
    --bm-wa-d: #0E7569;
    --bm-mist: #EEF3FD;
    --bm-rail: #F6F8FD;
    --bm-line: #DEE5F2;
    --bm-text: #1B2A4A;
    --bm-muted: #5E6B85;

    /* theme tokens (light) */
    --bm-bg: #fff;          /* page / bars / panels */
    --bm-head: #004fc0;     /* headings + nav link text */
    --bm-topbg: #1F3573;    /* top bar background */
    --bm-btn: #1F3573;      /* solid dark buttons */
    --bm-btn-h: #3A5FC7;

    --bm-top-h: 34px;     /* top bar height (JS keeps sticky offset in sync) */
    --bm-main-h: 64px;    /* main bar height */
    --bm-logo-h: 36px;    /* logo icon height */
    --bm-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --bm-brand-font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    --bm-roll: .4s cubic-bezier(.4, 0, .2, 1);   /* dropdown roll speed (desktop + mobile) */
}

/* ---------------- DARK THEME ---------------- */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bm-bg: #0F1730;
    --bm-rail: #141E3D;
    --bm-mist: #1B2850;
    --bm-line: #27345C;
    --bm-text: #DCE5FA;
    --bm-muted: #9AA8C7;
    --bm-head: #EAF0FF;
    --bm-topbg: #0A1126;
    --bm-btn: #3A5FC7;
    --bm-btn-h: #5A82E8;
    --bm-blue-d: #8FB0FF;
    --bm-green-t: #33471C;
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--bm-font); color: var(--bm-text); background: var(--bm-bg); -webkit-font-smoothing: antialiased; transition: background .25s, color .25s; }

/* Resets use :where() so they never beat the component classes below */
:where(.bm-header) ul { list-style: none; margin: 0; padding: 0; }
:where(.bm-header) p, :where(.bm-header) h3 { margin: 0; }
:where(.bm-header) a { color: inherit; text-decoration: none; }
:where(.bm-header) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(.bm-header) img { display: block; max-width: 100%; height: auto; }
.bm-i { width: 16px; height: 16px; flex: none; }

.bm-header :focus-visible, .bm-skip:focus-visible { outline: 2px solid var(--bm-green); outline-offset: 2px; }
.bm-main :focus-visible { outline-color: var(--bm-blue-d); }

.bm-skip { position: absolute; left: 12px; top: -60px; z-index: 2000; background: var(--bm-deep); color: #fff; padding: 10px 14px; border-radius: 6px; font-size: 13px; }
.bm-skip:focus { top: 8px; }

.bm-container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 20px; }

/* Sticky: top bar scrolls away, main bar stays */
.bm-header { position: sticky; top: calc(var(--bm-top-h) * -1); z-index: 1000; }

/* ---------------- TOP BAR ---------------- */
.bm-top { background: var(--bm-topbg); color: #DCE5FA; font-size: 12.5px; }
.bm-top__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.bm-top__left { display: flex; align-items: center; min-width: 0; }
.bm-top__item { display: flex; align-items: center; gap: 8px; line-height: 1.3; white-space: nowrap; transition: color .2s; }
.bm-top__item .bm-i { width: 15px; height: 15px; color: var(--bm-green); }
.bm-top__left > .bm-top__item + .bm-top__item { margin-left: 20px; padding-left: 20px; border-left: 1px solid rgba(255,255,255,.22); }
a.bm-top__item:hover { color: #fff; }
.bm-short { display: none; }
.bm-top__right { display: flex; align-items: center; }
.bm-social { display: flex; gap: 2px; }
.bm-social a { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; transition: background .2s, color .2s; }
.bm-social a:hover { background: rgba(255,255,255,.15); color: #fff; }
.bm-social .bm-i { width: 14px; height: 14px; }
.bm-top__sep { width: 1px; height: 14px; margin-inline: 10px; background: rgba(255,255,255,.28); }

.bm-lang { position: relative; }
.bm-lang__btn { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 4px; color: #fff; font-size: 12.5px; font-weight: 600; transition: background .2s; }
.bm-lang__btn:hover { background: rgba(255,255,255,.15); }
.bm-lang__btn .bm-i:first-child { width: 15px; height: 15px; }
.bm-lang__chev { width: 13px; height: 13px; transition: transform .2s; }
.bm-lang.is-open .bm-lang__chev { transform: rotate(180deg); }
.bm-lang__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 164px; padding: 6px; background: var(--bm-bg); color: var(--bm-text); border-radius: 8px; box-shadow: 0 16px 40px -8px rgba(31,53,115,.35); display: none; z-index: 1100; }
.bm-lang.is-open .bm-lang__menu { display: block; }
.bm-lang__menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 6px; font-size: 13.5px; }
.bm-lang__menu button:hover { background: var(--bm-mist); }
.bm-lang__menu button[aria-current="true"] { color: var(--bm-blue-d); font-weight: 700; }

/* ---------------- MAIN BAR ---------------- */
.bm-main { position: relative; background: var(--bm-bg); border-bottom: 1px solid var(--bm-line); transition: box-shadow .25s; }
.bm-header.is-stuck .bm-main { box-shadow: 0 8px 24px -14px rgba(31,53,115,.35); }
.bm-main__inner { display: flex; align-items: center; gap: 20px; height: var(--bm-main-h); }

/* ---------------- LOGO: icon + name + tagline ---------------- */
.bm-logo { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; }
.bm-logo img { height: var(--bm-logo-h); width: auto; flex: none; }
.bm-logo__text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.bm-logo__name {
    font-family: var(--bm-brand-font); font-size: 21px; font-weight: 800; line-height: 1;
    letter-spacing: -.025em; color: var(--bm-head); white-space: nowrap;
}
.bm-logo__mantra { color: var(--bm-green-x); }
:root[data-theme="dark"] .bm-logo__mantra { color: var(--bm-green); }
.bm-logo__tag {
    margin-top: 4px; font-family: var(--bm-brand-font); font-size: 8px; font-weight: 600; line-height: 1.1;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--bm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.bm-drawer { flex: 1; display: flex; align-items: stretch; justify-content: flex-end; align-self: stretch; min-width: 0; }
.bm-drawer__foot, .bm-overlay { display: none; }

.bm-nav { display: flex; align-items: stretch; }
.bm-nav > ul { display: flex; align-items: stretch; gap: 6px; }
.bm-nav__item { display: flex; align-items: center; }
.bm-nav__link { display: flex; align-items: center; gap: 5px; padding: 9px 12px; border-radius: 6px; font-size: 14.5px; font-weight: 600; color: var(--bm-head); white-space: nowrap; transition: color .2s, background .2s; }
.bm-nav__link:hover, .has-mega.is-open > .bm-nav__link { color: var(--bm-blue-d); background: var(--bm-mist); }
.bm-nav__chev { width: 14px; height: 14px; transition: transform .25s; }
.has-mega.is-open > .bm-nav__link .bm-nav__chev { transform: rotate(180deg); }

/* ---------------- DROPDOWN (desktop: rolls down out of the header, rolls back up into it) ---------------- */
@media (min-width: 1024px) {
    .bm-mega {
        position: absolute; left: 0; right: 0; top: calc(100% - 1px);
        background: var(--bm-bg); border-top: 1px solid var(--bm-line); border-bottom: 3px solid var(--bm-green);
        box-shadow: 0 24px 40px -20px rgba(31,53,115,.35);
        max-height: calc(100vh - var(--bm-main-h) - 24px); overflow-y: auto; overscroll-behavior: contain;
        z-index: 5;
        /* closed: fully rolled up behind the header's bottom edge.
           Side values are negative so the box-shadow is not clipped. */
        clip-path: inset(0 -50px 100% -50px);
        visibility: hidden;
        transition: clip-path var(--bm-roll), visibility 0s linear .4s;
    }
    .has-mega.is-open > .bm-mega {
        clip-path: inset(0 -50px -60px -50px);
        visibility: visible;
        transition: clip-path var(--bm-roll), visibility 0s;
    }
}
.bm-mega__inner { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 28px 36px; width: 100%; max-width: 1240px; margin-inline: auto; padding: 28px 20px 32px; }

.bm-grp__btn { display: none; }
.bm-grp__title { position: relative; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 2px solid var(--bm-line); font-size: 13.5px; font-weight: 700; color: var(--bm-head); }
.bm-grp__title::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 32px; height: 2px; background: var(--bm-green); }
.bm-links a, .bm-row__label { display: block; padding: 7px 0; font-size: 14px; line-height: 1.4; color: var(--bm-text); transition: color .15s, padding-left .15s; }
.bm-links a:hover { color: var(--bm-blue-d); padding-left: 4px; }

/* Tree rows (links that have children) */
.bm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bm-row > a, .bm-row > .bm-row__label { flex: 1; min-width: 0; }
.bm-sub__btn { display: none; }
/* desktop: children are always visible, indented under their parent */
.bm-sub__list { margin: 0 0 4px 4px; padding-left: 12px; border-left: 1px solid var(--bm-line); }
.bm-sub__list a { padding: 5px 0; font-size: 13px; color: var(--bm-muted); }
.bm-sub__list a:hover { color: var(--bm-blue-d); }

/* ---------------- CTA + buttons ---------------- */
.bm-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.bm-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: 4px; background: var(--bm-green); color: var(--bm-deep) !important; font-size: 14px; font-weight: 800; white-space: nowrap; transition: background .2s, transform .2s; }
.bm-cta:hover { background: var(--bm-green-d); transform: translateY(-1px); }
.bm-cta .bm-i { width: 15px; height: 15px; transition: transform .2s; }
.bm-cta:hover .bm-i { transform: translateX(3px); }

.bm-iconbtn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; color: var(--bm-head); }
.bm-iconbtn .bm-i { width: 22px; height: 22px; }
.bm-burger { display: none; border: 1px solid var(--bm-line) !important; }
.bm-burger .bm-burger__close { display: none; }
.bm-burger[aria-expanded="true"] .bm-burger__open { display: none; }
.bm-burger[aria-expanded="true"] .bm-burger__close { display: block; }

/* ---------------- THEME TOGGLE ---------------- */
.bm-iconbtn.bm-theme { border: 1px solid var(--bm-line) !important; transition: background .2s, border-color .2s; }
.bm-iconbtn.bm-theme:hover { background: var(--bm-mist); }
/* top-bar version (all devices) */
.bm-theme--top { display: grid; place-items: center; width: 26px; height: 26px; margin-right: 4px; border-radius: 50%; color: #fff; transition: background .2s; }
.bm-theme--top:hover { background: rgba(255,255,255,.15); }
.bm-theme--top .bm-i { width: 15px; height: 15px; }
@media (min-width: 1024px) { .bm-iconbtn.bm-theme { display: none; } }
.bm-theme .bm-theme__sun { display: none; }
:root[data-theme="dark"] .bm-theme .bm-theme__sun { display: block; }
:root[data-theme="dark"] .bm-theme .bm-theme__moon { display: none; }

/* Logo icon: unchanged in both themes. Optional dark icon only swaps in if LOGO_FILE_DARK is defined */
.bm-logo__img--dark { display: none; }
:root[data-theme="dark"] .bm-logo--has-dark .bm-logo__img--light { display: none; }
:root[data-theme="dark"] .bm-logo--has-dark .bm-logo__img--dark { display: block; }

/* ---------------- Laptops ---------------- */
@media (min-width: 1024px) and (max-width: 1199px) {
    :root { --bm-main-h: 60px; --bm-logo-h: 32px; }
    .bm-main__inner { gap: 12px; }
    .bm-nav > ul { gap: 2px; }
    .bm-nav__link { padding: 8px 9px; font-size: 14px; }
    .bm-cta { padding: 8px 14px; font-size: 13.5px; }
    .bm-mega__inner { gap: 24px 24px; }
    .bm-links a { font-size: 13.5px; }
    .bm-logo__name { font-size: 19px; }
    .bm-logo__tag { font-size: 7.5px; letter-spacing: .12em; }
}

/* ---------------- TABLET + MOBILE (panel opens below the header) ---------------- */
@media (max-width: 1023px) {
    :root { --bm-main-h: 58px; --bm-logo-h: 32px; }
    .bm-main__inner { gap: 12px; }
    .bm-burger { display: grid; }
    .bm-logo { margin-right: auto; }
    .bm-logo__name { font-size: 20px; }
    .bm-cta--bar { display: none; }               /* no Free Consultation on mobile/tablet */

    .bm-top { font-size: 12px; }
    .bm-full { display: none; }
    .bm-short { display: inline; }
    .bm-top__left > .bm-top__item + .bm-top__item { margin-left: 14px; padding-left: 14px; }

    /* Panel: drops down directly under the main bar, full width */
    .bm-drawer {
        position: absolute; left: 0; right: 0; top: 100%;
        z-index: 20;
        flex-direction: column; align-items: stretch; justify-content: flex-start;
        background: var(--bm-bg);
        border-top: 1px solid var(--bm-line);
        border-bottom: 3px solid var(--bm-green);
        box-shadow: 0 24px 40px -20px rgba(31,53,115,.35);
        max-height: calc(100vh - var(--bm-main-h) - var(--bm-top-h) - 8px);
        max-height: calc(100dvh - var(--bm-main-h) - var(--bm-top-h) - 8px);
        overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
        /* Roll effect: panel unrolls downward from the header edge and rolls back up into it.
           Side values are negative so the box-shadow is not clipped. */
        clip-path: inset(0 -50px 100% -50px);
        visibility: hidden;
        transition: clip-path var(--bm-roll), visibility 0s linear .4s;
    }
    .bm-drawer.is-open {
        clip-path: inset(0 -50px -60px -50px);
        visibility: visible;
        transition: clip-path var(--bm-roll), visibility 0s;
    }

    /* Dim overlay sits behind the header bars, over the page */
    .bm-overlay { display: block; position: fixed; inset: 0; z-index: -1; background: rgba(31,53,115,.4); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
    .bm-overlay.is-open { opacity: 1; visibility: visible; }
    body.bm-lock { overflow: hidden; }

    .bm-nav { display: block; padding: 4px 18px 8px; }
    .bm-nav > ul { display: block; }
    .bm-nav__item { display: block; border-bottom: 1px solid var(--bm-line); }
    .bm-nav__item:last-child { border-bottom: 0; }
    .bm-nav__link { width: 100%; justify-content: space-between; padding: 14px 4px; border-radius: 0; font-size: 14.5px; font-weight: 500; background: none !important; }
    .bm-nav__link:hover, .has-mega.is-open > .bm-nav__link { color: var(--bm-blue-d); }

    /* Level 1 (menu item) -> Level 2 (group) -> Level 3+ (sub links): tree accordion */
    .bm-mega { position: static; display: none; visibility: visible; opacity: 1; transform: none; border: 0; box-shadow: none; max-height: none; overflow: visible; }
    .has-mega.is-open > .bm-mega { display: block; }
    .bm-mega__inner { display: block; max-width: none; padding: 0 0 12px; }
    .bm-grp__title { display: none; }
    .bm-grp__btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 6px; text-align: left; font-size: 14px; font-weight: 500; color: var(--bm-text); }
    .bm-grp.is-active > .bm-grp__btn { background: var(--bm-mist); color: var(--bm-blue-d); }
    .bm-grp__chev, .bm-sub__chev { width: 14px; height: 14px; transition: transform .2s; }
    .bm-grp.is-active > .bm-grp__btn .bm-grp__chev { transform: rotate(180deg); }

    .bm-links { display: none; margin: 2px 0 8px 14px; padding-left: 10px; border-left: 2px solid var(--bm-green); }
    .bm-grp.is-active > .bm-links { display: block; }
    .bm-links a, .bm-row__label { padding: 10px 6px; font-size: 13.5px; font-weight: 400; }
    .bm-links a:hover { padding-left: 6px; }

    .bm-row { min-height: 42px; cursor: pointer; }
    .bm-sub__btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 6px; color: var(--bm-muted); }
    .bm-sub.is-active > .bm-row .bm-sub__chev { transform: rotate(180deg); }
    .bm-sub.is-active > .bm-row > a,
    .bm-sub.is-active > .bm-row > .bm-row__label { color: var(--bm-blue-d); }
    .bm-sub__list { display: none; margin: 0 0 6px 10px; padding-left: 10px; border-left: 2px solid var(--bm-line); }
    .bm-sub.is-active > .bm-sub__list { display: block; }
    .bm-sub__list a { padding: 9px 6px; font-size: 13px; color: var(--bm-muted); }
    .bm-sub__list .bm-sub__list { border-left-color: var(--bm-green-t); }

    /* Footer: Call + WhatsApp, then email / hours */
    .bm-drawer__foot { display: block; padding: 16px 18px 20px; border-top: 1px solid var(--bm-line); background: var(--bm-rail); }
    .bm-qbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .bm-qbtn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 14px; border-radius: 8px; color: #fff !important; font-size: 14px; font-weight: 500; letter-spacing: .01em; transition: background .2s; }
    .bm-qbtn .bm-i { width: 17px; height: 17px; }
    .bm-qbtn--call { background: var(--bm-btn); }
    .bm-qbtn--call:hover { background: var(--bm-btn-h); }
    .bm-qbtn--wa { background: var(--bm-wa); }
    .bm-qbtn--wa:hover { background: var(--bm-wa-d); }

    .bm-info { display: grid; gap: 8px; margin-top: 14px; }
    .bm-info__row { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; font-weight: 400; line-height: 1.4; color: var(--bm-muted); }
    .bm-info__row .bm-i { width: 14px; height: 14px; color: var(--bm-blue-d); }
    .bm-info__row span { min-width: 0; overflow-wrap: anywhere; }
    a.bm-info__row:hover { color: var(--bm-blue-d); }
}

/* ---------------- PHONES: small, tidy text ---------------- */
@media (max-width: 599px) {
    :root { --bm-main-h: 54px; --bm-logo-h: 30px; }
    .bm-container { padding-inline: 14px; }

    .bm-logo { gap: 8px; }
    .bm-logo__name { font-size: 18px; }
    .bm-logo__tag { margin-top: 3px; font-size: 7.5px; letter-spacing: .1em; }

    .bm-top { font-size: 11px; }
    .bm-top__inner { gap: 8px; }
    .bm-top__hours, .bm-top__mail { display: none; }   /* no email / hours in the top bar on phones (they live in the menu) */
    .bm-top__left { gap: 12px; }
    .bm-top__left > .bm-top__item + .bm-top__item { margin-left: 0; padding-left: 0; border-left: 0; }
    .bm-top__item { gap: 5px; }
    .bm-top__item .bm-i { width: 14px; height: 14px; }
    .bm-top__mail { padding: 4px; }
    .bm-social a { width: 24px; height: 24px; }
    .bm-social .bm-i { width: 13px; height: 13px; }
    .bm-top__sep { margin-inline: 6px; }
    .bm-lang__btn { padding: 4px 6px; font-size: 11px; gap: 4px; }
    .bm-lang__btn .bm-i:first-child { width: 14px; height: 14px; }
    .bm-lang__chev { width: 11px; height: 11px; }
    .bm-lang__menu { min-width: 148px; }
    .bm-lang__menu button { font-size: 12.5px; padding: 8px 10px; }

    .bm-iconbtn { width: 36px; height: 36px; }
    .bm-iconbtn .bm-i { width: 20px; height: 20px; }
    .bm-nav { padding-inline: 14px; }
    .bm-drawer__foot { padding-inline: 14px; }
}
/* all 5 social icons stay in the top bar: tighten as the screen gets narrower */
@media (max-width: 479px) {
    .bm-top__inner { gap: 6px; }
    .bm-top__left { gap: 8px; }
    .bm-social { gap: 0; }
    .bm-social a { width: 23px; height: 23px; }
    .bm-social .bm-i { width: 12px; height: 12px; }
    .bm-top__sep { margin-inline: 4px; }
    .bm-lang__btn { padding: 4px 4px; gap: 3px; }
}
@media (max-width: 389px) { .bm-top__tel span { display: none; } }   /* phone shows as icon only; Call button is in the menu */
@media (max-width: 359px) {
    .bm-top__item span { font-size: 10.5px; }
    .bm-top__left { gap: 8px; }
    .bm-qbtn { font-size: 13px; padding-inline: 8px; }
}

/* Hide Google Translate's own banner */
body { top: 0 !important; }
.goog-te-banner-frame, iframe.skiptranslate, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

@media (prefers-reduced-motion: reduce) {
    .bm-header *, .bm-header *::before { transition-duration: .01ms !important; }
}

/* =========================================================
   AUTH: Sign in button + profile menu (role based)
   ========================================================= */
.bm-signin .bm-i { width: 16px; height: 16px; }

.bm-user { position: relative; flex: none; }
.bm-user__btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 2px solid var(--bm-line) !important; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.bm-user__btn:hover, .bm-user.is-open .bm-user__btn { border-color: var(--bm-green) !important; box-shadow: 0 0 0 3px rgba(154,205,79,.28); }

.bm-av { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.bm-av--ini { display: grid; place-items: center; background: linear-gradient(135deg, #3A5FC7, #5A82E8); color: #fff; font-family: var(--bm-brand-font); font-size: 15px; font-weight: 800; line-height: 1; }

.bm-user__menu {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 30;
    width: 280px; max-width: calc(100vw - 28px); overflow: hidden;
    background: var(--bm-bg); color: var(--bm-text);
    border: 1px solid var(--bm-line); border-bottom: 3px solid var(--bm-green); border-radius: 10px;
    box-shadow: 0 24px 40px -16px rgba(31,53,115,.4);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .2s, transform .2s, visibility 0s linear .2s;
}
.bm-user.is-open .bm-user__menu { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .2s, visibility 0s; }

.bm-user__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bm-rail); border-bottom: 1px solid var(--bm-line); }
.bm-user__head .bm-av { width: 46px; height: 46px; flex: none; font-size: 18px; }
.bm-user__who { display: grid; gap: 2px; min-width: 0; }
.bm-user__who strong { font-size: 14px; font-weight: 700; color: var(--bm-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-user__who span { font-size: 12px; color: var(--bm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-role { justify-self: start; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--bm-green-t); color: #3F5F12; }
.bm-role--admin { background: #FDE8E6; color: #A6291C; }
.bm-role--editor { background: #FFF2D6; color: #8A5A00; }
:root[data-theme="dark"] .bm-role { color: #CFE9A2; }
:root[data-theme="dark"] .bm-role--admin { background: #4A1F1B; color: #FFB4AB; }
:root[data-theme="dark"] .bm-role--editor { background: #4A3A12; color: #FFD98A; }

.bm-user__list { padding: 6px 0; }
.bm-user__list a, .bm-user__out { display: flex; align-items: center; gap: 12px; padding: 11px 16px; font-size: 14px; font-weight: 500; color: var(--bm-text); transition: background .15s, color .15s; }
.bm-user__list a .bm-i, .bm-user__out .bm-i { width: 17px; height: 17px; color: var(--bm-blue-d); }
.bm-user__list a:hover { background: var(--bm-mist); color: var(--bm-blue-d); }
.bm-user__out { border-top: 1px solid var(--bm-line); color: #C0392B; }
.bm-user__out .bm-i { color: currentColor; }
.bm-user__out:hover { background: var(--bm-mist); }
:root[data-theme="dark"] .bm-user__out { color: #FF8A80; }

@media (max-width: 1023px) {
    .bm-signin { padding: 8px 14px; font-size: 13.5px; }
}
@media (max-width: 599px) {
    .bm-user__btn { width: 36px; height: 36px; }
    /* phone: menu spans the header width, directly under the main bar */
    .bm-user { position: static; }
    .bm-user__menu { left: 14px; right: 14px; top: 100%; width: auto; max-width: none; border-radius: 0 0 10px 10px; }
}
@media (max-width: 419px) {
    /* very small phones: sign in shows as a round icon button */
    .bm-signin { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
    .bm-signin__txt { display: none; }
}

/* =========================================================
   THEME BUTTON in top bar (all devices) + MOBILE ACCOUNT DRAWER
   ========================================================= */
@media (max-width: 479px) {
    .bm-theme--top { width: 23px; height: 23px; margin-right: 2px; }
    .bm-theme--top .bm-i { width: 14px; height: 14px; }
}

/* desktop: drawer-only blocks are hidden */
.bm-drawer__top { display: none; }

/* avatar button (replaces hamburger when signed in) */
.bm-burger--av {
    padding: 0; overflow: hidden; border-radius: 50% !important;
    border: 2px solid var(--bm-line) !important;
    transition: border-color .2s, box-shadow .2s;
}
.bm-burger--av[aria-expanded="true"] {
    border-color: var(--bm-green) !important; box-shadow: 0 0 0 3px rgba(154,205,79,.28);
}

@media (max-width: 1023px) {
    .bm-signin, .bm-user { display: none; }   /* Sign in + desktop dropdown: only inside the drawer on mobile */

    /* top: user details / Sign in */
    .bm-drawer__top { display: block; flex: none; padding: 16px 18px 14px; background: var(--bm-rail); border-bottom: 1px solid var(--bm-line); }
    .bm-dwho { display: flex; align-items: center; gap: 12px; padding-left: 12px; border-left: 3px solid var(--bm-green); }
    .bm-dwho__txt { display: grid; gap: 3px; min-width: 0; flex: 1; }
    .bm-dwho__name { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .bm-dwho__name strong { min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.25; color: var(--bm-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bm-dwho__name .bm-role { flex: none; margin-top: 0; padding: 2px 7px; font-size: 9.5px; }
    .bm-dwho__txt > span { font-size: 12.5px; line-height: 1.3; color: var(--bm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bm-dsignin {
        display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 16px;
        border-radius: 8px; background: var(--bm-green); color: var(--bm-deep) !important; font-size: 15px; font-weight: 800;
        transition: background .2s;
    }
    .bm-dsignin:hover { background: var(--bm-green-d); }
    .bm-dsignin .bm-i { width: 18px; height: 18px; }

    /* small sign out button on the user row */
    .bm-dwho__out {
        display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 12px;
        border: 1px solid rgba(192,57,43,.35); border-radius: 8px; background: var(--bm-bg);
        color: #C0392B !important; font-size: 12px; font-weight: 700; line-height: 1; transition: background .2s, border-color .2s;
    }
    .bm-dwho__out .bm-i { width: 14px; height: 14px; }
    .bm-dwho__out:hover { background: #FDECEA; border-color: #C0392B; }
    :root[data-theme="dark"] .bm-dwho__out { color: #FF8A80 !important; border-color: rgba(255,138,128,.4); }
    :root[data-theme="dark"] .bm-dwho__out:hover { background: #3A1B19; border-color: #FF8A80; }

    /* one-row small text links for role menu (scrolls sideways if too many) */
    .bm-dchips { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--bm-line); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .bm-dchips::-webkit-scrollbar { display: none; }
    .bm-dchips a {
        display: block; flex: none; padding: 7px 13px; border: 1px solid var(--bm-line); border-radius: 8px;
        background: var(--bm-bg); color: var(--bm-text); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
        transition: color .2s, border-color .2s, background .2s;
    }
    .bm-dchips a:hover { color: var(--bm-blue-d); border-color: var(--bm-blue-d); background: var(--bm-mist); }

    /* drawer: only the menu scrolls; user row on top and Call/WhatsApp footer stay fixed */
    .bm-drawer { overflow: hidden; }
    .bm-drawer__top { flex: none; }
    .bm-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .bm-drawer__foot { flex: none; }
}