.shell--imperial-clean {
    --shell-bg: #eef2ed;
    --shell-emerald-950: #173c31;
    --shell-emerald-900: #1f4b3f;
    --shell-emerald-800: #2c6a57;
    --shell-cream-50: #f9f7f1;
    --shell-cream-100: #f2ece0;
    --shell-gold-300: #d9c08d;
    --shell-gold-500: #ad8f56;
    --shell-slate-500: #5f7684;
    --shell-sky-50: #eef6fb;
    --shell-sky-100: #dceaf4;
    --shell-sky-300: #b7d0e0;
    --shell-shadow: 0 14px 34px rgba(11, 34, 27, 0.14);
    --shell-bottom-gap: max(18px, calc(env(safe-area-inset-bottom) + 10px));
    --shell-header-height: 92px;
    --shell-font-ui: 'IBM Plex Sans Arabic', 'IBM Plex Sans', 'SF Pro Arabic', 'SF Arabic', 'Geeza Pro', 'Tahoma', 'Arial', sans-serif;
}

.shell--imperial-clean .map-container {
    top: var(--shell-header-height);
    background: transparent;
}

.shell--imperial-clean .map-container::after {
    display: none !important;
}

.shell--imperial-clean .leaflet-container,
.shell--imperial-clean .leaflet-pane,
.shell--imperial-clean .leaflet-tile-pane {
    background: transparent !important;
}

.shell--imperial-clean .app-header {
    position: relative;
    min-height: var(--shell-header-height);
    padding: calc(10px + env(safe-area-inset-top)) 18px 12px;
    border: 0;
    border-radius: 0 0 24px 24px;
    background: linear-gradient(180deg, rgba(26, 72, 58, 0.98), rgba(37, 95, 76, 0.96));
    box-shadow:
        0 12px 28px rgba(10, 29, 23, 0.14),
        inset 0 -1px 0 rgba(255, 248, 231, 0.06);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
}

.shell--imperial-clean .app-header::before {
    content: "";
    position: absolute;
    inset: auto 18px 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(217, 192, 141, 0.36), transparent);
    pointer-events: none;
}

.shell--imperial-clean .app-header::after {
    display: none;
}

.shell--imperial-clean .app-header .logo {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
}

.shell--imperial-clean .app-header .logo-icon {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top));
    left: 18px;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: rgba(249, 247, 241, 0.08);
    color: var(--shell-cream-50);
    box-shadow:
        inset 0 0 0 1px rgba(249, 247, 241, 0.08),
        0 6px 14px rgba(8, 25, 19, 0.1);
}

.shell--imperial-clean .app-header .logo-icon svg {
    width: 42px;
    height: 42px;
}

.shell--imperial-clean .logo-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    width: min(56ch, calc(100% - 156px));
    align-items: center;
    text-align: center;
    margin: 0 auto;
}

.shell--imperial-clean .title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.shell--imperial-clean .app-header .logo-text h1 {
    font-family: var(--shell-font-ui);
    font-size: clamp(2.05rem, 2.6vw, 2.7rem);
    font-weight: 700;
    line-height: 1.06;
    color: var(--shell-cream-50);
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.shell--imperial-clean .app-header .tagline {
    max-width: min(54ch, 100%);
    color: rgba(249, 247, 241, 0.78);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.34;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-wrap: pretty;
}

.shell--imperial-clean .report-chip {
    padding: 0.16rem 0.58rem;
    border-radius: 999px;
    border: 1px solid rgba(217, 192, 141, 0.18);
    background: rgba(217, 192, 141, 0.05);
    color: rgba(234, 216, 176, 0.9);
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1;
    opacity: 0.9;
}

.shell--imperial-clean .app-header .btn-icon {
    position: absolute;
    top: calc(11px + env(safe-area-inset-top));
    left: 74px;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(217, 192, 141, 0.14);
    background: linear-gradient(180deg, rgba(248, 244, 236, 0.96), rgba(240, 233, 220, 0.92));
    color: var(--shell-emerald-950);
    box-shadow:
        0 7px 14px rgba(8, 25, 19, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.shell--imperial-clean #statsBtn::after {
    inset: 6px;
    border-radius: 10px;
    border-color: rgba(217, 192, 141, 0.12);
}

.shell--imperial-clean #locationControls,
.shell--imperial-clean .location-controls {
    position: fixed;
    top: calc(var(--shell-header-height) + 14px);
    right: 16px;
    left: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    display: grid;
    gap: 8px;
    padding: 8px;
    border-radius: 20px;
    background: rgba(249, 247, 241, 0.84);
    border: 1px solid rgba(217, 192, 141, 0.1);
    box-shadow:
        0 12px 26px rgba(10, 29, 23, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    z-index: 170;
    pointer-events: auto;
}

.shell--imperial-clean #locationControls > .location-action,
.shell--imperial-clean .location-controls .location-action {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.shell--imperial-clean #locationControls > .location-action .location-label,
.shell--imperial-clean .location-controls .location-label {
    display: none;
}

.shell--imperial-clean #locationControls > .location-action > .location-btn,
.shell--imperial-clean .location-btn {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    border: 1px solid rgba(23, 60, 49, 0.07);
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(245, 240, 232, 0.96));
    color: var(--shell-emerald-950);
    box-shadow:
        0 8px 18px rgba(10, 29, 23, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.shell--imperial-clean .location-btn:hover {
    transform: translateY(-1px);
}

.shell--imperial-clean .action-dock {
    position: fixed;
    left: 18px;
    bottom: calc(var(--shell-bottom-gap) + 16px);
    display: grid;
    gap: 10px;
    z-index: 180;
    width: 126px;
}

.shell--imperial-clean .action-card {
    width: 126px;
    min-height: 58px;
    padding: 8px 10px 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    border-radius: 22px;
    box-shadow: var(--shell-shadow);
    direction: rtl;
    overflow: hidden;
}

.shell--imperial-clean .action-dock > .action-card,
.shell--imperial-clean #gpsLocationBtn,
.shell--imperial-clean #reportBtn {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    margin: 0 !important;
}

.shell--imperial-clean .action-card__icon,
.shell--imperial-clean .action-card .fab-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.84);
}

.shell--imperial-clean .action-card__label,
.shell--imperial-clean .action-card .fab-text {
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1.15;
}

.shell--imperial-clean .action-card--gps {
    background: linear-gradient(180deg, var(--shell-sky-50), var(--shell-sky-100));
    color: #23506f;
    border: 1px solid rgba(93, 135, 170, 0.14);
}

.shell--imperial-clean .action-card--gps .action-card__icon {
    color: #23506f;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(93, 135, 170, 0.12);
}

.shell--imperial-clean .action-card--report {
    background: linear-gradient(180deg, rgba(23, 60, 49, 0.98), rgba(34, 82, 68, 0.96));
    color: var(--shell-cream-50);
    border: 1px solid rgba(217, 192, 141, 0.12);
    box-shadow:
        0 18px 36px rgba(10, 29, 23, 0.18),
        inset 0 1px 0 rgba(255, 248, 231, 0.06);
}

.shell--imperial-clean #reportBtn {
    justify-content: space-between;
    padding: 8px 10px 8px 12px;
}

.shell--imperial-clean .action-card--report .fab-icon {
    background: rgba(249, 247, 241, 0.12);
    color: inherit;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 1.35rem;
    line-height: 1;
}

.shell--imperial-clean .action-card--report.selecting {
    background: linear-gradient(180deg, rgba(173, 143, 86, 0.98), rgba(150, 120, 66, 0.96));
    color: #fffaf0;
}

.shell--imperial-clean .action-card--report.selecting .fab-icon {
    background: rgba(255, 250, 240, 0.18);
}

.shell--imperial-clean .action-card:hover {
    transform: translateY(-1px);
}

.shell--imperial-clean .leaflet-control-zoom,
.shell--imperial-clean .leaflet-control-attribution {
    background: rgba(249, 247, 241, 0.88) !important;
    border: 1px solid rgba(217, 192, 141, 0.12) !important;
    box-shadow:
        0 10px 22px rgba(10, 29, 23, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(10px);
}

.shell--imperial-clean .leaflet-control-zoom {
    border-radius: 18px !important;
    overflow: hidden;
}

.shell--imperial-clean .leaflet-control-zoom a {
    width: 42px;
    height: 42px;
    line-height: 42px;
    color: var(--shell-emerald-950) !important;
    font-weight: 600;
    font-size: 1.1rem;
}

.shell--imperial-clean .leaflet-control-zoom a + a {
    border-top: 1px solid rgba(23, 60, 49, 0.08);
}

.shell--imperial-clean .leaflet-control-attribution {
    margin: 0 0 10px 10px !important;
    padding: 3px 7px !important;
    border-radius: 999px !important;
    color: rgba(82, 97, 90, 0.88) !important;
    font-size: 0.63rem !important;
    line-height: 1.25 !important;
    opacity: 0.84;
}

.shell--imperial-clean .leaflet-control-attribution a {
    color: rgba(36, 82, 68, 0.92) !important;
}

@media (max-width: 640px) {
    .shell--imperial-clean {
        --shell-header-height: 84px;
    }

    .shell--imperial-clean .app-header {
        padding: calc(9px + env(safe-area-inset-top)) 12px 10px;
        border-radius: 0 0 18px 18px;
        gap: 8px;
    }

    .shell--imperial-clean .app-header .logo {
        gap: 8px;
        flex: 1 1 auto;
    }

    .shell--imperial-clean .app-header .logo-icon,
    .shell--imperial-clean .app-header .logo-icon svg {
        width: 38px;
        height: 38px;
    }

    .shell--imperial-clean .app-header .logo-icon {
        left: 12px;
        top: calc(9px + env(safe-area-inset-top));
        border-radius: 13px;
    }

    .shell--imperial-clean .app-header .logo-text {
        width: min(27ch, calc(100% - 110px));
    }

    .shell--imperial-clean .app-header .logo-text h1 {
        font-size: 1.9rem;
    }

    .shell--imperial-clean .app-header .tagline {
        max-width: 100%;
        font-size: 0.74rem;
        line-height: 1.28;
    }

    .shell--imperial-clean .app-header .btn-icon {
        left: 58px;
        top: calc(10px + env(safe-area-inset-top));
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }

    .shell--imperial-clean .report-chip {
        font-size: 0.54rem;
        padding: 0.12rem 0.38rem;
    }

    .shell--imperial-clean #locationControls,
    .shell--imperial-clean .location-controls {
        top: calc(var(--shell-header-height) + 12px);
        right: 12px;
        padding: 7px;
        border-radius: 18px;
    }

    .shell--imperial-clean .location-btn {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .shell--imperial-clean .action-dock {
        left: 16px;
        bottom: calc(var(--shell-bottom-gap) + 16px);
        gap: 10px;
        width: 118px;
    }

    .shell--imperial-clean .action-card {
        width: 118px;
        min-height: 56px;
        padding: 8px 9px 8px 10px;
        border-radius: 22px;
    }

    .shell--imperial-clean .action-card__icon,
    .shell--imperial-clean .action-card .fab-icon {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    .shell--imperial-clean .action-card__label,
    .shell--imperial-clean .action-card .fab-text {
        font-size: 0.98rem;
    }

    .shell--imperial-clean .action-card--report .fab-icon {
        font-size: 1.28rem;
        width: 38px;
        height: 38px;
    }

    .shell--imperial-clean .leaflet-control-zoom a {
        width: 40px;
        height: 40px;
        line-height: 40px;
    }
}

/* Final shell polish (v5) */
.shell--imperial-clean {
    --shell-header-height: 92px;
    --shell-z-banner: 210;
    --shell-z-controls: 230;
    --shell-z-overlay: 300;
}

.shell--imperial-clean .app-header {
    justify-content: center;
}

.shell--imperial-clean .app-header .logo {
    max-width: none;
    width: 100%;
    flex: 1 1 auto;
    justify-content: center;
    gap: 10px;
}

.shell--imperial-clean .logo-text {
    width: min(56ch, calc(100% - 156px));
    gap: 3px;
}

.shell--imperial-clean .app-header .logo-text h1 {
    font-size: clamp(2.05rem, 2.6vw, 2.7rem);
}

.shell--imperial-clean .app-header .tagline {
    max-width: 100%;
    font-size: 0.87rem;
    line-height: 1.48;
    color: rgba(249, 247, 241, 0.76);
}

.shell--imperial-clean .report-chip {
    padding: 0.14rem 0.52rem;
}

.shell--imperial-clean .inapp-banner,
.shell--imperial-clean .internet-banner {
    z-index: var(--shell-z-banner);
}

.shell--imperial-clean #locationControls,
.shell--imperial-clean .location-controls {
    z-index: var(--shell-z-controls);
}

.shell--imperial-clean .action-dock {
    z-index: calc(var(--shell-z-controls) + 5);
}

.shell--imperial-clean .modal-overlay,
.shell--imperial-clean .stats-overlay,
.shell--imperial-clean .onboarding-overlay {
    z-index: var(--shell-z-overlay);
}

@media (max-width: 640px) {
    .shell--imperial-clean {
        --shell-header-height: 84px;
    }

    .shell--imperial-clean .app-header .logo {
        max-width: none;
        width: 100%;
    }

    .shell--imperial-clean .logo-text {
        width: min(27ch, calc(100% - 110px));
    }

    .shell--imperial-clean .app-header .tagline {
        font-size: 0.74rem;
        line-height: 1.28;
    }
}

/* RTL header/menu cleanup (v10) */
.shell--imperial-clean .app-header {
    min-height: 96px;
    padding-block: calc(10px + env(safe-area-inset-top)) 14px;
    overflow: visible;
}

.shell--imperial-clean .app-header .logo {
    gap: 0;
}

.shell--imperial-clean .app-header .logo-icon {
    display: none !important;
}

.shell--imperial-clean .logo-text {
    width: min(54ch, calc(100% - 118px));
    align-items: center;
    text-align: center;
    gap: 4px;
}

.shell--imperial-clean .title-row {
    direction: rtl;
    gap: 12px;
}

.shell--imperial-clean .app-header .logo-text h1 {
    font-size: clamp(2.15rem, 2.7vw, 2.85rem);
    line-height: 1.02;
    letter-spacing: -0.012em;
}

.shell--imperial-clean .app-header .tagline {
    max-width: 42ch;
    font-size: 0.92rem;
    line-height: 1.5;
}

.shell--imperial-clean .report-chip,
.shell--imperial-clean .header-menu,
.shell--imperial-clean .header-menu__item,
.shell--imperial-clean .action-card,
.shell--imperial-clean .action-card__label,
.shell--imperial-clean .action-card .fab-text,
.shell--imperial-clean .action-card__icon,
.shell--imperial-clean .action-card .fab-icon,
.shell--imperial-clean .location-btn,
.shell--imperial-clean .btn-icon {
    font-family: var(--shell-font-ui);
}

.shell--imperial-clean .report-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.22rem 0.62rem;
    font-size: 0.7rem;
}

.shell--imperial-clean .report-chip svg {
    width: 0.92rem;
    height: 0.92rem;
}

.shell--imperial-clean .header-menu-trigger,
.shell--imperial-clean .app-header .btn-icon {
    left: 18px;
    top: calc(11px + env(safe-area-inset-top));
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: rgba(249, 247, 241, 0.12);
    color: var(--shell-cream-50);
    border: 1px solid rgba(249, 247, 241, 0.12);
    box-shadow:
        0 10px 18px rgba(10, 29, 23, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.shell--imperial-clean .header-menu-trigger svg {
    width: 22px;
    height: 22px;
}

.shell--imperial-clean .header-menu-trigger[aria-expanded="true"] {
    background: rgba(249, 247, 241, 0.18);
    border-color: rgba(217, 192, 141, 0.22);
}

.shell--imperial-clean .header-menu {
    position: absolute;
    top: calc(62px + env(safe-area-inset-top));
    left: 18px;
    width: min(260px, calc(100vw - 36px));
    padding: 8px;
    border-radius: 22px;
    background: rgba(248, 244, 236, 0.98);
    border: 1px solid rgba(217, 192, 141, 0.18);
    box-shadow:
        0 18px 36px rgba(10, 29, 23, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
    display: grid;
    gap: 7px;
    z-index: calc(var(--shell-z-overlay) - 20);
}

.shell--imperial-clean .header-menu[hidden] {
    display: none !important;
}

.shell--imperial-clean .header-menu__item {
    width: 100%;
    padding: 12px 13px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--shell-emerald-950);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    direction: rtl;
    text-align: right;
}

.shell--imperial-clean .header-menu__item:hover,
.shell--imperial-clean .header-menu__item:focus-visible {
    background: rgba(31, 75, 63, 0.06);
    outline: none;
}

.shell--imperial-clean .header-menu__item[disabled] {
    opacity: 0.68;
    pointer-events: none;
}

.shell--imperial-clean .header-menu__item[data-state="loading"] .header-menu__icon {
    animation: shell-spin 0.9s linear infinite;
}

.shell--imperial-clean .header-menu__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.shell--imperial-clean .header-menu__copy strong {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
}

.shell--imperial-clean .header-menu__copy small {
    color: rgba(44, 74, 62, 0.72);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
}

.shell--imperial-clean .header-menu__icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 75, 63, 0.08);
    color: var(--shell-emerald-900);
    flex: 0 0 auto;
}

@keyframes shell-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.shell--imperial-clean .action-card {
    font: inherit;
    direction: rtl;
}

.shell--imperial-clean .action-card__label,
.shell--imperial-clean .action-card .fab-text {
    order: 1;
}

.shell--imperial-clean .action-card__icon,
.shell--imperial-clean .action-card .fab-icon {
    order: 2;
}

.shell--imperial-clean .action-card--gps {
    background: linear-gradient(180deg, #e8f1f8, #dbe9f3);
}

.shell--imperial-clean .action-card__label,
.shell--imperial-clean .action-card .fab-text {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.shell--imperial-clean #reportBtn {
    justify-content: space-between;
}

@media (max-width: 640px) {
    .shell--imperial-clean {
        --shell-header-height: 86px;
    }

    .shell--imperial-clean .app-header {
        min-height: 86px;
        padding-block: calc(9px + env(safe-area-inset-top)) 11px;
    }

    .shell--imperial-clean .logo-text {
        width: min(26ch, calc(100% - 96px));
    }

    .shell--imperial-clean .app-header .logo-text h1 {
        font-size: 1.98rem;
    }

    .shell--imperial-clean .app-header .tagline {
        max-width: 25ch;
        font-size: 0.77rem;
        line-height: 1.35;
    }

    .shell--imperial-clean .header-menu-trigger,
    .shell--imperial-clean .app-header .btn-icon {
        left: 12px;
        top: calc(9px + env(safe-area-inset-top));
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }

    .shell--imperial-clean .header-menu {
        top: calc(54px + env(safe-area-inset-top));
        left: 12px;
        width: min(230px, calc(100vw - 24px));
        border-radius: 18px;
    }

    .shell--imperial-clean .header-menu__item {
        padding: 11px 12px;
        border-radius: 14px;
    }

    .shell--imperial-clean .header-menu__icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }
}
