/* Mulk Wallet · Crystal / smoked glass · 2026-09-18
 * Shared material layer. Approved map geometry and touch targets are unchanged.
 * Scoped to the public shell; the administration workspace is unchanged.
 * The :root scope wins over the older public bridges without changing markup.
 */
:root[data-mh-shell="public"][data-em-theme] {
  --crystal-bg:#dce3e9;
  --crystal-solid:#f5f7f9;
  --crystal-soft:#e6edf0;
  --crystal-ink:#0e1934;
  --crystal-muted:#3d5063;
  --crystal-line:#b8c8ce;
  --crystal-edge:rgba(255,255,255,.90);
  --crystal-action:#096447;
  --crystal-positive:#086444;
  --crystal-negative:#a92e44;
  --crystal-accent-soft:#dcefe7;
  --crystal-card:linear-gradient(135deg,rgba(255,255,255,.64),rgba(237,243,251,.38) 50%,rgba(239,245,250,.56));
  --crystal-control:linear-gradient(135deg,rgba(255,255,255,.78),rgba(228,238,250,.46));
  --crystal-field:rgba(247,251,255,.68);
  --crystal-floating:linear-gradient(145deg,rgba(253,254,255,.98),rgba(233,240,244,.96));
  --crystal-chrome:linear-gradient(125deg,rgba(248,253,255,.84),rgba(223,236,247,.72));
  --crystal-shadow:inset 0 1px 1px rgba(255,255,255,.98),inset 0 -1px 0 rgba(255,255,255,.28),0 8px 26px rgba(36,57,87,.09),0 0 0 1px rgba(79,108,134,.09);
  --crystal-control-shadow:inset 0 1px 0 rgba(255,255,255,.96),0 3px 9px rgba(49,75,91,.08);
  --crystal-chrome-shadow:inset 0 1px 0 rgba(255,255,255,.90),0 4px 18px rgba(38,63,79,.08);
  --crystal-icon:linear-gradient(140deg,rgba(244,255,253,.82),rgba(80,240,180,.28));
  --crystal-canvas:radial-gradient(ellipse at 3% 12%,#f6fbffb3,transparent 32%),radial-gradient(ellipse at 92% 34%,#b6c8dc99,transparent 28%),radial-gradient(ellipse at 18% 64%,#9eafc86b,transparent 33%),radial-gradient(ellipse at 85% 85%,#ffffffb3,transparent 28%),#dce3e9;
  --crystal-green:linear-gradient(135deg,#39f3b8,#00dc96 60%,#00c98b);
  --crystal-green-ink:#043524;
  --crystal-selected:linear-gradient(135deg,#caffeadb,#6cf6c694);
  --crystal-ring:#087655;
  --bg:var(--crystal-bg);--panel:var(--crystal-solid);
  --surface:var(--crystal-solid);--surface-soft:var(--crystal-soft);
  --text:var(--crystal-ink);--muted:var(--crystal-muted);--line:var(--crystal-line);
  --accent-soft:var(--crystal-accent-soft);--shadow:var(--crystal-shadow);
  --em-background:var(--crystal-bg);--em-surface:var(--crystal-solid);
  --em-surface-raised:var(--crystal-solid);--em-surface-soft:var(--crystal-soft);
  --em-text:var(--crystal-ink);--em-muted:var(--crystal-muted);--em-line:var(--crystal-line);
  --em-shadow:var(--crystal-shadow);--em-accent-ink:var(--crystal-green-ink);
  --mulk-ui-action:var(--crystal-action);--mulk-ui-positive:var(--crystal-positive);--mulk-ui-negative:var(--crystal-negative);
}
:root[data-mh-shell="public"][data-em-theme="dark"] {
  --crystal-bg:#0c1923;
  --crystal-solid:#20323e;
  --crystal-soft:#263b48;
  --crystal-ink:#edf6f5;
  --crystal-muted:#c1d2de;
  --crystal-line:#375356;
  --crystal-edge:rgba(205,227,242,.34);
  --crystal-action:#87e3c2;
  --crystal-positive:#87e3c2;
  --crystal-negative:#ffadb9;
  --crystal-accent-soft:#1b3d34;
  --crystal-card:linear-gradient(135deg,rgba(100,132,151,.48),rgba(33,56,73,.52) 55%,rgba(24,42,54,.60));
  --crystal-control:linear-gradient(135deg,rgba(108,136,156,.40),rgba(31,51,67,.62));
  --crystal-field:rgba(15,34,47,.66);
  --crystal-floating:linear-gradient(145deg,rgba(33,50,53,.98),rgba(14,32,32,.98));
  --crystal-chrome:linear-gradient(125deg,rgba(57,84,102,.83),rgba(17,35,48,.82));
  --crystal-shadow:inset 0 1px 0 rgba(208,244,241,.16),inset 0 -1px 0 rgba(2,12,14,.38),0 10px 28px rgba(0,5,8,.27),0 2px 5px rgba(0,5,8,.17);
  --crystal-control-shadow:inset 0 1px 0 rgba(208,244,241,.18),0 3px 10px rgba(0,5,8,.22);
  --crystal-chrome-shadow:inset 0 1px 0 rgba(208,244,241,.12),0 4px 18px rgba(0,5,8,.24);
  --crystal-icon:linear-gradient(140deg,rgba(96,152,136,.45),rgba(27,65,53,.72));
  --crystal-canvas:radial-gradient(ellipse at 8% 8%,#42678166,transparent 32%),radial-gradient(ellipse at 88% 39%,#42736c55,transparent 32%),radial-gradient(ellipse at 14% 68%,#52687f70,transparent 32%),radial-gradient(ellipse at 75% 90%,#183a394d,transparent 28%),#0c1923;
  --crystal-green:linear-gradient(135deg,#2be3b1,#05c995 60%,#02b987);
  --crystal-selected:linear-gradient(135deg,#29c79d61,#096d586e);
  --crystal-ring:#87e3c2;
}

/* A silver / slate light field sits behind the translucent cards. No animated canvas. */
:root[data-mh-shell="public"][data-em-theme] body,
:root[data-mh-shell="public"][data-em-theme] .em-shell,
:root[data-mh-shell="public"][data-em-theme] .em-auth {
  background:var(--crystal-canvas)!important;
  color:var(--crystal-ink);
}

/* Surfaces: no filter on generic panels, which may contain fixed dialogs/maps. */
:root[data-mh-shell="public"][data-em-theme] :is(.em-panel,.em-price-card,.em-area-chip,.em-empty,.em-auth-card,.em-marketing-notice,.em-search-box,.em-hero-indicator,.pr-panel,.pr-metric,.pr-plan-card,.pr-photo-grid button,.pr-timeline article,.pp-panel,.pp-unit-card,.pp-price-card,.pp-nearby-grid article,.ls-panel,.ls-filter,.ls-filter-box,.ls-card,.auth-card,.mh-card,.mh-panel,.mh-lux-card,.mh-lux-panel) {
  background:var(--crystal-card);
  border-color:var(--crystal-edge);
  box-shadow:var(--crystal-shadow);
  color:var(--crystal-ink);
}
/* These cards have no fixed descendants. Existing controls keep their positions. */
:root[data-mh-shell="public"][data-em-theme] :is(.em-price-card,.em-tool,.em-index-card,.em-project-card,.em-search-box,.em-hero-indicator) {
  -webkit-backdrop-filter:blur(16px) saturate(115%);
  backdrop-filter:blur(16px) saturate(115%);
}
:root[data-mh-shell="public"][data-em-theme] :is(.em-header,.em-bottom-nav,.topbar) {
  background:var(--crystal-chrome)!important;
  border-color:var(--crystal-edge)!important;
  box-shadow:var(--crystal-chrome-shadow);
}
:root[data-mh-shell="public"][data-em-theme] :is(.em-language-menu,.em-search-results,.em-menu-panel,.ls-app dialog) {
  background:var(--crystal-floating);
  border-color:var(--crystal-edge);
  box-shadow:var(--crystal-shadow);
  color:var(--crystal-ink);
}

/* Same buttons / touch targets / wrapping. Material, edges and color only. */
:root[data-mh-shell="public"][data-em-theme] :is(.em-button,.pp-button,.button:not(.danger),.ls-btn:not(.danger),.auth-action--primary,.primary,.mh-lux-btn-primary) {
  background:var(--crystal-green);
  border-color:rgba(169,255,224,.80);
  color:var(--crystal-green-ink)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.40),0 4px 12px rgba(0,91,60,.16);
}
:root[data-mh-shell="public"][data-em-theme] :is(.em-secondary,.em-login,.em-theme-toggle,.em-language-trigger,.em-filter-button,.em-theme-menu-action,.em-icon-button,.pp-button.secondary,.button.secondary,.ls-btn.secondary,.auth-action:not(.auth-action--primary),.mulk-theme-toggle,.pr-text-button,.text-button,.pr-breadcrumb a,.auth-foot a,.mh-lux-btn-secondary,.mh-lux-btn-ghost) {
  background:var(--crystal-control)!important;
  border-color:var(--crystal-edge)!important;
  color:var(--crystal-ink)!important;
  box-shadow:var(--crystal-control-shadow);
}
:root[data-mh-shell="public"][data-em-theme] :is(.em-search-tabs button.is-active,.pr-segment button.active) {
  background:var(--crystal-selected);
  color:var(--crystal-action);
  box-shadow:inset 0 1px 0 rgba(155,232,204,.30);
}
:root[data-mh-shell="public"][data-em-theme] :is(.em-icon-tile,.em-project-cover,.pr-unit-icon,.pr-plan-art,.pp-nearby-icon) {
  background:var(--crystal-icon);
  border-color:var(--crystal-edge);
  color:var(--crystal-action);
  box-shadow:var(--crystal-control-shadow);
}
:root[data-mh-shell="public"][data-em-theme] .em-icon-tone {fill:currentColor;fill-opacity:.12;stroke:none}
:root[data-mh-shell="public"][data-em-theme="dark"] .em-icon-tone {fill-opacity:.18}

/* Input text stays clear; the search input remains transparent within its field. */
:root[data-mh-shell="public"][data-em-theme] :is(.em-search-form,input:where(:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range])),textarea,select) {
  background:var(--crystal-field)!important;
  border-color:var(--crystal-line)!important;
  color:var(--crystal-ink)!important;
}
:root[data-mh-shell="public"][data-em-theme] .em-search-form input {background:transparent!important}
:root[data-mh-shell="public"][data-em-theme] :is(input,textarea)::placeholder {color:var(--crystal-muted)!important}
:root[data-mh-shell="public"][data-em-theme] select option {background:var(--crystal-solid);color:var(--crystal-ink)}
:root[data-mh-shell="public"][data-em-theme] :is(.em-price-card small,.em-tool p,.em-muted,.pr-muted,.pr-note,.pr-description-text,.pr-heading p,.pr-metric>span,.pr-metric small,.pr-analysis-meta,.pr-analysis-controls label,.pr-facts dt,.pr-timeline small,.pp-note,.pp-price-card p,.pp-range,.pp-nearby-grid p,.pp-nearby-grid small,.ls-muted,.ls-heading p,.ls-facts,.ls-price small) {color:var(--crystal-muted)}
:root[data-mh-shell="public"][data-em-theme] .pr-metric.rising strong {color:var(--crystal-positive)}
:root[data-mh-shell="public"][data-em-theme] .pr-metric.falling strong {color:var(--crystal-negative)}
:root[data-mh-shell="public"][data-em-theme] .pr-metric.stable strong {color:var(--crystal-ink)}
:root[data-mh-shell="public"][data-em-theme] :is(.pp-unit-price strong,.pp-reference,.ls-price) {color:var(--crystal-action)}
:root[data-mh-shell="public"][data-em-theme] :is(.em-bottom-nav .is-active,.em-index-top .em-icon,.em-area-chip .em-icon) {color:var(--crystal-action)}
:root[data-mh-shell="public"][data-em-theme] :focus-visible {outline-color:var(--crystal-ring)}

/* Finish the frame and external toolbar; preserve the map canvas and marker. */
:root[data-mh-shell="public"][data-em-theme] .em-map-stage {border-color:var(--crystal-edge);box-shadow:var(--crystal-shadow)}
:root[data-mh-shell="public"][data-em-theme] :is(.mulk-map-toolbar,.mulk-map-status) {background:var(--crystal-card)!important;border-color:var(--crystal-edge)!important;color:var(--crystal-ink)!important}
:root[data-mh-shell="public"][data-em-theme] [data-testid="market-map-filters"] {background:var(--crystal-control)!important;border-color:var(--crystal-edge)!important;color:var(--crystal-ink)!important}

/* Older public functional pages use these shared tokens; admin stays untouched. */
:root[data-mh-shell="public"][data-em-theme] :is(.mh-day,.mh-midnight) {
  --mh-surface:229 234 237;--mh-surface-raised:245 247 249;--mh-surface-sunken:230 237 240;
  --mh-ink:19 34 49;--mh-ink-muted:72 92 105;--mh-ink-faint:72 92 105;
  --mh-line:184 200 206;--mh-line-strong:143 165 175;
  --mh-night-raised:245 247 249;--mh-night-sunken:230 237 240;
}
:root[data-mh-shell="public"][data-em-theme="dark"] :is(.mh-day,.mh-midnight) {
  --mh-surface:8 17 19;--mh-surface-raised:21 36 39;--mh-surface-sunken:10 25 28;
  --mh-ink:237 246 245;--mh-ink-muted:176 197 199;--mh-ink-faint:176 197 199;
  --mh-line:55 83 86;--mh-line-strong:96 126 129;
  --mh-night-raised:21 36 39;--mh-night-sunken:10 25 28;
}

@media(hover:hover) {
  :root[data-mh-shell="public"][data-em-theme] :is(.em-price-card,.em-area-chip,.em-button,.em-theme-toggle,.em-language-trigger,.ls-card):hover {border-color:var(--crystal-action)}
}
/* Preserve readable surfaces on browsers without backdrop blur. */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  :root[data-mh-shell="public"][data-em-theme] {--crystal-card:var(--crystal-solid);--crystal-control:var(--crystal-solid);--crystal-chrome:var(--crystal-solid)}
}
@media(prefers-reduced-transparency:reduce) {
  :root[data-mh-shell="public"][data-em-theme] {--crystal-card:var(--crystal-solid);--crystal-control:var(--crystal-solid);--crystal-chrome:var(--crystal-solid);--crystal-floating:var(--crystal-solid)}
  :root[data-mh-shell="public"][data-em-theme] :is(.em-price-card,.em-tool,.em-index-card,.em-project-card,.em-search-box,.em-hero-indicator,.em-header,.topbar) {-webkit-backdrop-filter:none;backdrop-filter:none}
}
@media(forced-colors:active) {
  :root[data-mh-shell="public"][data-em-theme] {
    --crystal-bg:Canvas;--crystal-solid:Canvas;--crystal-soft:Canvas;
    --crystal-ink:CanvasText;--crystal-muted:CanvasText;--crystal-line:ButtonText;--crystal-edge:ButtonText;
    --crystal-action:LinkText;--crystal-ring:Highlight;--crystal-green-ink:ButtonText;
    --crystal-card:Canvas;--crystal-control:ButtonFace;--crystal-field:Field;--crystal-floating:Canvas;
    --crystal-chrome:Canvas;--crystal-canvas:Canvas;--crystal-green:ButtonFace;--crystal-selected:Canvas;
    --crystal-icon:Canvas;--crystal-shadow:none;--crystal-control-shadow:none;--crystal-chrome-shadow:none;
  }
}

/* Crystal revision: the SAME hero photograph continues behind the copy. */
:root[data-mh-shell="public"][data-em-theme] .em-shell .em-hero-copy{background:transparent;border:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
:root[data-mh-shell="public"][data-em-theme] .em-hero-picture img{filter:none;object-position:50% 50%}
:root[data-mh-shell="public"][data-em-theme][dir] .em-hero:before{background:linear-gradient(var(--hero-scrim-direction,90deg),rgba(238,245,252,.02) 15%,rgba(238,245,252,.48) 48%,rgba(238,245,252,.80) 100%)}
:root[data-mh-shell="public"][data-em-theme="dark"][dir] .em-hero:before{background:linear-gradient(var(--hero-scrim-direction,90deg),rgba(9,24,39,.05) 15%,rgba(9,24,39,.49) 48%,rgba(9,24,39,.84) 100%)}
:root[data-mh-shell="public"][dir="ltr"] .em-hero{--hero-scrim-direction:270deg}
:root[data-mh-shell="public"][data-em-theme] .em-hero-subtitle{color:var(--crystal-ink)}
:root[data-mh-shell="public"][data-em-theme] .em-hero h1{text-shadow:0 1px 8px rgba(237,247,255,.12)}
:root[data-mh-shell="public"][data-em-theme="dark"] .em-hero h1{text-shadow:0 2px 12px rgba(2,12,25,.28)}
@media(max-width:767px){
 :root[data-mh-shell="public"][data-em-theme][dir] .em-hero:before{background:linear-gradient(180deg,rgba(239,246,253,.72),rgba(239,246,253,.50) 48%,rgba(239,246,253,.60))}
 :root[data-mh-shell="public"][data-em-theme="dark"][dir] .em-hero:before{background:linear-gradient(180deg,rgba(10,26,42,.68),rgba(10,26,42,.46) 48%,rgba(10,26,42,.58))}
}
/* Floating controls retain opaque-enough backing above arbitrary map imagery. */
:root[data-mh-shell="public"][data-em-theme] :is(.maplibregl-ctrl-group,.maplibregl-ctrl-attrib){background:var(--crystal-floating)!important;border-color:var(--crystal-edge);box-shadow:var(--crystal-control-shadow)}
:root[data-mh-shell="public"][data-em-theme] .maplibregl-ctrl-attrib a{background:transparent!important;color:var(--crystal-ink)!important}
:root[data-mh-shell="public"][data-em-theme] [data-testid="market-map-filters"] button[aria-pressed="true"]{background:var(--crystal-green)!important;color:var(--crystal-green-ink)!important;box-shadow:inset 0 1px 1px #ffffff70}
:root[data-mh-shell="public"][data-em-theme] [data-testid="market-map-filters"] button[aria-pressed="false"]{background:var(--crystal-control)!important;color:var(--crystal-ink)!important}

@media(forced-colors:active){
 :root[data-mh-shell="public"][data-em-theme][dir] .em-hero:before{background:Canvas}
 :root[data-mh-shell="public"][data-em-theme] .em-hero-picture{visibility:hidden}
}
