/* Dark theme for the logged-in app (html[data-theme=dark], set by static/theme.js from the saved
   choice or prefers-color-scheme). Tokens (--dk-*) live in theme.css.
   Section 1 re-points the app tokens. Section 2 repaints the light surfaces / dark text of the
   per-feature stylesheets (one block per source file). Section 3 holds hand-written fixes.
   Deliberately NOT recolored: the map's own scene palette (3D WebGL and the 2D SVG keep their
   built-in light colors so booths stay readable), brand-colored hero/buttons (white text on jade). */

/* 1. Tokens */
html[data-theme=dark]{background:var(--dk-bg)}
html[data-theme=dark] body,html[data-theme=dark] body.market-studio{background-color:var(--dk-bg);color:var(--dk-text);--ink:var(--dk-text);--muted:var(--dk-muted);--line:var(--dk-line);--paper:var(--dk-surface);--accent:var(--dk-green)}
html[data-theme=dark] body[data-map-theme]{--market-bg:#101916;--market-paper:var(--dk-surface);--market-ink:var(--dk-text);--market-muted:var(--dk-muted);--market-line:var(--dk-line);--market-tint:var(--dk-tint);--market-accent-soft:#3a2e12}

/* 2. Per-feature surfaces */
/* style.css */
html[data-theme=dark] input, html[data-theme=dark] select{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] input::placeholder{color:var(--dk-text)}
html[data-theme=dark] .demo-bar{background-color:var(--dk-surface-2)}
html[data-theme=dark] .demo-bar select{border-color:var(--dk-line)}
html[data-theme=dark] .panel{background-color:var(--dk-surface)}
html[data-theme=dark] .secondary{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .secondary:hover{background-color:var(--dk-surface-2)}
html[data-theme=dark] .notice{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .notice.error{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .calendar>span:first-child{background-color:var(--dk-surface-2)}
html[data-theme=dark] .history li{background-color:var(--dk-surface)}
html[data-theme=dark] .report-controls{background-color:var(--dk-surface)}
html[data-theme=dark] .table-wrap{background-color:var(--dk-surface)}
html[data-theme=dark] th{background-color:var(--dk-surface-2)}
html[data-theme=dark] td a{color:var(--dk-teal)}
html[data-theme=dark] .empty-state{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .vacant-count strong{color:var(--dk-teal)}
html[data-theme=dark] .vacant-booths{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .booth-list li{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .partial-booths{border-top-color:var(--dk-line)}
html[data-theme=dark] .channel-panel{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] tr{background-color:var(--dk-surface)}
/* community.css */
html[data-theme=dark] .community-view textarea{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .community-eyebrow{color:var(--dk-teal)}
html[data-theme=dark] .community-details dd a{color:var(--dk-teal)}
html[data-theme=dark] .community-receipt{background-color:var(--dk-surface-2)}
html[data-theme=dark] .community-card{background-color:var(--dk-surface)}
html[data-theme=dark] .community-badge{background-color:var(--dk-surface-2)}
html[data-theme=dark] .community-badge.is-resolved{background-color:var(--dk-surface-2)}
html[data-theme=dark] .community-list>.community-load-error{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .complaint-decision{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] #admin-locked-vendors{border-top-color:var(--dk-line)}
html[data-theme=dark] .standing-red-label{color:var(--dk-red)}
/* market_map.css */
html[data-theme=dark] .map-own-button{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-counts>span{border-inline-start-color:var(--dk-line)}
html[data-theme=dark] .map-plan-top{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-plan-bottom{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-plan-bottom>span{color:var(--dk-text)}
html[data-theme=dark] .map-legend{color:var(--dk-text)}
html[data-theme=dark] .map-note{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-own-badge{background-color:var(--dk-tint);border-color:var(--dk-line)}
html[data-theme=dark] .map-status{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-status.vacant{background-color:var(--dk-tint)}
html[data-theme=dark] .map-status.partial{background-color:var(--dk-tint)}
html[data-theme=dark] .map-merchants li{border-inline-start-color:var(--dk-line)}
html[data-theme=dark] .map-merchants span{color:var(--dk-text)}
html[data-theme=dark] .map-result{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .map-result:hover{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-shop-card{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .map-shop-media{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-shop-placeholder-title{color:var(--dk-text)}
html[data-theme=dark] .map-shop-placeholder{color:var(--dk-text)}
html[data-theme=dark] .map-shop-owner{color:var(--dk-text)}
html[data-theme=dark] .map-shop-bio{color:var(--dk-text)}
html[data-theme=dark] .map-shop-bio.is-empty{color:var(--dk-text)}
html[data-theme=dark] .map-storefront-editor{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .map-eyebrow{color:var(--dk-green)}
html[data-theme=dark] .map-storefront-fields textarea{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .map-storefront-fields input[type=file]{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] #map-store-image-remove{color:var(--dk-red)}
html[data-theme=dark] .map-storefront-status{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-storefront-status.is-error{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] body[data-map-theme]:has(#map-view:not([hidden])) .tabs button[aria-current=page]{color:var(--dk-teal)}
html[data-theme=dark] .swatches-emerald i:nth-child(3){background-color:var(--dk-surface-2)}
html[data-theme=dark] .swatches-navy i:nth-child(3){background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-own-badge{color:var(--dk-teal)}
html[data-theme=dark] .map-eyebrow{color:var(--dk-teal)}
html[data-theme=dark] .map-subscription-expiry{color:var(--dk-teal)}
html[data-theme=dark] .swatches-emerald i:nth-child(3){background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-own-badge{color:var(--dk-teal)}
html[data-theme=dark] .map-shop-section-label{color:var(--dk-teal)}
html[data-theme=dark] .map-reconstruction-mark{color:var(--dk-teal)}
html[data-theme=dark] .map-reconstruction-note strong{color:var(--dk-teal)}
html[data-theme=dark] .map-reconstruction-place{color:var(--dk-teal)}
html[data-theme=dark] .map-route-guide{border-color:var(--dk-line)}
html[data-theme=dark] .map-route-guide div + svg + div{border-top-color:var(--dk-line)}
html[data-theme=dark] .map-gallery-upload legend{color:var(--dk-teal)}
html[data-theme=dark] .map-gallery-count.is-complete{color:var(--dk-teal)}
html[data-theme=dark] .map-gallery-edit-label{color:var(--dk-teal)}
html[data-theme=dark] #map-view .map-gallery-pick{color:var(--dk-teal)}
html[data-theme=dark] .map-store-link-hint{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-store-text-error{color:var(--dk-red)}
html[data-theme=dark] .map-numbering-guide>span{background-color:var(--dk-surface)}
html[data-theme=dark] .map-booth-browser{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-booth-browser legend{background-color:var(--dk-surface-2)}
html[data-theme=dark] .map-booth-browser label{color:var(--dk-text)}
html[data-theme=dark] .booth-page-dialog{background-color:var(--dk-surface-2)}
html[data-theme=dark] .booth-page-bar{border-bottom-color:var(--dk-line)}
html[data-theme=dark] .map-merchant-avatar{color:var(--dk-teal)}
html[data-theme=dark] .map-merchant-identity .map-standing{border-color:var(--dk-line)}
html[data-theme=dark] .map-merchant-identity .map-standing.is-white{background-color:var(--dk-surface)}
html[data-theme=dark] .map-merchant-identity .map-cleanliness-warning{background-color:var(--dk-surface-2)}
/* approvals.css */
html[data-theme=dark] .approvals-privacy{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .approvals-import{background-color:var(--dk-surface)}
html[data-theme=dark] .approvals-import textarea{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .approval-card{background-color:var(--dk-surface)}
html[data-theme=dark] .approval-badge{background-color:var(--dk-surface-2)}
html[data-theme=dark] .approval-badge.inactive{background-color:var(--dk-tint)}
html[data-theme=dark] .approval-confirmation{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] #registration-status{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] #registration-status.registration-revoked{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .vr-filters button[aria-pressed=true]{background-color:var(--dk-btn);border-color:var(--dk-btn);color:var(--dk-text)}
html[data-theme=dark] .vr-card textarea{background-color:var(--dk-surface-2);border-color:var(--dk-line);color:var(--dk-text)}
html[data-theme=dark] .vr-reveal{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .approval-badge.pending{background-color:var(--dk-surface-2);color:var(--dk-amber)}
html[data-theme=dark] .vr-flag{background-color:var(--dk-surface-2);color:var(--dk-amber)}
html[data-theme=dark] .vs-card,html[data-theme=dark] .vs-form{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .vs-rejected,html[data-theme=dark] .vs-revoked{background-color:var(--dk-surface-2);color:var(--dk-red);border-color:var(--dk-line)}
html[data-theme=dark] .vr-facts>div,html[data-theme=dark] .vs-facts>div{border-color:var(--dk-line)}
/* team.css */
html[data-theme=dark] .identity-copy{border-color:var(--dk-line)}
html[data-theme=dark] .identity-copy:hover{background-color:var(--dk-surface)}
html[data-theme=dark] .team-owner-note{background-color:var(--dk-surface-2)}
html[data-theme=dark] .team-owner-note p{color:var(--dk-teal)}
html[data-theme=dark] .team-add-panel{background-color:var(--dk-surface)}
html[data-theme=dark] .team-permission-option{border-color:var(--dk-line)}
html[data-theme=dark] .team-permission-option:has(input:checked){background-color:var(--dk-surface-2)}
html[data-theme=dark] .team-member{background-color:var(--dk-surface)}
html[data-theme=dark] .team-member-badge{background-color:var(--dk-surface-2)}
html[data-theme=dark] .team-member-badge.inactive{background-color:var(--dk-surface-2)}
html[data-theme=dark] .team-member-permissions li{background-color:var(--dk-surface-2)}
html[data-theme=dark] .team-revoke{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .team-review{background-color:var(--dk-surface-2)}
html[data-theme=dark] .team-review.revoke{background-color:var(--dk-surface-2)}
html[data-theme=dark] .team-review span{color:var(--dk-text)}
html[data-theme=dark] .team-audit-entry{background-color:var(--dk-surface)}
html[data-theme=dark] .team-audit-changes p{color:var(--dk-teal)}
html[data-theme=dark] .team-map-shortcut{background-color:var(--dk-surface)}
/* phone_verification.css */
html[data-theme=dark] .phone-verification{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .phone-verification-badge{background-color:var(--dk-surface-2)}
html[data-theme=dark] .phone-verification-badge.verified{background-color:var(--dk-surface-2)}
html[data-theme=dark] .phone-verification-message{color:var(--dk-teal)}
html[data-theme=dark] .phone-code-entry{border-top-color:var(--dk-line)}
html[data-theme=dark] .phone-verification-error{background-color:var(--dk-surface-2)}
html[data-theme=dark] .phone-attendance-guidance{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
/* citizen.css */
html[data-theme=dark] .account-area{border-color:var(--dk-line)}
html[data-theme=dark] .account-area-switch{border-color:var(--dk-line)}
html[data-theme=dark] .citizen-welcome{border-color:var(--dk-line)}
html[data-theme=dark] .citizen-service{border-color:var(--dk-line)}
html[data-theme=dark] .citizen-privacy-note{border-inline-start-color:var(--dk-line)}
html[data-theme=dark] .reviews-summary{border-color:var(--dk-line)}
html[data-theme=dark] .reviews-score-star{color:var(--dk-red)}
html[data-theme=dark] .reviews-writing{border-color:var(--dk-line)}
html[data-theme=dark] .review-star-option{color:var(--dk-text);border-color:var(--dk-line)}
html[data-theme=dark] .review-star-option.is-selected{background-color:var(--dk-surface-2)}
html[data-theme=dark] .review-star-option.is-filled span{color:var(--dk-red)}
html[data-theme=dark] .reviews-view textarea{border-color:var(--dk-line)}
html[data-theme=dark] .review-delete{color:var(--dk-red);border-color:var(--dk-line)}
html[data-theme=dark] .review-restriction{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .review-card{border-color:var(--dk-line)}
html[data-theme=dark] .review-display-stars{color:var(--dk-red)}
html[data-theme=dark] .reviews-admin{border-top-color:var(--dk-line)}
html[data-theme=dark] .review-moderation-controls{border-top-color:var(--dk-line)}
html[data-theme=dark] .map-review-action{border-top-color:var(--dk-line)}
html[data-theme=dark] .map-review-action p>span{color:var(--dk-red)}
/* brand_motion.css */
html[data-theme=dark] .jb-motion-trigger{background-color:var(--dk-tint);border-color:var(--dk-line)}
html[data-theme=dark] .jb-motion-dialog{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .jb-motion-eyebrow{color:var(--dk-text)}
html[data-theme=dark] .jb-motion-close{background-color:var(--dk-tint)}
html[data-theme=dark] .jb-motion-description{color:var(--dk-text)}
html[data-theme=dark] .jb-motion-video, html[data-theme=dark] .jb-motion-poster{background-color:var(--dk-tint)}
html[data-theme=dark] .jb-film-wordmark span{color:var(--dk-text)}
html[data-theme=dark] .jb-film-caption{color:var(--dk-text)}
html[data-theme=dark] .jb-motion-footer{border-top-color:var(--dk-line)}
html[data-theme=dark] .jb-motion-footer>p{color:var(--dk-text)}
html[data-theme=dark] .jb-motion-dialog .jb-motion-pause{background-color:var(--dk-tint)}
html[data-theme=dark] .jb-motion-note{color:var(--dk-text)}
html[data-theme=dark] .jb-motion-trigger:hover{background-color:var(--dk-tint)}
html[data-theme=dark] .jb-motion-close:hover, html[data-theme=dark] .jb-motion-dialog .jb-motion-pause:hover{background-color:var(--dk-tint)}
/* service_navigation.css */
html[data-theme=dark] .service-directory{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .directory-heading{border-bottom-color:var(--dk-line)}
html[data-theme=dark] .directory-monogram{background-color:var(--dk-tint);border-color:var(--dk-line)}
html[data-theme=dark] .directory-heading div>span{color:var(--dk-text)}
html[data-theme=dark] body #application .service-directory .service-key{color:var(--dk-text)}
html[data-theme=dark] .service-key-hint{color:var(--dk-text)}
html[data-theme=dark] .directory-address{border-top-color:var(--dk-line)}
html[data-theme=dark] .directory-address span{color:var(--dk-text)}
html[data-theme=dark] body #application .service-directory .service-key:not([aria-current=page]):hover{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] #directory-toggle{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] body #application .service-directory .service-key{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
/* account_profile.css */
html[data-theme=dark] .market-studio .header-profile{background-color:var(--dk-surface)}
html[data-theme=dark] .login-scene{background-color:var(--dk-tint);border-color:var(--dk-line)}
html[data-theme=dark] .login-scene figcaption{background-color:var(--dk-tint)}
html[data-theme=dark] .profile-card{background-color:var(--dk-surface)}
html[data-theme=dark] .profile-avatar{background-color:var(--dk-tint);border-color:var(--dk-line)}
html[data-theme=dark] .profile-identity .identity-copy{color:var(--dk-green)}
html[data-theme=dark] .profile-privacy{background-color:var(--dk-tint)}
html[data-theme=dark] .profile-logout{color:var(--dk-red)}
html[data-theme=dark] .profile-cancel:hover, html[data-theme=dark] .profile-logout:hover{background-color:var(--dk-tint)}
/* account_login.css */
html[data-theme=dark] .credential-copy h1 em{color:var(--dk-teal)}
html[data-theme=dark] .credential-account-type legend{color:var(--dk-teal)}
html[data-theme=dark] .credential-account-options button{color:var(--dk-teal)}
html[data-theme=dark] .credential-register-progress li[aria-current=step]{color:var(--dk-teal)}
html[data-theme=dark] .credential-vendor-verified{color:var(--dk-teal)}
html[data-theme=dark] .credential-modes{border-color:var(--dk-line)}
html[data-theme=dark] .credential-modes button{color:var(--dk-teal)}
html[data-theme=dark] .credential-modes button:not([aria-pressed=true]):hover{background-color:var(--dk-tint)}
html[data-theme=dark] .credential-card h2{color:var(--dk-teal)}
html[data-theme=dark] .credential-card label{color:var(--dk-teal)}
html[data-theme=dark] .credential-card input, html[data-theme=dark] .credential-card select{background-color:var(--dk-surface);color:var(--dk-teal);border-color:var(--dk-line)}
html[data-theme=dark] .credential-inline-link{color:var(--dk-teal)}
html[data-theme=dark] .credential-inline-link:hover, html[data-theme=dark] .credential-link:hover{color:var(--dk-text)}
html[data-theme=dark] .credential-password-row button{color:var(--dk-teal)}
html[data-theme=dark] .credential-card .credential-error, html[data-theme=dark] .credential-card .credential-status{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .credential-card .credential-status{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .credential-link{color:var(--dk-teal)}
html[data-theme=dark] .credential-proof-note{border-top-color:var(--dk-line)}
html[data-theme=dark] .credential-eitaa{color:var(--dk-teal)}
html[data-theme=dark] .credential-delivery-mark{color:var(--dk-teal)}
html[data-theme=dark] .credential-card #credential-demo-code{background-color:var(--dk-surface-2)}
html[data-theme=dark] .credential-scene{background-color:var(--dk-tint);border-color:var(--dk-line)}
html[data-theme=dark] .credential-scene-kicker{color:var(--dk-text)}
html[data-theme=dark] .credential-scene-heading strong{color:var(--dk-text)}
html[data-theme=dark] .account-login .credential-scene-heading p{color:var(--dk-text)}
html[data-theme=dark] .credential-scene-services{border-bottom-color:var(--dk-line)}
html[data-theme=dark] .login-scene.credential-scene .credential-scene-services span{color:var(--dk-text)}
html[data-theme=dark] .credential-scene-services span+span:before{color:var(--dk-text)}
html[data-theme=dark] .account-login .credential-scene figcaption p{color:var(--dk-text)}
html[data-theme=dark] .identity-methods legend{color:var(--dk-text)}
html[data-theme=dark] .credential-card .identity-choices label{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .credential-card .identity-choices label:has(:checked){background-color:var(--dk-surface-2)}
/* interface_studio.css */
html[data-theme=dark] body.market-studio{background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio .secondary{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .secondary:hover:not(:disabled){background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio :is(input:not([type=checkbox],[type=radio]),select,textarea){background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio :is(input,textarea)::placeholder{color:var(--dk-text)}
html[data-theme=dark] .market-studio .muted{color:var(--dk-text)}
html[data-theme=dark] .market-studio .panel{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .brand small{color:var(--dk-text)}
html[data-theme=dark] .market-studio .jb-motion-trigger{color:var(--dk-text)}
html[data-theme=dark] .market-studio .header-profile{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio footer{color:var(--dk-text);border-top-color:var(--dk-line)}
html[data-theme=dark] .market-studio .demo-bar{background-color:var(--dk-tint);border-bottom-color:var(--dk-line)}
html[data-theme=dark] .market-studio .demo-bar select{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .workspace-account{border-bottom-color:var(--dk-line)}
html[data-theme=dark] .workspace-account .account-area-eyebrow{color:var(--dk-text)}
html[data-theme=dark] .workspace-account .account-area-heading strong{color:var(--dk-text)}
html[data-theme=dark] .workspace-account .account-area-switch{background-color:var(--dk-tint);border-color:var(--dk-line)}
html[data-theme=dark] .workspace-account .account-area-switch button{color:var(--dk-text)}
html[data-theme=dark] .workspace-account .account-area-switch button[aria-pressed=true]{background-color:var(--dk-surface)}
html[data-theme=dark] .workspace-account .service-finder-open{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .service-finder-open kbd{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .studio-eyebrow{color:var(--dk-text)}
html[data-theme=dark] .market-studio .citizen-home{color:var(--dk-text)}
html[data-theme=dark] .home-search-field{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .home-search-field>svg{color:var(--dk-text)}
html[data-theme=dark] .market-editorial-scene{background-color:var(--dk-tint)}
html[data-theme=dark] .market-editorial-scene figcaption{background-color:var(--dk-surface-2)}
html[data-theme=dark] .citizen-section-heading p{color:var(--dk-text)}
html[data-theme=dark] .citizen-section-heading>span{color:var(--dk-text)}
html[data-theme=dark] .market-studio .citizen-services .citizen-service{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .citizen-service-icon{background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio .citizen-service-copy>span{color:var(--dk-text)}
html[data-theme=dark] .market-studio .citizen-service-arrow{color:var(--dk-text)}
html[data-theme=dark] .market-studio .citizen-services .service-feature{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .wayfinding-label{color:var(--dk-text)}
html[data-theme=dark] .market-wayfinding p{color:var(--dk-text)}
html[data-theme=dark] .market-wayfinding strong{color:var(--dk-text)}
html[data-theme=dark] .wayfinding-line{border-top-color:var(--dk-line)}
html[data-theme=dark] .market-studio .citizen-privacy-note{color:var(--dk-text)}
html[data-theme=dark] .market-studio #admin-open-map{background-color:var(--dk-tint)}
html[data-theme=dark] .admin-map-art{background-color:var(--dk-tint)}
html[data-theme=dark] .admin-map-art figcaption{background-color:var(--dk-tint)}
html[data-theme=dark] .market-studio #admin-team-shortcut{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio #admin-team-shortcut p{color:var(--dk-text)}
html[data-theme=dark] .market-studio #attendance-admin-section{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .report-controls .count{border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .count strong{color:var(--dk-green)}
html[data-theme=dark] .market-studio .count span{color:var(--dk-text)}
html[data-theme=dark] .market-studio .vacant-booths{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .table-wrap{border-color:var(--dk-line)}
html[data-theme=dark] .market-studio th{background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio :is(th,td){border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .people-details{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .people-details summary{color:var(--dk-text)}
html[data-theme=dark] .market-studio .reviews-admin{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio :is(.profile-card,.profile-privacy,.team-add-panel,.team-member,.review-card,.reviews-summary){border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .profile-card{background-color:var(--dk-surface)}
html[data-theme=dark] .market-studio .profile-privacy{background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio .team-owner-note{background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio .calendar{border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .calendar>span:first-child{background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio .calendar strong{color:var(--dk-text)}
html[data-theme=dark] .market-studio .history{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .credential-card{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .credential-modes{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio :is(.community-eyebrow,.citizen-eyebrow){color:var(--dk-text)}
html[data-theme=dark] .market-studio .registration-note{background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio .community-form-disclosure>summary{color:var(--dk-green)}
html[data-theme=dark] .market-studio :is(.community-admin-section,.approvals-section){background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio :is(.approvals-privacy,.approvals-import){background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .reviews-picker{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .reviews-score>strong{color:var(--dk-green)}
html[data-theme=dark] .market-studio .reviews-summary{background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio .review-star-option:has(input:checked){background-color:var(--dk-tint)}
html[data-theme=dark] .studio-dialog{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .finder-heading>div>span{color:var(--dk-text)}
html[data-theme=dark] #service-finder-close{background-color:var(--dk-surface-2)}
html[data-theme=dark] .finder-status{color:var(--dk-text)}
html[data-theme=dark] .finder-results button{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .finder-results button small{color:var(--dk-text)}
html[data-theme=dark] .finder-results button:hover{background-color:var(--dk-tint);border-color:var(--dk-line)}
html[data-theme=dark] .finder-help{color:var(--dk-text)}
html[data-theme=dark] .finder-help kbd{border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .citizen-services .citizen-service:hover{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio #admin-open-map:hover{background-color:var(--dk-surface-2)}
html[data-theme=dark] .wayfinding-line{border-inline-start-color:var(--dk-line)}
html[data-theme=dark] .market-section-header>.service-emblem{background-color:var(--dk-tint)}
html[data-theme=dark] .market-studio #admin-view>.market-section-header-paper{background-color:var(--dk-surface-2);color:var(--dk-teal)}
html[data-theme=dark] .market-studio .market-section-header-paper>div>p{color:var(--dk-text)}
html[data-theme=dark] .market-section-header-paper>.service-emblem{background-color:var(--dk-surface)}
html[data-theme=dark] .market-field-group>legend{color:var(--dk-teal)}
html[data-theme=dark] .market-studio .market-privacy-hint{background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-ledger{background-color:var(--dk-surface)}
html[data-theme=dark] .market-studio .team-permission-option:has(input:checked), html[data-theme=dark] .market-studio .team-review:not(.revoke){background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio .team-member-permissions li, html[data-theme=dark] .market-studio .community-badge:not(.is-resolved){background-color:var(--dk-surface-2)}
html[data-theme=dark] .market-studio .approvals-import{background-color:var(--dk-surface)}
html[data-theme=dark] .market-studio .approvals-counts strong{color:var(--dk-teal)}
html[data-theme=dark] .market-studio #map-view .map-tools{background-color:var(--dk-surface)}
html[data-theme=dark] .market-studio .map-storefront-preview>.map-eyebrow{color:var(--dk-teal)}
html[data-theme=dark] .market-studio .citizen-services{background-color:var(--dk-surface)}
html[data-theme=dark] .market-studio .citizen-services .citizen-service{background-color:var(--dk-surface)}
html[data-theme=dark] .market-operations-heading .desk-caption{color:var(--dk-text)}
html[data-theme=dark] .market-operations-heading>.service-emblem{background-color:var(--dk-tint)}
html[data-theme=dark] .market-operations-heading h1{color:var(--dk-teal)}
html[data-theme=dark] .market-studio .report-controls .vacant-count{background-color:var(--dk-tint)}
html[data-theme=dark] .market-studio #application .service-directory{background-color:var(--dk-surface-2);border-top-color:var(--dk-line)}
html[data-theme=dark] .handheld-shortcuts button, html[data-theme=dark] .market-studio #directory-toggle{color:var(--dk-text)}
html[data-theme=dark] .handheld-shortcuts button[aria-current=page], html[data-theme=dark] .market-studio #directory-toggle[aria-expanded=true]{background-color:var(--dk-tint);color:var(--dk-teal)}
html[data-theme=dark] .service-directory:has(.service-key[aria-current=page]:not([data-view=citizen],[data-view=attendance],[data-view=map],[data-view=profile])) #directory-toggle{background-color:var(--dk-tint);color:var(--dk-teal)}
/* cleanliness.css */
html[data-theme=dark] .cleanliness-view{color:var(--dk-text)}
html[data-theme=dark] .cleanliness-heading p{color:var(--dk-text)}
html[data-theme=dark] .cleanliness-rule{color:var(--dk-red)}
html[data-theme=dark] .cleanliness-create{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .cleanliness-view select, html[data-theme=dark] .cleanliness-view input, html[data-theme=dark] .cleanliness-view textarea{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .cleanliness-record{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .cleanliness-record-head p{color:var(--dk-text)}
html[data-theme=dark] .cleanliness-status{color:var(--dk-red)}
html[data-theme=dark] .cleanliness-record[data-status=resolved] .cleanliness-status, html[data-theme=dark] .cleanliness-record[data-status=dismissed] .cleanliness-status{background-color:var(--dk-surface-2)}
html[data-theme=dark] .cleanliness-history{border-top-color:var(--dk-line)}
html[data-theme=dark] .cleanliness-timeline{border-inline-start-color:var(--dk-line)}
html[data-theme=dark] .cleanliness-timeline time{color:var(--dk-text)}
html[data-theme=dark] .cleanliness-decision{background-color:var(--dk-surface-2)}
html[data-theme=dark] .cleanliness-sanction{border-color:var(--dk-line)}
html[data-theme=dark] .cleanliness-sanction[data-state=cancelled]{color:var(--dk-text)}
html[data-theme=dark] .cleanliness-muted{color:var(--dk-text)}
html[data-theme=dark] .cleanliness-notifications{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .cleanliness-shortcut{background-color:var(--dk-surface-2)}
/* mobile_install.css */
html[data-theme=dark] .mobile-install{background-color:var(--dk-surface-2);border-color:var(--dk-line)}
html[data-theme=dark] .mobile-install p{color:var(--dk-text)}
html[data-theme=dark] .mobile-offline{background-color:var(--dk-surface-2)}
/* modern_ui.css */
html[data-theme=dark] .market-studio #application .service-directory{background-color:var(--dk-surface-2)}
html[data-theme=dark] .handheld-shortcuts button, html[data-theme=dark] .market-studio #directory-toggle{color:var(--dk-text)}
html[data-theme=dark] .handheld-shortcuts button[aria-current=page]{background-color:var(--dk-tint)}

/* 3. Hand-written fixes (after the generated rules so they win at equal specificity) */
html[data-theme=dark] body.market-studio{background-color:var(--dk-bg);color:var(--dk-text)}
html[data-theme=dark] .primary{background:var(--dk-btn);color:#fff}
html[data-theme=dark] .primary:hover{background:#2f7d68}
html[data-theme=dark] .header-profile[aria-current=page]{background:var(--dk-btn);color:#fff}
html[data-theme=dark] .citizen-home .home-action-primary{background:var(--dk-btn);border-color:var(--dk-btn);color:#fff}
html[data-theme=dark] .citizen-home .home-action{border-color:var(--dk-line)}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder,html[data-theme=dark] .market-studio :is(input,textarea)::placeholder{color:var(--dk-muted);opacity:1}
html[data-theme=dark] .handheld-shortcuts button,html[data-theme=dark] .market-studio #directory-toggle{color:var(--dk-text)}
html[data-theme=dark] .handheld-shortcuts button[aria-current=page],html[data-theme=dark] .market-studio #directory-toggle[aria-expanded=true]{background:var(--dk-tint);color:var(--dk-green);box-shadow:inset 0 3px 0 var(--dk-green)}
html[data-theme=dark] .market-studio .service-directory,html[data-theme=dark] .market-studio #application .service-directory{background:var(--dk-surface);border-color:var(--dk-line);box-shadow:0 -4px 16px #0008}
html[data-theme=dark] .map-mode-bar p{color:var(--dk-muted)}
html[data-theme=dark] .theme-toggle{background:var(--dk-surface);color:var(--dk-text);border-color:var(--dk-line)}

/* 4. Contrast fixes found by auditing every screen in dark mode (text >= 4.5:1).
   The generated rules above repainted some surfaces but left dark text or light paper behind. */
html[data-theme=dark] .market-studio .secondary,html[data-theme=dark] .market-studio .header-profile{color:var(--dk-text)}
html[data-theme=dark] .market-studio .header-profile{background-color:var(--dk-surface);border-color:var(--dk-line)}
html[data-theme=dark] .market-studio .header-profile[aria-current=page]{background-color:var(--dk-btn);color:#fff}
html[data-theme=dark] .market-studio .market-privacy-hint{background-color:var(--dk-tint);border-inline-start-color:var(--dk-green);color:var(--dk-text)}
html[data-theme=dark] .map-booth-browser legend{background-color:var(--dk-surface-2);color:var(--dk-text)}
html[data-theme=dark] .demo-bar,html[data-theme=dark] .demo-bar strong,html[data-theme=dark] .demo-bar label{color:var(--dk-text)}
html[data-theme=dark] .notice{background-color:var(--dk-tint);border-color:var(--dk-line);color:var(--dk-green)}
html[data-theme=dark] .notice.error{background-color:#3a1d22;border-color:#7a3a45;color:var(--dk-red)}
html[data-theme=dark] .market-studio .citizen-service-copy strong{color:var(--dk-text)}
html[data-theme=dark] .cleanliness-view{--clean-paper:#3a2e12;--clean-amber:var(--dk-amber);color:var(--dk-text)}
html[data-theme=dark] .cleanliness-rule,html[data-theme=dark] .cleanliness-status{color:var(--dk-amber)}
html[data-theme=dark] .market-studio #admin-open-map{background-color:var(--dk-btn);color:#fff;box-shadow:0 3px 0 var(--dk-line)}
html[data-theme=dark] .market-studio #admin-open-map:hover{background-color:#2d7d68}
html[data-theme=dark] .admin-map-art figcaption,html[data-theme=dark] .market-editorial-scene figcaption{background-color:var(--dk-surface-2);color:var(--dk-muted)}
html[data-theme=dark] .market-studio .cleanliness-notifications,html[data-theme=dark] .market-studio .cleanliness-notifications span,html[data-theme=dark] .market-studio .service-finder-open>span,html[data-theme=dark] .market-studio .directory-heading strong{color:var(--dk-text)}
html[data-theme=dark] .market-studio .directory-heading span:not(.directory-monogram){color:var(--dk-muted)}
html[data-theme=dark] .service-finder-open kbd,html[data-theme=dark] .finder-help kbd{background-color:var(--dk-surface-2);border-color:var(--dk-line);color:var(--dk-muted)}
html[data-theme=dark] .market-studio .directory-address strong{color:var(--dk-text)}
/* Status badges: generated rules repainted the pill background only. */
html[data-theme=dark] .market-studio .community-badge,html[data-theme=dark] .approval-badge,html[data-theme=dark] .team-member-badge,html[data-theme=dark] .phone-verification-badge.verified{color:var(--dk-green)}
html[data-theme=dark] .approval-badge.inactive{color:var(--dk-red)}
html[data-theme=dark] .team-member-badge.inactive,html[data-theme=dark] .phone-verification-badge{color:var(--dk-muted)}
html[data-theme=dark] .phone-verification-badge.verified{color:var(--dk-green)}
html[data-theme=dark] .review-own-badge{background-color:var(--dk-tint);color:var(--dk-teal)}
html[data-theme=dark] .cleanliness-record[data-status=resolved] .cleanliness-status,html[data-theme=dark] .cleanliness-record[data-status=dismissed] .cleanliness-status{background-color:var(--dk-surface-2);color:var(--dk-green)}
html[data-theme=dark] #service-finder,html[data-theme=dark] #service-finder h2{color:var(--dk-text)}
html[data-theme=dark] #service-finder-close{background-color:var(--dk-surface-2);color:var(--dk-text)}
html[data-theme=dark] #service-finder-results button,html[data-theme=dark] #service-finder button:not(#service-finder-close){color:var(--dk-text)}
