/* RAQEEM Shell — global nav (HEADER_SHELL_V2 / S4) */
/* RAQEEM_SHELL_S4_UNIT_DETAIL_NORTH_STAR — Unit Detail Style: quiet white cards, soft borders, no loud banner identity. */

:root {
    --rq-shell-border: var(--rq-border-subtle, rgb(226 232 240));
    --rq-shell-border-soft: var(--rq-bg-muted, rgb(241 245 249));
    --rq-shell-surface-muted: var(--rq-bg-main, rgb(248 250 252));
    --rq-shell-text-main: var(--rq-text-main, rgb(15 23 42));
    --rq-shell-text-muted: var(--rq-text-muted, rgb(100 116 139));
    --rq-shell-radius-surface: 1.5rem;
    --rq-shell-radius-control: 1.1rem;
    --rq-shell-radius-row: 1.25rem;
    --rq-shell-shadow-surface: 0 10px 30px rgba(15, 23, 42, 0.045);
    --rq-shell-active-bg: var(--rq-bg-main, rgb(248 250 252));
    --rq-shell-active-border: var(--rq-border-subtle, rgb(226 232 240));
    --rq-shell-active-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* —— Shell background: Unit Detail North Star —— */
.rq-shell-bg {
    background: var(--rq-bg-main, rgb(248 250 252));
    border-bottom: 1px solid var(--rq-shell-border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.045);
}

@media (max-width: 1279px) {
    .rq-shell-bg {
        box-shadow: none;
    }

    #mainNav {
        position: relative;
    }
}

/* —— Mobile operating shell (Unit Detail tokens: rounded-2xl/3xl, slate-200, shadow-sm) —— */
.rq-shell-mobile-shell {
    padding: 0 0 0.0625rem;
}

.rq-shell-mobile-command-surface {
    padding: 0.375rem 0.5rem 0.4375rem;
    border: 1px solid var(--rq-shell-border);
    border-radius: var(--rq-shell-radius-surface);
    background: #fff;
    box-shadow: var(--rq-shell-shadow-surface);
}

.rq-shell-mobile-identity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
    min-height: 1.125rem;
    margin-bottom: 0.1875rem;
}

.rq-shell-mobile-edge {
    flex-shrink: 0;
    text-decoration: none;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.rq-shell-mobile-edge--brand {
    font-size: 0.5625rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    color: var(--rq-shell-text-muted, rgb(71 85 105));
    text-transform: uppercase;
}

.rq-shell-mobile-edge--brand:hover,
.rq-shell-mobile-edge--brand:focus-visible {
    color: var(--rq-shell-text-main, rgb(15 23 42));
    outline: none;
}

.rq-shell-mobile-edge--menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    padding: 0;
    border-radius: var(--rq-shell-radius-control);
    border: 1px solid var(--rq-shell-border);
    background: var(--rq-shell-surface-muted);
    color: rgb(100 116 139);
}

.rq-shell-mobile-edge--menu:hover {
    background: #fff;
    border-color: rgb(203 213 225);
    color: rgb(51 65 85);
}

.rq-shell-mobile-edge--menu:focus-visible {
    outline: 2px solid rgb(203 213 225);
    outline-offset: 1px;
}

.rq-shell-menu-icon {
    width: 0.6875rem;
    height: 0.6875rem;
}

.rq-shell-mobile-command-grid {
    display: grid;
    grid-template-rows: auto auto;
    gap: 0.1875rem;
}

.rq-shell-mobile-topbar,
.rq-shell-mobile-action-row,
.rq-shell-mobile-command-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.375rem;
}

.rq-shell-mobile-nav-segment {
    padding: 0.1875rem;
    border-radius: var(--rq-shell-radius-control);
    border: 1px solid var(--rq-shell-border);
    background: var(--rq-shell-surface-muted);
}

.rq-shell-mobile-cmd,
.rq-shell-mobile-action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 0.1875rem;
    border-radius: var(--rq-shell-radius-control);
    border: 1px solid transparent;
    background: transparent;
    color: var(--rq-shell-text-main, rgb(15 23 42));
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.rq-shell-mobile-cmd--nav {
    height: 1.75rem;
    min-height: 1.75rem;
    max-height: 1.75rem;
    border: none;
    background: transparent;
    box-shadow: none;
}

.rq-shell-mobile-action {
    height: 1.75rem;
    min-height: 1.75rem;
    max-height: 1.75rem;
}

.rq-shell-mobile-cmd-label {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: var(--rq-shell-text-muted, rgb(51 65 85));
}

.rq-shell-mobile-cmd.rq-shell-brand--mobile {
    max-width: none;
    padding: 0 0.1875rem;
}

.rq-shell-mobile-context {
    position: absolute;
    width: 1px;
    height: 1px;
    max-height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    border-radius: 9999px;
}

.rq-shell-context-section {
    display: block;
}

.rq-shell-mobile-cmd--nav:not(.rq-shell-mobile-cmd--gated):hover {
    background: rgb(255 255 255 / 0.72);
    color: rgb(15 23 42);
}

.rq-shell-mobile-cmd--nav:not(.rq-shell-mobile-cmd--gated):focus-visible {
    background: #fff;
    outline: 2px solid rgb(203 213 225);
    outline-offset: 0;
}

.rq-shell-mobile-cmd--nav:not(.rq-shell-mobile-cmd--gated):active {
    background: rgb(248 250 252);
}

.rq-shell-mobile-cmd--nav.is-active {
    background: var(--rq-shell-active-bg);
    border-color: var(--rq-shell-active-border);
    color: var(--rq-shell-text-main, rgb(15 23 42));
    box-shadow: var(--rq-shell-active-shadow);
}

.rq-shell-mobile-cmd--nav.is-active .rq-shell-mobile-cmd-label {
    color: var(--rq-shell-text-main, rgb(15 23 42));
    font-weight: 800;
}

.rq-shell-mobile-cmd--gated,
.rq-shell-mobile-action--gated {
    opacity: 1;
    cursor: not-allowed;
    background: transparent;
    color: rgb(148 163 184);
}

.rq-shell-mobile-cmd--gated .rq-shell-mobile-cmd-label,
.rq-shell-mobile-action--gated .rq-shell-mobile-cmd-label {
    color: rgb(148 163 184);
}

.rq-shell-mobile-action-row {
    background: #fff;
}

.rq-shell-mobile-action--primary:not(.is-active) {
    background: #fff;
    border-color: var(--rq-shell-border);
    color: var(--rq-shell-text-main, rgb(15 23 42));
}

.rq-shell-mobile-action--primary.is-active,
.rq-shell-v4-mobile-primary:not(.rq-shell-v4-mobile-primary--quad) .rq-shell-mobile-action--primary {
    background: rgb(15 23 42);
    border-color: rgb(15 23 42);
    color: #fff;
}

.rq-shell-mobile-action--primary.is-active .rq-shell-mobile-cmd-label,
.rq-shell-v4-mobile-primary:not(.rq-shell-v4-mobile-primary--quad) .rq-shell-mobile-action--primary .rq-shell-mobile-cmd-label {
    color: #fff;
    font-weight: 800;
}

.rq-shell-mobile-action--primary:not(.is-active) .rq-shell-mobile-cmd-label {
    color: var(--rq-shell-text-muted, rgb(51 65 85));
    font-weight: 700;
}

.rq-shell-mobile-action--primary:hover {
    background: rgb(30 41 59);
    border-color: rgb(30 41 59);
}

.rq-shell-mobile-action--primary:focus-visible {
    outline: 2px solid rgb(100 116 139);
    outline-offset: 1px;
}

.rq-shell-mobile-action--primary.is-active {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
    box-shadow: inset 0 0 0 1px rgb(71 85 105);
}

.rq-shell-mobile-action--secondary {
    background: #fff;
    border-color: var(--rq-shell-border);
}

.rq-shell-mobile-action--secondary:hover {
    background: rgb(248 250 252);
    border-color: var(--rq-shell-border);
}

.rq-shell-mobile-action--secondary:focus-visible {
    outline: 2px solid rgb(203 213 225);
    outline-offset: 1px;
}

.rq-shell-mobile-action--secondary.is-active {
    background: var(--rq-shell-active-bg);
    border-color: var(--rq-shell-active-border);
    box-shadow: var(--rq-shell-active-shadow);
    color: var(--rq-shell-text-main, rgb(15 23 42));
}

.rq-shell-mobile-action--capture:not(.is-active) {
    background: #fff;
    border-color: var(--rq-shell-border);
}

.rq-shell-mobile-action--capture.is-active,
.rq-shell-v4-mobile-primary:not(.rq-shell-v4-mobile-primary--quad) .rq-shell-mobile-action--capture {
    background: rgb(15 23 42);
    border-color: rgb(15 23 42);
}

.rq-shell-mobile-action--capture:hover {
    background: rgb(30 41 59);
    border-color: rgb(30 41 59);
}

.rq-shell-mobile-action--capture.is-active {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
    box-shadow: inset 0 0 0 1px rgb(71 85 105);
}

.rq-shell-mobile-action--invoice,
.rq-shell-mobile-action--project {
    background: #fff;
    border-color: var(--rq-shell-border);
}

.rq-shell-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    min-width: 0;
}

.rq-shell-brand--mobile:not(.rq-shell-mobile-cmd) {
    padding: 0.25rem 0.4375rem 0.25rem 0.3125rem;
    border-radius: 0.75rem;
    background: #fff;
    border: 1px solid rgb(241 245 249);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    max-width: min(42vw, 9.75rem);
}

.rq-shell-brand--bar-inline {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    max-width: none;
}

.rq-shell-v4-mobile-bar .rq-shell-brand-mark--mobile {
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
}

.rq-shell-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 0.5rem;
    background: rgb(248 250 252);
    font-size: 0.6875rem;
    font-weight: 900;
    color: rgb(71 85 105);
    flex-shrink: 0;
}

.rq-shell-brand-mark-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rq-shell-brand-mark:has(.rq-shell-brand-mark-img) {
    padding: 0;
    background: transparent;
    color: transparent;
    font-size: 0;
    line-height: 0;
}

.rq-shell-brand-mark--desktop:has(.rq-shell-brand-mark-img) {
    border: 0;
    box-shadow: none;
}

.rq-shell-brand-stack--mobile {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    min-width: 0;
}

.rq-shell-brand-wordmark {
    font-size: 0.6875rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    color: rgb(51 65 85);
    white-space: nowrap;
    line-height: 1;
}

.rq-shell-brand-workspace {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.rq-shell-brand-workspace-label {
    font-size: 0.5625rem;
    font-weight: 750;
    color: rgb(100 116 139);
    white-space: nowrap;
    line-height: 1.1;
    max-width: 5.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rq-shell-tenant-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 0.25rem;
    background: rgb(248 250 252);
    border: 1px solid rgb(226 232 240);
    font-size: 0.5rem;
    font-weight: 850;
    color: rgb(100 116 139);
    flex-shrink: 0;
    line-height: 1;
}

.rq-shell-header-action-btn--gated {
    opacity: 0.45;
    cursor: not-allowed;
}

/* —— Desktop header geometry —— */
.rq-shell-desktop-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3.25rem;
    height: auto;
    flex-wrap: nowrap;
    overflow: visible;
}

.rq-shell-brand--desktop {
    padding: 0.375rem 0.5rem;
    border-radius: var(--rq-shell-radius-control);
    background: #fff;
    border: 1px solid var(--rq-shell-border);
    box-shadow: var(--rq-shell-shadow-surface);
}

.rq-shell-brand-mark--desktop {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    border-radius: var(--rq-shell-radius-control);
    background: var(--rq-bg-surface, #fff);
    border: 1px solid var(--rq-shell-border);
    overflow: hidden;
}

.rq-shell-brand-stack {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.rq-shell-brand-wordmark--desktop {
    font-size: 1.125rem;
    line-height: 1;
}

.rq-shell-brand-tagline {
    margin-top: 0.125rem;
    font-size: 11px;
    color: var(--rq-shell-text-muted, rgb(100 116 139));
    white-space: nowrap;
}

.rq-shell-desktop-nav-groups {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: center;
    max-width: 560px;
    margin-inline: auto;
    padding-inline: 0.75rem;
}

.rq-shell-desktop-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.375rem;
    padding-inline-start: 0.75rem;
    border-inline-start: 1px solid rgba(226, 232, 240, 0.8);
}

.rq-shell-header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 2.125rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid var(--rq-shell-border);
    background: var(--rq-bg-surface, #fff);
    font-size: 11px;
    font-weight: 900;
    color: var(--rq-shell-text-muted, rgb(51 65 85));
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.rq-shell-header-action-btn:hover:not(:disabled) {
    background: #fff;
}

.rq-shell-desktop-qc {
    background: var(--rq-shell-surface-muted);
    border-color: var(--rq-shell-border);
    color: var(--rq-shell-text-main, rgb(15 23 42));
}

.rq-shell-header-action-icon {
    font-size: 0.75rem;
    opacity: 0.9;
}

.rq-shell-desktop-account-cluster {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.5rem;
    max-width: 220px;
}

.rq-shell-subscription-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background-color 0.18s ease;
}

.rq-shell-subscription-badge--green {
    color: rgb(4 120 87);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.rq-shell-subscription-badge--yellow {
    color: rgb(146 64 14);
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.rq-shell-subscription-badge--red {
    color: rgb(159 18 57);
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.rq-shell-subscription-badge--neutral,
.rq-shell-subscription-badge-- {
    color: rgb(51 65 85);
    background: rgba(100, 116, 139, 0.15);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.rq-shell-account-menu {
    max-width: 220px;
}

.rq-shell-account-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-inline-end: 0.5rem;
    border-inline-end: 1px solid rgba(226, 232, 240, 0.8);
}

.rq-shell-account-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: 2px solid #fff;
    background: linear-gradient(to top right, rgb(99 102 241), rgb(168 85 247));
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

/* —— Quick Peek mount offsets —— */
.rq-shell-peek-scrim {
    top: 0;
}

.rq-shell-peek-mount {
    top: calc(5.5rem + env(safe-area-inset-top, 0px));
}

@media (max-width: 1279px) {
    .rq-shell-peek-mount {
        top: calc(5.5rem + env(safe-area-inset-top, 0px));
    }
}

@media (min-width: 1280px) {
    .rq-shell-peek-scrim {
        inset-inline: 0;
        bottom: 0;
        top: 4.75rem;
    }

    .rq-shell-peek-mount {
        inset-inline: auto auto 0;
        left: 0.75rem;
        right: auto;
        top: 4.875rem;
        bottom: auto;
        max-height: none;
        width: min(calc(100vw - 1.5rem), 28rem);
        justify-content: flex-start;
    }
}

/* —— Shared nav components —— */
.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: 9px 12px;
    border-radius: var(--rq-shell-radius-control);
    color: var(--rq-shell-text-muted, #64748b);
    font-size: 13px;
    font-weight: 850;
    transition: .18s ease;
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--rq-bg-surface, #fff);
    border: 1px solid var(--rq-shell-border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}
.nav-pill:hover, .nav-pill-active {
    color: var(--rq-shell-text-main, #0f172a);
    background: var(--rq-bg-surface, #fff);
    border-color: var(--rq-shell-border);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}
.nav-pill-button { border: none; background: transparent; }

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 9px 14px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 850;
    border: 1px solid rgba(255,255,255,.12);
    transition: .18s ease;
    box-shadow: 0 8px 18px rgba(2,6,23,.16);
    flex-shrink: 0;
}

.nav-popover { pointer-events: auto;
    position: absolute;
    right: 0;
    top: 100%;
    padding-top: 12px;
    z-index: 80;
    transition: all .18s ease;
    width: 310px;
}
.nav-popover-wide { width: 340px; }
.nav-popover-shell {
    background: #fff;
    border: 1px solid var(--rq-shell-border);
    border-radius: var(--rq-shell-radius-surface);
    padding: 11px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.nav-popover-header { padding: 7px 9px 10px; }
.nav-popover-title { color: var(--rq-shell-text-main, #0f172a); font-size: 13px; font-weight: 850; }
.nav-popover-subtitle { margin-top: 3px; color: var(--rq-shell-text-muted, #64748b); font-size: 11.5px; line-height: 1.45; }
.nav-pop-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px;
    border-radius: var(--rq-shell-radius-control);
    color: var(--rq-shell-text-main, #1e293b);
    transition: .18s ease;
    text-decoration: none;
}
.nav-pop-link:hover {
    color: var(--rq-shell-text-main, #0f172a);
    background: var(--rq-shell-surface-muted);
}
.nav-pop-link .font-black { color: #1e293b !important; }
.nav-pop-link .text-xs { color: #475569 !important; }
.nav-pop-icon { font-size: 17px; line-height: 1; margin-top: 1px; }

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--rq-shell-text-muted, rgb(51 65 85));
    border-radius: var(--rq-shell-radius-control);
    transition: .18s ease;
}
.menu-link:hover { background: var(--rq-shell-surface-muted); }

/* —— Mobile drawer: Unit Detail navigation surface (DRAWER_NAV_V4) —— */
.rq-shell-drawer-overlay {
    background: rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.rq-shell-drawer-overlay.is-open {
    opacity: 1;
}

.rq-shell-drawer-panel {
    inset-inline-end: 0;
    width: min(76vw, 300px);
    max-width: calc(100vw - 72px);
    transform: translate3d(100%, 0, 0);
    transition: transform 0.22s ease;
    will-change: transform;
    border-start-start-radius: var(--rq-shell-radius-surface);
    border-end-start-radius: var(--rq-shell-radius-surface);
    overflow: hidden;
}

.rq-shell-drawer-panel.is-open {
    transform: translate3d(0, 0, 0);
}

.rq-shell-drawer {
    background: #fff;
    color: var(--rq-shell-text-main, rgb(15 23 42));
    border-inline-start: 1px solid var(--rq-shell-border);
    box-shadow: -10px 0 32px rgba(15, 23, 42, 0.06);
}

.rq-shell-drawer-header {
    padding: 0.5rem 0.625rem 0.5625rem;
    background: var(--rq-shell-surface-muted);
    border-bottom: 1px solid var(--rq-shell-border);
}

.rq-shell-drawer-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
}

.rq-shell-drawer-identity {
    min-width: 0;
    flex: 1;
}

.rq-shell-drawer-user-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3125rem;
    min-width: 0;
}

.rq-shell-drawer-username {
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--rq-shell-text-main, rgb(15 23 42));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rq-shell-drawer-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.0625rem;
    min-width: 0;
    font-size: 0.625rem;
    line-height: 1.2;
    color: var(--rq-shell-text-muted, rgb(100 116 139));
}

.rq-shell-drawer-tenant-inline {
    font-weight: 600;
    color: rgb(71 85 105);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.rq-shell-drawer-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.rq-shell-drawer-status {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.0625rem 0.375rem;
    border-radius: 9999px;
    border: 1px solid var(--rq-shell-border);
    background: var(--rq-shell-surface-muted);
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: rgb(71 85 105);
    text-decoration: none;
}

.rq-shell-drawer-status--green {
    border-color: rgb(167 243 208);
    background: rgb(236 253 245);
    color: rgb(4 120 87);
}

.rq-shell-drawer-status--yellow {
    border-color: rgb(253 230 138);
    background: rgb(255 251 235);
    color: rgb(146 64 14);
}

.rq-shell-drawer-status--red {
    border-color: rgb(254 202 202);
    background: rgb(254 242 242);
    color: rgb(185 28 28);
}

.rq-shell-chrome-btn,
.rq-shell-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    padding: 0;
    border-radius: var(--rq-shell-radius-control);
    border: 1px solid var(--rq-shell-border);
    background: var(--rq-shell-surface-muted);
    color: rgb(71 85 105);
    font-size: 0.875rem;
    line-height: 1;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.rq-shell-chrome-btn:hover,
.rq-shell-drawer-close:hover {
    background: #fff;
    border-color: rgb(203 213 225);
    color: rgb(15 23 42);
}

.rq-shell-chrome-btn:focus-visible,
.rq-shell-drawer-close:focus-visible {
    outline: 2px solid rgb(203 213 225);
    outline-offset: 1px;
}

.rq-shell-drawer-body {
    padding: 0.375rem 0.4375rem 0.5rem;
    background: var(--rq-shell-surface-muted);
}

.rq-shell-drawer-section {
    padding: 0.0625rem 0;
}

.rq-shell-drawer-section + .rq-shell-drawer-section {
    border-top: 1px solid var(--rq-shell-border-soft);
    margin-top: 0;
    padding-top: 0.125rem;
}

.rq-shell-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.mobile-link {
    display: flex;
    align-items: center;
    min-height: 2.25rem;
    max-height: 2.5rem;
    padding: 0 0.625rem;
    border-radius: var(--rq-shell-radius-row);
    border: 1px solid var(--rq-shell-border);
    background: var(--rq-bg-surface, #fff);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--rq-shell-text-muted, rgb(51 65 85));
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.mobile-link:hover {
    background: var(--rq-shell-surface-muted);
    border-color: var(--rq-shell-border);
    color: rgb(15 23 42);
}

.mobile-link:active {
    background: rgb(241 245 249);
    border-color: rgb(203 213 225);
}

.mobile-link.is-active,
.mobile-link[aria-current="page"] {
    background: var(--rq-bg-surface, #fff);
    border-color: var(--rq-shell-border);
    color: var(--rq-shell-text-main, rgb(15 23 42));
    font-weight: 700;
    box-shadow: var(--rq-shell-active-shadow);
}

.mobile-link:focus-visible {
    outline: 2px solid rgb(203 213 225);
    outline-offset: 0;
    background: var(--rq-shell-surface-muted);
    border-color: var(--rq-shell-border);
}

.mobile-link--danger {
    color: rgb(220 38 38);
}

.mobile-link--danger:hover {
    background: rgb(254 242 242);
    border-color: rgb(254 202 202);
    color: rgb(185 28 28);
}

.mobile-link--danger.is-active,
.mobile-link--danger[aria-current="page"] {
    background: rgb(254 242 242);
    border-color: rgb(252 165 165);
    box-shadow: inset 0 0 0 1px rgb(252 165 165);
    color: rgb(185 28 28);
}

.mobile-link-gated {
    opacity: 0.55;
    cursor: not-allowed;
}

.section-label {
    padding: 0.125rem 0.625rem 0.1875rem;
    color: var(--rq-shell-text-muted, rgb(100 116 139));
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
}

.rq-shell-account-dropdown {
    background: #fff;
    color: rgb(30 41 59);
}

.rq-shell-account-dropdown .menu-link {
    color: rgb(51 65 85);
}

.rq-shell-account-dropdown .menu-link:hover {
    background: rgb(248 250 252);
}

/* —— RAQEEM Command Shell V3 — command-first + drawer-first —— */

.rq-shell-v3-page-context {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
}

.rq-shell-v3-page-context .rq-shell-context-section {
    display: inline-block;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.6875rem;
    font-weight: 800;
    color: var(--rq-shell-text-muted, rgb(100 116 139));
}

.rq-shell-v3-mobile .rq-shell-mobile-command-grid {
    gap: 0.3125rem;
}

.rq-shell-v3-mobile .rq-shell-mobile-identity-row {
    margin-bottom: 0.25rem;
}

.rq-shell-v3-mobile .rq-shell-mobile-cmd--home .rq-shell-mobile-cmd-label {
    font-weight: 800;
}

.rq-shell-v3-mobile .rq-shell-mobile-cmd--home .rq-shell-v3-page-context {
    display: block;
    margin-top: 0.0625rem;
}

.rq-shell-v3-action-shelf {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.01fr) minmax(0, 0.01fr);
    gap: 0.1875rem;
    align-items: stretch;
    background: transparent;
}

.rq-shell-v3-primary-action {
    min-height: 2rem;
    border-radius: var(--rq-shell-radius-control);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.rq-shell-v3-action-shelf .rq-shell-mobile-action--invoice,
.rq-shell-v3-action-shelf .rq-shell-mobile-action--project {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rq-shell-v3-desktop {
    gap: 0.625rem;
}

.rq-shell-v3-desktop-context {
    display: none;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    padding: 0.25rem 0.75rem;
    border-radius: var(--rq-shell-radius-control);
    border: 1px solid var(--rq-shell-border);
    background: var(--rq-bg-surface, #fff);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.rq-shell-v3-desktop-context-label {
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rq-shell-text-muted, #64748b);
    line-height: 1;
}

.rq-shell-v3-desktop-context-value {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--rq-shell-text-main, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rq-shell-v3-nav-launcher {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--rq-shell-radius-control);
    border: 1px solid var(--rq-shell-border);
    background: var(--rq-bg-surface, #fff);
    color: var(--rq-shell-text-main, #0f172a);
    font-size: 0.75rem;
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    flex-shrink: 0;
}

.rq-shell-v3-nav-launcher:hover {
    background: var(--rq-shell-surface-muted);
}

.rq-shell-v3-nav-archive {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rq-shell-v3-nav-archive .nav-popover {
    pointer-events: auto;
}

.rq-shell-v3-primary-action.rq-shell-header-action-btn,
.rq-shell-v3-primary-action.rq-shell-desktop-qc {
    background: var(--rq-text-main, #0f172a);
    border-color: var(--rq-text-main, #0f172a);
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.rq-shell-v3-primary-action.rq-shell-header-action-btn:hover,
.rq-shell-v3-primary-action.rq-shell-desktop-qc:hover {
    background: rgb(30 41 59);
    border-color: rgb(30 41 59);
}

.rq-shell-v3-drawer-hint {
    margin: 0 0.5rem 0.25rem;
    font-size: 0.625rem;
    line-height: 1.35;
    color: var(--rq-shell-text-muted, #64748b);
}

.rq-shell-v3-drawer-body .mobile-link {
    position: relative;
    border-color: var(--rq-shell-border);
    background: var(--rq-bg-surface, #fff);
}

.rq-shell-v3-drawer-body .mobile-link.is-active,
.rq-shell-v3-drawer-body .mobile-link[aria-current="page"] {
    background: var(--rq-shell-active-bg);
    border-color: var(--rq-shell-active-border);
    box-shadow: var(--rq-shell-active-shadow);
}

.rq-shell-v3-drawer-body .mobile-link.is-active::before,
.rq-shell-v3-drawer-body .mobile-link[aria-current="page"]::before {
    content: "";
    position: absolute;
    inset-block: 0.375rem;
    inset-inline-end: 0;
    width: 0.1875rem;
    border-radius: 9999px;
    background: var(--rq-primary, #375093);
}

.rq-shell-v3-drawer-exec {
    padding-bottom: 0.25rem;
    margin-bottom: 0.125rem;
    border-bottom: 1px solid var(--rq-shell-border-soft);
}

@media (min-width: 1280px) {
    .rq-shell-v3-desktop-context {
        display: flex;
    }

    .rq-shell-v3-nav-launcher {
        display: inline-flex;
    }

    .rq-shell-v3-drawer-panel {
        width: min(24rem, 92vw);
        max-width: 24rem;
        inset-inline-end: 0;
    }

    .rq-shell-v3-drawer-overlay {
        backdrop-filter: blur(4px);
    }
}

@media (max-width: 1279px) {
    .rq-shell-v3-mobile .rq-shell-mobile-topbar {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 0.7fr);
    }

    .rq-shell-v3-mobile .rq-shell-mobile-cmd--peek {
        opacity: 0.92;
    }
}
/* —— RAQEEM Command Shell V4 — clean top bar + command drawer —— */

.rq-shell-v4-mobile-surface {
    padding: 0.5rem 0.625rem 0.5625rem;
    border: 1px solid var(--rq-shell-border);
    border-radius: var(--rq-shell-radius-surface);
    background: #fff;
    box-shadow: var(--rq-shell-shadow-surface);
}

.rq-shell-v4-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 2rem;
}

.rq-shell-v4-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: var(--rq-shell-radius-control);
    border: 1px solid var(--rq-shell-border);
    background: var(--rq-shell-surface-muted);
    color: var(--rq-shell-text-muted);
    font-size: 0.6875rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.rq-shell-v4-icon-btn:hover {
    background: #fff;
    border-color: rgb(203 213 225);
    color: var(--rq-shell-text-main);
}

.rq-shell-v4-mobile-context,
.rq-shell-v4-mobile .rq-shell-mobile-context {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: auto;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.rq-shell-v4-mobile-context .rq-shell-context-section,
.rq-shell-v4-desktop-context .rq-shell-context-section {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--rq-shell-text-main);
    letter-spacing: -0.01em;
}

.rq-shell-v4-mobile-primary {
    margin-top: 0.4375rem;
}

.rq-shell-v4-mobile-primary .rq-shell-mobile-action-row {
    display: grid;
    gap: 0.375rem;
}

.rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rq-shell-v4-mobile-primary--triple .rq-shell-mobile-action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rq-shell-v4-mobile-primary:not(.rq-shell-v4-mobile-primary--quad):not(.rq-shell-v4-mobile-primary--triple) .rq-shell-mobile-action-row {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

@media (max-width: 360px) {
    .rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action-row > [data-start-work="root"],
.rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action-row > .rq-shell-mobile-action-slot {
    display: contents;
}

.rq-shell-v4-mobile-primary .rq-shell-mobile-action-row .rq-shell-v4-primary-btn,
.rq-shell-v4-mobile-primary .rq-shell-mobile-action-row .rq-shell-header-action-btn {
    width: 100%;
    min-width: 0;
    min-height: 2.125rem;
    padding: 0 0.375rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action--capture:not(.is-active) {
    background: #fff;
    border-color: var(--rq-shell-border);
    color: var(--rq-shell-text-main, rgb(15 23 42));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action--capture:not(.is-active) .rq-shell-mobile-cmd-label {
    color: var(--rq-shell-text-muted, rgb(51 65 85));
    font-weight: 700;
}

.rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action--capture.is-active {
    background: rgb(15 23 42);
    border-color: rgb(15 23 42);
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action--capture.is-active .rq-shell-mobile-cmd-label {
    color: #fff;
    font-weight: 800;
}

.rq-shell-mobile-action--home.is-active {
    background: rgb(30 58 95);
    border-color: rgb(30 58 95);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgb(51 65 85 / 0.35), 0 2px 8px rgba(30, 58, 95, 0.16);
}

.rq-shell-mobile-action--home.is-active .rq-shell-mobile-cmd-label {
    color: #fff;
    font-weight: 800;
}

.rq-shell-mobile-action--wizard.is-active {
    background: var(--rq-shell-active-bg);
    border-color: rgb(30 58 95);
    box-shadow: inset 0 -2px 0 rgb(30 58 95);
    color: var(--rq-shell-text-main, rgb(15 23 42));
}

.rq-shell-mobile-action--wizard.is-active .rq-shell-mobile-cmd-label {
    color: var(--rq-shell-text-main, rgb(15 23 42));
    font-weight: 800;
}

.rq-shell-v4-mobile-primary .rq-shell-mobile-action-row .rq-shell-v4-primary-btn {
    border-color: rgb(15 23 42);
}


/* —— V4 mobile: full label text, no frame overflow —— */
/* Markup puts v4-mobile-primary ON the action-row itself (not as parent of a nested row). */
.rq-shell-mobile-action-row.rq-shell-v4-mobile-primary {
    display: grid;
    gap: 0.375rem;
}

.rq-shell-mobile-action-row.rq-shell-v4-mobile-primary--quad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rq-shell-mobile-action-row.rq-shell-v4-mobile-primary--triple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rq-shell-mobile-action-row.rq-shell-v4-mobile-primary .rq-shell-mobile-action,
.rq-shell-mobile-action-row.rq-shell-v4-mobile-primary .rq-shell-header-action-btn {
    height: auto;
    max-height: none;
    min-height: 2.125rem;
    overflow: visible;
    align-items: center;
    white-space: normal;
}

.rq-shell-v4-mobile .rq-shell-mobile-action-row.rq-shell-v4-mobile-primary .rq-shell-mobile-cmd-label,
.rq-shell-mobile-action-row.rq-shell-v4-mobile-primary .rq-shell-mobile-cmd-label {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.15;
    text-align: center;
    word-break: break-word;
    hyphens: auto;
}

.rq-shell-v4-mobile .rq-shell-v4-mobile-context,
.rq-shell-v4-mobile-context {
    white-space: normal;
    overflow: visible;
}

.rq-shell-v4-mobile .rq-shell-v4-mobile-context .rq-shell-context-section,
.rq-shell-v4-mobile-context .rq-shell-context-section {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.2;
    word-break: break-word;
}

@media (max-width: 360px) {
    .rq-shell-mobile-action-row.rq-shell-v4-mobile-primary--quad {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rq-shell-mobile-action-row.rq-shell-v4-mobile-primary--quad .rq-shell-header-action-btn,
    .rq-shell-mobile-action-row.rq-shell-v4-mobile-primary--quad .rq-shell-v4-primary-btn {
        min-height: 2.5rem;
        padding-block: 0.25rem;
        font-size: 0.625rem;
    }
}

.rq-shell-v4-mobile-primary .rq-shell-mobile-action-row .rq-shell-v4-secondary-btn {
    color: var(--rq-shell-text-main, rgb(15 23 42));
}

.rq-shell-v4-primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.125rem;
    padding: 0 0.875rem;
    border-radius: 9999px;
    border: 1px solid rgb(15 23 42);
    background: rgb(15 23 42);
    color: #fff;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.rq-shell-v4-primary-btn:hover {
    background: rgb(30 41 59);
    color: #fff;
}

.rq-shell-v4-primary-btn:active {
    transform: translateY(1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

/* P1A: tenant-spine primary alias — constitutional action tokens */
.rq-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.375rem;
    padding: 0 1rem;
    border-radius: var(--rq-shell-radius-control);
    border: 1px solid var(--rq-action-bg, rgb(15 23 42));
    background: var(--rq-action-bg, rgb(15 23 42));
    color: var(--rq-action-text, #fff);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 800;
    box-shadow: var(--rq-elev-float, 0 12px 28px rgba(15, 23, 42, 0.14));
    transition: transform var(--rq-duration-instant, 0.12s) var(--rq-ease-standard, ease),
        box-shadow var(--rq-duration-fast, 0.16s) var(--rq-ease-standard, ease),
        background-color var(--rq-duration-fast, 0.16s) var(--rq-ease-standard, ease);
    cursor: pointer;
}

.rq-btn-primary:hover {
    background: var(--rq-action-bg-hover, rgb(30 41 59));
    color: var(--rq-action-text, #fff);
}

.rq-btn-primary:active {
    transform: translateY(1px);
    box-shadow: var(--rq-elev-raised, 0 8px 18px rgba(15, 23, 42, 0.12));
}

button.rq-btn-primary,
input[type="submit"].rq-btn-primary {
    appearance: none;
    -webkit-appearance: none;
}


.rq-shell-v4-desktop {
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    min-height: 3.25rem;
}

.rq-shell-v4-tenant-name {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--rq-shell-text-muted);
    line-height: 1.1;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rq-shell-v4-desktop-context {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.rq-shell-v4-nav-launcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 2.125rem;
    padding: 0 0.875rem;
    border-radius: 9999px;
    border: 1px solid var(--rq-shell-border);
    background: #fff;
    color: var(--rq-shell-text-main);
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.rq-shell-v4-nav-launcher:hover {
    background: var(--rq-shell-surface-muted);
    border-color: rgb(203 213 225);
}

.rq-shell-v4-desktop-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.rq-shell-v4-secondary-btn {
    min-width: 2.75rem;
    height: 2.125rem;
    padding: 0 0.75rem;
    border-radius: 9999px;
    border: 1px solid var(--rq-shell-border);
    background: #fff;
    color: var(--rq-shell-text-muted);
    font-size: 0.6875rem;
    font-weight: 800;
}

.rq-shell-v4-route-registry {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rq-shell-v4-drawer-overlay {
    background: rgba(15, 23, 42, 0.28);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.rq-shell-v4-drawer-overlay.is-open {
    opacity: 1;
}

.rq-shell-v4-drawer-panel {
    right: 0;
    left: auto;
    width: min(20rem, 92vw);
    transform: translateX(100%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -18px 0 48px rgba(15, 23, 42, 0.12);
}

.rq-shell-v4-drawer-panel.is-open {
    transform: translateX(0);
}

.rq-shell-v4-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--rq-shell-border-soft);
}

.rq-shell-v4-drawer-tenant {
    margin-top: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--rq-shell-text-muted);
}

.rq-shell-v4-drawer-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.rq-shell-v4-drawer-card {
    padding: 0.625rem;
    border: 1px solid var(--rq-shell-border);
    border-radius: var(--rq-shell-radius-row);
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
}

.rq-shell-v4-drawer-card .rq-shell-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
    margin-top: 0.375rem;
}

.rq-shell-v4-drawer-card .mobile-link {
    border-radius: 0.875rem;
    min-height: 2.25rem;
    padding-inline: 0.75rem;
}

.rq-shell-v4-drawer-card .mobile-link.is-active,
.rq-shell-v4-drawer-card .mobile-link[aria-current="page"] {
    border-inline-start: 3px solid rgb(15 23 42);
    padding-inline-start: calc(0.75rem - 3px);
}

.rq-shell-v4-btn--gated {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (min-width: 1280px) {
    .rq-shell-v4-drawer-panel {
        width: min(22rem, 34vw);
    }
}


/* ===== Wave 1A — Product Chrome Cleanup (cleanup-first, not redesign) ===== */

.rq-view-as-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 32px;
    max-height: 32px;
    margin: 0 0 0.75rem;
    padding: 0 0.75rem;
    border-bottom: 1px solid var(--rq-view-as-border, #fde68a);
    background: var(--rq-view-as-bg, #fffbeb);
    color: var(--rq-view-as-text, #92400e);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
}

.rq-view-as-strip__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.rq-view-as-strip__form {
    margin: 0;
    flex-shrink: 0;
}

.rq-view-as-strip__exit {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

.rq-shell-wave1a .rq-shell-bg {
    background: #fff;
}

.rq-shell-wave1a .rq-shell-v4-mobile-surface {
    padding: 0.5rem 0 0.625rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid var(--rq-chrome-border, #e2e8f0);
}

.rq-shell-wave1a .rq-shell-v4-mobile-context .rq-shell-context-section,
.rq-shell-wave1a .rq-shell-v4-desktop-context .rq-shell-context-section {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--rq-text-main, #0f172a);
    letter-spacing: 0;
}

.rq-shell-wave1a .rq-shell-v4-icon-btn {
    font-weight: 600;
    box-shadow: none;
}

.rq-shell-wave1a .rq-shell-v4-primary-btn {
    font-weight: 700;
    box-shadow: var(--rq-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.rq-shell-wave1a .rq-shell-v4-primary-btn:hover {
    box-shadow: var(--rq-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.08));
}

.rq-shell-wave1a .rq-shell-v4-primary-btn:active {
    transform: none;
}

.rq-shell-wave1a .rq-shell-v4-nav-launcher {
    font-weight: 700;
    border-radius: var(--rq-chrome-radius-sm, 8px);
}

.rq-shell-wave1a .rq-shell-v4-secondary-btn {
    font-weight: 700;
}

.rq-shell-wave1a .rq-shell-v4-drawer-panel {
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.08);
}

.rq-shell-wave1a .rq-shell-v4-drawer-head {
    padding: 0.875rem 1rem 0.625rem;
}

.rq-shell-wave1a .rq-shell-drawer-username {
    font-weight: 700;
}

.rq-shell-wave1a .rq-shell-v4-drawer-body {
    padding: 0.375rem 0.5rem 0.5rem;
    gap: 0;
}

.rq-shell-wave1a .rq-shell-v4-drawer-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.rq-shell-wave1a .rq-shell-v4-drawer-card + .rq-shell-v4-drawer-card {
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid #f1f5f9;
}

.rq-shell-wave1a .rq-shell-v4-drawer-card .section-label {
    padding: 0.375rem 0.75rem 0.125rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #94a3b8;
}

.rq-shell-wave1a .rq-shell-v4-drawer-card .rq-shell-drawer-nav {
    gap: 0.125rem;
    margin-top: 0.125rem;
}

.rq-shell-wave1a .rq-shell-v4-drawer-card .mobile-link {
    min-height: 2.75rem;
    max-height: none;
    padding: 0 0.75rem;
    border: 0;
    border-radius: var(--rq-chrome-radius-sm, 8px);
    background: transparent;
    box-shadow: none;
    font-weight: 600;
}

.rq-shell-wave1a .rq-shell-v4-drawer-card .mobile-link:hover {
    background: #f8fafc;
    border-color: transparent;
}

.rq-shell-wave1a .rq-shell-v4-drawer-card .mobile-link.is-active,
.rq-shell-wave1a .rq-shell-v4-drawer-card .mobile-link[aria-current="page"] {
    background: #eff6ff;
    color: #1e40af;
    font-weight: 700;
    border-inline-start: 0;
    padding-inline-start: 0.75rem;
    box-shadow: none;
}

.rq-shell-wave1a .rq-shell-v4-drawer-foot {
    margin-top: auto;
    padding: 0.625rem 0.75rem;
    border-top: 1px solid var(--rq-chrome-border, #e2e8f0);
    background: #f8fafc;
}

.rq-shell-wave1a .rq-shell-v4-drawer-foot .mobile-link {
    min-height: 2.75rem;
    border: 0;
    border-radius: var(--rq-chrome-radius-sm, 8px);
    background: transparent;
    box-shadow: none;
    font-weight: 600;
}

.rq-shell-wave1a .rq-shell-v4-drawer-foot .mobile-link--danger:hover {
    background: #fef2f2;
}

.rq-shell-wave1a .rq-shell-peek-scrim {
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: none;
}

/* ===== Wave 1A.1 — Drawer flat rows (runtime proof) ===== */
#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-card + .rq-shell-v4-drawer-card {
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid #f1f5f9;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-card .section-label {
    padding: 0.375rem 0.75rem 0.125rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: #94a3b8;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-card .rq-shell-drawer-nav {
    gap: 0;
    margin-top: 0;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-body .mobile-link {
    min-height: 2.75rem;
    max-height: none;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
    font-weight: 600;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-body .mobile-link:hover,
#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-body .mobile-link:active {
    background: #f8fafc;
    border-color: transparent;
    color: #0f172a;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-body .mobile-link.is-active,
#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-body .mobile-link[aria-current="page"] {
    background: #eff6ff;
    color: #1e40af;
    font-weight: 700;
    border: 0;
    border-inline-start: 0;
    padding-inline-start: 0.75rem;
    box-shadow: none;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-body .mobile-link--danger {
    color: #b91c1c;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-body .mobile-link--danger:hover {
    background: #fef2f2;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-foot {
    margin-top: auto;
    padding: 0.625rem 0.75rem;
    border-top: 1px solid var(--rq-chrome-border, #e2e8f0);
    background: #f8fafc;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-foot .mobile-link {
    min-height: 2.75rem;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
    font-weight: 600;
    color: #b91c1c;
}

#mainNav.rq-shell-wave1a #mobileMenu .rq-shell-v4-drawer-foot .mobile-link:hover {
    background: #fef2f2;
    border-color: transparent;
}

/* Start-work dropdown must escape clipped mobile action geometry */
[data-start-work="root"] {
    overflow: visible;
    height: auto;
    max-height: none;
}

[data-start-work-menu] {
    z-index: 60;
}

/* —— شؤون الأطراف · customers home (scoped) —— */
[data-parties="customers-home"] {
    --ph-border: rgb(226 232 240);
    --ph-muted: rgb(100 116 139);
    --ph-ink: rgb(15 23 42);
}
[data-parties="customers-home"] .ph-card {
    border: 1px solid var(--ph-border);
    border-radius: 1.25rem;
    background: rgba(255,255,255,.98);
    box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
[data-parties="customers-home"] .ph-section-head { margin-bottom: .85rem; }
[data-parties="customers-home"] .ph-section-title {
    font-size: 1.125rem;
    font-weight: 900;
    color: var(--ph-ink);
    letter-spacing: -.01em;
}
[data-parties="customers-home"] .ph-section-sub {
    margin-top: .2rem;
    font-size: .8125rem;
    font-weight: 700;
    color: var(--ph-muted);
}
[data-parties="customers-home"] .ph-kicker {
    margin-bottom: .65rem;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgb(100 116 139);
}
[data-parties="customers-home"] .ph-stat-grid {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) {
    [data-parties="customers-home"] .ph-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
}
[data-parties="customers-home"] .ph-stat-tile {
    border: 1px solid rgb(241 245 249);
    border-radius: .85rem;
    background: linear-gradient(180deg, #fff 0%, rgb(248 250 252) 100%);
    padding: .55rem .65rem;
    text-align: center;
    min-height: 4.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
}
[data-parties="customers-home"] .ph-stat-tile--accent-in {
    border-color: rgb(209 250 229);
    background: linear-gradient(180deg, rgb(236 253 245 / .55) 0%, #fff 100%);
}
[data-parties="customers-home"] .ph-stat-tile--accent-out {
    border-color: rgb(254 226 226);
    background: linear-gradient(180deg, rgb(254 242 242 / .55) 0%, #fff 100%);
}
[data-parties="customers-home"] .ph-stat-tile--accent-warn {
    border-color: rgb(254 243 199);
    background: linear-gradient(180deg, rgb(255 251 235 / .65) 0%, #fff 100%);
}
[data-parties="customers-home"] .ph-stat-hint {
    margin-top: .2rem;
    font-size: .55rem;
    font-weight: 800;
    line-height: 1.2;
    color: rgb(148 163 184);
}
[data-parties="customers-home"] .ph-stat-label {
    font-size: .62rem;
    font-weight: 900;
    line-height: 1.25;
    color: rgb(71 85 105);
}
[data-parties="customers-home"] .ph-stat-value {
    font-size: .95rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: rgb(15 23 42);
    line-height: 1.1;
}
@media (min-width: 640px) {
    [data-parties="customers-home"] .ph-stat-value { font-size: 1.05rem; }
}
[data-parties="customers-home"] .ph-party-grid {
    display: grid;
    gap: .65rem;
    grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 768px) {
    [data-parties="customers-home"] .ph-party-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    [data-parties="customers-home"] .ph-party-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
[data-parties="customers-home"] .ph-subsection-title {
    font-size: .75rem;
    font-weight: 900;
    color: rgb(51 65 85);
}
[data-parties="customers-home"] .ph-empty {
    grid-column: 1 / -1;
    padding: 2rem 1rem;
    text-align: center;
    font-size: .8125rem;
    font-weight: 700;
    color: rgb(100 116 139);
    border: 1px dashed rgb(226 232 240);
    border-radius: 1rem;
    background: rgb(248 250 252 / .6);
}
[data-parties="customers-home"] .ph-empty--cta { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
[data-parties="customers-home"] .ph-empty-cta {
    display: inline-flex;
    min-height: 2.25rem;
    align-items: center;
    border-radius: .65rem;
    border: 1px solid rgb(199 210 254);
    background: linear-gradient(180deg, #fff 0%, rgb(238 242 255) 100%);
    padding: .35rem .85rem;
    font-size: .75rem;
    font-weight: 900;
    color: rgb(67 56 202);
    text-decoration: none;
}
[data-parties="customers-home"] .ph-tab-pill {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    border-radius: 9999px;
    border: 1px solid rgba(226,232,240,.92);
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    padding: .45rem .85rem;
    font-size: .78rem;
    font-weight: 900;
    color: #334155;
    box-shadow: 0 1px 0 rgba(255,255,255,.95) inset;
    transition: border-color .16s ease, box-shadow .16s ease, transform .14s ease, background .16s ease;
}
[data-parties="customers-home"] .ph-tab-pill:hover {
    border-color: rgba(165,180,252,.65);
    box-shadow: 0 4px 16px -8px rgba(79,70,229,.25);
    transform: translateY(-1px);
}
[data-parties="customers-home"] .ph-tab-pill--active,
[data-parties="customers-home"] .ph-tab-pill[aria-selected="true"] {
    background: #020617 !important;
    color: #fff !important;
    border-color: #020617 !important;
    box-shadow: 0 0 0 3px rgba(15,23,42,.12), 0 10px 22px -14px rgba(15,23,42,.45) !important;
    transform: translateY(-1px);
}
[data-parties="customers-home"] .ph-tab-badge {
    display: inline-flex;
    min-width: 1.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(15,23,42,.08);
    padding: .05rem .35rem;
    font-size: .65rem;
    font-variant-numeric: tabular-nums;
}
[data-parties="customers-home"] .ph-tab-pill--active .ph-tab-badge,
[data-parties="customers-home"] .ph-tab-pill[aria-selected="true"] .ph-tab-badge {
    background: rgba(255,255,255,.18);
    color: #fff;
}
[data-parties="customers-home"] .ph-kpi-strip {
    /* One active panel at a time — no horizontal scroll dump */
}
[data-parties="customers-home"] .ph-kpi-panel[hidden],
[data-parties="customers-home"] .ph-kpi-panel.hidden {
    display: none !important;
}
[data-parties="customers-home"] .ph-kpi-panel:not([hidden]):not(.hidden) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
}
@media (min-width: 480px) {
    [data-parties="customers-home"] .ph-kpi-panel:not([hidden]):not(.hidden) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
[data-parties="customers-home"] .ph-kpi-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border: 1px solid rgb(226 232 240);
    border-radius: .75rem;
    background: #fff;
    padding: .4rem .55rem;
    text-align: center;
}
[data-parties="customers-home"] .ph-kpi-chip--in { border-color: rgb(209 250 229); background: rgb(236 253 245 / .45); }
[data-parties="customers-home"] .ph-kpi-chip--out { border-color: rgb(254 226 226); background: rgb(254 242 242 / .45); }
[data-parties="customers-home"] .ph-kpi-chip--warn { border-color: rgb(254 243 199); background: rgb(255 251 235 / .55); }
[data-parties="customers-home"] .ph-kpi-label { font-size: .6rem; font-weight: 900; color: rgb(100 116 139); }
[data-parties="customers-home"] .ph-kpi-value { font-size: .82rem; font-weight: 900; font-variant-numeric: tabular-nums; color: rgb(15 23 42); }
[data-parties="customers-home"] .ph-jump-chips {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
[data-parties="customers-home"] .ph-jump-chip {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    min-width: 5.5rem;
    border: 1px solid rgb(226 232 240);
    border-radius: .85rem;
    background: linear-gradient(180deg, #fff 0%, rgb(248 250 252) 100%);
    padding: .55rem .75rem;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
[data-parties="customers-home"] .ph-jump-chip:hover {
    border-color: rgb(199 210 254);
    box-shadow: 0 4px 14px -8px rgba(79,70,229,.28);
    transform: translateY(-1px);
}
[data-parties="customers-home"] .ph-jump-chip-label { font-size: .68rem; font-weight: 900; color: rgb(71 85 105); }
[data-parties="customers-home"] .ph-jump-chip-value { font-size: .95rem; font-weight: 900; font-variant-numeric: tabular-nums; color: rgb(15 23 42); }
[data-parties="customers-home"] .ph-search-shell {
    border-radius: 1rem;
    border: 1px solid rgba(226,232,240,.92);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    padding: .35rem .45rem;
}
[data-parties="customers-home"] .ph-search-input {
    display: block;
    width: 100%;
    border: 0;
    border-radius: .65rem;
    background: #fff;
    padding: .55rem .65rem;
    font-size: .8125rem;
    font-weight: 700;
    color: rgb(15 23 42);
    box-shadow: 0 1px 5px rgba(15,23,42,.055) inset;
}
[data-parties="customers-home"] .ph-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(199,210,254,.55), 0 8px 26px -14px rgba(79,70,229,.28);
}
[data-parties="customers-home"] .ph-party-card[data-ph-expanded="true"] {
    border-color: rgb(199 210 254 / .75);
    box-shadow: 0 4px 18px -8px rgba(79,70,229,.12);
}
[data-parties="customers-home"] .ph-party-card[data-ph-expanded="true"] [data-ph-party-chevron] {
    transform: rotate(-90deg);
    color: rgb(79 70 229);
}
[data-parties="customers-home"] .ph-peek-line-cell {
    min-width: 0;
    border-radius: .5rem;
    border: 1px solid rgb(226 232 240);
    background: linear-gradient(180deg, #fff 0%, rgb(248 250 252 / .85) 100%);
    padding: .375rem .5rem;
    box-shadow: 0 1px 0 rgba(255,255,255,.92) inset;
}
@media (min-width: 640px) {
    [data-parties="customers-home"] .ph-peek-line-cell { max-width: 42%; flex: 1 1 0; }
    [data-parties="customers-home"] .ph-peek-rail { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: stretch; gap: .375rem; }
}
[data-parties="customers-home"] .ph-peek-line-label {
    font-size: .625rem;
    font-weight: 900;
    line-height: 1.25;
    color: rgb(100 116 139);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[data-parties="customers-home"] .ph-peek-line-value {
    margin-top: .125rem;
    font-size: .8125rem;
    font-weight: 900;
    line-height: 1.35;
    color: rgb(15 23 42);
    text-align: center;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}
[data-parties="customers-home"] .ph-skeleton {
    background: linear-gradient(90deg, rgb(241 245 249) 25%, rgb(226 232 240) 50%, rgb(241 245 249) 75%);
    background-size: 200% 100%;
    animation: ph-skeleton-shimmer 1.2s ease-in-out infinite;
    border-radius: .5rem;
}
[data-parties="customers-home"] .ph-skeleton--inline { display: inline-block; width: 1rem; height: 1rem; border-radius: 9999px; }
[data-parties="customers-home"] .ph-skeleton--cell { min-height: 2.75rem; }
@keyframes ph-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* MOBILE_PRESENCE_W1 — evolve Shell V4 for installed (standalone) mode; no new components */
@media (display-mode: standalone) {
    html {
        overscroll-behavior: none;
    }

    body {
        -webkit-tap-highlight-color: transparent;
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }
}

@media (display-mode: standalone) and (max-width: 1279px) {
    #mainNav .rq-shell-v4-mobile-bar[data-nav="mobile-header-bar"] {
        position: sticky;
        top: 0;
        z-index: 44;
        padding-top: env(safe-area-inset-top, 0px);
        background: #fff;
    }

    #mainNav [data-nav="mobile-action-row"] {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 45;
        margin: 0;
        padding: 0.35rem 0.625rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--rq-shell-border);
        border-radius: 0;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(8px);
        box-shadow: 0 -1px 10px rgba(15, 23, 42, 0.06);
    }

    #mainNav .rq-shell-v4-mobile-surface {
        padding-bottom: 0.25rem;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    body > main.flex-grow {
        padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)) !important;
    }
}

#pwaInstallHelp[hidden] {
    display: none !important;
}

#pwaInstallHelp {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    background: var(--rq-dark-overlay);
}

#pwaInstallHelp .rq-pwa-install-card {
    width: min(100%, 24rem);
    border-radius: 1.25rem;
    border: 1px solid rgb(226 232 240);
    background: #fff;
    padding: 1rem 1.1rem 1.1rem;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    text-align: right;
}

#pwaInstallHelp .rq-pwa-install-title {
    font-size: 1rem;
    font-weight: 900;
    color: rgb(15 23 42);
}

#pwaInstallHelp .rq-pwa-install-steps {
    margin-top: 0.65rem;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.65;
    color: rgb(51 65 85);
}

#pwaInstallHelp .rq-pwa-install-actions {
    margin-top: 0.85rem;
    display: flex;
    justify-content: flex-end;
}

#pwaInstallHelp .rq-pwa-install-close {
    border: 1px solid rgb(226 232 240);
    border-radius: 9999px;
    background: rgb(248 250 252);
    padding: 0.45rem 0.95rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: rgb(51 65 85);
}

/* MOBILE_PRESENCE_W2 — form-draft trust + shell back affordance */
#mainNav [data-nav="shell-context-strip"] {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.rq-shell-back-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--rq-shell-border, rgb(226 232 240));
    border-radius: 0.625rem;
    background: #fff;
    color: var(--rq-shell-text-main, rgb(15 23 42));
    padding: 0;
    cursor: pointer;
}

.rq-shell-back-btn:hover {
    background: rgb(248 250 252);
    border-color: rgb(203 213 225);
}

.rq-shell-back-icon {
    width: 1rem;
    height: 1rem;
}

.rq-shell-back-btn.hidden {
    display: none !important;
}


/* MOBILE_PRESENCE_W3 — smart install nudge after 2nd save */
.rq-pwa-install-nudge {
    position: fixed;
    left: 0.625rem;
    right: 0.625rem;
    z-index: 44;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.85rem;
    border: 1px solid rgb(191 219 254);
    background: rgba(239 246 255 / 0.97);
    color: rgb(30 58 138);
    box-shadow: 0 8px 24px rgba(30 58 138 0.14);
    backdrop-filter: blur(8px);
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
}

.rq-pwa-install-nudge-text {
    flex: 1 1 auto;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.35;
    text-align: right;
}

.rq-pwa-install-nudge-cta {
    flex-shrink: 0;
    border: 1px solid rgb(59 130 246);
    border-radius: 9999px;
    background: rgb(37 99 235);
    color: #fff;
    padding: 0.35rem 0.7rem;
    font-size: 0.6875rem;
    font-weight: 900;
    cursor: pointer;
}

.rq-pwa-install-nudge-dismiss {
    flex-shrink: 0;
    width: 1.65rem;
    height: 1.65rem;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: rgb(71 85 105);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

@media (display-mode: standalone) {
    .rq-pwa-install-nudge {
        bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    }
}


/* MOBILE_PRESENCE_W4 — honest offline banner + brand alignment */
#offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    padding: 0.5rem 0.75rem;
    padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
    background: #375093;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 2px 12px rgba(26, 54, 115, 0.28);
}

#offline-banner.hidden {
    display: none !important;
}

/* MOBILE_PRESENCE_P0 — unified install CTA + smart dialog (Android/iOS/in-app) */
@media (display-mode: standalone) {
    [data-pwa-install-cta],
    [data-pwa-install-cta] [data-nav="pwa-install-trigger"] {
        display: none !important;
    }
}
@media (min-width: 1280px) {
    [data-pwa-install-cta],
    [data-pwa-install-cta] [data-nav="pwa-install-trigger"] {
        display: none !important;
    }
}


.rq-pwa-install-cta--hero {
    width: min(100%, 22rem);
    text-align: center;
}

.rq-pwa-install-cta-eyebrow {
    margin: 0 0 0.65rem;
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--rq-dark-accent-soft);
}

.rq-pwa-install-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 0;
    cursor: pointer;
    font-weight: 900;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.rq-pwa-install-cta-btn--hero {
    width: 100%;
    border-radius: 1.25rem;
    background: rgba(255 255 255 / 0.14);
    border: 1px solid rgba(255 255 255 / 0.22);
    color: #fff;
    padding: 0.85rem 1.25rem;
    font-size: 0.9375rem;
}

.rq-pwa-install-cta-btn--hero:hover {
    background: rgba(255 255 255 / 0.2);
}

.rq-pwa-install-cta-note {
    margin: 0.55rem 0 0;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--rq-dark-text-muted);
    line-height: 1.5;
}

.rq-pwa-install-cta-inline-inner {
    width: min(100%, 24rem);
    text-align: center;
    border-radius: 1.25rem;
    border: 1px solid rgb(226 232 240);
    background: rgb(248 250 252);
    padding: 0.85rem 1rem;
}

.rq-pwa-install-cta-inline-lead {
    margin: 0 0 0.55rem;
    font-size: 0.8125rem;
    font-weight: 800;
    color: rgb(51 65 85);
}

.rq-pwa-install-cta-btn--inline {
    width: 100%;
    border-radius: 9999px;
    background: rgb(37 99 235);
    color: #fff;
    padding: 0.55rem 1rem;
    font-size: 0.8125rem;
}

.rq-pwa-install-cta-btn--inline:hover {
    background: rgb(29 78 216);
}

.rq-pwa-install-cta-btn--compact {
    border-radius: 9999px;
    border: 1px solid rgb(191 219 254);
    background: rgb(239 246 255);
    color: rgb(30 58 138);
    padding: 0.4rem 0.75rem;
    font-size: 0.6875rem;
}

.rq-pwa-install-cta-icon {
    font-size: 0.875rem;
    line-height: 1;
}

#pwaInstallHelp .rq-pwa-install-subtitle {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--rq-text-muted, rgb(71 85 105));
}

#pwaInstallHelp .rq-pwa-install-now {
    border: 0;
    border-radius: 9999px;
    background: rgb(37 99 235);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 900;
    cursor: pointer;
}

#pwaInstallHelp .rq-pwa-install-now:hover {
    background: rgb(29 78 216);
}

#pwaInstallHelp .rq-pwa-install-now.hidden {
    display: none;
}

#pwaInstallHelp .rq-pwa-install-actions {
    gap: 0.5rem;
    align-items: center;
}

.rq-pwa-install-step-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.rq-pwa-install-step {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.rq-pwa-install-step-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: rgb(37 99 235);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
}

.rq-pwa-install-step-text {
    flex: 1 1 auto;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.55;
    color: rgb(51 65 85);
}

.rq-pwa-install-step-icon {
    display: inline-block;
    font-size: 0.875rem;
    vertical-align: middle;
}

.rq-pwa-install-trust,
.rq-pwa-install-note {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.65;
    color: rgb(51 65 85);
}

.rq-pwa-install-note {
    margin-top: 0.65rem;
    color: var(--rq-text-muted, rgb(71 85 105));
    font-size: 0.75rem;
}

/* MOBILE_PRESENCE_W5 — splash psychology: standalone entry + premium welcome */
@media (display-mode: standalone) {
    html.rq-standalone {
        height: 100%;
        height: 100dvh;
        overscroll-behavior-y: none;
    }

    html.rq-standalone body {
        min-height: 100%;
        min-height: 100dvh;
        touch-action: manipulation;
        -webkit-overflow-scrolling: auto;
    }

    html.rq-standalone body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: env(safe-area-inset-top, 0px);
        background: #375093;
        z-index: 100;
        pointer-events: none;
    }

    body.rq-standalone-entry {
        opacity: 0;
    }

    body.rq-standalone-entry.rq-standalone-ready {
        opacity: 1;
        transition: opacity 0.38s ease;
    }
}

@media (display-mode: standalone) and (max-width: 1279px) {
    body > footer {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.rq-standalone-entry,
    body.rq-standalone-entry.rq-standalone-ready {
        opacity: 1 !important;
        transition: none !important;
    }
}

.rq-app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 70;
    max-width: min(22rem, calc(100vw - 1.5rem));
    transform: translateX(-50%) translateY(0.75rem);
    padding: 0.7rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(235, 196, 105, 0.45);
    background: rgba(55, 80, 147, 0.96);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 800;
    line-height: 1.45;
    text-align: center;
    box-shadow: 0 12px 32px rgba(26, 54, 115, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.rq-app-toast.rq-app-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (display-mode: standalone) {
    .rq-app-toast {
        bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .rq-app-toast {
        transition: none;
    }
}

/* MOBILE_PRESENCE_P0R — reinstall + multi-tenant install guidance (per-device localStorage) */
[data-pwa-install-cta][data-pwa-install-mode="reinstall"] .rq-pwa-install-cta-inline-inner,
[data-pwa-install-cta][data-pwa-install-mode="reinstall"] .rq-pwa-install-cta-hero-inner {
    border-color: rgb(191 219 254);
    background: rgb(239 246 255);
}

.rq-pwa-install-multi-tenant {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px dashed rgb(203 213 225);
    color: rgb(71 85 105);
    line-height: 1.55;
}

/* MOBILE_RUNTIME_SURFACE — shell/header coherence on public dark routes */
body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-bg {
    background: var(--rq-dark-chrome-bg);
    border-bottom-color: var(--rq-dark-chrome-border);
    box-shadow: none;
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-v4-mobile-surface {
    border-bottom-color: var(--rq-dark-chrome-border);
    background: transparent;
    box-shadow: none;
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-mobile-action-row {
    background: transparent;
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action--capture:not(.is-active) {
    background: var(--rq-dark-btn-primary);
    border-color: var(--rq-dark-btn-primary);
    color: var(--rq-dark-text-primary);
    box-shadow: none;
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action--capture:not(.is-active) .rq-shell-mobile-cmd-label {
    color: var(--rq-dark-text-primary);
    font-weight: 800;
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-v4-mobile-primary--quad .rq-shell-mobile-action--capture:not(.is-active):hover {
    background: var(--rq-dark-btn-primary-hover);
    border-color: var(--rq-dark-btn-primary-hover);
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-context-section {
    color: var(--rq-dark-text-body);
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-brand--desktop,
body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-v4-nav-launcher {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--rq-dark-chrome-border);
    color: var(--rq-dark-text-primary);
    box-shadow: none;
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-v4-nav-launcher:hover,
body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-brand--desktop:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--rq-dark-chrome-border);
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-v4-icon-btn:hover,
body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-chrome-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--rq-dark-chrome-border);
    color: var(--rq-dark-text-primary);
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-v4-icon-btn,
body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-chrome-btn {
    border-color: var(--rq-dark-chrome-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--rq-dark-text-primary);
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-v4-secondary-btn {
    border-color: var(--rq-dark-chrome-border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--rq-dark-text-body);
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-v4-primary-btn {
    background: var(--rq-dark-btn-primary);
    color: #fff;
}

body:has(main > .min-h-screen.bg-slate-950) .rq-shell-wave1a .rq-shell-mobile-cmd-label {
    color: inherit;
}

.rq-pwa-install-ios-compact {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.65;
    color: var(--rq-text-muted);
}


/* W9-A — shell nav loading affordance */
.rq-nav-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, #375093, #60a5fa, #375093);
    background-size: 200% 100%;
    transition: opacity 0.15s ease;
}

body.rq-nav-loading .rq-nav-loading-bar {
    opacity: 1;
    animation: rq-nav-loading-slide 1.1s linear infinite;
}

body.rq-nav-loading {
    cursor: progress;
}

@keyframes rq-nav-loading-slide {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
