/* SolanaDEX shared UI. Financial state, warning and destructive colors stay native. */
html[data-sdex-ui] {
  --sdex-bg:#080d16; --sdex-surface:#111b2b; --sdex-raised:#18253a;
  --sdex-text:#f2f5fc; --sdex-muted:#a9b7cd; --sdex-line:#2b3b53;
  --sdex-primary:#a78bfa; --sdex-primary-solid:#7052d9; --sdex-primary-text:#ffffff;
  --sdex-mint:#55e5c4; --sdex-shadow:0 20px 60px #0005;
  --sdex-header-height:calc(72px + env(safe-area-inset-top,0px));
  color-scheme:dark;
}
html[data-sdex-ui][data-sdex-ui-theme="light"] {
  --sdex-bg:#f5f7fc; --sdex-surface:#ffffff; --sdex-raised:#eef2f9;
  --sdex-text:#142137; --sdex-muted:#5e6f89; --sdex-line:#d6deed;
  --sdex-primary:#6544c8; --sdex-primary-solid:#6544c8; --sdex-primary-text:#ffffff;
  --sdex-mint:#147d6b; --sdex-shadow:0 20px 60px #1828441f;
  color-scheme:light;
}
html[data-sdex-ui],html[data-sdex-ui] body {
  --page:var(--sdex-bg) !important; --bg:var(--sdex-bg) !important;
  --surface:var(--sdex-surface) !important; --surface-2:var(--sdex-raised) !important;
  --panel:var(--sdex-surface) !important; --panel-2:var(--sdex-raised) !important; --panel2:var(--sdex-raised) !important;
  --bg-card:var(--sdex-surface) !important; --bg-elev:var(--sdex-raised) !important;
  --ink:var(--sdex-text) !important; --text:var(--sdex-text) !important;
  --primary:var(--sdex-primary) !important; --primary-fg:var(--sdex-primary-text) !important;
  --purple:var(--sdex-primary) !important; --brand:var(--sdex-primary) !important;
  --border:var(--sdex-line) !important; --border-strong:var(--sdex-line) !important; --line:var(--sdex-line) !important;
  --bs-bg:var(--sdex-bg) !important; --bs-surface:var(--sdex-surface) !important; --bs-surface-2:var(--sdex-raised) !important;
  --bs-text:var(--sdex-text) !important; --bs-muted:var(--sdex-muted) !important; --bs-primary:var(--sdex-primary) !important; --bs-border:var(--sdex-line) !important;
  --ms-bg:var(--sdex-bg) !important; --ms-panel:var(--sdex-surface) !important; --ms-panel-2:var(--sdex-raised) !important;
  --ms-text:var(--sdex-text) !important; --ms-muted:var(--sdex-muted) !important; --ms-accent:var(--sdex-primary) !important; --ms-line:var(--sdex-line) !important;
}
html[data-sdex-ui][data-sdex-ui-family="vanilla"],html[data-sdex-ui][data-sdex-ui-family="vanilla"] body {
  --muted:var(--sdex-muted) !important; --accent:var(--sdex-primary) !important;
}
html[data-sdex-ui][data-sdex-ui-family="shadcn"],html[data-sdex-ui][data-sdex-ui-family="shadcn"] body {
  --background:var(--sdex-bg) !important; --foreground:var(--sdex-text) !important;
  --card:var(--sdex-surface) !important; --card-foreground:var(--sdex-text) !important;
  --popover:var(--sdex-surface) !important; --popover-foreground:var(--sdex-text) !important;
  --secondary:var(--sdex-raised) !important; --secondary-foreground:var(--sdex-text) !important;
  --muted:var(--sdex-raised) !important; --muted-foreground:var(--sdex-muted) !important;
  --accent:var(--sdex-raised) !important; --accent-foreground:var(--sdex-text) !important;
  --primary:var(--sdex-primary-solid) !important; --primary-foreground:var(--sdex-primary-text) !important; --input:var(--sdex-line) !important; --ring:var(--sdex-primary) !important;
}
html[data-sdex-ui="standalone"] body {
  display:block !important; margin:0; min-height:100svh;
  background:var(--sdex-bg) !important; color:var(--sdex-text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
html[data-sdex-ui="standalone"] body.bs-standalone { padding-top:0; }
html[data-sdex-ui="standalone"] .app { min-height:calc(100svh - var(--sdex-header-height)); min-height:calc(100dvh - var(--sdex-header-height)); }
html[data-sdex-ui="standalone"] [data-sdex-duplicate-brand],html[data-sdex-ui="standalone"] [data-sdex-duplicate-theme] { display:none !important; }
html[data-sdex-ui="standalone"] [data-sdex-toolbar] { position:relative; top:auto; margin-top:0; background:transparent; border-color:var(--sdex-line); }
html[data-sdex-ui="standalone"] [data-sdex-toolbar-row] { display:flex !important; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; min-height:56px; height:auto; padding-block:8px; }
html[data-sdex-ui="standalone"] [data-sdex-toolbar-row] > .sdex-ui-local-title { flex:1 1 auto; min-width:0; color:var(--sdex-muted); font:600 13px/1.5 Inter,ui-sans-serif,system-ui,sans-serif; letter-spacing:.01em; }
html[data-sdex-ui="standalone"] .shared-site-header .header-nav { display:none; }
html[data-sdex-ui] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea) { border-color:var(--sdex-line); border-radius:10px; }
html[data-sdex-ui] :is(.card,.panel,.workspace-card,.tool-card,[data-slot="card"]) { border-color:var(--sdex-line); border-radius:16px; }
html[data-sdex-ui] :is(.primary-link,.btn-primary,.button.primary,.pill.primary) { background:var(--sdex-primary-solid); border-color:var(--sdex-primary-solid); color:var(--sdex-primary-text); border-radius:10px; }
#sdex-ui-header,#sdex-ui-header * { box-sizing:border-box; }
#sdex-ui-header { position:relative; z-index:20; width:100%; margin:0; border-bottom:1px solid var(--sdex-line); background:var(--sdex-bg); color:var(--sdex-text); font:14px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
#sdex-ui-header .sdex-ui-inner { display:flex; align-items:center; justify-content:space-between; gap:28px; max-width:1328px; min-height:var(--sdex-header-height); margin:0 auto; padding:calc(12px + env(safe-area-inset-top,0px)) 24px 12px; }
#sdex-ui-header a { text-decoration:none; color:inherit; }
#sdex-ui-header a:hover { color:var(--sdex-primary); }
#sdex-ui-header .sdex-ui-brand { display:inline-flex; align-items:center; flex:none; gap:12px; min-height:44px; }
#sdex-ui-header .sdex-ui-logo { display:block; width:40px; height:40px; object-fit:contain; border-radius:12px; }
#sdex-ui-header .sdex-ui-brand-copy { display:grid; gap:2px; }
#sdex-ui-header .sdex-ui-brand-copy strong { color:var(--sdex-text); font-size:19px; line-height:1.1; font-weight:750; letter-spacing:-.7px; white-space:nowrap; }
#sdex-ui-header .sdex-ui-brand-copy strong span { color:var(--sdex-primary); }
#sdex-ui-header .sdex-ui-brand-copy small { color:var(--sdex-muted); font-size:10px; font-weight:450; letter-spacing:.02em; }
#sdex-ui-header .sdex-ui-quick { display:flex; align-items:center; justify-content:center; flex:1; gap:22px; }
#sdex-ui-header .sdex-ui-quick a { display:inline-flex; align-items:center; min-height:44px; color:var(--sdex-muted); font-size:13px; font-weight:550; white-space:nowrap; }
#sdex-ui-header .sdex-ui-actions { display:flex; align-items:center; gap:9px; }
#sdex-ui-header .sdex-ui-apps { position:relative; }
#sdex-ui-header summary { list-style:none; display:flex; align-items:center; justify-content:center; gap:9px; min-height:42px; padding:9px 13px; border:1px solid var(--sdex-line); border-radius:10px; background:var(--sdex-surface); color:var(--sdex-text); cursor:pointer; font-weight:600; }
#sdex-ui-header summary::-webkit-details-marker { display:none; }
#sdex-ui-header .sdex-ui-chevron { color:var(--sdex-muted); font-size:16px; }
#sdex-ui-header .sdex-ui-theme { display:grid; place-items:center; width:42px; min-width:42px; height:42px; padding:0; border:1px solid var(--sdex-line); border-radius:10px; background:var(--sdex-surface); color:var(--sdex-text); font:25px/1 system-ui,sans-serif; cursor:pointer; }
html[data-sdex-ui-theme="dark"] #sdex-ui-header .sdex-ui-moon,html[data-sdex-ui-theme="light"] #sdex-ui-header .sdex-ui-sun { display:none; }
#sdex-ui-header .sdex-ui-swap { display:inline-flex; align-items:center; justify-content:center; min-height:42px; padding:10px 15px; border-radius:10px; background:var(--sdex-primary-solid); color:#fff; font-size:12px; font-weight:650; white-space:nowrap; }
#sdex-ui-header .sdex-ui-swap:hover { background:color-mix(in srgb,var(--sdex-primary-solid) 84%,white); color:#fff; }
#sdex-ui-header .sdex-ui-menu { position:absolute; top:calc(100% + 10px); right:0; width:400px; max-width:calc(100vw - 28px); max-height:min(690px,calc(100svh - 100px)); overflow:auto; padding:18px; border:1px solid var(--sdex-line); border-radius:16px; background:var(--sdex-surface); color:var(--sdex-text); box-shadow:var(--sdex-shadow); }
#sdex-ui-header .sdex-ui-menu-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
#sdex-ui-header .sdex-ui-menu-top strong { font-size:16px; }
#sdex-ui-header .sdex-ui-menu-top a,#sdex-ui-header .sdex-ui-menu-foot { color:var(--sdex-primary); font-size:12px; }
#sdex-ui-header .sdex-ui-search-label { display:block; margin:0 0 6px; color:var(--sdex-muted); font-size:11px; }
#sdex-ui-header .sdex-ui-search { display:block; width:100%; min-height:44px; margin:0 0 16px; padding:10px 12px; border:1px solid var(--sdex-line); border-radius:10px; background:var(--sdex-bg); color:var(--sdex-text); font:inherit; font-size:14px; line-height:1.5; }
#sdex-ui-header .sdex-ui-search::placeholder { color:var(--sdex-muted); }
#sdex-ui-header .sdex-ui-app-list { display:grid; gap:16px; }
#sdex-ui-header .sdex-ui-app-list h2 { margin:0 0 6px; color:var(--sdex-muted); font-size:10px; font-weight:650; letter-spacing:.1em; text-transform:uppercase; }
#sdex-ui-header .sdex-ui-app-link { display:flex; justify-content:space-between; align-items:center; gap:10px; min-height:40px; padding:8px 10px; border-radius:8px; color:var(--sdex-text); font-size:13px; }
#sdex-ui-header .sdex-ui-app-link span { color:var(--sdex-muted); }
#sdex-ui-header .sdex-ui-app-link:hover { background:var(--sdex-raised); }
#sdex-ui-header .sdex-ui-menu-foot { display:block; margin-top:18px; padding-top:14px; border-top:1px solid var(--sdex-line); }
#sdex-ui-header .sdex-ui-empty { margin:18px 0; color:var(--sdex-muted); font-size:13px; }
#sdex-ui-header [hidden] { display:none !important; }
#sdex-ui-header :focus-visible { outline:2px solid var(--sdex-primary); outline-offset:3px; }
@media(max-width:1080px) { #sdex-ui-header .sdex-ui-quick { gap:14px; } #sdex-ui-header .sdex-ui-quick a:nth-child(n+3) { display:none; } }
@media(max-width:760px) {
  html[data-sdex-ui] { --sdex-header-height:calc(64px + env(safe-area-inset-top,0px)); }
  #sdex-ui-header .sdex-ui-inner { padding:calc(10px + env(safe-area-inset-top,0px)) 16px 10px; gap:12px; }
  #sdex-ui-header .sdex-ui-brand { gap:9px; }
  #sdex-ui-header .sdex-ui-logo { width:36px; height:36px; border-radius:10px; }
  #sdex-ui-header .sdex-ui-brand-copy strong { font-size:18px; }
  #sdex-ui-header .sdex-ui-brand-copy small,#sdex-ui-header .sdex-ui-quick,#sdex-ui-header .sdex-ui-swap { display:none; }
  #sdex-ui-header .sdex-ui-actions { gap:7px; }
  #sdex-ui-header .sdex-ui-menu { position:fixed; top:calc(66px + env(safe-area-inset-top,0px)); left:14px; right:14px; width:auto; max-width:none; max-height:calc(100svh - 84px - env(safe-area-inset-top,0px)); }
  html[data-sdex-ui="standalone"] [data-sdex-toolbar-row] { min-height:48px; gap:8px; }
  html[data-sdex-ui="standalone"] [data-sdex-toolbar-row] > .sdex-ui-local-title { font-size:12px; }
}
@media(prefers-reduced-motion:no-preference) { #sdex-ui-header a,#sdex-ui-header button,#sdex-ui-header summary { transition:background-color .15s,color .15s,border-color .15s; } }

#sdex-ui-header:has(details[open]) { z-index:60; }
html[data-sdex-ui="standalone"] .shared-site-header .mobile-nav { display:none !important; }
html[data-sdex-ui="standalone"] .shared-site-header .header-actions > .language-selector { display:inline-flex !important; }
#sdex-ui-header .sdex-ui-menu-foot { display:flex; gap:14px; flex-wrap:wrap; }

html[data-sdex-ui="standalone"] [data-sdex-toolbar] { max-width:1280px; margin-inline:auto; box-sizing:border-box; }
html[data-sdex-ui="standalone"] [data-sdex-toolbar-row] { padding-inline:16px; }

html[data-sdex-ui] :is(.muted,.subtle,.text-muted-foreground,.small,.loading-text) { color:var(--sdex-muted); }

html[data-sdex-ui],html[data-sdex-ui] body { --card:var(--sdex-surface) !important; --card2:var(--sdex-raised) !important; --surface2:var(--sdex-raised) !important; --card-foreground:var(--sdex-text) !important; }
html[data-sdex-ui] :is(.card,.panel,.workspace-card,.tool-card,[data-slot="card"]) { background:var(--sdex-surface); color:var(--sdex-text); }
html[data-sdex-ui][data-sdex-ui-family="shadcn"] .app :is(.hero-balance,.stat) { background:var(--sdex-surface); border-color:var(--sdex-line); color:var(--sdex-text); }
html[data-sdex-ui][data-sdex-ui-family="shadcn"] .app :is(.login > p:not(.eyebrow),.login-note,.page-heading p,.wallet-help,.rule-hint,.screen-loading,.dialog-body,.install-step p,.footer-note,.subtle-link,.refresh-note) { color:var(--sdex-muted); }
html[data-sdex-ui][data-sdex-ui-family="shadcn"] .app :is(.setting-row strong,.form label,.rule-field label) { color:var(--sdex-text); }
html[data-sdex-ui][data-sdex-ui-family="shadcn"] .app :is(.form input,.rule-field input,[data-slot="select-trigger"],[data-slot="select-content"],.segmented [data-slot="tabs-list"]) { background:var(--sdex-surface) !important; border-color:var(--sdex-line); color:var(--sdex-text); }
