/* Loaded after the legacy public styles so the selected theme always wins. */
html[data-theme="dark"] body.public-page{background:#07111f;color:#f8fafc}
html[data-theme="dark"] body.public-page .sharik-user-header{background:#091525!important;border-color:#263852!important;color:#f8fafc!important}
html[data-theme="dark"] body.public-page .sharik-user-header .sh-nav-link,
html[data-theme="dark"] body.public-page .sharik-user-header .sh-icon-btn{color:#b8c5d8!important}
html[data-theme="dark"] body.public-page .sharik-user-header .sh-search-box{background:#0f1c2e!important;border-color:#263852!important}
html[data-theme="dark"] body.public-page .sharik-user-header .sh-search-box input{color:#f8fafc!important}
html[data-theme="dark"] .marketplace-experience,html[data-theme="dark"] .marketplace-main-section{background:#07111f!important}
html[data-theme="dark"] .marketplace-empty-state,html[data-theme="dark"] .filters-card-wrapper{background:#0f1c2e!important;border-color:#263852!important}
html[data-theme="dark"] .marketplace-empty-state h3,html[data-theme="dark"] .results-title{color:#f8fafc!important}
html[data-theme="dark"] .marketplace-empty-state p,html[data-theme="dark"] .results-total-badge{color:#a8b5c7!important}
html[data-theme="dark"] .category-page-wrapper,html[data-theme="dark"] .category-content-section{background:#07111f!important;color:#f8fafc!important}
html[data-theme="dark"] .category-page .card,html[data-theme="dark"] .category-page .service-empty{background:#0f1c2e!important;border-color:#263852!important;color:#f8fafc!important}
html[data-theme="dark"] .category-page .service-empty h3{color:#f8fafc!important}html[data-theme="dark"] .category-page .service-empty p{color:#a8b5c7!important}
html[data-theme="dark"] .hero-search-wrapper{background:#fff!important}html[data-theme="dark"] .hero-search-input{background:transparent!important;color:#0f172a!important}

/* Semantic aliases used by older marketplace templates. */
body.public-page{--bg-surface:var(--surface);--bg-surface-elevated:var(--surface);--surface-muted:var(--soft);--text-primary:var(--text);--text-secondary:var(--muted);--text-muted:var(--muted);--border-subtle:var(--line)}
body.public-page main{min-height:calc(100svh - 72px)}
body.public-page :where(input,select,textarea){font-family:inherit}
body.public-page :where(.card,.filters-card-wrapper,.provider-directory-card){transition:border-color .2s ease,background-color .2s ease,box-shadow .2s ease,transform .2s ease}

/* Provider directory — keep search control readable in both themes. */
.providers-index-page .providers-directory-hero{padding-block:clamp(3rem,6vw,5rem)}
.providers-index-page .providers-directory-search{background:#fff!important;border:1px solid rgba(255,255,255,.65);color-scheme:light}
.providers-index-page .providers-directory-search input{background:#fff!important;background-color:#fff!important;color:#0f172a!important;-webkit-text-fill-color:#0f172a!important;color-scheme:light!important}
.providers-index-page .providers-directory-search input::placeholder{color:#64748b!important;opacity:1}
.providers-index-page .providers-directory-results{background:var(--page);padding-block:clamp(2.5rem,5vw,4.5rem)}
.provider-directory-card:hover{transform:translateY(-3px);border-color:rgba(59,130,246,.5);box-shadow:0 18px 38px -26px rgba(37,99,235,.55)}
html[data-theme="dark"] .provider-directory-card{background:#0f1c2e;border-color:#263852}.provider-directory-card h3,.provider-directory-card h3 a{color:var(--text-primary)}

/* Category results — remove the bright white island in dark mode. */
html[data-theme="dark"] body.category-page .service-results{color:#f8fafc}
html[data-theme="dark"] body.category-page .service-empty{background:#0f1c2e!important;border:1px dashed #334966!important;box-shadow:none!important}
html[data-theme="dark"] body.category-page .service-empty .empty-state-icon{background:#13243a!important;color:#8eb2df!important}
html[data-theme="dark"] body.category-page .service-empty h3{color:#f8fafc!important}
html[data-theme="dark"] body.category-page .service-empty p{color:#a8b5c7!important}
html[data-theme="dark"] body.category-page .results-toolbar label{color:#a8b5c7}
html[data-theme="dark"] body.category-page .field{background:#0f1c2e;color:#f8fafc;border-color:#334966}

@media(max-width:760px){.providers-index-page .providers-directory-hero{padding-block:2.5rem}.providers-index-page .providers-directory-hero p{font-size:.92rem}.category-page .service-empty>div{flex-direction:column}.category-page .service-empty .btn{width:100%}}

/* Global public components: consistent theme behavior on every route. */
html[data-theme="dark"] body.public-page{
  --page:#07111f;--surface:#0f1c2e;--soft:#13243a;--navy:#f8fafc;--text:#f8fafc;
  --text-2:#cbd5e1;--muted:#9eacc0;--line:#293b54;--input-bg:#101e31;
}
html[data-theme="dark"] body.public-page main :where(.card,.panel,.filter-card,.search-panel,.results-panel,.category-empty,.category-requests){background-color:var(--surface)!important;border-color:var(--line)!important;color:var(--text)!important}
html[data-theme="dark"] body.public-page main :where(h1,h2,h3,h4,strong,label,legend){color:var(--text-primary)!important}
html[data-theme="dark"] body.public-page main :where(p,small,.meta,.hint,.helper-text){color:var(--text-secondary)}
html[data-theme="dark"] body.public-page main :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background-color:var(--input-bg);border-color:#334966;color:#f8fafc}
html[data-theme="dark"] body.public-page main :where(input,textarea)::placeholder{color:#7f91a9;opacity:1}
html[data-theme="dark"] body.public-page main :where(table,thead,tbody,tr,th,td){border-color:var(--line)}
html[data-theme="dark"] body.public-page main :where(th,thead){background:#13243a;color:#dbe7f5}
html[data-theme="dark"] body.public-page main :where(dialog,.modal,.dropdown-menu){background:var(--surface);color:var(--text);border-color:var(--line)}
html[data-theme="dark"] body.public-page .public-footer{background:#050b14;border-color:#1f3047}

/* White hero search bars are deliberate contrast components, even in dark mode. */
html[data-theme="dark"] body.providers-index-page .providers-directory-search input[type="search"],
html[data-theme="dark"] body.marketplace-services-page .hero-search-wrapper input[type="search"]{
  background:#fff!important;background-color:#fff!important;color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;border-color:transparent!important;color-scheme:light!important;
}
html[data-theme="dark"] body.providers-index-page .providers-directory-search input[type="search"]::placeholder,
html[data-theme="dark"] body.marketplace-services-page .hero-search-wrapper input[type="search"]::placeholder{color:#64748b!important;-webkit-text-fill-color:#64748b!important;opacity:1}

/* Never hide the appearance switch on narrow screens. */
@media(max-width:900px){.sharik-user-header .sh-left>.sh-icon-btn#sh-theme-toggle{display:inline-flex!important;width:40px;height:40px}.sharik-user-header .sh-left{gap:.35rem}}
