/*
 * app-shell.css — global sidebar + content layout.
 *
 * Self-contained design system for the app shell. Defines its own --app-*
 * tokens for both light and dark themes (activated by html[data-theme="dark"],
 * matching wh-dark-mode-init.php), so the sidebar renders correctly on any
 * page regardless of which page-specific CSS is loaded.
 *
 * Loaded by Partials/layout/head.php.
 */

/* ============================================================
   Design tokens
   ============================================================ */
:root {
    /* Surfaces */
    --app-bg: #ffffff;
    --app-surface: #ffffff;
    --app-surface-hov: #f4f6f9;
    --app-surface-active: #eef2f8;
    /* Borders */
    --app-border: #eaedf3;
    --app-border-strong: #dde2eb;
    /* Text */
    --app-text: #0f172a;
    --app-text-2: #475569;
    --app-text-3: #94a3b8;
    /* Brand / accent */
    --app-primary: #225aea;
    --app-primary-hover: #1d4ed8;
    --app-primary-soft: #eaf0ff;
    --app-primary-text: #1e52d4;
    /* Layout */
    --app-sidebar-width: 232px;
    --app-sidebar-collapsed-width: 68px;
    --app-sidebar-duration: 0.22s;
    --app-sidebar-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --app-shell-inset: 10px;
    --app-content-radius: 16px;
    --app-content-left: var(--app-sidebar-width);
    --app-radius: 8px;
    --app-radius-sm: 6px;
    --app-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.05);
}

html.app-sidebar-collapsed {
    --app-sidebar-width: var(--app-sidebar-collapsed-width);
}

html[data-theme="dark"] {
    color-scheme: dark;
    /* Surfaces — content card lifts off black sidebar/bezel (#09090b) */
    --app-bg: #0e1014;
    --app-surface: #101216;
    --app-surface-hov: #161b23;
    --app-surface-active: #1b2029;
    /* Borders */
    --app-border: #232830;
    --app-border-strong: #323845;
    /* Text */
    --app-text: #ffffff;
    --app-text-2: #bcc5d4;
    --app-text-3: #7c8699;
    /* Brand / accent (slightly brighter blue for dark contrast) */
    --app-primary: #3b76ff;
    --app-primary-hover: #2b66f0;
    --app-primary-soft: rgba(34, 90, 234, 0.16);
    --app-primary-text: #8fb0ff;
    /* Layout */
    --app-shadow: none;
}

/* ============================================================
   Sidebar — always-black rail (independent of page light/dark).
   Remaps --app-* tokens locally so nav/footer descendants pick
   them up without rewriting every child rule.
   ============================================================ */
.app-sidebar {
    --app-bg: #09090b;
    --app-surface: #09090b;
    --app-surface-hov: rgba(255, 255, 255, 0.05);
    --app-surface-active: rgba(255, 255, 255, 0.08);
    --app-border: #1f1f23;
    --app-border-strong: #2e2e34;
    --app-text: #ffffff;
    --app-text-2: #e4e4e7;
    --app-text-3: #a1a1aa;
    --app-primary: #3b76ff;
    --app-primary-hover: #2b66f0;
    --app-primary-soft: rgba(255, 255, 255, 0.08);
    --app-primary-text: #ffffff;
    --wh-logo-icon-width-ratio: 21.2%;
    --wh-logo-wordmark-mask-start: 25.5%;

    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    box-sizing: border-box;
    /* One token for rail + content pane. min/max stop flex/logo min-content
       from growing the rail past #appContent's `left`. */
    width: var(--app-sidebar-width);
    min-width: var(--app-sidebar-width);
    max-width: var(--app-sidebar-width);
    background: var(--app-surface);
    color: var(--app-text);
    display: flex;
    flex-direction: column;
    z-index: 30;
    overflow-x: hidden !important;
    transition: width var(--app-sidebar-duration) var(--app-sidebar-ease), transform 0.3s ease;
    border-right: none;
}
@media (prefers-reduced-motion: reduce) {
    .app-sidebar {
        transition: none;
    }
}
.app-sidebar::-webkit-scrollbar { width: 5px; }
.app-sidebar::-webkit-scrollbar-track { background: transparent; }
.app-sidebar::-webkit-scrollbar-thumb {
    background: var(--app-border-strong);
    border-radius: 999px;
}
.app-sidebar::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* Brand / logo header */
.app-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 12px 12px 12px 16px;
    border-bottom: 1px solid var(--app-border);
    flex-shrink: 0;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
}
.app-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
    overflow: hidden;
}
.app-sidebar__mark-wrap {
    display: none;
    position: relative;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    border-radius: var(--app-radius);
    cursor: pointer;
    background: transparent;
    transition: background 0.16s ease;
}
.app-sidebar__mark-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-sidebar__mark-expand {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.75);
    color: var(--app-text);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.app-sidebar__mark-wrap:hover {
    background: var(--app-surface-hov);
}
.app-sidebar__mark-wrap:hover .app-sidebar__mark-img {
    opacity: 0;
    transform: scale(0.65);
}
.app-sidebar__mark-wrap:hover .app-sidebar__mark-expand {
    opacity: 1;
    transform: scale(1);
}

/* Panel Icon: normal state is line only, hover reveals centered arrow */
.app-sidebar-icon {
    display: block;
    width: 18px;
    height: 18px;
}
.app-sidebar-icon__line {
    opacity: 1;
    transition: opacity 0.16s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-sidebar-icon__arrow {
    opacity: 0;
    transform: scale(0.65);
    transform-origin: center;
    transition: opacity 0.16s cubic-bezier(0.4, 0, 0.2, 1), transform 0.16s cubic-bezier(0.2, 0, 0, 1);
}
.app-sidebar__collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: none;
    background: transparent;
    color: var(--app-text-3);
    border-radius: var(--app-radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.16s ease;
}
.app-sidebar__collapse-btn:hover {
    background: var(--app-surface-hov);
    color: var(--app-text);
}
.app-sidebar__collapse-btn:hover .app-sidebar-icon__line {
    opacity: 0;
}
.app-sidebar__collapse-btn:hover .app-sidebar-icon__arrow--left {
    opacity: 1;
    transform: scale(1);
}

.app-sidebar__mark-wrap:hover .app-sidebar-icon__line {
    opacity: 0;
}
.app-sidebar__mark-wrap:hover .app-sidebar-icon__arrow--right {
    opacity: 1;
    transform: scale(1);
}

/* Tight wrapper around the logo so dark overlays align to the image, not the padded brand. */
.app-sidebar__logo-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
    min-width: 0;
    max-width: 100%;
    opacity: 1;
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
}
/* Keep the icon tile; invert the wordmark for the black rail. */
.app-sidebar__logo-wrap::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: var(--wh-logo-icon-width-ratio);
    height: 100%;
    background: url("/images/webclip.png") center / contain no-repeat;
    border-radius: 18%;
    z-index: 1;
    pointer-events: none;
}
.app-sidebar__logo {
    /* Wordmark (≈4.3:1, 675×156). Width-constrained so the lockup stays legible. */
    width: 148px;
    max-width: 100%;
    flex-shrink: 1;
    height: auto;
    /* Explicit aspect-ratio guard so the image reserves space even before load. */
    aspect-ratio: 675 / 156;
    display: block;
    filter: invert(1) hue-rotate(180deg);
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        transparent var(--wh-logo-wordmark-mask-start),
        #000 var(--wh-logo-wordmark-mask-start)
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        transparent var(--wh-logo-wordmark-mask-start),
        #000 var(--wh-logo-wordmark-mask-start)
    );
}

/* Navigation */
.app-sidebar__nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden !important;
    padding: 8px 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    transition: padding 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar__section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--app-text-3);
    padding: 16px 10px 6px;
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    max-height: 40px;
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s, max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1), padding 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-sidebar__section-label:first-child {
    padding-top: 6px;
}

/* Base row styles shared by leaf links and group triggers. */
.app-nav-link,
.app-nav-group__trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--app-radius);
    color: var(--app-text-2);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: -0.005em;
    text-decoration: none;
    font-family: inherit;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    transition: background 0.16s ease, color 0.16s ease, padding 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.16s ease;
}
.app-nav-link:hover,
.app-nav-group__trigger:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}
.app-nav-link--active,
.app-nav-group__trigger--active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.app-nav-link__icon {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: inherit;
    opacity: 1;
}
i.app-nav-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}
.app-nav-link:hover .app-nav-link__icon,
.app-nav-group__trigger:hover .app-nav-link__icon { opacity: 1; color: #ffffff; }
.app-nav-link--active .app-nav-link__icon,
.app-nav-group__trigger--active .app-nav-link__icon { opacity: 1; color: #ffffff; }

.app-nav-link__label {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s, transform 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
}

/* Collapsible nav groups */
.app-nav-group {
    display: flex;
    flex-direction: column;
}
.app-nav-group__trigger {
    border: none;
    background: transparent;
    cursor: pointer;
}
.app-nav-group__trigger--active {
    color: #ffffff;
    font-weight: 600;
}
.app-nav-group__caret {
    display: block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--app-text-3);
    opacity: 1;
    transform: translateX(0);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
}
.app-nav-group.is-open > .app-nav-group__trigger > .app-nav-group__caret {
    transform: rotate(180deg);
    color: var(--app-text-2);
}

/* Sub-link panel — grid row interpolation for smooth expand/collapse. */
.app-nav-group__panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-nav-group.is-open > .app-nav-group__panel {
    grid-template-rows: 1fr;
}
.app-nav-group__panel-inner {
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 0 0 22px;
    opacity: 0;
    transition:
        opacity 0.18s ease,
        padding 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-nav-group.is-open > .app-nav-group__panel .app-nav-group__panel-inner {
    padding: 4px 0 6px 22px;
    opacity: 1;
    transition:
        opacity 0.22s ease 0.05s,
        padding 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sub-links (nested leaves) */
.app-nav-sublink {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--app-radius-sm);
    color: var(--app-text-2);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.app-nav-sublink:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}
.app-nav-sublink--active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.app-nav-sublink__icon {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: inherit;
    opacity: 1;
}
i.app-nav-sublink__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}
.app-nav-sublink:hover .app-nav-sublink__icon { opacity: 1; color: #ffffff; }
.app-nav-sublink--active .app-nav-sublink__icon { opacity: 1; color: #ffffff; }
.app-nav-sublink__label {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer: Upgrade CTA + user card */
.app-sidebar__footer {
    flex-shrink: 0;
    padding: 10px;
    border-top: 1px solid var(--app-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
    transition: padding 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    border-radius: var(--app-radius);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    transition: background 0.14s ease, padding 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.app-sidebar__cta span {
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s, transform 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
}
.app-sidebar__cta--trial {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.app-sidebar__cta--trial:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}
.app-sidebar__cta--upgrade {
    background: #2563eb;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.app-sidebar__cta--upgrade:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.app-sidebar__utilities {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.app-utility-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--app-radius);
    color: var(--app-text-2);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.005em;
    text-decoration: none;
    background: transparent;
    border: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    transition: background 0.14s ease, color 0.14s ease, padding 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.14s ease;
}
.app-utility-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}
.app-utility-link--active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.app-utility-link__icon {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: inherit;
    opacity: 1;
}
.app-utility-link:hover .app-utility-link__icon,
.app-utility-link--active .app-utility-link__icon {
    opacity: 1;
    color: #ffffff;
}
.app-utility-link__label {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s, transform 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
}
.app-utility-link__badge {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    min-width: 7px;
    padding: 0;
    border-radius: 9999px;
    background: #3b82f6;
}
.app-utility-link__badge:not(:empty) {
    width: auto;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    color: #ffffff;
    background: #3b82f6;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    border-radius: 9999px;
}

.app-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--app-radius);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: #ffffff;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, padding 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-profile-trigger:hover,
.app-profile-trigger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.app-profile-trigger__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    overflow: hidden;
    background: #18181b;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.app-profile-trigger__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s, transform 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
}
.app-profile-trigger__name {
    display: block;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.app-profile-trigger__plan {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--app-text-2);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.14s ease;
}
.app-profile-trigger:hover .app-profile-trigger__plan {
    color: #cbd5e1;
}
.app-plan-pill {
    display: inline-block;
    color: var(--app-text-2);
}
.app-plan-pill--pro,
.app-plan-pill--premium,
.app-plan-pill--vip {
    color: var(--app-text-2);
}
.app-profile-trigger__caret {
    flex-shrink: 0;
    opacity: 1;
    color: var(--app-text-3);
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
}

/* ============================================================
   Collapsed Sidebar State (Desktop)
   ============================================================ */
html.app-sidebar-collapsed .app-sidebar {
    width: var(--app-sidebar-width);
    min-width: var(--app-sidebar-width);
    max-width: var(--app-sidebar-width);
}
html.app-sidebar-collapsed .app-sidebar__head {
    padding: 12px 14px;
    justify-content: center;
}
html.app-sidebar-collapsed .app-sidebar__brand {
    flex: 0 0 auto;
    justify-content: center;
}
html.app-sidebar-collapsed .app-sidebar__logo-wrap {
    display: none;
}
html.app-sidebar-collapsed .app-sidebar__logo-wrap::before {
    display: none;
}
html.app-sidebar-collapsed .app-sidebar__collapse-btn {
    display: none;
}
html.app-sidebar-collapsed .app-sidebar__mark-wrap {
    display: flex;
}
html.app-sidebar-collapsed .app-sidebar__nav {
    padding: 8px 14px 16px;
    align-items: center;
}
html.app-sidebar-collapsed .app-sidebar__section-label {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
}
html.app-sidebar-collapsed .app-nav-link,
html.app-sidebar-collapsed .app-nav-group__trigger {
    height: 40px;
    padding: 0 11px;
    justify-content: flex-start;
    gap: 0;
}
html.app-sidebar-collapsed .app-nav-link__label,
html.app-sidebar-collapsed .app-nav-group__caret {
    opacity: 0;
    pointer-events: none;
    width: 0;
    min-width: 0;
    transform: translateX(-6px);
}
html.app-sidebar-collapsed .app-nav-group__panel {
    display: none !important;
}
html.app-sidebar-collapsed .app-sidebar__footer {
    padding: 10px 14px;
    align-items: center;
}
html.app-sidebar-collapsed .app-sidebar__cta {
    height: 38px;
    padding: 0 11px;
    gap: 0;
}
html.app-sidebar-collapsed .app-sidebar__cta span {
    opacity: 0;
    pointer-events: none;
    width: 0;
    min-width: 0;
    transform: translateX(-6px);
}
html.app-sidebar-collapsed .app-sidebar__utilities {
    width: 100%;
}
html.app-sidebar-collapsed .app-utility-link {
    height: 38px;
    padding: 0 11px;
    gap: 0;
}
html.app-sidebar-collapsed .app-utility-link__label {
    opacity: 0;
    pointer-events: none;
    width: 0;
    min-width: 0;
    transform: translateX(-6px);
}
html.app-sidebar-collapsed .app-utility-link__badge {
    position: absolute;
    top: 7px;
    right: 7px;
}
html.app-sidebar-collapsed .app-profile-trigger {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    margin: 0 auto;
    justify-content: center;
    gap: 0;
    border-radius: var(--app-radius);
}
html.app-sidebar-collapsed .app-profile-trigger__body,
html.app-sidebar-collapsed .app-profile-trigger__caret {
    display: none !important;
}
html.app-sidebar-collapsed .app-profile-trigger__avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    flex: 0 0 32px;
    margin: 0;
    border-radius: 50%;
}

/* ============================================================
   Floating Morphing Sidebar Tooltip
   ============================================================ */
.app-sidebar-tooltip {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 10px;
    background: #18181b;
    color: #f4f4f5;
    border: 1px solid #27272a;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.92) translateX(-4px);
    transition:
        top 0.16s cubic-bezier(0.2, 0, 0, 1),
        left 0.16s cubic-bezier(0.2, 0, 0, 1),
        opacity 0.14s ease,
        transform 0.16s cubic-bezier(0.2, 0, 0, 1),
        visibility 0.14s ease;
}
.app-sidebar-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateX(0);
}
.app-sidebar-tooltip::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid #27272a;
}
.app-sidebar-tooltip::after {
    content: "";
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 4px solid #18181b;
}

/* ============================================================
   Profile popup menu (.app-menu — positioned by Popper via dropdown.js)
   Rendered as a body-level sibling of .app-sidebar so it is never clipped by
   the sidebar's overflow. Popper sets absolute coords when shown.
   Always-black to match the sidebar rail (same --app-* remap).
   ============================================================ */
.app-menu {
    /* Match .app-sidebar black rail tokens (menu is not a sidebar descendant). */
    --app-bg: #09090b;
    --app-surface: #09090b;
    --app-surface-hov: rgba(255, 255, 255, 0.05);
    --app-surface-active: rgba(255, 255, 255, 0.08);
    --app-border: #1f1f23;
    --app-border-strong: #2e2e34;
    --app-text: #ffffff;
    --app-text-2: #e4e4e7;
    --app-text-3: #a1a1aa;
    --app-primary: #3b76ff;
    --app-primary-hover: #2b66f0;
    --app-primary-soft: rgba(255, 255, 255, 0.08);
    --app-primary-text: #ffffff;

    position: absolute;
    width: 268px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    color: var(--app-text);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
    overflow: hidden;
    z-index: 9999;
}
.app-menu.hidden {
    display: none;
}
.app-menu__header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--app-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.app-menu__header-avatar {
    --app-avatar-hue: 220;
    position: relative;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--app-surface-active);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.app-menu__header-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.app-menu__header-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--app-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.app-menu__header-email {
    font-size: 11.5px;
    color: var(--app-text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.app-menu__group {
    padding: 6px;
    border-bottom: 1px solid var(--app-border);
}
.app-menu__group:last-child {
    border-bottom: none;
}
.app-menu__label {
    display: block;
    padding: 6px 10px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--app-text-3);
}
.app-menu__item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--app-radius);
    color: var(--app-text-2);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    font-family: inherit;
    transition: background 0.12s ease, color 0.12s ease;
}
.app-menu__item:hover {
    background: var(--app-surface-hov);
    color: var(--app-text);
}
.app-menu__item i.bx,
.app-menu__item svg {
    font-size: 17px;
    width: 17px;
    height: 17px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.85;
}
.app-menu__item--danger {
    color: var(--app-text-2);
}
.app-menu__item--danger:hover {
    background: rgba(244, 63, 94, 0.14);
    color: #fb7185;
}

/* Theme toggle row — app-shell native (no legacy .dropdown-item chrome). */
.app-menu__theme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    width: 100%;
    padding: 8px 10px;
    margin: 0;
    border-radius: var(--app-radius);
    color: var(--app-text-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: background 0.12s ease, color 0.12s ease;
}
.app-menu__theme-row:hover {
    background: var(--app-surface-hov);
    color: var(--app-text);
}
.app-menu__theme-row__label {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    flex: 1;
    color: inherit;
}
.app-menu__theme-row__label i.bx {
    font-size: 17px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.85;
}
/* Show moon when light, sun when dark. The row gets .is-dark via hydrate. */
.app-menu__theme-icon { display: none; }
.app-menu__theme-row:not(.is-dark) .app-menu__theme-icon--moon { display: inline-block; }
.app-menu__theme-row.is-dark .app-menu__theme-icon--sun { display: inline-block; }
.app-menu__theme-switch {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    color: inherit;
}
/* Pill track — follow app tokens so dark menu never shows a light switch. */
.app-menu__theme-switch .wh-theme-toggle__track {
    width: 44px !important;
    height: 24px !important;
    background: var(--app-surface-active) !important;
    border: 1px solid var(--app-border-strong) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12) !important;
}
.app-menu__theme-switch.is-dark .wh-theme-toggle__track {
    background: var(--app-surface-active) !important;
    border-color: var(--app-border-strong) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}
.app-menu__theme-switch .wh-theme-toggle__thumb {
    width: 18px !important;
    height: 18px !important;
    left: calc(25% - 9px) !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18) !important;
}
.app-menu__theme-switch.is-dark .wh-theme-toggle__thumb {
    left: calc(75% - 9px) !important;
    background: var(--app-primary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}
.app-menu__theme-switch .wh-theme-toggle__glyph {
    width: 11px;
    height: 11px;
    color: var(--app-text-3);
}
.app-menu__theme-switch.is-dark .wh-theme-toggle__slot--sun .wh-theme-toggle__glyph {
    color: var(--app-text-3);
    opacity: 0.7;
}
.app-menu__theme-switch .wh-theme-toggle__thumb-glyph {
    width: 10px;
    height: 10px;
}
.app-menu__theme-switch.is-dark .wh-theme-toggle__thumb-glyph--moon {
    color: #fff !important;
}
.app-menu__theme-switch:not(.is-dark) .wh-theme-toggle__thumb-glyph--sun {
    color: #d97706 !important;
}

/* ============================================================
   Stores pages inside app shell (/stores, /brands, …)
   ============================================================ */
/* Ads library switch — page-local (Meta / TikTok / Pinterest / Facebook Post) */
.ads-library-switch {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    margin: 8px 0 6px;
    padding: 3px;
    width: fit-content;
    max-width: 100%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-sizing: border-box;
}
.ads-library-switch__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}
.ads-library-switch__tab:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.55);
    text-decoration: none;
}
.ads-library-switch__tab.is-active {
    color: #0f172a;
    font-weight: 600;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.ads-library-switch__tab.is-active:hover {
    color: #0f172a;
    background: #fff;
}
.ads-library-switch__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.ads-library-switch__svg,
.ads-library-switch__img,
.ads-library-switch__icon svg,
.ads-library-switch__icon img {
    display: block;
    width: 16px;
    height: 16px;
    object-fit: contain;
}
html[data-theme="dark"] .ads-library-switch {
    background: var(--app-surface-hov);
    border-color: var(--app-border);
}
html[data-theme="dark"] .ads-library-switch__tab {
    color: #bcc5d4;
}
html[data-theme="dark"] .ads-library-switch__tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .ads-library-switch__tab.is-active,
html[data-theme="dark"] .ads-library-switch__tab.is-active:hover {
    color: #fff;
    background: var(--app-surface-active);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Ads library compact topbar: Ads + platforms | search | actions */
.ads-page-wrapper .explore-shops-topbar.ads-topbar--compact {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    background: var(--es2-surface-alt, #f8fafc);
    border: none;
    border-radius: var(--es2-radius-lg, 12px);
    padding: 10px 14px !important;
    margin-bottom: 10px !important;
    min-height: 0;
    box-shadow: none;
    align-items: center !important;
    gap: 12px !important;
    overflow: visible !important;
}
.ads-page-wrapper .ads-topbar-search,
.ads-page-wrapper #ads-topbar-search-slot,
.ads-page-wrapper .ads-topbar-search #search-container,
.ads-page-wrapper .ads-topbar-search .relative.z-10.isolate {
    overflow: visible !important;
}
.ads-page-wrapper .ads-topbar--compact .explore-shops-heading {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
.ads-page-wrapper .ads-topbar--compact .ads-library-switch {
    margin: 0;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    width: max-content;
    max-width: 100%;
    min-width: 0;
}
/* Compact header: platform tabs stay icon-only (labels are for title/a11y). */
.ads-page-wrapper .ads-topbar--compact .ads-library-switch__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.ads-page-wrapper .ads-topbar--compact .ads-library-switch__tab,
.ads-page-wrapper .ads-library-switch--icons-only .ads-library-switch__tab,
.ads-page-wrapper .ads-topbar--compact.ads-topbar--icons-only .ads-library-switch__tab {
    position: relative;
    padding: 6px 8px;
    gap: 5px;
}
.ads-page-wrapper .ads-topbar-search {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 40;
}
.ads-page-wrapper .ads-topbar-search #search-container {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    transform: none !important;
    display: block !important;
    min-width: 0;
    left: auto !important;
    right: auto !important;
    top: auto !important;
}
.ads-page-wrapper .ads-topbar-search #search-container.select-wrapper {
    max-width: 100% !important;
}
/* Only the search shell — not suggestion rows (those also use .relative / w-7 thumbs). */
.ads-page-wrapper .ads-topbar-search #search-container > .relative,
.ads-page-wrapper .ads-topbar-search #search-container .keyword-search-inset,
.ads-page-wrapper .ads-topbar-search #search-container .div-block-71 {
    width: 100% !important;
    margin-left: 0 !important;
    position: relative !important;
}
.ads-page-wrapper .ads-topbar-search #suggested-searches {
    max-width: 100%;
    min-width: 0 !important;
    overflow-x: hidden;
    box-sizing: border-box;
}
.ads-page-wrapper .ads-topbar-search #suggested-searches .relative.w-7 {
    width: 1.75rem !important;
    min-width: 1.75rem !important;
    max-width: 1.75rem !important;
    height: 1.75rem !important;
    flex: 0 0 1.75rem !important;
}
.ads-page-wrapper .ads-topbar-search #suggested-searches .relative.w-7 img,
.ads-page-wrapper .ads-topbar-search #suggested-searches .relative.w-7 svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover !important;
    margin: 0 !important;
}
.ads-page-wrapper .ads-topbar-search #suggested-searches .suggested-results-class {
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}
.ads-page-wrapper .ads-topbar-search #suggested-searches button.w-full {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden;
    text-align: left;
    box-sizing: border-box;
}
/* Grow + truncate in-row; keep label left-aligned next to the icon (no centered gap) */
.ads-page-wrapper .ads-topbar-search #suggested-searches button.w-full > .truncate {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    max-width: 100%;
    overflow: hidden;
    text-align: left !important;
}
.ads-page-wrapper .ads-topbar-search #suggested-searches button.w-full > .flex-shrink-0 {
    flex: 0 1 auto !important;
    min-width: 0;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ads-page-wrapper .ads-topbar-search #suggested-searches #keyword-search-hint .whitespace-nowrap,
.ads-page-wrapper .ads-topbar-search #suggested-searches .suggested-results-class hr {
    white-space: normal;
    max-width: 100%;
}
.ads-page-wrapper .ads-topbar-search #search-container .form-input,
.ads-page-wrapper .ads-topbar-search #search-container input.form-input,
.ads-page-wrapper .ads-topbar-search #search-container #keyword,
.ads-page-wrapper .ads-topbar-search #search-container #keyword-editable {
    max-width: 100% !important;
    margin-left: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
}
.ads-page-wrapper .ads-topbar-search #search-container #keyword-composite {
    width: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
}
.ads-page-wrapper .ads-topbar-search #search-container #keyword-composite.form-input,
.ads-page-wrapper .ads-topbar-search #search-container #keyword-composite.w-input {
    height: auto !important;
    min-height: 2.5rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    outline: none !important;
}
.ads-page-wrapper .ads-topbar-search #search-container #keyword-composite #keyword,
.ads-page-wrapper .ads-topbar-search #search-container #keyword-composite #keyword-editable {
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 2.25rem !important;
    position: relative !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 0.75rem !important;
    line-height: 1.4 !important;
    padding: 0 0.125rem !important;
    margin: 0 !important;
}
.ads-page-wrapper .ads-topbar-search #search-container #keyword-composite #keyword::placeholder,
.ads-page-wrapper .ads-topbar-search #search-container #keyword-composite #keyword-editable::placeholder {
    font-size: 0.6875rem !important;
    line-height: 1.35 !important;
    color: #717c92 !important;
}
.ads-page-wrapper .ads-topbar-search #search-icon {
    position: absolute !important;
    inset-inline-end: 0;
    inset-block: 0;
    width: 2.5rem;
    display: grid;
    place-content: center;
    z-index: 40;
    pointer-events: auto;
}
.ads-page-wrapper .ads-topbar-search #search-icon > svg {
    position: absolute;
    margin: 0 !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.ads-page-wrapper .explore-shops-topbar-actions.dashboard-header-actions {
    width: 100%;
    max-width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    justify-self: stretch;
    gap: 8px;
    min-width: 0;
}
.ads-page-wrapper .ads-search-row-legacy:not(:has(.page-component:not(.hidden))) {
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
}
@media (max-width: 1500px) {
    .ads-page-wrapper .ads-topbar--compact .ads-library-switch__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .ads-page-wrapper .ads-topbar--compact .ads-library-switch__tab {
        position: relative;
        padding: 6px 8px;
    }
}
@media (max-width: 1100px) {
    .ads-page-wrapper .explore-shops-topbar.ads-topbar--compact {
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .ads-page-wrapper .ads-topbar--compact .explore-shops-heading {
        width: 100%;
        flex-wrap: wrap;
    }
    .ads-page-wrapper .ads-topbar--compact .ads-library-switch {
        flex-wrap: wrap;
        width: fit-content;
        max-width: 100%;
    }
    .ads-page-wrapper .ads-topbar-search {
        order: 2;
    }
    .ads-page-wrapper .ads-topbar-search #search-container {
        max-width: none !important;
        margin: 0 !important;
    }
}

.app-shell .ads-page-wrapper,
.app-shell .google-ads-page-wrapper,
.app-shell .saved-ads-page-wrapper,
.app-shell .explore-shops-page-wrapper,
.app-shell .brands-page-wrapper,
.app-shell .store-tracker-page-wrapper,
.app-shell .std-page-wrapper,
.app-shell .tiktok-shop-page-wrapper,
.app-shell .tiktok-detail-page-wrapper,
.app-shell .ai-ads-page-wrapper,
.app-shell .profile-page-wrapper,
.app-shell .teams-page-wrapper,
.app-shell .knowledge-page-wrapper,
.app-shell .api-page-wrapper,
.app-shell .tutorials-page-wrapper {
    width: 100% !important;
    max-width: 1800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
    min-width: 0;
    /* Match /saved-ads: the app shell owns the content gutter — wrappers add no padding. */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.app-shell .wh-home-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    background: transparent !important;
}

/* TikTok Shop: content margin includes the filter rail when open.
   Keep content under the shell bezel (z-index 25) — same as other pages —
   so the wrap stays visible while scrolling. Only the filter rail sits above. */
.app-shell.tiktok-shop-app-page .app-shell__content {
    z-index: 1;
    transition: none;
}
/* Filter rail is body-hoisted; must sit above the shell bezel matte (z-index 25). */
body.app-shell #filterSidebar.tts-filter-drawer {
    z-index: 28;
}
.app-shell.tiktok-shop-app-page .app-shell__content.tts-filters-sliding {
    transition: margin-left var(--app-sidebar-duration) var(--app-sidebar-ease);
}
body.app-shell.tiktok-shop-app-page.tts-filters-open {
    /* Same wrap as other pages: card starts at chrome edge (sidebar + filters). */
    --app-content-left: calc(var(--app-sidebar-width) + var(--tiktok-sidebar-expanded, 240px));
}
body.app-shell.tiktok-shop-app-page.tts-filters-open .app-shell__content {
    margin-left: var(--app-content-left);
}
/* Bezel hole must track the pushed content edge (inherits --app-content-left). */
@media (max-width: 991px) {
    .app-shell.tiktok-shop-app-page .app-shell__content,
    body.app-shell.tiktok-shop-app-page.tts-filters-open .app-shell__content {
        margin-left: var(--app-shell-inset);
        transition: none;
    }
    body.app-shell.tiktok-shop-app-page.tts-filters-open {
        --app-content-left: var(--app-shell-inset);
    }
}

/* Home page content spacing */
.app-shell.home-page-shell .app-shell__content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
}

.app-shell.home-page-shell .app-shell__content-body {
    padding: 28px 24px 48px;
}

@media (max-width: 991px) {
    .app-shell.home-page-shell .app-shell__content-body {
        padding: 48px 16px 36px !important;
    }
}

/* Home / profile / teams / knowledge — drop legacy navbar-era top offsets */
.app-shell .wh-home-page .wh-home-page-inner {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.app-shell .teams-page-wrapper .pt-12 {
    padding-top: 0 !important;
}

/* Teams / API page hero — app-shell tokens (auto dark mode via --app-*). */
.app-shell .teams-page-wrapper .explore-shops-topbar,
.app-shell .api-page-wrapper .explore-shops-topbar,
.app-shell .tutorials-page-wrapper .explore-shops-topbar {
    background: var(--app-surface, #fff);
    border: none;
    border-radius: var(--app-radius, 8px);
    padding: 10px 14px !important;
    margin-bottom: 10px !important;
    min-height: 48px;
    box-shadow: none;
    align-items: flex-start !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}
.app-shell .teams-page-wrapper .explore-shops-heading,
.app-shell .api-page-wrapper .explore-shops-heading,
.app-shell .tutorials-page-wrapper .explore-shops-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.app-shell .teams-page-wrapper .explore-shops-title-line,
.app-shell .api-page-wrapper .explore-shops-title-line,
.app-shell .tutorials-page-wrapper .explore-shops-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.app-shell .teams-page-wrapper .explore-shops-main-title,
.app-shell .api-page-wrapper .explore-shops-main-title,
.app-shell .tutorials-page-wrapper .explore-shops-main-title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--app-text, #0f172a);
    line-height: 1.15;
}
.app-shell .teams-page-wrapper .explore-shops-title-icon,
.app-shell .api-page-wrapper .explore-shops-title-icon,
.app-shell .tutorials-page-wrapper .explore-shops-title-icon {
    font-size: 1.5rem;
    color: var(--app-primary, #225aea);
}

/* Page title icon badge — sidebar glyph at 18px inside a 28px tile */
.app-shell span.explore-shops-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--app-primary, #225aea);
    background: var(--app-primary-soft, rgba(34, 90, 234, 0.1));
    border-radius: 8px;
    flex-shrink: 0;
}

.app-shell .explore-shops-title-icon__glyph,
.app-shell span.explore-shops-title-icon > svg {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.app-shell .teams-page-wrapper .explore-shops-subtitle,
.app-shell .api-page-wrapper .explore-shops-subtitle,
.app-shell .tutorials-page-wrapper .explore-shops-subtitle {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--app-text-3, #64748b);
    line-height: 1.45;
    max-width: 52ch;
}
.app-shell .teams-page-wrapper .explore-shops-subtitle-prefix,
.app-shell .api-page-wrapper .explore-shops-subtitle-prefix,
.app-shell .tutorials-page-wrapper .explore-shops-subtitle-prefix {
    font-weight: 500;
    color: var(--app-text-3, #94a3b8);
}
.app-shell .teams-page-wrapper .explore-shops-sidebar-toggle,
.app-shell .api-page-wrapper .explore-shops-sidebar-toggle,
.app-shell .tutorials-page-wrapper .explore-shops-sidebar-toggle {
    display: none;
}
@media (max-width: 991px) {
    .app-shell .teams-page-wrapper .explore-shops-sidebar-toggle,
    .app-shell .api-page-wrapper .explore-shops-sidebar-toggle,
    .app-shell .tutorials-page-wrapper .explore-shops-sidebar-toggle {
        display: inline-flex;
    }
}
.app-shell .teams-page-content,
.app-shell .api-page-content,
.app-shell .tutorials-page-content {
    width: 100%;
}
.app-shell .tutorials-page-wrapper .tutorials-card {
    background: var(--app-surface, #fff);
    border-color: var(--app-border, #e5e7eb) !important;
    color: var(--app-text, #0f172a);
}
.app-shell .tutorials-page-wrapper .tutorials-card:hover {
    border-color: var(--app-border-strong, #d1d5db) !important;
}
.app-shell .tutorials-page-wrapper .tutorials-card h2 {
    color: var(--app-text, #0f172a);
}
.app-shell .tutorials-page-wrapper .tutorials-card .text-gray-600 {
    color: var(--app-text-2, #475569) !important;
}
.app-shell .tutorials-page-wrapper .tutorials-card .bg-gray-200 {
    background: var(--app-surface-hov, #f3f4f6) !important;
    color: var(--app-text, #0f172a) !important;
}
.app-shell .tutorials-page-wrapper .tutorials-card .course-thumb {
    background: var(--app-surface-hov, #f9fafb) !important;
    border-color: var(--app-border, #e5e7eb) !important;
}

.app-shell .api-page-wrapper .explore-shops-topbar-actions {
    flex-shrink: 0;
    margin-left: auto;
}

/* Tutorial button — matches soft sort/filter controls (explore-landers-sort-btn). */
.app-shell .watch-tutorial-btn,
.app-shell a.invite-friends-btn.watch-tutorial-btn:not(.shopify-affiliate-btn),
.app-shell button.watch-tutorial-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 32px;
    padding: 0 10px;
    margin: 0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: #3f3f46;
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    box-sizing: border-box;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.app-shell .watch-tutorial-btn:hover,
.app-shell a.invite-friends-btn.watch-tutorial-btn:not(.shopify-affiliate-btn):hover,
.app-shell button.watch-tutorial-btn:hover {
    background: #f4f4f5;
    border-color: #d1d5db;
    color: #18181b;
}
.app-shell .watch-tutorial-btn:focus-visible,
.app-shell button.watch-tutorial-btn:focus-visible {
    outline: none;
    border-color: var(--app-primary, #225aea);
    box-shadow: 0 0 0 3px var(--app-primary-soft, rgba(34, 90, 234, 0.14));
}
.app-shell .watch-tutorial-btn .watch-tutorial-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: inherit;
}
.app-shell .watch-tutorial-btn .watch-tutorial-text,
.app-shell .watch-tutorial-btn .invite-friends-btn__text {
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
    color: inherit;
}
.app-shell .dashboard-header-actions .watch-tutorial-btn,
.app-shell .explore-shops-topbar-actions .watch-tutorial-btn {
    align-self: center;
}

/* API dashboard — semantic badges + code in dark mode */
html[data-theme="dark"] .app-shell .api-page-wrapper .api-page code {
    color: #f472b6;
}
html[data-theme="dark"] .app-shell .api-page-wrapper .method-GET {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.28);
}
html[data-theme="dark"] .app-shell .api-page-wrapper .method-POST {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.24);
}
html[data-theme="dark"] .app-shell .api-page-wrapper .method-GETPOST {
    background: rgba(139, 92, 246, 0.16);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.28);
}
html[data-theme="dark"] .app-shell .api-page-wrapper .method-DELETE {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.24);
}
html[data-theme="dark"] .app-shell .api-page-wrapper .method-PUT,
html[data-theme="dark"] .app-shell .api-page-wrapper .method-PATCH {
    background: rgba(249, 115, 22, 0.14);
    color: #fdba74;
    border-color: rgba(249, 115, 22, 0.24);
}
html[data-theme="dark"] .app-shell .api-page-wrapper .status-2xx {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
}
html[data-theme="dark"] .app-shell .api-page-wrapper .status-4xx {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
}
html[data-theme="dark"] .app-shell .api-page-wrapper .status-5xx {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

/* Content blocks — no extra horizontal gutter (app shell owns padding). */
.app-shell .teams-page-content .teams-block {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.app-shell .teams-page-content .teams-block + .teams-block {
    margin-top: 12px;
}
/* Surface cards, action tiles, modals — wrapper scope for dark mode tokens */
.app-shell .teams-page-wrapper .teams-card,
.app-shell .teams-page-wrapper .bg-white.rounded-lg,
.app-shell .teams-page-wrapper .bg-white.rounded-2xl,
.app-shell .teams-page-wrapper button.bg-white,
.app-shell .teams-page-wrapper a.bg-white {
    background: var(--app-surface, #fff) !important;
    border-color: var(--app-border, #e5e7eb) !important;
    color: var(--app-text, #0f172a);
}
.app-shell .teams-page-wrapper .teams-card {
    border: 1px solid var(--app-border, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem;
}
.app-shell .teams-page-wrapper .text-gray-900,
.app-shell .teams-page-wrapper h1.text-gray-900,
.app-shell .teams-page-wrapper h2.text-gray-900,
.app-shell .teams-page-wrapper h3.text-gray-900 {
    color: var(--app-text, #0f172a) !important;
}
.app-shell .teams-page-wrapper .text-gray-700,
.app-shell .teams-page-wrapper label.text-gray-700,
.app-shell .teams-page-wrapper a.text-gray-700 {
    color: var(--app-text-2, #475569) !important;
}
.app-shell .teams-page-wrapper .text-gray-600,
.app-shell .teams-page-wrapper .text-gray-500 {
    color: var(--app-text-3, #64748b) !important;
}
.app-shell .teams-page-wrapper .border-gray-200,
.app-shell .teams-page-wrapper .border-gray-300,
.app-shell .teams-page-wrapper .border-b.border-gray-200 {
    border-color: var(--app-border, #e5e7eb) !important;
}
.app-shell .teams-page-wrapper .bg-blue-50 {
    background: var(--app-primary-soft, rgba(34, 90, 234, 0.08)) !important;
}
.app-shell .teams-page-wrapper .bg-blue-100 {
    background: var(--app-primary-soft, rgba(34, 90, 234, 0.12)) !important;
}
.app-shell .teams-page-wrapper .text-blue-600 {
    color: var(--app-primary-text, #225aea) !important;
}
.app-shell .teams-page-wrapper input.border-gray-300,
.app-shell .teams-page-wrapper input[type="text"],
.app-shell .teams-page-wrapper input[type="email"] {
    background: var(--app-surface, #fff) !important;
    border-color: var(--app-border-strong, #d1d5db) !important;
    color: var(--app-text, #0f172a) !important;
}
.app-shell .teams-page-wrapper input::placeholder {
    color: var(--app-text-3, #9ca3af);
}
.app-shell .teams-page-wrapper .bg-gray-100 {
    background: var(--app-surface-hov, #f3f4f6) !important;
    color: var(--app-text-2, #374151) !important;
}
.app-shell .teams-page-wrapper .hover\:bg-gray-50:hover {
    background: var(--app-surface-hov, #f9fafb) !important;
}
.app-shell .teams-page-wrapper .hover\:bg-gray-200:hover {
    background: var(--app-surface-active, #e5e7eb) !important;
}
.app-shell .teams-page-wrapper .hover\:border-gray-300:hover {
    border-color: var(--app-border-strong, #d1d5db) !important;
}
.app-shell .teams-page-wrapper .hover\:text-gray-900:hover {
    color: var(--app-text, #0f172a) !important;
}
/* Modals & overlays — fixed, never expand page height.
   Only target .teams-modal — do NOT use [id$="Modal"] (matches hide*Modal buttons). */
.app-shell .teams-page-wrapper .teams-modal {
    position: fixed !important;
    inset: 0;
    z-index: 9999;
    margin: 0;
    padding: 1rem;
    overflow-y: auto;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(15, 23, 42, 0.45) !important;
}
.app-shell .teams-page-wrapper .teams-modal.hidden {
    display: none !important;
}
.app-shell .teams-page-wrapper .teams-modal:not(.hidden) {
    display: flex !important;
}
html[data-theme="dark"] .app-shell .teams-page-wrapper .teams-modal {
    background-color: rgba(0, 0, 0, 0.62) !important;
}
.app-shell .teams-page-wrapper .teams-modal-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 28rem;
    margin: auto;
    padding: 2rem;
    border-radius: 12px;
    background: var(--app-surface, #fff) !important;
    color: var(--app-text, #0f172a);
    box-shadow: var(--app-shadow, 0 10px 40px rgba(0, 0, 0, 0.12));
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.app-shell .teams-page-wrapper .teams-modal-divider {
    margin: 1rem -2rem;
    border-top: 1px solid var(--app-border, #e5e7eb);
}
.app-shell .teams-page-wrapper .teams-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}
.app-shell .teams-page-wrapper .teams-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.app-shell .teams-page-wrapper .teams-modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.app-shell .teams-page-wrapper .teams-modal-btn--secondary {
    background: var(--app-surface-hov, #f3f4f6) !important;
    color: var(--app-text-2, #374151) !important;
    border-color: var(--app-border, #e5e7eb);
}
.app-shell .teams-page-wrapper .teams-modal-btn--secondary:hover:not(:disabled) {
    background: var(--app-surface-active, #e5e7eb) !important;
}
.app-shell .teams-page-wrapper .teams-modal-btn--primary {
    background: #225aea !important;
    color: #fff !important;
}
.app-shell .teams-page-wrapper .teams-modal-btn--primary:hover:not(:disabled) {
    background: #1a46b8 !important;
}
.app-shell .teams-page-wrapper .teams-modal-btn--danger {
    background: #fff !important;
    color: #ef4444 !important;
    border-color: #f87171 !important;
}
.app-shell .teams-page-wrapper .teams-modal-btn--danger:hover:not(:disabled) {
    background: #ef4444 !important;
    color: #fff !important;
    border-color: #ef4444 !important;
}
/* Action buttons keep semantic hover colors */
.app-shell .teams-page-wrapper button.text-red-600:not(:hover),
.app-shell .teams-page-wrapper a.text-red-600:not(:hover) {
    color: #ef4444 !important;
}
.app-shell .teams-page-wrapper button.text-blue-600:not(:hover) {
    color: var(--app-primary-text, #225aea) !important;
}

/* Mobile nav hamburger for TikTok Shop detail pages (explore-shops CSS isn't loaded here) */
.app-shell .tiktok-detail-page-wrapper > .explore-shops-sidebar-toggle {
    display: none;
}

@media (max-width: 991px) {
    .app-shell .tiktok-detail-page-wrapper > .explore-shops-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: 8px 0 4px;
        padding: 0;
        border: 1px solid var(--app-border, #e5e7eb);
        border-radius: 10px;
        background: var(--app-surface, #fff);
        color: var(--app-text, #0f172a);
        cursor: pointer;
        position: relative;
        top: auto;
        left: auto;
        z-index: 5;
        box-shadow: none;
        transform: none;
    }

    .app-shell .tiktok-detail-page-wrapper > .explore-shops-sidebar-toggle .explore-shops-sidebar-toggle__icon--close {
        display: none;
    }

    .app-shell .tiktok-detail-page-wrapper > .explore-shops-sidebar-toggle.is-open .explore-shops-sidebar-toggle__icon--open {
        display: none;
    }

    .app-shell .tiktok-detail-page-wrapper > .explore-shops-sidebar-toggle.is-open .explore-shops-sidebar-toggle__icon--close {
        display: block;
    }
}

/* TikTok Shop detail: app shell owns the content gutter — drop legacy navbar-era offsets */
.app-shell .tiktok-detail-page-wrapper .tiktok-detail-page-shell,
.app-shell .tiktok-detail-page-wrapper .tiktok-detail-outer-wrap {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.app-shell .tiktok-detail-page-wrapper .tiktok-detail-page-shell > div {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.app-shell .tiktok-detail-page-wrapper .tiktok-product-detail-page,
.app-shell .tiktok-detail-page-wrapper .tiktok-shop-detail-page,
.app-shell .tiktok-detail-page-wrapper .tiktok-creator-detail-page,
.app-shell .tiktok-detail-page-wrapper .tiktok-video-detail-page,
.app-shell .tiktok-detail-page-wrapper .tiktok-category-detail-page {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* AI Ads: kill old ugc-rail / navbar-era offsets (styles.css uses 10rem top on .padding-section-large) */
.app-shell .ai-ads-page-wrapper .padding-global,
.app-shell .ai-ads-page-wrapper .padding-section-large,
.app-shell .ai-ads-page-wrapper .padding-section-medium {
    padding-left: 0 !important;
}

.app-shell .ai-ads-page-wrapper .padding-section-large {
    padding-top: 0 !important;
    padding-bottom: 12px !important;
}

.app-shell .ai-ads-page-wrapper .padding-section-medium {
    padding-top: 0 !important;
    padding-bottom: 12px !important;
}

.app-shell .ai-ads-page-wrapper #page-content {
    position: relative;
    padding-top: 0 !important;
}

/* Decorative bg must not participate in flex layout */
.app-shell .ai-ads-page-wrapper .background-image {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    max-width: min(520px, 55%) !important;
    height: auto !important;
}

/* AI Ads: toggle lives inside .ai-ads-topbar (not wrapper-level) */
.app-shell .ai-ads-page-wrapper > .explore-shops-sidebar-toggle {
    display: none !important;
}

/* Ad Launcher — app shell layout */
.app-shell .adslauncher-page-shell {
    width: 100%;
    position: relative;
}

.app-shell .adslauncher-topbar {
    margin-bottom: 12px !important;
}

.app-shell .adslauncher-page-wrapper .wh-tool-tabs-wrap {
    margin-bottom: 12px;
}

.app-shell .adslauncher-page-wrapper .mobile-breadcrumb {
    margin-bottom: 10px;
}

.app-shell .adslauncher-page-wrapper .adslauncher-section-title {
    margin: 0;
}

/* Legacy fixed credits badge — topbar chip replaces it on migrated pages */
.app-shell .ai-ads-page-wrapper .credits-display-container:not(.ai-ads-credits-chip) {
    left: calc(var(--app-sidebar-width) + 12px) !important;
}

@media (max-width: 991px) {
    .app-shell .ai-ads-page-wrapper .credits-display-container:not(.ai-ads-credits-chip) {
        left: 12px !important;
    }
}

.app-shell .explore-shops-page-wrapper .page-content,
.app-shell .explore-shops-page-wrapper .section_dashbaord,
.app-shell .explore-shops-page-wrapper .padding-global,
.app-shell .explore-shops-page-wrapper .padding-section-medium,
.app-shell .explore-shops-page-wrapper .margin-bottom.margin-xlarge,
.app-shell .explore-shops-page-wrapper .margin-xlarge,
.app-shell .explore-shops-page-wrapper .new-page-wrapper,
.app-shell .explore-shops-page-wrapper .landers-page-wrapper {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0 !important;
}

.app-shell .explore-shops-page-wrapper .page-content,
.app-shell .explore-shops-page-wrapper .new-page-wrapper,
.app-shell .explore-shops-page-wrapper .landers-page-wrapper {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Landers table min-width is ~1424px. Sticky `left: 0` on the first column
   (and on colspan skeleton cells during load) pins to the shell/viewport
   instead of the table scroller, so the row slides under the sidebar. */
.app-shell .landers-page-wrapper {
    overflow-x: clip;
}
.app-shell .landers-page-wrapper .explore-shops-results-card {
    min-width: 0;
    max-width: 100%;
}
.app-shell .landers-page-wrapper .table-wrapper.explore-shops-results-wrap {
    position: relative;
    overflow-x: auto !important;
    overflow-y: auto !important;
}
.app-shell .landers-page-wrapper .shops-table thead th:first-child,
.app-shell .landers-page-wrapper .shops-table tbody td:first-child,
.app-shell .landers-page-wrapper .shops-table.landers-table thead th[data-explore-col="lander"],
.app-shell .landers-page-wrapper .shops-table.landers-table tbody td[data-explore-col="lander"] {
    left: auto !important;
}
.app-shell .landers-page-wrapper .shops-table tbody td[colspan],
.app-shell .landers-page-wrapper .shops-table tbody tr.std-skel-row > td {
    position: static !important;
    left: auto !important;
    box-shadow: none !important;
}

@media (max-width: 991px) {
    .app-shell .explore-shops-page-wrapper .new-page-wrapper,
    .app-shell .explore-shops-page-wrapper .landers-page-wrapper,
    .app-shell .store-tracker-page-wrapper .new-page-wrapper,
    .app-shell .std-page-wrapper .new-page-wrapper {
        padding: 0 !important;
    }
}

.app-shell .store-tracker-page-wrapper .page-content,
.app-shell .store-tracker-page-wrapper .section_dashbaord,
.app-shell .store-tracker-page-wrapper .padding-global,
.app-shell .store-tracker-page-wrapper .padding-section-medium,
.app-shell .store-tracker-page-wrapper .margin-bottom.margin-xlarge,
.app-shell .store-tracker-page-wrapper .margin-xlarge,
.app-shell .store-tracker-page-wrapper .new-page-wrapper {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0 !important;
}

.app-shell .store-tracker-page-wrapper .page-content,
.app-shell .store-tracker-page-wrapper .new-page-wrapper {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.app-shell .std-page-wrapper .page-content,
.app-shell .std-page-wrapper .section_dashbaord,
.app-shell .std-page-wrapper .padding-global,
.app-shell .std-page-wrapper .padding-section-medium,
.app-shell .std-page-wrapper .margin-bottom.margin-xlarge,
.app-shell .std-page-wrapper .margin-xlarge,
.app-shell .std-page-wrapper .new-page-wrapper {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0 !important;
}

.app-shell .std-page-wrapper .page-content,
.app-shell .std-page-wrapper .new-page-wrapper {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.app-shell .std-page-wrapper .explore-shops-sidebar-toggle {
    display: none;
}
@media (max-width: 991px) {
    .app-shell .std-page-wrapper .explore-shops-sidebar-toggle {
        display: inline-flex;
    }
}

/* Pagination — shared by /brands (and any explore page that renders .pagination-wrapper) */
.app-shell .brands-page-wrapper .pagination-wrapper,
.app-shell .explore-shops-page-wrapper .pagination-wrapper {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--es2-surface, var(--app-surface, #fff));
    border-top: 1px solid var(--es2-border, var(--app-border, #e2e8f0));
    font-size: 0.75rem;
    color: var(--es2-text-3, var(--app-text-3, #6b7280));
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.app-shell .brands-page-wrapper .explore-shops-results-card.is-layout-table .pagination-wrapper {
    border-radius: 0 0 12px 12px;
}

.app-shell .brands-page-wrapper .pagination-info,
.app-shell .explore-shops-page-wrapper .pagination-info {
    color: var(--es2-text-mute, var(--app-text-3, #9ca3af));
    font-size: 0.7rem;
}

.app-shell .brands-page-wrapper .pagination-controls,
.app-shell .explore-shops-page-wrapper .pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.app-shell .brands-page-wrapper .pagination-button,
.app-shell .explore-shops-page-wrapper .pagination-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid var(--es2-border, var(--app-border, #e5e7eb));
    border-radius: 6px;
    background: var(--es2-filter-surface, var(--app-surface, #fff));
    color: var(--es2-text-3, var(--app-text-3, #6b7280));
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.app-shell .brands-page-wrapper .pagination-button:hover:not(:disabled),
.app-shell .explore-shops-page-wrapper .pagination-button:hover:not(:disabled) {
    background: var(--es2-surface-hov, var(--app-surface-hov, #f9fafb));
    border-color: var(--es2-border-hov, var(--app-border-strong, #d1d5db));
}

.app-shell .brands-page-wrapper .pagination-button:disabled,
.app-shell .explore-shops-page-wrapper .pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.app-shell .brands-page-wrapper .pagination-icon,
.app-shell .explore-shops-page-wrapper .pagination-icon {
    width: 14px;
    height: 14px;
}

.app-shell .brands-page-wrapper .pagination-pages,
.app-shell .explore-shops-page-wrapper .pagination-pages {
    display: flex;
    align-items: center;
    gap: 2px;
}

.app-shell .brands-page-wrapper .page-number,
.app-shell .explore-shops-page-wrapper .page-number {
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--es2-text-2, var(--app-text-2, #475569));
}

.app-shell .brands-page-wrapper .page-number:hover:not(.active),
.app-shell .explore-shops-page-wrapper .page-number:hover:not(.active) {
    background: var(--es2-surface-hov, var(--app-surface-hov, #f1f5f9));
}

.app-shell .brands-page-wrapper .page-number.active,
.app-shell .explore-shops-page-wrapper .page-number.active {
    background: var(--es2-primary-soft, var(--app-primary-soft, #e8eef9));
    color: var(--es2-primary-text, var(--app-primary-text, #1e40af));
    font-weight: 600;
}

.app-shell .brands-page-wrapper .page-ellipsis,
.app-shell .explore-shops-page-wrapper .page-ellipsis {
    min-width: 20px;
    text-align: center;
    color: var(--es2-text-3, var(--app-text-3, #94a3b8));
    font-size: 0.7rem;
}

/* Country flags in tables */
.app-shell .brands-page-wrapper .monthly-visits-flags {
    display: grid;
    grid-template-columns: repeat(3, 14px);
    grid-auto-rows: 10px;
    gap: 3px;
    flex-shrink: 0;
    position: relative;
}

.app-shell .brands-page-wrapper .brands-active-ads-flags .monthly-visits-flags.landers-active-ad-countries,
.app-shell .brands-page-wrapper .landers-store-countries-cell .monthly-visits-flags,
.app-shell .brands-page-wrapper .monthly-visits-flags.st-monthly-visits-flags {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    grid-template-columns: unset;
    grid-auto-rows: unset;
}

.app-shell .brands-page-wrapper .monthly-visits-flag {
    width: 14px;
    height: 10px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
    background: var(--es2-surface, #fff);
    flex-shrink: 0;
}

.app-shell .brands-page-wrapper .monthly-visits-more-flags {
    font-size: 9px;
    font-weight: 600;
    color: #64748b;
    margin-left: 1px;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.app-shell .brands-page-wrapper .monthly-visits-flags-tooltip {
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--es2-surface, #fff);
    border: 1px solid var(--es2-border, #e2e8f0);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: var(--es2-shadow-sm, 0 4px 12px rgba(15, 23, 42, 0.08));
    z-index: 1200;
    width: 260px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    pointer-events: none;
}

.app-shell .brands-page-wrapper .monthly-visits-flags.is-tooltip-open .monthly-visits-flags-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Infinite-scroll footer (/stores uses this instead of numbered pagination) */
.app-shell .explore-shops-page-wrapper .explore-shops-results-card > .explore-shops-infinite-sentinel,
.app-shell .explore-shops-page-wrapper .explore-shops-infinite-sentinel,
.app-shell .explore-shops-page-wrapper .new-page-wrapper .explore-shops-infinite-sentinel,
.app-shell .explore-shops-page-wrapper .landers-page-wrapper .explore-shops-infinite-sentinel {
    width: 100%;
    height: 1px;
}

.app-shell .explore-shops-page-wrapper .explore-shops-results-card > .explore-shops-infinite-loading,
.app-shell .explore-shops-page-wrapper .explore-shops-infinite-loading,
.app-shell .explore-shops-page-wrapper .new-page-wrapper .explore-shops-infinite-loading,
.app-shell .explore-shops-page-wrapper .landers-page-wrapper .explore-shops-infinite-loading {
    display: flex;
    justify-content: center;
    padding: 16px 0 8px;
    position: static;
    left: auto;
    bottom: auto;
    background: transparent;
    min-width: 0;
}

.app-shell .explore-shops-page-wrapper .explore-shops-results-card > .explore-shops-infinite-loading[hidden],
.app-shell .explore-shops-page-wrapper .explore-shops-infinite-loading[hidden],
.app-shell .explore-shops-page-wrapper .new-page-wrapper .explore-shops-infinite-loading[hidden],
.app-shell .explore-shops-page-wrapper .landers-page-wrapper .explore-shops-infinite-loading[hidden] {
    display: none !important;
}

.app-shell .explore-shops-page-wrapper .explore-shops-results-card > .explore-shops-infinite-loading__inner,
.app-shell .explore-shops-page-wrapper .explore-shops-infinite-loading__inner,
.app-shell .explore-shops-page-wrapper .new-page-wrapper .explore-shops-infinite-loading__inner,
.app-shell .explore-shops-page-wrapper .landers-page-wrapper .explore-shops-infinite-loading__inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--es2-surface, #fff);
    border: 1px solid var(--es2-border, #e7edf5);
    box-shadow: var(--es2-shadow-sm, 0 4px 12px rgba(15, 23, 42, 0.08));
}

.app-shell .explore-shops-page-wrapper .explore-shops-results-card > .explore-shops-infinite-loading__spinner,
.app-shell .explore-shops-page-wrapper .explore-shops-infinite-loading__spinner,
.app-shell .explore-shops-page-wrapper .new-page-wrapper .explore-shops-infinite-loading__spinner,
.app-shell .explore-shops-page-wrapper .landers-page-wrapper .explore-shops-infinite-loading__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--es2-border, #e2e8f0);
    border-top-color: var(--es2-primary, #1d4ed8);
    border-radius: 50%;
    animation: app-shell-infinite-spin 0.7s linear infinite;
}

.app-shell .explore-shops-page-wrapper .explore-shops-results-card > .explore-shops-infinite-end,
.app-shell .explore-shops-page-wrapper .explore-shops-infinite-end,
.app-shell .explore-shops-page-wrapper .new-page-wrapper .explore-shops-infinite-end,
.app-shell .explore-shops-page-wrapper .landers-page-wrapper .explore-shops-infinite-end {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 0 6px;
    color: var(--es2-text-mute, #94a3b8);
    font-size: 12px;
    font-weight: 500;
    border-top: 1px solid var(--es2-border, #e2e8f0);
    background: var(--es2-surface, #fff);
    border-radius: 0 0 12px 12px;
}

.app-shell .explore-shops-page-wrapper .explore-shops-results-card > .explore-shops-infinite-end[hidden],
.app-shell .explore-shops-page-wrapper .explore-shops-infinite-end[hidden],
.app-shell .explore-shops-page-wrapper .new-page-wrapper .explore-shops-infinite-end[hidden],
.app-shell .explore-shops-page-wrapper .landers-page-wrapper .explore-shops-infinite-end[hidden] {
    display: none !important;
}

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

.app-shell .page-content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

@media (max-width: 991px) {
    .explore-shops-topbar .explore-shops-sidebar-toggle.is-open .explore-shops-sidebar-toggle__icon--open,
    .explore-shops-topbar .sidebar-toggle.is-open .explore-shops-sidebar-toggle__icon--open {
        display: none;
    }
    .explore-shops-topbar .explore-shops-sidebar-toggle.is-open .explore-shops-sidebar-toggle__icon--close,
    .explore-shops-topbar .sidebar-toggle.is-open .explore-shops-sidebar-toggle__icon--close {
        display: block;
    }
    .explore-shops-topbar .explore-shops-sidebar-toggle.is-open,
    .explore-shops-topbar .sidebar-toggle.is-open {
        background: var(--es2-primary-soft, var(--app-primary-soft));
        border-color: rgba(29, 78, 216, 0.28);
        color: var(--es2-primary-text, var(--app-primary-text));
    }
    body.app-sidebar-open .explore-shops-topbar .explore-shops-sidebar-toggle,
    body.app-sidebar-open .explore-shops-topbar .sidebar-toggle {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
    }
}

/* Floating sticky mobile hamburger toggle */
.app-sidebar-floating-toggle {
    display: none !important;
}

/* Overlay — inert on desktop */
.app-sidebar__overlay {
    display: none;
}

/* ============================================================
   Content area — sidebar chrome + rounded page card.
   Document/window remains the scrollport (smooth like ext-optimize).
   A fixed “bezel” restores the wrapped-card look without putting
   overflow:auto inside a rounded clip (that nested path was the jank).
   ============================================================ */
html:has(body.app-shell),
html:has(body.app-shell) body,
body.app-shell {
    background: #09090b !important;
    background-color: #09090b !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100%;
    margin: 0;
}

/* Fixed viewport matte: black surrounds a rounded hole aligned with #appContent.
   pointer-events:none so wheel/click reach the page; sidebar/modals sit above. */
body.app-shell::after {
    content: "";
    position: fixed;
    top: var(--app-shell-inset);
    right: var(--app-shell-inset);
    bottom: var(--app-shell-inset);
    left: var(--app-content-left, var(--app-sidebar-width));
    border-radius: var(--app-content-radius);
    box-shadow: 0 0 0 100vmax #09090b;
    pointer-events: none;
    z-index: 25;
}

.app-shell__content {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    margin: var(--app-shell-inset) var(--app-shell-inset) var(--app-shell-inset) var(--app-content-left, var(--app-sidebar-width));
    width: auto;
    height: auto;
    min-height: calc(100vh - (2 * var(--app-shell-inset)));
    max-height: none;
    box-sizing: border-box;
    padding: 0;
    display: block;
    background: #ffffff;
    border-radius: var(--app-content-radius);
    /* Clip paint to the radius without creating a scroll container. */
    overflow: clip;
    color: var(--app-text);
    z-index: 1;
    transition: none;
}
.app-shell__content.is-shell-flipping,
body.app-shell .app-shell__trial-bar.is-shell-flipping {
    transition: transform var(--app-sidebar-duration) var(--app-sidebar-ease);
    will-change: transform;
}
.app-shell__content-body {
    display: block;
    min-width: 0;
    min-height: 0;
    padding: 40px 28px 40px;
    box-sizing: border-box;
    overflow: visible;
}
html[data-theme="dark"] .app-shell__content {
    /* Lifted panel vs always-black sidebar / bezel (#09090b) */
    background: var(--app-bg, #0e1014);
}
@media (max-width: 991px) {
    body.app-shell::after {
        left: var(--app-shell-inset);
    }
    .app-shell__content {
        margin: var(--app-shell-inset) !important;
        width: auto !important;
        height: auto !important;
        min-height: calc(100vh - (2 * var(--app-shell-inset))) !important;
        max-height: none !important;
    }
    .app-shell__content-body {
        padding: 48px 16px 32px !important;
    }
}

/* Modal/open overlays must freeze document scroll; shell uses !important overflow. */
html:has(body.ad-modal-open),
html:has(body.ad-modal-open) body,
body.ad-modal-open {
    overflow: hidden !important;
}

/* ============================================================
   Mobile (≤ 991px): sticky floating toggle & slide-in drawer.
   ============================================================ */
@media (max-width: 991px) {
    body.app-sidebar-open {
        overflow: hidden;
    }

    /* Global sticky floating hamburger toggle */
    .app-sidebar-floating-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 14px;
        left: 14px;
        width: 36px;
        height: 36px;
        border-radius: 9px;
        background: #ffffff;
        border: 1px solid rgba(15, 23, 42, 0.12);
        color: #0f172a;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
        cursor: pointer;
        z-index: 195;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.2s ease, visibility 0.2s ease;
    }
    html[data-theme="dark"] .app-sidebar-floating-toggle {
        background: #27272a;
        border-color: #3f3f46;
        color: #f4f4f5;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    .app-sidebar-floating-toggle:hover {
        background: #f8fafc;
        transform: scale(1.04);
    }
    html[data-theme="dark"] .app-sidebar-floating-toggle:hover {
        background: #3f3f46;
        transform: scale(1.04);
    }
    .app-sidebar-floating-toggle:active {
        transform: scale(0.96);
    }
    body.app-sidebar-open .app-sidebar-floating-toggle {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /* Hide redundant in-page toggles placed against headers/titles */
    .explore-shops-topbar .sidebar-toggle,
    .explore-shops-topbar .explore-shops-sidebar-toggle,
    .explore-shops-sidebar-toggle,
    .app-page-mobile-toggle-bar,
    .wh-home-mobile-head {
        display: none !important;
    }

    /* Drawer: full-height, slides in from the left */
    .app-sidebar {
        width: min(280px, 88vw) !important;
        min-width: 0;
        max-width: 280px;
        transform: translateX(-105%);
        z-index: 210 !important;
        overflow: hidden;
    }
    .app-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(15, 23, 42, 0.2);
    }

    /* Sidebar head on mobile */
    .app-sidebar__head {
        padding: max(12px, env(safe-area-inset-top)) 14px 12px 16px;
    }
    .app-sidebar__collapse-btn {
        display: inline-flex !important;
        opacity: 1 !important;
    }
    .app-sidebar__collapse-btn .app-sidebar-icon__line {
        opacity: 0 !important;
    }
    .app-sidebar__collapse-btn .app-sidebar-icon__arrow--left {
        opacity: 1 !important;
        transform: scale(1) !important;
    }

    /* Overlay scrim */
    .app-sidebar__overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 205;
    }
    .app-sidebar__overlay.is-open {
        display: block;
    }
}

/* ============================================================
   Free-trial bar — fixed overlay at bottom of content panel.
   Rendered outside .app-shell__content so it is not clipped or
   scrolled away on infinite-scroll pages.
   ============================================================ */
body.app-shell .app-shell__trial-bar {
    position: fixed;
    bottom: calc(var(--app-shell-inset) + 16px);
    left: calc(var(--app-sidebar-width) + var(--app-shell-inset) + 16px);
    right: calc(var(--app-shell-inset) + 16px);
    z-index: 100;
    width: max-content;
    max-width: calc(100% - 32px);
    margin-inline: auto;
    box-sizing: border-box;
    border: 1px solid var(--app-border, #eaedf3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.08);
    background: #ffffff;
    pointer-events: auto;
    transition: none;
}
body.app-shell .app-shell__trial-upgrade-btn,
#bottom-noti-upgrade-btn.app-shell__trial-upgrade-btn {
    background: linear-gradient(180deg, #3b78f5 0%, var(--app-primary, #225aea) 48%, #1e54e0 100%);
    background-color: var(--app-primary, #225aea);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    box-shadow:
        inset 0 1px 1px 0 hsla(0, 0%, 100%, 0.2),
        inset 0 4px 8px 0 hsla(0, 0%, 100%, 0.08),
        0 1px 2px 0 rgba(8, 8, 8, 0.16),
        0 4px 10px 0 rgba(34, 90, 234, 0.26);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
body.app-shell .app-shell__trial-upgrade-btn:hover,
#bottom-noti-upgrade-btn.app-shell__trial-upgrade-btn:hover {
    background: linear-gradient(180deg, #336ff0 0%, var(--app-primary-hover, #1d4ed8) 100%);
    background-color: var(--app-primary-hover, #1d4ed8);
    color: #fff;
}
body.app-shell .app-shell__trial-upgrade-btn:active,
#bottom-noti-upgrade-btn.app-shell__trial-upgrade-btn:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 1px 1px 0 hsla(0, 0%, 100%, 0.14),
        0 1px 2px 0 rgba(8, 8, 8, 0.18);
}
body.app-shell .app-shell__trial-bar p {
    white-space: nowrap;
}
body.app-shell:has(.app-shell__trial-bar:not(.hidden)) .app-shell__content-body {
    padding-bottom: calc(40px + 96px) !important;
}
html[data-theme="dark"] body.app-shell .app-shell__trial-bar {
    background: var(--app-bg, #0e1014);
    border-color: var(--app-border, #2c323d);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
}
@media (max-width: 991px) {
    body.app-shell .app-shell__trial-bar {
        bottom: calc(var(--app-shell-inset) + 12px);
        left: calc(var(--app-shell-inset) + 12px);
        right: calc(var(--app-shell-inset) + 12px);
        border-radius: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    body.app-shell .app-shell__trial-bar p {
        white-space: normal;
        text-align: center;
    }
    body.app-shell:has(.app-shell__trial-bar:not(.hidden)) .app-shell__content-body {
        padding-bottom: calc(32px + 96px) !important;
    }
}
/* Home packs hero + cards into one viewport — reserve clearance and
   slightly shorten product previews so labels sit above the trial bar. */
body.app-shell.home-page-shell:has(.app-shell__trial-bar:not(.hidden)) .app-shell__content-body {
    padding-bottom: calc(32px + 88px) !important;
}
body.app-shell.home-page-shell:has(.app-shell__trial-bar:not(.hidden)) .wh-home-page-inner {
    padding-bottom: 12px !important;
}
body.app-shell.home-page-shell:has(.app-shell__trial-bar:not(.hidden)) .wh-home-product-preview {
    height: 232px;
}
body.app-shell.home-page-shell:has(.app-shell__trial-bar:not(.hidden)) .wh-home-hero {
    gap: 22px;
}
body.app-shell.home-page-shell:has(.app-shell__trial-bar:not(.hidden)) .wh-home-hero-stage {
    min-height: 160px;
    padding-bottom: 4px;
}
@media (max-width: 991px) {
    body.app-shell.home-page-shell:has(.app-shell__trial-bar:not(.hidden)) .app-shell__content-body {
        padding-bottom: calc(28px + 100px) !important;
    }
    body.app-shell.home-page-shell:has(.app-shell__trial-bar:not(.hidden)) .wh-home-product-preview {
        height: 210px;
    }
}
