.lux-public-header-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.lux-public-header-tools :is(.lux-public-icon-control, .lux-public-notification),
.portal-topbar-actions .lux-public-icon-control {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    inline-size: 44px;
    block-size: 44px;
    padding: 0;
    border: 1px solid var(--line, var(--border));
    border-radius: 14px;
    background: rgba(127, 127, 127, .10);
    color: inherit;
    cursor: pointer;
}

.lux-public-header-tools .lux-public-icon-control[hidden],
.lux-public-icon-control[aria-pressed="false"] .lux-theme-icon-moon,
.lux-public-icon-control[aria-pressed="true"] .lux-theme-icon-sun {
    display: none;
}

:is(.lux-public-icon-control, .lux-public-notification):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

:is(.lux-public-notification, .portal-topbar-actions .lux-public-icon-control) b {
    position: absolute;
    inset-block-start: -6px;
    inset-inline-end: -5px;
    min-inline-size: 20px;
    padding-inline: 4px;
    border-radius: 999px;
    background: #ad1730;
    color: #fff;
    font: 700 11px/20px Vazirmatn, Tahoma, sans-serif;
    text-align: center;
}

html[data-public-theme="light"] {
    color-scheme: light;
    --bg: #f5f6f9;
    --panel: #fff;
    --panel-strong: #fff;
    --text: #232733;
    --muted: #535d6e;
    --line: #d8dee7;
    --border: var(--line);
    --soft: #fae7eb;
    --public-accent: #97172e;
    background: var(--bg);
}

html[data-public-theme="light"] body {
    background: radial-gradient(ellipse at 90% 0%, #f7e7eb, transparent 32rem), var(--bg);
    color: var(--text);
}

html[data-public-theme="light"] :is(
    .selector-header, .cms-topbar, .lux-header, .cms-content-card, .cms-feature-grid article,
    .cms-contact-card, .cms-contact-item, .cms-address-row, .lux-hero-card,
    .lux-service-card, .lux-branches article, .market-hero, .market-filter-panel,
    .public-listing-card, .market-sold-card, .market-panel, .market-contact-card, .market-price
) {
    color: var(--text);
    background: var(--panel);
    border-color: var(--line);
    box-shadow: 0 8px 28px rgba(35, 39, 51, .08);
}

html[data-public-theme="light"] :is(.cms-nav, .marketplace-nav) {
    color: var(--text);
}

html[data-public-theme="light"] :is(
    .cms-brand small, .cms-nav a:not(.owner-entry), .cms-editorial-content > div,
    .cms-feature-grid p, .cms-footer-brand small, .cms-footer-nav a,
    .cms-contact-copy > span:not(.cms-contact-icon), .cms-contact-copy bdi,
    .cms-contact-copy small, .cms-contact-heading p, .cms-address-copy address,
    .cms-contact-card address, .lux-nav a:not(.market-owner-entry), .market-description,
    .market-contact-card label, .market-sold-body > small
) {
    color: var(--muted);
}

html[data-public-theme="light"] :is(
    .selector-kicker, .cms-kicker, .cms-contact-icon, .cms-contact-item:hover,
    .market-results-head span, .market-panel-head span, .public-listing-body > small, .market-trust span,
    .cms-nav a:not(.owner-entry):is(:hover, .active), .cms-footer-nav a:hover,
    .lux-nav a:not(.market-owner-entry):is(:hover, .active)
) {
    color: var(--public-accent);
}

html[data-public-theme="light"] :is(.cms-brand, .cms-contact-copy strong, .cms-address-copy strong) {
    color: var(--text);
}

html[data-public-theme="light"] :is(.public-nav-toggle, .public-market-nav-toggle) {
    color: var(--text);
    border-color: var(--line);
    background: var(--panel);
}

html[data-public-theme="light"] :is(.public-nav-toggle, .public-market-nav-toggle) span {
    background: currentColor;
}

html[data-public-theme="light"] :is(.market-filter-panel, .market-contact-card) :is(input, select, option, textarea) {
    color: var(--text);
    background: var(--panel);
    border-color: #aab4c3;
}

html[data-public-theme="light"] .public-listing-cover {
    color: #e2e5eb;
}

html[data-public-theme="light"] .public-listing-cover b {
    color: #fff;
}

/* Image cards keep light text over their existing photo overlays. */
html[data-public-theme="light"] .branch-card {
    --text: #f7f7f8;
    --muted: #c7c7ce;
    color: var(--text);
}

html[data-public-theme="light"] .cms-hero {
    color: #f8fafc;
}

@media (max-width: 980px) {
    html[data-public-theme="light"] :is(.cms-nav, .marketplace-nav) {
        background: var(--panel);
        border-color: var(--line);
    }

    .cms-topbar:has(.lux-public-header-tools),
    .marketplace-header:has(.lux-public-header-tools) {
        gap: 8px;
    }

    .cms-topbar:has(.lux-public-header-tools) .cms-brand,
    .marketplace-header:has(.lux-public-header-tools) .lux-brand {
        min-width: 0;
    }
}
