/* 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);
}

/* —— 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: block;
    position: relative;
    min-width: 0;
}

.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;
}

/* Secondary action — outlined twin of rq-btn-primary (was referenced by templates but never defined). */
.rq-btn-secondary {
    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 rgb(203 213 225);
    background: #fff;
    color: rgb(15 23 42);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}

.rq-btn-secondary:hover {
    background: rgb(248 250 252);
    border-color: rgb(148 163 184);
    color: rgb(15 23 42);
}

button.rq-btn-secondary,
input[type="submit"].rq-btn-secondary {
    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: var(--rq-border-subtle);
    --ph-muted: var(--rq-text-muted);
    --ph-ink: var(--rq-text-main);
}
[data-parties="customers-home"] .ph-card {
    border: 1px solid var(--rq-border-subtle);
    border-radius: var(--rq-radius-surface);
    background: var(--rq-bg-surface);
    box-shadow: var(--rq-elev-rest);
}
[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: .75rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--rq-text-muted);
}
[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 var(--rq-border-subtle);
    border-radius: var(--rq-radius-md);
    background: var(--rq-bg-surface);
    padding: .6rem .7rem .55rem;
    text-align: center;
    min-height: 5.5rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: .2rem;
    box-shadow: none;
}
[data-parties="customers-home"] .ph-stat-tile > a {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}
[data-parties="customers-home"] .ph-stat-tile--accent-in {
    border-color: var(--rq-tint-success-border);
    background: var(--rq-tint-success-bg);
}
[data-parties="customers-home"] .ph-stat-tile--accent-out {
    border-color: var(--rq-tint-danger-border);
    background: var(--rq-tint-danger-bg);
}
[data-parties="customers-home"] .ph-stat-tile--accent-warn {
    border-color: var(--rq-tint-warning-border);
    background: var(--rq-tint-warning-bg);
}
[data-parties="customers-home"] .ph-stat-hint {
    margin-top: 0;
    font-size: .6875rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--rq-text-subtle);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
[data-parties="customers-home"] .ph-stat-label {
    font-size: .75rem;
    font-weight: 900;
    line-height: 1.25;
    color: var(--rq-text-muted);
}
[data-parties="customers-home"] .ph-stat-value {
    margin-top: auto;
    padding-top: .35rem;
    font-size: 1.2rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--rq-text-main);
    line-height: 1.1;
    white-space: nowrap;
}
@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: var(--rq-text-main);
}
[data-parties="customers-home"] .ph-empty {
    grid-column: 1 / -1;
    padding: 2rem 1rem;
    text-align: center;
    font-size: .8125rem;
    font-weight: 700;
    color: var(--rq-text-muted);
    border: 1px dashed var(--rq-border-subtle);
    border-radius: var(--rq-radius-md);
    background: var(--rq-bg-muted);
}
[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: var(--rq-radius-md);
    border: 1px solid var(--rq-action-bg);
    background: var(--rq-action-bg);
    padding: .35rem .85rem;
    font-size: .75rem;
    font-weight: 900;
    color: var(--rq-action-text);
    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 var(--rq-border-subtle);
    background: var(--rq-bg-surface);
    padding: .45rem .85rem;
    font-size: .78rem;
    font-weight: 900;
    color: var(--rq-text-main);
    text-decoration: none;
    box-shadow: var(--rq-elev-rest);
    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: var(--rq-border-active);
    box-shadow: var(--rq-elev-raised);
    transform: translateY(-1px);
    color: var(--rq-text-main);
}
[data-parties="customers-home"] .ph-tab-pill--active,
[data-parties="customers-home"] .ph-tab-pill[aria-selected="true"] {
    background: var(--rq-action-bg) !important;
    color: var(--rq-action-text) !important;
    border-color: var(--rq-action-bg) !important;
    box-shadow: var(--rq-elev-float) !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;
}
/* Parties quick sheets (add / edit / archive / employee) — full-screen on phones, centered card on desktop. */
[data-parties="customers-home"] .ph-sheet-backdrop {
    position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,.45);
}
[data-parties="customers-home"] .ph-sheet {
    position: fixed; inset: 0; z-index: 61; display: flex; flex-direction: column;
    background: var(--rq-bg-surface, #fff); overflow-y: auto; overscroll-behavior: contain;
}
[data-parties="customers-home"] .ph-sheet[hidden],
[data-parties="customers-home"] .ph-sheet-backdrop[hidden],
[data-parties="customers-home"] .ph-sheet [hidden] { display: none !important; }
@media (min-width: 640px) {
    [data-parties="customers-home"] .ph-sheet {
        inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%);
        width: min(30rem, calc(100vw - 2rem)); max-height: calc(100vh - 3rem);
        border-radius: var(--rq-radius-surface, 1rem); box-shadow: 0 20px 50px rgba(15,23,42,.25);
    }
}
[data-parties="customers-home"] .ph-sheet-head {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: calc(.75rem + env(safe-area-inset-top, 0px)) 1rem .75rem;
    border-bottom: 1px solid var(--rq-border-subtle, #e2e8f0); background: var(--rq-bg-surface, #fff);
}
[data-parties="customers-home"] .ph-sheet-title { font-size: 1.05rem; font-weight: 900; color: #0f172a; }
[data-parties="customers-home"] .ph-sheet-close {
    min-width: 44px; min-height: 44px; border-radius: 9999px; font-weight: 900; color: #475569;
}
[data-parties="customers-home"] .ph-sheet-body { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; }
[data-parties="customers-home"] .ph-field { display: flex; flex-direction: column; gap: .3rem; font-size: .875rem; font-weight: 800; color: #1e293b; }
[data-parties="customers-home"] .ph-field small { font-weight: 700; color: #64748b; }
[data-parties="customers-home"] .ph-input {
    min-height: 44px; width: 100%; border: 1px solid #cbd5e1; border-radius: .75rem; padding: .5rem .75rem;
    font-size: 1rem; font-weight: 700; background: #fff;
}
[data-parties="customers-home"] .ph-input:focus { outline: 2px solid var(--rq-primary, #2c4470); outline-offset: 1px; }
[data-parties="customers-home"] .ph-check { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 800; }
[data-parties="customers-home"] .ph-check input { width: 1.25rem; height: 1.25rem; }
[data-parties="customers-home"] .ph-sheet-actions {
    position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    margin-top: .25rem; padding: .6rem 0 calc(.35rem + env(safe-area-inset-bottom, 0px));
    background: var(--rq-bg-surface, #fff);
}
[data-parties="customers-home"] .ph-sheet-back {
    display: inline-flex; min-height: 44px; align-items: center; justify-content: center;
    padding: 0 .9rem; border: 0; background: transparent; font-size: .875rem; font-weight: 800; color: #475569;
}
[data-parties="customers-home"] .ph-sheet-error {
    border-radius: .75rem; background: #fef2f2; color: var(--rq-danger, #b91c1c); padding: .5rem .75rem; font-size: .875rem; font-weight: 800;
}
[data-parties="customers-home"] .ph-sheet-dup {
    display: flex; flex-direction: column; gap: .5rem; border-radius: .75rem; background: #fffbeb;
    border: 1px solid #fde68a; padding: .6rem .75rem; font-size: .875rem; font-weight: 800; color: #78350f;
}
[data-parties="customers-home"] .ph-sheet-success { font-size: .95rem; font-weight: 900; color: #065f46; }
[data-parties="customers-home"] .ph-toast {
    position: fixed; inset-inline: 1rem; bottom: 1rem; z-index: 62; margin-inline: auto; max-width: 32rem;
    border-radius: .9rem; background: #0f172a; color: #fff; padding: .75rem 1rem; font-size: .875rem; font-weight: 800;
    box-shadow: 0 10px 30px rgba(15,23,42,.3);
}
[data-parties="customers-home"] .ph-toast[hidden] { display: none; }
[data-parties="customers-home"] .ph-card-flash { animation: ph-card-flash 1.6s ease-out 1; }
@keyframes ph-card-flash { from { box-shadow: 0 0 0 3px rgba(44,68,112,.45); } to { box-shadow: var(--rq-elev-rest); } }
@media (prefers-reduced-motion: reduce) { [data-parties="customers-home"] .ph-card-flash { animation: none; } }
/* Card actions — one clear primary (rq-btn-primary) + calm 44px secondaries. */
/* «نراجع آخر وضع معروف…» showed forever: a flex class beat the hidden attribute. */
[data-parties="customers-home"] .ph-peek-loading { display: flex; }
[data-parties="customers-home"] .ph-peek-loading[hidden] { display: none; }
/* Calm card (v3): name · one quiet status line · key number · one primary when money is due · «المزيد». */
[data-parties="customers-home"] .ph-party-card { display: flex; flex-direction: column; }
[data-parties="customers-home"] .ph-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
    gap: .35rem .4rem;
    width: 100%;
    padding: .6rem .7rem;
}
[data-parties="customers-home"] .ph-card-head > button {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}
[data-parties="customers-home"] .ph-card-head > .ph-menu {
    grid-column: 2;
    grid-row: 1;
    width: 44px;
    justify-self: end;
}
[data-parties="customers-home"] .ph-card-head [data-ph-party-toggle] { cursor: pointer; padding-top: .125rem; }
[data-parties="customers-home"] .ph-card-name {
    min-width: 0; font-size: .9375rem; line-height: 1.4; font-weight: 900; color: rgb(15 23 42);
    overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
[data-parties="customers-home"] .ph-card-status {
    margin-top: .15rem; display: block; font-size: .75rem; line-height: 1.35; font-weight: 700; color: rgb(100 116 139);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-parties="customers-home"] .ph-card-status--due { color: rgb(159 18 57); }
[data-parties="customers-home"] .ph-card-amount { flex-shrink: 1; min-width: 0; display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: .15rem .35rem; text-align: start; }
[data-parties="customers-home"] .ph-card-amount-label {
    max-width: 9.5rem; font-size: .75rem; font-weight: 700; color: rgb(100 116 139);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-parties="customers-home"] .ph-card-amount-value { font-size: 1.05rem; line-height: 1.2; font-weight: 900; color: rgb(15 23 42); font-variant-numeric: tabular-nums; white-space: nowrap; }
[data-parties="customers-home"] .ph-card-amount-note {
    flex-basis: 100%; font-size: .6875rem; font-weight: 700; color: rgb(100 116 139);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-parties="customers-home"] .ph-card-actions {
    margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    border-top: 1px solid rgb(241 245 249); padding: .5rem 1rem .75rem;
}
[data-parties="customers-home"] .ph-card-actions:not(:has(a, button)) { display: none; }
/* One button family: navy pill primary + white pill secondary, same 44px height. */
[data-parties="customers-home"] .ph-act-primary { min-height: 44px; padding-inline: 1.25rem; font-size: .875rem; font-weight: 900; }
[data-parties="customers-home"] .ph-act {
    display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: .375rem;
    border-radius: 9999px; border: 1px solid rgb(226 232 240); background: #fff;
    padding: 0 1rem; font-size: .875rem; font-weight: 800; color: rgb(30 41 59); text-decoration: none; cursor: pointer;
    transition: background-color var(--rq-duration-fast, .16s) ease, border-color var(--rq-duration-fast, .16s) ease;
}
[data-parties="customers-home"] .ph-act:hover { background: rgb(248 250 252); border-color: rgb(148 163 184); }
/* «⋯» sits in the same header corner on every card; its list drops under it. */
[data-parties="customers-home"] .ph-menu { position: relative; flex-shrink: 0; }
[data-parties="customers-home"] .ph-menu-btn { list-style: none; width: 44px; padding: 0; font-size: 1.125rem; }
[data-parties="customers-home"] .ph-menu-btn::-webkit-details-marker { display: none; }
[data-parties="customers-home"] .ph-menu[open] .ph-menu-btn { background: var(--rq-shell-surface-muted, rgb(241 245 249)); }
[data-parties="customers-home"] .ph-menu-list {
    position: absolute; inset-inline-end: 0; top: calc(100% + .25rem); z-index: 30; min-width: 13rem;
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid var(--rq-border-subtle); border-radius: var(--rq-radius-md, 12px); background: var(--rq-bg-surface, #fff);
    box-shadow: var(--rq-elev-float);
}
/* Breakdown tiles: only non-zero ones, filling the row evenly. */
[data-parties="customers-home"] .ph-stat-grid--clients { display: flex; }
[data-parties="customers-home"] .ph-stat-grid--clients > .ph-stat-tile { flex: 1 1 0; min-width: 0; }
[data-parties="customers-home"] .ph-stat-grid--clients[hidden] { display: none; }
[data-parties="customers-home"] .ph-menu-item {
    display: flex; min-height: 44px; width: 100%; align-items: center; padding: 0 1rem;
    font-size: .875rem; font-weight: 800; color: rgb(30 41 59); text-decoration: none; text-align: right; background: none; cursor: pointer;
}
[data-parties="customers-home"] .ph-menu-item + .ph-menu-item { border-top: 1px solid rgb(241 245 249); }
[data-parties="customers-home"] .ph-menu-item:hover, [data-parties="customers-home"] .ph-menu-item:focus-visible { background: rgb(248 250 252); }
[data-parties="customers-home"] .ph-menu-item--warn { color: rgb(146 64 14); }
[data-parties="customers-home"] .ph-menu-item--danger { color: rgb(159 18 57); }
/* Quieter page chrome. Focus/all segment never wraps its labels. */
[data-parties="customers-home"] .rq-shell-mobile-nav-segment .ph-tab-pill { white-space: nowrap; }
[data-parties="customers-home"] [data-customers="summary-strip"]:has(+ [data-ph-rel-chips]) { display: none; }
/* Payroll hint only on the employees tab — it was sitting on every tab. */
[data-parties="customers-home"][data-ph-js]:not([data-ph-active-tab="employees"]) [data-testid="customers-home-employee-payroll-hint"] { display: none; }
@media (max-width: 639px) {
    /* Phone: one add, the sticky bar for the open tab. The four header buttons are the desktop row. */
    [data-parties="customers-home"][data-ph-js] [data-testid="customers-home-create-actions"] { display: none; }
}
/* New / just-saved card stays marked a few seconds so the eye finds it. */
[data-parties="customers-home"] .ph-card-new { outline: 2px solid rgba(4,120,87,.55); outline-offset: 2px; }
[data-parties="customers-home"] .ph-new-badge { display: inline-flex; align-items: center; border-radius: 9999px; background: rgb(209 250 229); color: rgb(6 95 70); padding: 0 .5rem; font-size: .75rem; font-weight: 900; }
[data-parties="customers-home"] .ph-skeleton-card { height: 6.5rem; border-radius: var(--rq-radius-lg, 1rem); }
[data-parties="customers-home"] .ph-sheet-success-icon {
    display: inline-flex; width: 2.75rem; height: 2.75rem; align-items: center; justify-content: center; border-radius: 9999px;
    background: rgb(209 250 229); color: rgb(4 120 87); font-size: 1.35rem; font-weight: 900;
}
/* Phone: the add for the open tab stays under the thumb. */
[data-parties="customers-home"] .ph-sticky-add { display: none; }
@media (max-width: 639px) {
    [data-parties="customers-home"] .ph-sticky-add:not([hidden]) {
        /* Bottom action bar pinned to the safe area; the page reserves its height. */
        position: fixed; inset-inline: 0; bottom: 0; z-index: 40; display: flex;
        padding: .5rem 1rem calc(.5rem + env(safe-area-inset-bottom, 0px));
        background: var(--rq-bg-surface, #fff); border-top: 1px solid var(--rq-border-subtle);
    }
    [data-parties="customers-home"] .ph-sticky-add .rq-btn-primary { width: 100%; min-height: 48px; font-size: .9375rem; }
    [data-parties="customers-home"] { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
    html.ph-sheet-open [data-parties="customers-home"] .ph-sticky-add,
    [data-parties="customers-home"]:has([data-ph-card-menu][open]) .ph-sticky-add { display: none; }
    [data-parties="customers-home"] .ph-toast { bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px)); }
}
[data-parties="customers-home"] [data-ph-lazy-section][aria-busy="true"] [data-ph-card-list] { opacity: .55; transition: opacity .16s ease; }
html.ph-sheet-open { overflow: hidden; }
[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: var(--rq-tint-success-border); background: var(--rq-tint-success-bg); }
[data-parties="customers-home"] .ph-kpi-chip--out { border-color: var(--rq-tint-danger-border); background: var(--rq-tint-danger-bg); }
[data-parties="customers-home"] .ph-kpi-chip--warn { border-color: var(--rq-tint-warning-border); background: var(--rq-tint-warning-bg); }
[data-parties="customers-home"] .ph-kpi-label { font-size: .6rem; font-weight: 900; color: var(--rq-text-muted); }
[data-parties="customers-home"] .ph-kpi-value { font-size: .82rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--rq-text-main); }
[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 var(--rq-border-subtle);
    border-radius: var(--rq-radius-md);
    background: var(--rq-bg-surface);
    padding: .55rem .75rem;
    color: var(--rq-text-main);
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
[data-parties="customers-home"] .ph-jump-chip:hover {
    border-color: var(--rq-border-active);
    box-shadow: var(--rq-elev-raised);
    transform: translateY(-1px);
    color: var(--rq-text-main);
}
[data-parties="customers-home"] .ph-jump-chip-label { font-size: .75rem; 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: 1px solid var(--rq-border-field);
    border-radius: var(--rq-radius-field);
    background: var(--rq-bg-elevated);
    padding: .55rem .65rem;
    font-size: .8125rem;
    font-weight: 700;
    color: var(--rq-text-main);
    box-shadow: none;
}
[data-parties="customers-home"] .ph-search-input:focus {
    outline: none;
    border-color: var(--rq-border-active);
    box-shadow: var(--rq-focus-ring, 0 0 0 3px var(--rq-border-active));
}
[data-parties="customers-home"] .ph-party-card[data-ph-expanded="true"] {
    border-color: var(--rq-border-active);
    box-shadow: var(--rq-elev-raised);
}
[data-parties="customers-home"] .ph-party-card[data-ph-expanded="true"] [data-ph-party-chevron] {
    transform: rotate(-90deg);
    color: var(--rq-text-main);
}
[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 {
        position: sticky !important;
        top: 0;
        z-index: 46;
        background: #fff;
    }

    #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 {
        min-height: 100%;
        min-height: 100dvh;
        height: auto;
        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;
}


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


/* PAYROLL-UX-E2E-20260802: sticky/nav must not cover primary actions */
html {
    scroll-padding-top: 6rem;
    scroll-padding-bottom: 6.5rem;
}
@media (min-width: 1280px) {
    html {
        scroll-padding-top: 5.5rem;
    }
}
/* Mobile browser (not only PWA standalone): keep bottom CTAs clear of action row */
@media (max-width: 1279px) {
    body > main.flex-grow {
        padding-bottom: max(6rem, calc(5.25rem + env(safe-area-inset-bottom, 0px)));
    }
}
#payroll-actions {
    scroll-margin-bottom: 6rem;
    scroll-margin-top: 5.5rem;
}

/* RAQEEM_SHELL_VV_SOURCE_V1 — phone overlays share --rq-vv-height from base_core.js */
@media (max-width: 1279px) {
    #mobileMenu.rq-shell-drawer-panel {
        top: var(--rq-vv-offset-top, 0px);
        bottom: auto;
        height: var(--rq-vv-height, 100dvh);
        max-height: var(--rq-vv-height, 100dvh);
    }

    #quickDrawer {
        max-height: calc(var(--rq-vv-height, 100dvh) - 0.75rem);
    }
}

@media (pointer: coarse), (display-mode: standalone) {
    #mobileMenuOverlay.rq-shell-drawer-overlay,
    #quick-peek-scrim.rq-shell-peek-scrim,
    #quickDrawerOverlay,
    #pwaInstallHelp {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* PHONE_START_WORK_V1 — company name in the phone bar; new-work menu stays on screen. */
@media (max-width: 1279px) {
    #mainNav .rq-shell-desktop-bar {
        display: none !important;
    }

    #mainNav .rq-shell-mobile-tenant {
        display: block;
        max-width: 6.75rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.6875rem;
        font-weight: 800;
        line-height: 1.15;
        color: var(--rq-shell-text-main, #0f172a);
    }

    #mainNav .rq-shell-v4-drawer-head {
        padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    }

    .rq-ref-primary-actions,
    .rq-ref-primary-actions [data-start-work="root"] {
        overflow: visible;
        position: relative;
        z-index: 6;
    }

    #mainNav [data-nav="mobile-action-row"] .rq-shell-mobile-cmd-label {
        font-size: 0.625rem;
        line-height: 1.15;
        max-height: 2.4em;
        overflow: hidden;
    }

    /* The menu belongs to the full row, not the narrow pill, so it stays on screen. */
    #mainNav [data-nav="mobile-action-row"] {
        position: relative;
        overflow: visible;
    }

    #mainNav [data-nav="mobile-action-row"] > [data-start-work="root"] {
        position: static;
    }

    #mainNav [data-nav="mobile-action-row"] [data-start-work-menu] {
        position: absolute;
        top: calc(100% + 0.35rem);
        right: auto;
        bottom: auto;
        left: 50%;
        width: min(18rem, calc(100vw - 1.5rem));
        margin: 0;
        transform: translateX(-50%);
        z-index: 80;
    }
}

@media (display-mode: standalone) and (max-width: 1279px) {
    #mainNav [data-nav="mobile-action-row"] {
        position: fixed;
        overflow: visible;
    }

    #mainNav [data-nav="mobile-action-row"] [data-start-work-menu] {
        top: auto;
        bottom: calc(100% + 0.45rem);
    }
}


/* PHONE_VISUAL_R1 — one phone header, readable type, fields that iOS will not zoom. */
@media (max-width: 1279px) {
    #mainNav .rq-shell-mobile-shell {
        position: sticky;
        top: 0;
        z-index: 46;
        background: #fff;
    }

    #mainNav [data-nav="mobile-action-row"] {
        position: static !important;
        bottom: auto;
        left: auto;
        right: auto;
    }

    #mainNav .rq-shell-v4-mobile-bar,
    #mainNav .rq-shell-back-btn,
    #mainNav [data-nav="mobile-menu-open"],
    #mainNav button[aria-label="فتح التنقل"] {
        min-height: 44px;
    }

    #mainNav .rq-shell-back-btn,
    #mainNav button[aria-label="فتح التنقل"] {
        min-width: 44px;
    }

    #mainNav [data-nav="mobile-action-row"] .rq-shell-v4-primary-btn,
    #mainNav [data-nav="mobile-action-row"] .rq-shell-header-action-btn,
    #mainNav [data-nav="mobile-action-row"] .rq-shell-mobile-action {
        min-height: 44px !important;
        height: auto;
        font-size: 13px !important;
    }

    #mainNav [data-nav="mobile-action-row"] .rq-shell-mobile-cmd-label {
        font-size: 13px !important;
        line-height: 1.2;
        max-height: none;
        overflow: visible;
    }

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

    #mobileMenu button,
    #mobileMenu .mobile-link,
    .rq-shell-drawer-nav .mobile-link {
        min-height: 44px;
        font-size: 14px;
    }

    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="file"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    #qlAmount {
        font-size: 1.875rem !important;
    }

    .text-\[8px\],
    .text-\[9px\],
    .text-\[10px\],
    .text-\[11px\] {
        font-size: 12px !important;
    }

    .ph-tab-bar {
        position: static;
        overflow: visible;
    }

    .ph-tab-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .ph-tab-pill {
        min-height: 44px;
        font-size: 13px;
        line-height: 1.2;
        white-space: normal;
        text-align: center;
        overflow: visible;
    }

    #qlSave {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 40;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    body:has(#qlSave) { padding-bottom: 4.5rem; }

    .rq-ref-money-value {
        direction: ltr;
        unicode-bidi: isolate;
        display: inline-block;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .ph-tab-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 360px) {
    #mainNav .rq-shell-v4-mobile-surface {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

    #mainNav .rq-shell-context-section {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 7.5rem;
    }

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

@media (min-width: 1024px) {
    [data-qc="primary-modes"] {
        grid-template-columns: repeat(4, minmax(160px, 1fr)) !important;
    }
}

@media (display-mode: standalone) and (max-width: 1279px) {
    #mainNav [data-nav="mobile-action-row"] {
        position: static !important;
    }

    #mainNav [data-nav="mobile-action-row"] [data-start-work-menu] {
        top: calc(100% + 0.35rem);
        bottom: auto;
    }
}

/* PHONE_VISUAL_R1 measured fixes — specificity above the parties pills and the 11px chrome. */
@media (max-width: 1279px) {
    #mainNav {
        position: sticky !important;
        top: 0;
        z-index: 46;
        background: #fff;
    }
    #mainNav .rq-shell-v4-mobile-surface {
        padding-top: 0.2rem !important;
        padding-bottom: 0.2rem !important;
    }
    #mainNav .rq-shell-mobile-tenant { font-size: 12px !important; }
    #mainNav [data-nav="mobile-action-row"] .rq-shell-v4-primary-btn,
    #mainNav [data-nav="mobile-action-row"] .rq-shell-header-action-btn,
    #mainNav [data-nav="mobile-action-row"] .rq-shell-mobile-action {
        max-height: 48px;
        padding-top: 2px !important;
        padding-bottom: 2px !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        overflow: hidden;
    }
    #mainNav [data-nav="mobile-action-row"] .rq-shell-mobile-cmd-label {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        word-break: normal;
        overflow-wrap: break-word;
    }
    #mainNav [data-nav="mobile-action-row"] .rq-shell-mobile-action-slot .rq-shell-header-action-btn {
        width: 100% !important;
        min-height: 44px !important;
    }
    .rq-shell-drawer-close {
        min-width: 44px !important;
        min-height: 44px !important;
        width: 44px !important;
    }
    [data-parties="customers-home"] .ph-tab-pill {
        min-height: 44px !important;
        font-size: 13px !important;
        flex-shrink: 1;
    }
    [data-parties="customers-home"] .ph-tab-badge { font-size: 12px !important; }
    .rq-zone-pathways > summary { font-size: 13px !important; }
}

/* PHONE_VISUAL_R1 field and text floor at every width, including desktop. */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="file"]),
select,
textarea {
    font-size: 16px !important;
}
#qlAmount { font-size: 1.875rem !important; }
.text-\[8px\],
.text-\[9px\],
.text-\[10px\],
.text-\[11px\] {
    font-size: 12px !important;
}

@media (max-width: 1279px) {
    [data-parties="customers-home"] .ph-jump-chips {
        flex-wrap: wrap;
        overflow: visible;
    }
    [data-parties="customers-home"] .ph-jump-chip {
        flex: 1 1 30%;
        min-width: 0;
    }
}

/* PHONE_VISUAL_R1 chrome tap floor: header, tabs, save, mode row. */
#mainNav a,
#mainNav button,
.ph-tab-pill,
#qlSave,
#qlModeCollapsed,
.rq-shell-drawer-close,
[data-qc="primary-modes"] button {
    min-height: 44px !important;
}
#mainNav a,
#mainNav button,
#qlModeCollapsed,
.rq-shell-drawer-close {
    min-width: 44px !important;
}


/* PHONE-VISUAL-R2 N5: desktop and wide-phone header labels stay readable and unclipped. */
@media (min-width: 1024px) {
  .rq-shell-desktop-bar,
  .rq-shell-desktop-actions {
    flex-wrap: wrap;
    overflow: visible;
    height: auto;
  }
  .rq-shell-header-action-btn,
  .rq-shell-subscription-badge {
    font-size: 13px;
    flex-shrink: 0;
    width: auto;
    min-width: max-content;
    max-width: none;
    white-space: nowrap;
    overflow: visible;
  }
  #mainNav [data-nav="mobile-action-row"] .rq-shell-mobile-action-slot .rq-shell-header-action-btn {
    width: auto !important;
    min-width: max-content;
    font-size: 13px;
  }
}

/* PHONE_VISUAL_R3 — unit page tap targets; tenant routes minimum readable type. */
@media (max-width: 1279px) {
    [data-unit-page] [data-unit-detail-action],
    [data-unit-page] .rq-btn-primary,
    [data-unit-page] .rq-btn-secondary {
        min-height: 44px !important;
        font-size: 13px !important;
    }
    [data-unit-page] details[data-unit-detail="contractor-obligations"]:not([open]) {
        margin-bottom: 1rem;
    }
    [data-unit-detail="headline-metrics"] .text-3xl {
        font-size: 1.5rem !important;
        line-height: 1.2;
    }
    body[data-path-prefix="/documents/"] main .text-\[9px\],
    body[data-path-prefix="/documents/"] main .text-\[10px\],
    body[data-path-prefix="/documents/"] main .text-\[11px\],
    body[data-path-prefix="/parties/"] main .text-\[9px\],
    body[data-path-prefix="/parties/"] main .text-\[10px\],
    body[data-path-prefix="/parties/"] main .text-\[11px\],
    body[data-path-prefix="/smart-inquiries/"] main .text-\[9px\],
    body[data-path-prefix="/smart-inquiries/"] main .text-\[10px\],
    body[data-path-prefix="/smart-inquiries/"] main .text-\[11px\],
    body[data-path-prefix="/subscriptions/"] main .text-\[9px\],
    body[data-path-prefix="/subscriptions/"] main .text-\[10px\],
    body[data-path-prefix="/subscriptions/"] main .text-\[11px\],
    body[data-path-prefix="/workspace/tasks/"] main .text-\[9px\],
    body[data-path-prefix="/workspace/tasks/"] main .text-\[10px\],
    body[data-path-prefix="/workspace/tasks/"] main .text-\[11px\] {
        font-size: 12px !important;
    }

    body[data-path-prefix="/documents/"] main [class*="text-["],
    body[data-path-prefix="/parties/"] main [class*="text-["],
    body[data-path-prefix="/smart-inquiries/"] main [class*="text-["],
    body[data-path-prefix="/subscriptions/"] main [class*="text-["],
    body[data-path-prefix="/workspace/tasks/"] main [class*="text-["] {
        font-size: 12px !important;
    }
    body[data-path-prefix="/documents/"] main :where(p, span, li, td, th, label, a, button, div, summary),
    body[data-path-prefix="/parties/"] main :where(p, span, li, td, th, label, a, button, div, summary),
    body[data-path-prefix="/smart-inquiries/"] main :where(p, span, li, td, th, label, a, button, div, summary),
    body[data-path-prefix="/subscriptions/"] main :where(p, span, li, td, th, label, a, button, div, summary),
    body[data-path-prefix="/workspace/tasks/"] main :where(p, span, li, td, th, label, a, button, div, summary) {
        font-size: max(12px, 1em) !important;
    }

}

/* subcontract list — phone density (was inline on subcontract_list.html) */
.subs-shell .metric-label { font-size: 12px; line-height: 1.2; }
@media (max-width: 420px) {
  .subs-shell,
  .subs-shell .sf-card,
  .subs-shell .list-grid { max-width: 100%; min-width: 0; }
  .subs-shell > .rq-surface { flex-wrap: wrap; align-items: center; padding: .3rem .45rem; max-width: 100%; }
  .subs-shell > .rq-surface > .min-w-0 { flex: 1; }
  .subs-shell h1 { font-size: 16px; line-height: 1.2; }
  .subs-shell .sf-intro,
  .subs-shell .section-title { display: none; }
  .subs-shell .smart-focus-bar { margin: 0 0 .15rem; }
  .subs-shell .smart-focus-bar > * + * { margin-top: 2px !important; }
  .subs-shell .smart-focus-bar p { font-size: 12px; line-height: 1.2; margin: 0; }
  .subs-shell a,
  .subs-shell button,
  .subs-shell input,
  .subs-shell select { min-height: 40px; min-width: 40px; }
  .subs-shell .list-grid { gap: .25rem; }
  .subs-shell .sf-card { padding: .25rem .4rem; border-radius: .7rem; }
  .subs-shell .sf-card .metric-label,
  .subs-shell .sf-card .metric-value,
  .subs-shell .sf-card .text-xs { font-size: 12px; line-height: 1.15; }
  .subs-shell .sf-card .metric-label {
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .subs-shell .sf-card .action-btn,
  .subs-shell .sf-card [data-testid="subcontract-open-units"],
  .subs-shell summary { min-height: 44px; min-width: 44px; padding: .2rem .45rem; }
  .subs-shell .rq-surface--metric { padding: 0 .15rem; }
}

.subs-shell .sf-open-units {
  display: inline-flex;
  min-height: 40px;
  flex-shrink: 0;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
  color: #334155;
}

/* Parties calm pass — same tokens, tighter phone chrome. No new color system. */
[data-parties="customers-home"] .ph-headline {
    margin-top: .25rem;
    font-size: .8125rem;
    line-height: 1.45;
    font-weight: 800;
    color: rgb(71 85 105);
    text-wrap: pretty;
}
[data-parties="customers-home"] .ph-card-note {
    margin-top: .1rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .75rem;
    line-height: 1.35;
    font-weight: 700;
    color: rgb(100 116 139);
}
[data-parties="customers-home"] .ph-card-side {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    max-width: none;
}
[data-parties="customers-home"] .ph-card-side .ph-act,
[data-parties="customers-home"] .ph-card-side .rq-btn-primary {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 44px;
    padding-inline: .85rem;
    font-size: .8125rem;
}
[data-parties="customers-home"] .ph-card-amount--due .ph-card-amount-value { color: rgb(159 18 57); }
[data-parties="customers-home"] .ph-card-side:not(:has(.ph-card-amount, a, button)) { display: none; }
[data-parties="customers-home"] .ph-menu { align-self: flex-start; }
[data-parties="customers-home"] .ph-menu-btn { color: rgb(30 41 59); background: rgb(248 250 252); }
[data-parties="customers-home"][data-ph-js] [data-ph-search-form] button[type="submit"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
[data-parties="customers-home"] [data-ph-search-form] { position: relative; }
[data-parties="customers-home"] [data-ph-rel-chips] { display: flex; flex-wrap: wrap; gap: .35rem; }
[data-parties="customers-home"] [data-ph-rel-chips] > .ph-tab-pill {
    flex: 1 1 4.25rem;
    min-width: 0;
    justify-content: center;
    padding-inline: .35rem;
}
@media (max-width: 639px) {
    [data-parties="customers-home"] .ph-tab-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: .25rem;
    }
    [data-parties="customers-home"] .ph-tab-bar .ph-tab-pill {
        width: 100%;
        min-width: 0;
        flex-shrink: 1;
        min-height: 52px;
        padding: 4px 2px;
        font-size: 11px;
        line-height: 1.15;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;
        box-shadow: none;
        transform: none;
    }
    [data-parties="customers-home"] [data-ph-focus-bar] {
        flex-direction: column;
        align-items: stretch;
    }
    [data-parties="customers-home"] [data-ph-focus-bar] > .flex {
        flex: 0 0 auto;
        flex-wrap: wrap;
        width: 100%;
    }
    [data-parties="customers-home"] [data-ph-search-form] input {
        height: auto;
    }
    [data-parties="customers-home"] .ph-focus-count--order {
        flex: 1 0 100%;
        order: 2;
        white-space: nowrap;
    }
    /* One row of relationship filters so the first card's action stays above the add bar. */
    [data-parties="customers-home"] [data-ph-rel-chips] {
        flex-wrap: nowrap;
        gap: .15rem;
    }
    [data-parties="customers-home"] [data-ph-rel-chips] > .ph-tab-pill {
        flex: 1 1 auto;
        min-width: 0;
        padding-inline: .28rem;
        font-size: 11px;
        gap: .12rem;
    }
    [data-parties="customers-home"] [data-ph-rel-chips] .ph-tab-badge {
        min-width: 0;
        padding-inline: .15rem;
        font-size: 10px;
    }
}
