/* Only the touched control gets a composited layer; no permanent will-change or live blur. */
body .account-avatar:not([data-avatar-ready]) { color:transparent; }
body:not(.app-embed) :is(.portfolio-global-nav,.portfolio-section-nav,.watch-view-switch) { position:relative; isolation:isolate; border-radius:999px; }
body:not(.app-embed) .watch-view-switch { align-items:center; padding:5px; border:1px solid var(--liquid-edge); background:var(--liquid-control); }
body:not(.app-embed) .watch-view-switch button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:40px; padding:8px 12px; border-radius:999px; }
.watch-toolbar { display:flex; align-items:center; gap:8px; }
.watch-toolbar>#watchEdit { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:40px; padding:8px 12px; border:1px solid var(--liquid-edge); border-radius:999px; }
.watch-control-icon { display:block; width:18px; height:18px; flex:0 0 18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
body:not(.app-embed) #watchlistGrid .watch-edit-icon { border:1px solid var(--liquid-edge); background:var(--liquid-control); }
body[data-workspace-view="watchlist"] .workspace-main { padding-top:0; }
body[data-workspace-view="watchlist"] #watchlist { margin-top:0; padding-top:0; }
body[data-workspace-view="watchlist"] .workspace-section-head { align-items:center; }
body[data-workspace-view="watchlist"] .workspace-section-head h2 { margin:0; }
body[data-workspace-view="watchlist"] #watchSearch input { height:44px; min-height:44px; padding:0 16px; border-radius:999px; }
:root:root body .release-button { color:var(--text) !important; border:1px solid var(--liquid-edge) !important; }
:root:root body .release-button.primary { background:var(--text) !important; color:var(--bg) !important; }
.admin-page #adminAIForm { grid-template-columns:repeat(2,minmax(0,1fr)); }
.admin-page #adminAIForm label { min-width:0; }
.admin-page #adminAIForm input:not([type="checkbox"]) { width:100%; min-width:0; box-sizing:border-box; }
.admin-page #adminAIForm .admin-backfill-actions { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:flex-start; }
.admin-page :is(#adminAIInterfaces,#adminAPISources) { overflow-wrap:anywhere; }
@media(max-width:600px){.admin-page #adminAIForm{grid-template-columns:minmax(0,1fr);}}
.admin-page .admin-main { grid-template-columns:minmax(0,1fr); }
.admin-page #adminBody { min-width:0; }
.admin-page #adminBody:not([hidden]) { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; }
.admin-page #adminAIForm .admin-backfill-actions label { display:inline-flex; align-items:center; gap:8px; }
.admin-page #adminAIForm input[type="checkbox"] { width:18px; height:18px; min-height:18px; margin:0; }
:root body .liquid-control:not(:disabled),
:root body .liquid-control:not(:disabled):is(:hover,:active) {
  transform:none !important;
}
/* Animated scale must win over the old :active rule. The controller owns it via WAAPI. */
:root body .liquid-control { transition-property:color,background-color,border-color,box-shadow !important; }
/* A rail has one moving lens. Individual labels never paint a second plate. */
:root body .liquid-rail > :is(a,button),
:root body .liquid-rail > :is(a,button):is(:hover,:active) {
  background:transparent !important;box-shadow:none !important;border-color:transparent !important;
}
/* Suppress the browser/WebView tap rectangle; retain keyboard focus outlines. */
:root body :is(button,a[href],[role="button"],[role="tab"],summary,label[for],label:has(input[type="file"]),input[type="submit"],input[type="button"]) {
  -webkit-tap-highlight-color:transparent;
}
:root body .liquid-selection { contain:layout style; }
:root body .liquid-control.is-glass-held { filter:none; }
:root body .liquid-selection.is-glass-held {
  scale:1.12 1.30;
  box-shadow:inset 0 1px 1px var(--glass-highlight),inset 0 -1px 1px var(--liquid-edge),0 3px 8px -5px rgba(0,0,0,.25);
}
:root body .liquid-selection { transition:scale 420ms linear(0, .10, .30, .53, .73, .88, .99, 1.05, 1.055, 1.035, 1.012, 1),box-shadow 260ms var(--ease-glass); }
@media(prefers-reduced-motion:reduce) {
  :root body :is(button,a[href],[role="button"],[role="tab"],summary,label):active { transform:none !important; scale:none !important; }
  :root body .liquid-selection { scale:none !important; transition:none !important; }
}

/* Localized control labels wrap without clipping or changing the glass selection. */
.segmented-control > button { min-width:0; height:auto; min-height:32px; padding-block:6px; line-height:1.35; white-space:normal; overflow-wrap:anywhere; text-align:center; }
.settings-language-panel .settings-panel-head { flex-wrap:wrap; gap:12px; }
.settings-language-panel [data-language-control] { max-width:100%; }
@media(max-width:480px) {
  .settings-language-panel [data-language-control] { width:100%; }
  .settings-language-panel [data-language-control] button { flex:1; padding-inline:8px; }
}

/* Refract background text at the rim; foreground control labels stay sharp. */
:root:root body :is(.home-header-inner,.topbar,.sidebar,.section-nav,.liquid-rail,.liquid-selection) {
  backdrop-filter:var(--glass-optics,blur(0)) blur(var(--glass-optical-blur,1.5px)) saturate(125%) !important;
  -webkit-backdrop-filter:var(--glass-optics,blur(0)) blur(var(--glass-optical-blur,1.5px)) saturate(125%) !important;
}
:root body .liquid-selection::after {
  content:"";position:absolute;inset:0;border-radius:inherit;padding:2px;pointer-events:none;
  background:linear-gradient(160deg,var(--liquid-edge),transparent 45%,var(--liquid-edge));
  mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask-composite:exclude;
  -webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;
  opacity:0;transition:opacity 220ms var(--ease-glass);
}
:root body .liquid-selection.is-glass-held::after { opacity:.9; }
@media(prefers-reduced-transparency:reduce) {
  :root:root body :is(.home-header-inner,.topbar,.sidebar,.section-nav,.liquid-rail,.liquid-selection) { backdrop-filter:none !important;-webkit-backdrop-filter:none !important; }
}
@media(prefers-reduced-motion:reduce) { :root body .liquid-selection::after { transition:none; } }

/* App Library reference: frosted content, clearer optical chrome, crisp type.
   Blur never animates; only the existing transform spring moves the surface. */
:root {
  --bg:#ffffff; --bg-top:#ffffff; --home-bg:var(--bg);
  --liquid-radius-card:26px; --liquid-radius-control:16px;
  --liquid-content:rgba(255,255,255,.58);
  --liquid-content-hover:rgba(255,255,255,.66);
  --liquid-control:rgba(255,255,255,.54);
  --liquid-surface:rgba(255,255,255,.38);
  --glass-navigation-fill:rgba(255,255,255,.28);
  --liquid-edge:rgba(0,0,0,.20);
  --liquid-edge-subtle:rgba(0,0,0,.22);
  --glass-highlight:rgba(255,255,255,.86);
  --glass-sheen:transparent;
  --material-shadow:0 12px 28px -22px rgba(0,0,0,.18),inset 0 .7px .7px rgba(255,255,255,.86),inset 0 -.7px .7px rgba(0,0,0,.22);
  --material-content-blur:blur(18px) saturate(135%); --material-sheet-blur:blur(30px) saturate(145%); --material-scrim-blur:blur(10px);
  --home-glass:var(--liquid-content); --home-glass-strong:var(--liquid-surface);
  --home-glass-soft:var(--liquid-control); --home-glass-sheet:var(--liquid-content);
}
:root[data-theme="dark"] {
  --bg:#000000; --bg-top:#000000; --home-bg:var(--bg);
  --liquid-content:rgba(0,0,0,.61);
  --liquid-content-hover:rgba(0,0,0,.70);
  --liquid-control:rgba(0,0,0,.50);
  --liquid-surface:rgba(0,0,0,.42);
  --glass-navigation-fill:rgba(0,0,0,.22);
  --liquid-edge:rgba(255,255,255,.24); --liquid-edge-subtle:rgba(255,255,255,.16);
  --glass-highlight:rgba(255,255,255,.40); --glass-sheen:transparent;
  --material-shadow:0 12px 28px -20px rgba(0,0,0,.55),inset 0 .7px .7px rgba(255,255,255,.30),inset 0 -.7px .7px rgba(255,255,255,.07);
}
@media screen {
  :root:root body::before { display:none !important; animation:none !important; }
  :root:root body {
    background-color:var(--bg) !important;
    background-image:none !important;
    background-size:100% 100vh;
    background-repeat:no-repeat;
  }
  :root:root body :is(.card,.event-board,.strategy-board,.tactical-board,.signal-board,.portfolio-board,.workspace-card,.workspace-hero,.workspace-kpis,.home-hero,.home-command-card,.home-change-panel,.home-action-panel,.home-evidence-card,.home-dimension,.home-news-card,.home-opportunity-row,.settings-panel,.settings-audit-panel,.settings-session-panel,.portfolio-summary-panel,.portfolio-stress-panel,.asset-card,.indicator-card,.news-card,.news-impact-card,.holding-news-card,.holding-news-item,.journal-card,.alert-rule-card,.macro-release-card,.release-card,.stress-card,.watchlist-card,.tactical-card,.tactical-watch-card,.daily-focus-card,.review-item,.register-card,.register-intro,.register-form-panel,.portfolio-auth-gate,.workspace-auth-gate,.tool-card,.tool-summary>div,.doc-card,.doc-hero,.doc-section,.news-detail-section,.symbol-fundamentals-panel) {
    border:1px solid var(--liquid-edge-subtle) !important;
    border-radius:var(--liquid-radius-card) !important;
    background:var(--liquid-content) !important;
    box-shadow:var(--material-shadow) !important;
    backdrop-filter:var(--material-content-blur) !important;
    -webkit-backdrop-filter:var(--material-content-blur) !important;
    /* Contents enter with the page, not a delayed extra hover/arrival transform. */
    transition-property:color,border-color,background-color !important;
  }
  /* One frosted sheet per data group; nested cards share that material. */
  :root:root body :is(.card,.workspace-card,.tool-card,.settings-panel,.portfolio-board,.home-command-panel) :is(.card,.workspace-card,.workspace-metric-card,.tool-card,.asset-card,.indicator-card,.portfolio-metric,.home-command-card) {
    backdrop-filter:none !important; -webkit-backdrop-filter:none !important;
    box-shadow:inset 0 .7px 0 var(--liquid-edge) !important;
    background:var(--liquid-control) !important;
    border-radius:18px !important;
  }
  :root:root body :is(.home-header-inner,.topbar,.sidebar,.section-nav,.section-nav,.liquid-rail) {
    --glass-optical-blur:1.5px;
    background:var(--glass-navigation-fill) !important;
    border-color:var(--liquid-edge) !important;
    box-shadow:var(--material-shadow) !important;
  }
  /* The vertical list is a layout container, not a second glass pane. */
  :root:root body .section-nav-links.liquid-rail {
    background:none !important; border:0 !important; box-shadow:none !important;
    backdrop-filter:none !important; -webkit-backdrop-filter:none !important;
  }
  :root:root body .liquid-selection { --glass-optical-blur:1.5px; }
  :root:root body .liquid-selection { background:var(--liquid-control) !important; border-color:var(--liquid-edge) !important; }
  :root:root body .daily-focus-grid {
    gap:14px; border:0; background:none !important; box-shadow:none !important;
    overflow:visible; backdrop-filter:none !important; -webkit-backdrop-filter:none !important;
  }
  :root:root body .daily-focus-card { padding:18px; }
  :root:root body .daily-focus-card::before { background:var(--text); opacity:.45; }
  :root:root body .product-optional > summary { padding:18px 22px; min-height:64px; }
  :root:root body .product-optional { padding:0 !important; }
  :root:root body .section-nav-link { border-radius:999px; }
  :root:root body .section-nav-collapse { justify-content:center; }
  :root:root body .section-nav-link::before { display:none; }
  :root:root body .liquid-rail > :is(a,button) { user-select:none; -webkit-user-drag:none; }
  :root:root body :is(.account-popover,.custom-select-menu,.release-panel,.app-notice-panel,.avatar-crop-panel,.opportunity-popup-panel,.indicator-detail-panel,.news-detail-panel,.holding-news-detail-panel,.account-modal-panel) {
    border-radius:32px !important;
    background:var(--liquid-content) !important;
    border-color:var(--liquid-edge) !important;
    box-shadow:var(--material-shadow) !important;
    backdrop-filter:var(--material-sheet-blur) !important;
    -webkit-backdrop-filter:var(--material-sheet-blur) !important;
  }
  :root:root body :is(.news-detail-popup,.indicator-detail-popup,.holding-news-detail-popup,.opportunity-popup,.account-modal,.release-popup,.app-notice-modal) {
    backdrop-filter:var(--material-scrim-blur) !important; -webkit-backdrop-filter:var(--material-scrim-blur) !important;
  }
  :root:root body :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) {
    border-radius:16px !important;
    background:var(--liquid-control) !important;
    border-color:var(--liquid-edge-subtle) !important;
    box-shadow:inset 0 .7px 0 var(--glass-highlight),inset 0 -.7px 0 var(--liquid-edge-subtle) !important;
  }
  :root:root body :is(button,.tool-button,.secondary-button,.symbol-report-link,.account-secondary-button):not(.liquid-rail>button) {
    border-radius:999px !important;
    background:var(--liquid-control);
    box-shadow:inset 0 .7px .7px var(--glass-highlight),inset 0 -.7px .7px var(--liquid-edge-subtle);
  }
  :root:root body :is(.card,.news-card,.workspace-card,.asset-card,.home-command-card,.home-news-card,.tool-card):hover { transform:none !important; }
  :root:root body :is(.card,.tool-card,.settings-panel,.workspace-card,.home-command-card) :is(button,.tool-button) {
    backdrop-filter:none; -webkit-backdrop-filter:none;
  }
  /* Finance labels and charts are foreground content, never Gaussian-blurred. */
  :root:root body :is(.chart,.chart-wrap,.table-scroll,.workspace-table-wrap,.watch-table-wrap) { filter:none; }
  :root:root body :is(.home-header-inner,.topbar) { border-radius:999px !important; }
  :root:root body .account-popover {
    max-height:calc(100dvh - 28px); overflow-y:auto; overscroll-behavior:contain;
    transition:none !important; animation:none !important;
  }
  :root:root body .news-hub-head { align-items:stretch; flex-direction:column; gap:16px; }
  :root:root body .news-toolbar { flex-wrap:wrap; justify-content:space-between; gap:12px; }
  :root:root body .news-categories {
    width:100%; max-width:100%; min-width:0; flex:1 1 520px;
    padding:6px; gap:4px; border:1px solid var(--liquid-edge);
    border-radius:999px; scroll-padding-inline:6px; overscroll-behavior-x:contain;
  }
  :root:root body .news-category {
    min-height:40px; padding:8px 14px; line-height:1.3; font-size:13px;
    color:var(--muted); border-radius:999px;
  }
  :root:root body .news-category[aria-selected="true"] { color:var(--text); }
  :root:root body .news-scroll-actions { gap:8px; }
  :root:root body :is(.news-icon-button,.news-refresh-button) { height:40px; min-height:40px; }
  :root:root body .news-icon-button { width:40px; flex:0 0 40px; }
  :root:root body .news-categories .liquid-selection.is-glass-held { scale:1.02 1.06; }
  :root:root body .news-overview { margin-top:24px; padding-top:20px; border-top:1px solid var(--liquid-edge-subtle); }
  :root:root body :is(.account-primary-button,.home-primary-action,.register-submit,.login-submit) {
    background:#000 !important; color:#fff !important; border-color:var(--liquid-edge) !important; box-shadow:var(--material-shadow) !important;
  }
  :root:root[data-theme="dark"] body :is(.account-primary-button,.home-primary-action,.register-submit,.login-submit) { background:#fff !important; color:#000 !important; }
}
@media(max-width:700px) {
  :root:root body.market-page { min-width:0; }
  :root:root body.market-page .topbar { display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; gap:6px; padding:10px; min-height:64px; }
  :root:root body.market-page .topbar .brand { display:flex; flex-direction:row; align-items:center; gap:8px; flex:1; min-width:0; }
  :root:root body.market-page .topbar .brand-mark { width:32px; height:32px; flex:0 0 32px; }
  :root:root body.market-page .topbar .brand h1 { display:block; font-size:19px; margin:0; }
  :root:root body.market-page .topbar .brand div>p { display:none; }
  :root:root body.market-page .topbar .top-actions { display:flex; flex-direction:row; flex-wrap:nowrap; width:auto; gap:6px; }
  :root:root body.market-page .topbar :is(.live-status,.switch-control) { display:none; }
  :root:root body.market-page .topbar :is(.refresh-button,.market-home-link,.mobile-nav-toggle) { display:inline-flex; width:36px; min-width:36px; height:40px; min-height:40px; padding:0; align-items:center; justify-content:center; }
  :root:root body.market-page .topbar .mobile-nav-toggle { flex-direction:column; }
  :root:root body.market-page .topbar .refresh-button>span:last-child { display:none; }
  :root:root body.market-page .topbar .market-home-link { font-size:0; }
  :root:root body.market-page .topbar .market-home-link::before { content:"‹"; font-size:24px; }
  :root:root body.market-page .topbar .account-trigger { min-width:40px; width:40px; min-height:40px; height:40px; padding:3px; gap:0; }
  :root:root body.market-page .topbar .account-avatar { width:32px; height:32px; flex:0 0 32px; }
  :root:root body.market-page .topbar .account-trigger-copy { display:none; }
}
@supports not (backdrop-filter:blur(1px)) {
  :root { --liquid-content:#fff; --liquid-surface:#fff; --liquid-control:#fff; --glass-navigation-fill:#fff; }
  :root[data-theme="dark"] { --liquid-content:#000; --liquid-surface:#000; --liquid-control:#111; --glass-navigation-fill:#000; }
}
@media (prefers-reduced-transparency:reduce) {
  :root { --liquid-content:#fff; --liquid-surface:#fff; --liquid-control:#fff; --glass-navigation-fill:#fff; }
  :root[data-theme="dark"] { --liquid-content:#000; --liquid-surface:#000; --liquid-control:#111; --glass-navigation-fill:#000; }
  :root { --material-content-blur:none; --material-sheet-blur:none; --material-scrim-blur:none; }
  :root:root body * { backdrop-filter:none !important; -webkit-backdrop-filter:none !important; }
}

/* Search fields are full capsules in both languages and every workspace. */
@media screen {
  :root:root body :is(input[type="search"],.watch-search input,.holding-search input) {
    border-radius:999px !important;
    padding-inline:14px;
  }
  :root:root body :is(.register-submit,.login-submit,.account-primary-button,.home-primary-action) {
    border-radius:999px !important;
  }
}

/* Neutral glass: remove static side lighting; keep the rounded rim and live optics. */
@media screen {
  :root,:root[data-theme="dark"] { --glass-sheen:transparent; --material-shadow:0 6px 18px -16px rgba(0,0,0,.22); }
  :root:root body :is(.home-header-inner,.topbar,.sidebar,.section-nav,.liquid-rail,.liquid-selection,.tool-summary>div) { background-image:none !important; }
  :root:root body :is(.home-header-inner,.topbar,.sidebar,.section-nav,.liquid-rail)::before { background-image:none !important; }
  :root:root body :is(.news-detail-panel,.holding-news-detail-panel) { max-width:820px; }
  :root:root body .news-detail-body { gap:18px; }
  :root:root body .news-article-text { font-size:16px; line-height:1.9; white-space:normal; overflow-wrap:anywhere; }
  :root:root body .news-article-text p { margin:0 0 1.2em; }
  :root:root body .news-article-text p:last-child { margin-bottom:0; }
  :root:root body :is(.news-detail-actions,.news-detail-foot) { gap:12px; flex-wrap:wrap; }
  :root:root body :is(.news-detail-actions button,.news-detail-section>a) { min-height:44px; padding:10px 18px; border:1px solid var(--liquid-edge); border-radius:999px; }
  :root:root body .news-detail-section { padding:20px; }
  :root:root body .news-detail-section-head { flex-wrap:wrap; gap:10px; }
  :root:root body .news-card-foot { display:flex; align-items:center; gap:12px; }
  :root:root body .news-card-foot>span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; }
  :root:root body .news-card-foot>b { flex-shrink:0; white-space:nowrap; padding:8px 12px; border:1px solid var(--liquid-edge-subtle); border-radius:999px; font-size:12px; font-weight:500; }
  :root:root body.daily-report-page #dailyDate { border-radius:999px !important; }
  :root:root body .news-evidence { padding:12px 0; border-bottom:1px solid var(--liquid-edge-subtle); }
  :root:root body .news-evidence small { display:block; color:var(--muted); margin-top:6px; }
}
