/* ============================================================
   Desktop application shell (Phase 1).

   Loaded only by pages that opt in (see fragments/desktop-shell.html), and
   every layout rule here is inside a min-width: 768px query, so below 768px
   this file changes nothing and the existing mobile chrome is the page.

     768–1199px  compact icon rail (76px) + top utility bar
     1200px+     full sidebar (248px) + top utility bar

   Tokens: the values below are the palette the mobile chrome already uses
   (mobile-chrome.css, new-design/ spec). They are named here so desktop pages
   can share them instead of repeating literals.
   ============================================================ */
:root {
  --ex-bg: #070B11;          /* page */
  --ex-bg-deep: #04070B;     /* outer canvas */
  --ex-surface: #0A0F15;     /* chrome: header, nav, sidebar */
  --ex-card: #11161E;        /* cards */
  --ex-card-2: #141A22;      /* inset controls */
  --ex-hover: #1A212B;
  --ex-line: #151B24;        /* hairlines */
  --ex-line-2: #1E2632;      /* card borders */
  --ex-text: #EAECEF;
  --ex-text-2: #B7BDC6;
  --ex-muted: #858C97;       /* lowest-contrast text allowed on --ex-bg (≈5.6:1) */
  --ex-accent: #18BB59;
  --ex-accent-hover: #20CA63;
  --ex-on-accent: #05130A;
  --ex-down: #EB4536;
  --ex-danger-text: #F07167;
  --ex-radius: 14px;
  --ex-radius-sm: 10px;
  --ex-focus: 0 0 0 2px var(--ex-bg), 0 0 0 4px var(--ex-accent);
  --ex-font: 'Roboto', Helvetica, Arial, sans-serif;

  --dshell-rail: 76px;
  --dshell-sidebar: 248px;
  --dshell-topbar: 64px;
}

/* Below 768px the shell does not exist. */
.dshell-skip,
.dshell-sidebar,
.dshell-topbar,
.dshell-footer { display: none; }

@media (min-width: 768px) {
  /* ---------- Hand the page over from the mobile chrome ---------- */
  html[data-desktop-shell] .mchrome-header,
  html[data-desktop-shell] .mchrome-nav,
  html[data-desktop-shell] .mchrome-menu,
  html[data-desktop-shell] #mchrome-lang-menu { display: none !important; }

  html[data-desktop-shell] { background: var(--ex-bg); }
  /* root.css paints the page scrollbar white with !important; keep it in the dark theme. */
  html[data-desktop-shell]::-webkit-scrollbar { background-color: var(--ex-bg) !important; width: 8px !important; }
  html[data-desktop-shell]::-webkit-scrollbar-thumb { background-color: #2A3441 !important; border-radius: 4px !important; }

  /* mobile-chrome.css pads the body for its fixed 56px header and 66px tab bar.
     Here the sidebar is fixed on the left instead, and the top bar is sticky. */
  html[data-desktop-shell] body.mchrome-on {
    padding: 0 0 0 var(--dshell-rail);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ex-bg);
  }
  html[data-desktop-shell] .dshell-main { flex: 1 0 auto; outline: none; }

  /* The support widget and toast no longer have a tab bar to clear. */
  html[data-desktop-shell] body.mchrome-on .support-button,
  html[data-desktop-shell] body.mchrome-on .chat-box { bottom: 24px; }
  html[data-desktop-shell] #mchrome-toast { bottom: 24px; }

  /* The Add to Desktop sheet keeps its bottom-sheet behaviour but not a full-width one. */
  html[data-desktop-shell] .mchrome-install__sheet { max-width: 520px; border-radius: 22px 22px 0 0; }

  .dshell-sidebar, .dshell-sidebar *,
  .dshell-topbar, .dshell-topbar *,
  .dshell-footer, .dshell-footer *,
  .dshell-skip { box-sizing: border-box; font-family: var(--ex-font); }
  .dshell-sidebar .mdi::before, .dshell-topbar .mdi::before { font-family: 'Material Design Icons'; }

  /* ---------- Skip link ---------- */
  .dshell-skip {
    display: block; position: fixed; top: 8px; left: 8px; z-index: 1500;
    padding: 10px 16px; border-radius: var(--ex-radius-sm);
    background: var(--ex-accent); color: var(--ex-on-accent); font-weight: 700; font-size: 14px;
    text-decoration: none; transform: translateY(-200%);
  }
  .dshell-skip:focus { transform: none; outline: none; box-shadow: var(--ex-focus); }

  /* ---------- Sidebar (rail by default, full from 1200px) ---------- */
  .dshell-sidebar {
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1100;
    width: var(--dshell-rail);
    padding: 12px 10px;
    background: var(--ex-surface); border-right: 1px solid var(--ex-line);
    color: var(--ex-text);
  }

  .dshell-brand {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    height: 48px; padding: 0 9px; margin-bottom: 12px;
    border-radius: var(--ex-radius-sm); color: var(--ex-text); text-decoration: none;
  }
  .dshell-brand__mark {
    width: 34px; height: 34px; flex: none; overflow: hidden;
    border-radius: 10px; background: var(--ex-accent); color: var(--ex-on-accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 17px;
  }
  .dshell-brand__mark img { width: 100%; height: 100%; object-fit: cover; }
  .dshell-brand__text { display: none; min-width: 0; flex-direction: column; gap: 4px; }
  /* A long whitelabel name is cut short rather than pushing the layout; the full name is the link title. */
  .dshell-brand__name {
    font-size: 16px; font-weight: 700; letter-spacing: -0.2px; line-height: 1.15;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dshell-brand__quantum { gap: 6px; }
  .dshell-brand__quantum .mchrome-quantum__lock { width: 15px; height: 17px; }
  .dshell-brand__quantum .mchrome-quantum__text { font-size: 9.5px; }

  .dshell-nav { flex: 1 1 auto; min-height: 0; }
  .dshell-list, .dshell-sub { list-style: none; margin: 0; padding: 0; }
  .dshell-list > li { position: relative; }

  /* Rows are <a> for destinations and <button> for group headers; the reset makes them one. */
  .dshell-link {
    position: relative; display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 44px; padding: 0 17px; margin: 1px 0;
    border: 0; border-radius: var(--ex-radius-sm); background: none;
    color: var(--ex-text-2); font: 500 14px/1.2 var(--ex-font); text-align: left;
    text-decoration: none; cursor: pointer;
  }
  .dshell-link .mdi { font-size: 20px; line-height: 1; flex: none; color: var(--ex-muted); }
  .dshell-link:hover { background: var(--ex-hover); color: var(--ex-text); }
  .dshell-link:hover .mdi { color: var(--ex-text); }
  .dshell-link:focus-visible,
  .dshell-sub a:focus-visible,
  .dshell-brand:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ex-accent); }
  .dshell-link.is-active,
  .dshell-group.has-active > .dshell-link { color: var(--ex-text); background: rgba(24, 187, 89, .10); }
  .dshell-link.is-active .mdi,
  .dshell-group.has-active > .dshell-link .mdi:not(.dshell-group__chevron) { color: var(--ex-accent); }
  .dshell-link.is-active::before {
    content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--ex-accent);
  }
  .dshell-group__chevron { display: none; }

  /* Rail: the label is the icon's accessible name, shown as a tooltip on hover/focus. */
  .dshell-link__label {
    position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
    z-index: 2; white-space: nowrap; pointer-events: none;
    padding: 6px 10px; border-radius: 8px;
    background: var(--ex-card); border: 1px solid var(--ex-line-2); color: var(--ex-text);
    font-size: 13px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    opacity: 0; visibility: hidden; transition: opacity .12s ease;
  }
  .dshell-link:hover .dshell-link__label,
  .dshell-link:focus-visible .dshell-link__label { opacity: 1; visibility: visible; }
  /* While a group's flyout is open the tooltip would sit on top of it. */
  .dshell-group.is-flyout > .dshell-link .dshell-link__label { opacity: 0; visibility: hidden; }

  /* Rail groups open as a flyout beside the rail. */
  .dshell-sub { display: none; }
  .dshell-group.is-flyout > .dshell-sub {
    display: block; position: absolute; left: calc(100% + 12px); top: 0; z-index: 3;
    min-width: 210px; padding: 6px;
    background: var(--ex-card); border: 1px solid var(--ex-line-2); border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
  }
  .dshell-sub__title {
    padding: 8px 12px 6px; color: var(--ex-muted);
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  }
  .dshell-sub a {
    display: flex; align-items: center; min-height: 40px; padding: 0 12px;
    border-radius: 8px; color: var(--ex-text-2); font-size: 14px; text-decoration: none;
  }
  .dshell-sub a:hover { background: var(--ex-hover); color: var(--ex-text); }
  .dshell-sub a.is-active { color: var(--ex-accent); font-weight: 500; background: rgba(24, 187, 89, .08); }

  .dshell-sidebar__end {
    display: flex; flex-direction: column; gap: 6px;
    padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--ex-line);
  }
  /* Guests have no panel link and no Log out: drop the empty section and its divider. */
  .dshell-sidebar__end:not(:has(a, button)) { display: none; }
  /* "App for …" card: icon only on the rail, the full card in the wide sidebar. */
  .dshell-app {
    display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
    min-height: 48px; padding: 6px; margin: 0 0 4px;
    border: 1px solid var(--ex-line-2); border-radius: 12px; background: var(--ex-card);
    color: var(--ex-text); font: 500 12px/1.3 var(--ex-font); text-align: left; cursor: pointer;
    transition: background .15s ease;
  }
  .dshell-app:hover { background: var(--ex-hover); }
  .dshell-app:focus-visible { outline: none; box-shadow: var(--ex-focus); }
  .dshell-app__icon {
    width: 36px; height: 36px; flex: none; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(150deg, #3BA6F5, #1E6FD9); color: #fff; font-size: 20px;
  }
  .dshell-app__text, .dshell-app__chevron { display: none; }
  .dshell-link--panel { color: var(--ex-accent); }
  .dshell-link--panel .mdi { color: var(--ex-accent); }
  .dshell-link--logout { color: var(--ex-danger-text); }
  .dshell-link--logout .mdi { color: var(--ex-danger-text); }
  .dshell-link--logout:hover { background: rgba(235, 69, 54, .10); color: var(--ex-danger-text); }
  .dshell-link--logout:hover .mdi { color: var(--ex-danger-text); }

  /* Short tablet screens in landscape: tighten the rail rather than scroll it,
     because a scrolling rail would clip its tooltips and flyouts. */
  @media (max-height: 760px) {
    .dshell-link { min-height: 38px; }
    .dshell-brand { margin-bottom: 6px; }
  }

  /* ---------- Top utility bar ---------- */
  .dshell-topbar {
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 1050;
    height: var(--dshell-topbar); padding: 0 24px;
    background: rgba(7, 11, 17, .92);
    -webkit-backdrop-filter: saturate(140%) blur(10px); backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--ex-line);
    color: var(--ex-text);
  }
  .dshell-topbar__title {
    margin: 0; flex: none; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; color: var(--ex-text);
  }
  .dshell-search {
    display: flex; align-items: center; gap: 8px; flex: 0 1 320px; min-width: 0;
    height: 40px; padding: 0 14px;
    border-radius: 999px; background: var(--ex-card-2); border: 1px solid var(--ex-line-2);
    color: var(--ex-muted); text-decoration: none; font-size: 14px;
  }
  .dshell-search .mdi { font-size: 19px; }
  .dshell-search__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dshell-search:hover { border-color: #2A3441; color: var(--ex-text-2); }
  .dshell-topbar__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

  .dshell-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; padding: 0 16px; border-radius: 999px;
    font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
    transition: background .15s ease, border-color .15s ease;
  }
  .dshell-btn .mdi { font-size: 18px; }
  .dshell-btn--primary { background: var(--ex-accent); color: var(--ex-on-accent); }
  .dshell-btn--primary:hover { background: var(--ex-accent-hover); }
  .dshell-btn--ghost { background: transparent; color: var(--ex-text); border: 1px solid #2A3441; }
  .dshell-btn--ghost:hover { border-color: var(--ex-accent); }

  .dshell-iconbtn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 40px; padding: 0 10px; border: 0; border-radius: 999px;
    background: none; color: var(--ex-text); font: 700 13px var(--ex-font); cursor: pointer;
  }
  .dshell-iconbtn:hover { background: var(--ex-hover); }
  .dshell-iconbtn .mdi { font-size: 16px; color: var(--ex-muted); }
  .dshell-iconbtn .mdi-web { font-size: 19px; }

  .dshell-lang { position: relative; }
  .dshell-popover {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 1260;
    min-width: 190px; margin: 0; padding: 6px; list-style: none;
    background: var(--ex-card); border: 1px solid var(--ex-line-2); border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  }
  .dshell-popover[hidden] { display: none; }
  .dshell-popover a {
    display: flex; align-items: center; min-height: 40px; padding: 0 12px;
    border-radius: 8px; color: var(--ex-text); font-size: 14px; text-decoration: none;
  }
  .dshell-popover a:hover { background: var(--ex-hover); }
  .dshell-popover a[aria-current] { color: var(--ex-accent); }

  .dshell-avatar {
    width: 38px; height: 38px; flex: none; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #1E2632; color: var(--ex-muted); text-decoration: none;
  }
  .dshell-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .dshell-avatar .mdi { font-size: 20px; }

  /* Account dropdown under the avatar: opens on hover or keyboard focus. The menu's top
     padding bridges the gap so the pointer can travel from the avatar into it. */
  .dshell-account { position: relative; display: flex; }
  .dshell-account__menu {
    position: absolute; right: 0; top: 100%; z-index: 1260;
    width: 300px; padding-top: 10px;
    visibility: hidden; opacity: 0; transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
  }
  .dshell-account.has-menu:hover .dshell-account__menu,
  .dshell-account.has-menu:focus-within .dshell-account__menu {
    visibility: visible; opacity: 1; transform: none; transition-delay: 0s;
  }
  .dshell-account__menu > * { background: var(--ex-card); }
  .dshell-account__balance {
    padding: 18px 18px 16px; border: 1px solid var(--ex-line-2); border-bottom: 0;
    border-radius: 14px 14px 0 0; box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  }
  .dshell-account__label { display: flex; align-items: center; gap: 6px; color: var(--ex-text-2); font-size: 13px; }
  .dshell-account__eye {
    display: inline-flex; padding: 2px; border: 0; border-radius: 6px;
    background: none; color: var(--ex-muted); cursor: pointer;
  }
  .dshell-account__eye:hover { color: var(--ex-text); }
  .dshell-account__eye .mdi { font-size: 17px; }
  .dshell-account__usd { margin-top: 8px; color: var(--ex-text); font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
  .dshell-account__btc { margin-top: 2px; color: var(--ex-muted); font-size: 13px; }
  .dshell-account__actions { display: flex; gap: 10px; margin-top: 14px; }
  .dshell-account__btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center;
    height: 38px; border-radius: 8px; border: 1px solid #2A3441;
    color: var(--ex-text); font-size: 14px; font-weight: 700; text-decoration: none;
  }
  .dshell-account__btn:hover { border-color: var(--ex-accent); }
  .dshell-account__btn--solid { background: #fff; border-color: #fff; color: #0B0E11; }
  .dshell-account__btn--solid:hover { background: #E6E8EA; border-color: #E6E8EA; }
  .dshell-account__email {
    padding: 14px 18px 6px; border: 1px solid var(--ex-line-2); border-top: 1px solid var(--ex-line);
    border-bottom: 0; color: var(--ex-text); font-size: 15px; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .dshell-account__list {
    margin: 0; padding: 6px 8px 8px; list-style: none;
    border: 1px solid var(--ex-line-2); border-top: 0; border-radius: 0 0 14px 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  }
  .dshell-account__list a {
    display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px;
    border-radius: 8px; color: var(--ex-text); font-size: 14px; text-decoration: none;
  }
  .dshell-account__list a:hover { background: var(--ex-hover); }
  .dshell-account__list .mdi { font-size: 19px; color: var(--ex-text-2); }
  .dshell-account__sep { height: 1px; margin: 6px 10px; background: var(--ex-line); }
  .dshell-account__btn:focus-visible,
  .dshell-account__eye:focus-visible,
  .dshell-account__list a:focus-visible { outline: none; box-shadow: var(--ex-focus); }

  .dshell-search:focus-visible,
  .dshell-btn:focus-visible,
  .dshell-iconbtn:focus-visible,
  .dshell-avatar:focus-visible,
  .dshell-popover a:focus-visible,
  .dshell-footer a:focus-visible { outline: none; box-shadow: var(--ex-focus); }

  /* ---------- Footer ---------- */
  .dshell-footer {
    display: block; margin-top: 32px; padding: 0 24px;
    border-top: 1px solid var(--ex-line); background: var(--ex-surface);
    color: var(--ex-muted); font-size: 13px;
  }
  .dshell-footer a { color: var(--ex-text-2); text-decoration: none; border-radius: 4px; }
  .dshell-footer a:hover { color: var(--ex-text); text-decoration: underline; }
  /* padding-right keeps the last links clear of the floating support launcher (52px, 24px
     from the right edge) when the footer sits at the bottom of the viewport. */
  .dshell-footer__bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
    min-height: 56px; padding: 14px 72px 14px 0;
  }
  .dshell-footer__copy { margin: 0; color: var(--ex-muted); }
  .dshell-footer__links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-left: auto; }

  .dshell-footer--full .dshell-footer__cols {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px;
    padding: 32px 0 24px; border-bottom: 1px solid var(--ex-line);
  }
  .dshell-footer__head {
    margin: 0 0 12px; color: var(--ex-text); font-size: 13px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
  }
  .dshell-footer__cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }

  /* Popular trading pairs: a titled grid, column-major so each of the 3 columns holds 3 pairs. */
  .dshell-footer__pairs { padding: 24px 0; border-bottom: 1px solid var(--ex-line); }
  .dshell-footer__pairs-grid {
    list-style: none; margin: 0; padding: 0; display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, auto);
    grid-auto-flow: column; gap: 9px 32px; max-width: 560px;
  }
  /* Pairs stay plain — no hover underline or brighten (a quiet index, not CTAs). */
  .dshell-footer__pairs-grid a:hover { text-decoration: none; color: var(--ex-text-2); }
  /* Certification / compliance logos. */
  .dshell-footer__trust {
    display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px;
    padding: 22px 0; border-bottom: 1px solid var(--ex-line);
  }
  .dshell-footer__trust img { height: 46px; width: auto; display: block; }
  /* iso-22301 is a solid-white vector; dim it to match the other three (grayscale at 50%). */
  .dshell-footer__trust img[src*="iso-22301"] { opacity: .5; }
  /* Risk disclaimer sits on its own line under the copyright. */
  .dshell-footer__disclaimer {
    flex-basis: 100%; margin: 0; color: var(--ex-muted); font-size: 12px; line-height: 1.5; max-width: 1000px;
  }

  /* Height-sensitive pages (trading, futures, assistant, support) fill the viewport under the
     top bar; the full footer starts below the fold instead of taking height from them. */
  .dshell-footer--workspace { margin-top: 0; }
  html[data-desktop-shell] body.mchrome-on:has(> .dshell-footer--workspace) > .dshell-main {
    min-height: calc(100vh - var(--dshell-topbar));
  }

  /* ---------- Coin pickers (Phase 3) ----------
     A page's bottom-sheet picker (marked data-dshell-picker, its sheet role="dialog")
     opens as a centred dialog instead of a full-width sheet. */
  html[data-desktop-shell] [data-dshell-picker] > [role="dialog"] {
    box-sizing: border-box; left: 50%; right: auto; top: 12vh; bottom: auto; margin: 0;
    width: min(440px, calc(100vw - 48px)); max-width: none; max-height: 76vh;
    transform: translateX(-50%);
    border: 1px solid var(--ex-line-2); border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  }
  html[data-desktop-shell] [data-dshell-picker] [role="button"] { transition: background .15s ease; }
  html[data-desktop-shell] [data-dshell-picker] [role="button"]:hover,
  html[data-desktop-shell] [data-dshell-picker] [role="button"]:focus-visible { background: var(--ex-hover); outline: none; }
  html[data-desktop-shell] [data-dshell-picker] [role="button"]:focus-visible { box-shadow: inset 0 0 0 2px var(--ex-accent); }
}

/* ---------- Desktop: full sidebar ---------- */
@media (min-width: 1200px) {
  html[data-desktop-shell] body.mchrome-on { padding-left: var(--dshell-sidebar); }

  .dshell-sidebar {
    width: var(--dshell-sidebar); padding: 16px 14px;
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2A3441 transparent;
  }
  /* The item list scrolls between the logo and the app card / account links, so an opened
     group never runs underneath them. */
  .dshell-nav {
    overflow-y: auto; overscroll-behavior: contain; margin: 0 -8px 0 -14px; padding: 0 8px 0 14px;
    scrollbar-width: thin; scrollbar-color: #2A3441 transparent;
  }
  .dshell-brand { padding: 0 8px; margin-bottom: 18px; }
  .dshell-brand__text { display: flex; }

  .dshell-link { padding: 0 12px; }
  .dshell-link.is-active::before { left: -14px; }
  .dshell-link__label {
    position: static; transform: none; z-index: auto; flex: 1; min-width: 0;
    padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
    font-size: 14px; font-weight: inherit; color: inherit;
    overflow: hidden; text-overflow: ellipsis;
    opacity: 1; visibility: visible; transition: none; pointer-events: auto;
  }
  .dshell-group__chevron { display: block; margin-left: auto; font-size: 18px; transition: transform .2s ease; }
  .dshell-group.is-open > .dshell-link .dshell-group__chevron { transform: rotate(180deg); }

  /* Groups are an accordion in the full sidebar. */
  .dshell-group.is-open > .dshell-sub {
    display: block; position: static; min-width: 0;
    margin: 2px 0 6px 21px; padding: 0 0 0 13px;
    background: none; border: 0; border-left: 1px solid var(--ex-line-2); border-radius: 0; box-shadow: none;
  }
  .dshell-sub__title { display: none; }
  .dshell-sub a { min-height: 38px; }

  .dshell-app { justify-content: flex-start; padding: 10px 12px; }
  .dshell-app__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
  .dshell-app__title { font-size: 13px; font-weight: 700; }
  .dshell-app__sub { color: var(--ex-text-2); font-size: 11.5px; }
  .dshell-app__chevron { display: block; font-size: 18px; color: var(--ex-muted); }

  .dshell-footer { padding: 0 32px; }
  .dshell-topbar { padding: 0 32px; }
  .dshell-footer--full .dshell-footer__cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Legacy page content (Phases 6 and 7) ----------
   The informational, legal, tools and error pages are still the legacy #__nuxt tree,
   laid out by root.css, which forces .container to 1328px. Pages opt in with
   <main class="dshell-main dshell-legacy">, so the Phase 4–5 legacy pages are unaffected.
   Content blocks get a sane maximum and gutters; long-form legal text a readable measure
   (about 75 characters a line); the TradingView tools an inset. Copy is untouched. */
@media (min-width: 768px) {
  html[data-desktop-shell] .dshell-legacy #__nuxt .container {
    max-width: 1160px !important; padding-left: 24px; padding-right: 24px;
  }
  html[data-desktop-shell] .dshell-legacy #__nuxt .container.global-information {
    max-width: calc(76ch + 60px) !important;
  }
  html[data-desktop-shell] .dshell-legacy .tradingview-widget-container {
    box-sizing: border-box; padding: 16px 24px 24px;
  }
  /* Real links inside legal text: visible focus, like the rest of the shell. */
  html[data-desktop-shell] .dshell-legacy a:focus-visible,
  html[data-desktop-shell] .dshell-legacy button:focus-visible,
  html[data-desktop-shell] .dshell-legacy input:focus-visible {
    outline: none; box-shadow: var(--ex-focus); border-radius: 6px;
  }
}

/* Tablet: keep the top bar compact so the quick actions always fit. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .dshell-search { flex: 0 0 40px; width: 40px; padding: 0; justify-content: center; }
  .dshell-search__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .dshell-btn { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .dshell-link__label, .dshell-group__chevron, .dshell-btn,
  [data-dshell-picker] [role="button"] { transition: none !important; }
}

/* Phase 8: the floating support launcher's "live" pulse (support.css / root.css, shared with
   other surfaces and left untouched) loops forever, even for visitors who ask for reduced
   motion. On shell pages from 768px it stops for them. Below 768px nothing changes. */
@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  html[data-desktop-shell] .support-button,
  html[data-desktop-shell] .support-button *,
  html[data-desktop-shell] .support-button::before,
  html[data-desktop-shell] .support-button::after,
  html[data-desktop-shell] .msupport__mark::after,
  html[data-desktop-shell] .msupport__status::before { animation: none !important; }
}

/* ---------- Desktop page kit (.dx-*) ----------
   Shared by the redesigned account and money pages (deposit, withdraw, transfer, staking,
   promo, referral, settings): a page grid, cards, tips, FAQ, history tables and status chips.
   Below 768px the layout wrappers are out of layout and every .dx-only block is hidden, so
   phones keep their own screens exactly as they were. */
@media (min-width: 768px) { .dx-hide { display: none !important; } }
@media (max-width: 767.98px) {
  .dx-only { display: none !important; }
  .dx-layout, .dx-main { display: contents; }
}
@media (min-width: 768px) {
  .dx-layout {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: start;
    width: 100%; max-width: 1560px; margin: 0 auto; padding: 28px 24px 56px; box-sizing: border-box;
    color: var(--ex-text); font-family: var(--ex-font);
  }
  .dx-layout *, .dx-layout *::before, .dx-layout *::after { box-sizing: border-box; }
  .dx-main, .dx-side, .dx-wide { min-width: 0; }
  .dx-side { display: grid; gap: 24px; align-content: start; }
  .dx-card {
    min-width: 0; padding: 22px 24px; background: var(--ex-surface);
    border: 1px solid var(--ex-line-2); border-radius: 18px;
  }
  .dx-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
  .dx-title { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 20px; font-weight: 700; color: var(--ex-text); }
  .dx-title--sm { font-size: 17px; }
  .dx-title__ic {
    width: 46px; height: 46px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(24, 187, 89, .12); border: 1px solid rgba(24, 187, 89, .4); color: var(--ex-accent); font-size: 24px;
  }
  .dx-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ex-accent); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
  .dx-link:hover { color: var(--ex-accent-hover); }
  .dx-sub { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--ex-text-2); }
  .dx-h { margin: 22px 0 12px; font-size: 16px; font-weight: 700; color: var(--ex-text); }
  .dx-h:first-child { margin-top: 0; }

  /* Tips: a check before each line. */
  .dx-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
  .dx-tips li { display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px; line-height: 1.5; color: var(--ex-text); }
  .dx-tips li > .mdi { flex: none; font-size: 22px; line-height: 1; color: var(--ex-accent); }
  .dx-tips a { color: var(--ex-accent); }

  /* Info line / callout. */
  .dx-callout {
    display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: 14px;
    background: var(--ex-card); border: 1px solid var(--ex-line-2); font-size: 14px; line-height: 1.5; color: var(--ex-text-2);
  }
  .dx-callout > .mdi { flex: none; font-size: 26px; line-height: 1; color: var(--ex-accent); }
  .dx-callout b { color: var(--ex-text); font-weight: 600; }

  /* FAQ: collapsible rows; .dx-faq--num numbers them. */
  .dx-faq { counter-reset: dxfaq; display: grid; gap: 10px; }
  .dx-faq details { background: var(--ex-card); border: 1px solid transparent; border-radius: 12px; transition: border-color .15s ease; }
  .dx-faq details[open] { border-color: var(--ex-line-2); }
  .dx-faq summary {
    display: flex; align-items: center; gap: 14px; padding: 15px 18px; cursor: pointer; list-style: none;
    font-size: 15px; font-weight: 500; color: var(--ex-text);
  }
  .dx-faq summary::-webkit-details-marker { display: none; }
  .dx-faq summary::after {
    content: "\F0140"; margin-left: auto; font-family: 'Material Design Icons'; font-size: 20px; color: var(--ex-text-2);
    transition: transform .2s ease;
  }
  .dx-faq details[open] summary::after { transform: rotate(180deg); }
  .dx-faq--num summary::before {
    counter-increment: dxfaq; content: counter(dxfaq); flex: none; width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
    color: var(--ex-accent); border: 1.5px solid var(--ex-accent);
  }
  .dx-faq p { margin: 0; padding: 0 18px 16px; font-size: 14px; line-height: 1.6; color: var(--ex-text-2); }
  .dx-faq--num p { padding-left: 60px; }
  .dx-faq summary:focus-visible { outline: none; box-shadow: var(--ex-focus); border-radius: 12px; }

  /* History tables. */
  .dx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
  .dx-table thead, .dx-table th, .dx-table td { background: none; }
  .dx-table th {
    padding: 0 12px 12px; text-align: left; white-space: nowrap; font-size: 13px; font-weight: 500;
    color: var(--ex-muted); border-bottom: 1px solid var(--ex-line);
  }
  .dx-table td { padding: 14px 12px; color: var(--ex-text); border-bottom: 1px solid var(--ex-line); font-variant-numeric: tabular-nums; }
  .dx-table tr:last-child td { border-bottom: 0; }
  .dx-table .r { text-align: right; }
  .dx-table .muted { color: var(--ex-text-2); }
  .dx-table .mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--ex-text-2); }
  .dx-coin { display: inline-flex; align-items: center; gap: 12px; font-weight: 500; white-space: nowrap; }
  .dx-coin__ic {
    width: 30px; height: 30px; border-radius: 50%; position: relative; overflow: hidden; flex: none;
    display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; background: #3C4351;
  }
  .dx-coin__ic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .dx-empty { padding: 26px 12px; text-align: center; color: var(--ex-muted); font-size: 14px; }

  /* Status chips. */
  .dx-status { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
  .dx-status--ok { color: var(--ex-accent); background: rgba(24, 187, 89, .12); }
  .dx-status--wait { color: #E8B931; background: rgba(232, 185, 49, .12); }
  .dx-status--bad { color: #F07167; background: rgba(235, 69, 54, .12); }
  .dx-status--off { color: var(--ex-text-2); background: var(--ex-card); }

  /* Hero banner: icon tile, title, text, and a large faint icon as decoration on the right. */
  .dx-hero {
    position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 24px; align-items: start;
    padding: 28px 30px; border-radius: 20px; border: 1px solid var(--ex-line-2);
    background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--dx-tint, #18BB59) 26%, transparent) 0%, transparent 55%), var(--ex-surface);
  }
  .dx-hero__ic {
    width: 76px; height: 76px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 40px;
    color: var(--dx-tint, #18BB59); background: color-mix(in srgb, var(--dx-tint, #18BB59) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--dx-tint, #18BB59) 40%, transparent);
  }
  .dx-hero__title { margin: 4px 0 0; font-size: 28px; font-weight: 700; color: var(--ex-text); letter-spacing: -.3px; }
  .dx-hero__text { margin: 8px 0 0; max-width: 820px; font-size: 15px; line-height: 1.55; color: var(--ex-text-2); }
  .dx-hero__body { position: relative; z-index: 1; min-width: 0; }
  .dx-hero__art {
    position: absolute; right: 28px; top: 50%; transform: translateY(-50%); font-size: 150px; line-height: 1;
    color: color-mix(in srgb, var(--dx-tint, #18BB59) 38%, transparent); pointer-events: none;
  }
  @media (max-width: 1199.98px) { .dx-hero__art { display: none; } }

  /* Numbered steps, vertical. */
  .dx-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; counter-reset: dxstep; }
  .dx-steps li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 16px; }
  .dx-steps li::before {
    counter-increment: dxstep; content: counter(dxstep); width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
    color: var(--ex-accent); border: 1.5px solid var(--ex-accent); background: rgba(24, 187, 89, .08);
  }
  .dx-steps li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 40px; bottom: -18px; width: 2px; background: rgba(24, 187, 89, .25); }
  .dx-steps b { display: block; font-size: 15.5px; color: var(--ex-text); }
  .dx-steps p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ex-text-2); }

  /* Segmented tabs. */
  .dx-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--ex-surface); border: 1px solid var(--ex-line-2); }
  .dx-tabs button {
    padding: 11px 26px; border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer;
    color: var(--ex-text-2); font: 600 14px var(--ex-font);
  }
  .dx-tabs button:hover { color: var(--ex-text); }
  .dx-tabs button.active, .dx-tabs button[aria-selected="true"] { color: var(--ex-text); border-color: var(--ex-accent); background: rgba(24, 187, 89, .14); }
  .dx-tabs button:focus-visible { outline: none; box-shadow: var(--ex-focus); }

  .dx-layout a:focus-visible, .dx-layout button:focus-visible { outline: none; box-shadow: var(--ex-focus); }
}
/* From 1200px: the main card and a side column on one row, wide blocks below them. */
@media (min-width: 1200px) {
  .dx-layout { padding: 32px 32px 64px; }
  .dx-layout--split { grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr); align-items: start; }
  .dx-layout--split > .dx-wide { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .dx-faq details, .dx-faq summary::after { transition: none !important; }
}

/* Account pages that use the full content width (verification, API, security). */
@media (min-width: 768px) {
  html[data-desktop-shell] #dshell-main.mp.mp--wide { max-width: none; width: 100%; box-sizing: border-box; }
  html[data-desktop-shell] .mp--wide .mp-field,
  html[data-desktop-shell] .mp--wide .mp-seg { max-width: none; }
}

/* .dx-layout--equal: the main card and the side column end on the same line from 1200px —
   whichever is shorter stretches (the side column's last card grows). */
@media (min-width: 1200px) {
  .dx-layout--equal { align-items: stretch; }
  .dx-layout--equal > .dx-main { display: flex; flex-direction: column; }
  .dx-layout--equal > .dx-main > * { flex: 1 1 auto; }
  .dx-layout--equal > .dx-side { display: flex; flex-direction: column; gap: 24px; }
  .dx-layout--equal > .dx-side > .dx-card:last-child { flex: 1 1 auto; }
}

/* "Still have questions?" block at the foot of an FAQ card, and taller FAQ rows in cards that
   stretch to their neighbour (.dx-layout--equal). */
@media (min-width: 768px) {
  .dx-help {
    display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 18px 20px; border-radius: 14px;
    background: linear-gradient(120deg, rgba(24, 187, 89, .12), rgba(24, 187, 89, .03)); border: 1px solid rgba(24, 187, 89, .25);
  }
  .dx-help__ic {
    width: 48px; height: 48px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(24, 187, 89, .16); color: var(--ex-accent); font-size: 26px;
  }
  .dx-help__body { flex: 1; min-width: 0; }
  .dx-help__body b { display: block; font-size: 15.5px; color: var(--ex-text); }
  .dx-help__body span { display: block; margin-top: 2px; font-size: 13.5px; color: var(--ex-text-2); }
  .dx-help__btn {
    flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 999px;
    background: var(--ex-accent); color: #05130A; font-size: 14px; font-weight: 700; text-decoration: none;
  }
  .dx-help__btn:hover { background: var(--ex-accent-hover); }
}
@media (min-width: 1200px) {
  .dx-layout--equal > .dx-side > .dx-card:last-child { display: flex; flex-direction: column; }
  .dx-layout--equal > .dx-side > .dx-card:last-child > .dx-help { margin-top: auto; }
  .dx-layout--equal > .dx-side > .dx-card:last-child > .dx-faq { margin-bottom: 18px; }
  .dx-layout--equal .dx-faq summary { padding-top: 20px; padding-bottom: 20px; }
}

/* Assurance strip: three small tiles at the foot of a form card, pushed to the bottom so a card
   stretched to match its side column ends in content rather than empty space. */
@media (min-width: 768px) {
  .dx-assure {
    margin-top: auto; padding-top: 24px; list-style: none; margin-bottom: 0; padding-left: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  }
  .dx-assure li {
    display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 14px;
    background: var(--ex-card); border: 1px solid var(--ex-line-2);
  }
  .dx-assure__ic {
    flex: none; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--ex-accent); background: rgba(24, 187, 89, .12);
  }
  .dx-assure b { display: block; font-size: 14px; color: var(--ex-text); }
  /* An inline symbol inside a description (e.g. the coin ticker) flows with the text — just bold. */
  .dx-assure .dep-x-sym { display: inline; font-size: inherit; color: inherit; font-weight: 700; }
  .dx-assure span:not(.dx-assure__ic) { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--ex-text-2); }
  .dx-assure a { color: var(--ex-accent); text-decoration: none; }
  .dx-assure a:hover { text-decoration: underline; }
  /* Compact variant: the icon sits beside the text, so each tile is about half as tall. */
  .dx-assure--row li { flex-direction: row; align-items: center; gap: 12px; padding: 11px 14px; }
  .dx-assure--row .dx-assure__ic { width: 32px; height: 32px; font-size: 17px; border-radius: 9px; }
  .dx-assure--row b { font-size: 13px; }
  .dx-assure--row span:not(.dx-assure__ic) { margin-top: 1px; font-size: 12px; line-height: 1.35; }
}

/* ---------- Accents ----------
   Red Log out in the account dropdown, and the small raised "0%" / "APY" tags beside
   Trading, Swap and Staking in the sidebar: gradient text that slowly flows, with a soft
   glow that breathes. Still for visitors who ask for reduced motion. */
.dshell-account__list a.dshell-account__logout,
.dshell-account__list a.dshell-account__logout .mdi { color: var(--ex-danger-text); }
.dshell-account__list a.dshell-account__logout:hover { background: rgba(235, 69, 54, .12); }
.dshell-account__list a.dshell-account__logout:focus-visible { box-shadow: 0 0 0 2px var(--ex-down); }

.dshell-tag {
  position: relative; top: -0.55em; margin-left: 3px;
  font-size: 10.5px; font-weight: 800; line-height: 1; letter-spacing: .01em; vertical-align: baseline;
  background: linear-gradient(90deg, #18BB59, #5CF29A, #B6F36B, #2FE0C8, #18BB59);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 3px rgba(24, 187, 89, .35));
  animation: dshell-tag-flow 3.2s linear infinite, dshell-tag-glow 2.4s ease-in-out infinite;
}
@keyframes dshell-tag-flow {
  from { background-position: 0% 50%; }
  to   { background-position: 300% 50%; }
}
@keyframes dshell-tag-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(24, 187, 89, .25)); }
  50%      { filter: drop-shadow(0 0 6px rgba(92, 242, 154, .65)); }
}
@media (prefers-reduced-motion: reduce) {
  .dshell-tag { animation: none; background-position: 30% 50%; }
}
/* The wide sidebar label clips overflow for ellipsis; let the raised tag show in full. */
.dshell-link__label:has(.dshell-tag) { overflow: visible; }

/* ---------- Small touches (round 2) ---------- */

/* "NEW" tags: same raised tag, warmer gradient so they read differently from "0%". */
.dshell-tag--new {
  font-size: 9px; letter-spacing: .04em;
  background-image: linear-gradient(90deg, #FFB347, #FF6FB5, #A78BFA, #FFD166, #FFB347);
  filter: drop-shadow(0 0 3px rgba(255, 111, 181, .35));
  animation: dshell-tag-flow 3.6s linear infinite, dshell-tag-glow-new 2.4s ease-in-out infinite;
}
@keyframes dshell-tag-glow-new {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(255, 111, 181, .25)); }
  50%      { filter: drop-shadow(0 0 6px rgba(255, 179, 71, .6)); }
}

/* Loading shimmer in the account dropdown. */
.dshell-skel {
  display: inline-block; border-radius: 6px; color: transparent !important;
  background: linear-gradient(90deg, #1E2632 0%, #2A3441 40%, #1E2632 80%);
  background-size: 200% 100%;
  animation: dshell-shimmer 1.2s ease-in-out infinite;
}
@keyframes dshell-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Verification mark on the avatar. */
.dshell-account { position: relative; }
.dshell-kyc {
  position: absolute; right: -2px; bottom: -2px; z-index: 1; pointer-events: none;
  width: 14px; height: 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #070B11;
}
.dshell-kyc.is-ok { background: var(--ex-accent, #18BB59); color: #05130A; }
.dshell-kyc.is-ok .mdi { font-size: 9px; line-height: 1; }
.dshell-kyc.is-pending { width: 12px; height: 12px; background: #F0B90B; }

/* Deposit arrow nudge. */
.dshell-btn--primary .mdi-arrow-down { transition: transform .18s ease; }
.dshell-btn--primary:hover .mdi-arrow-down { transform: translateY(2px); }

/* Unread count beside Live Support. */
.dshell-count {
  flex: none; min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto;
  border-radius: 999px; background: #EB4536; color: #fff;
  font: 700 11px/18px var(--ex-font, inherit); text-align: center;
  box-shadow: 0 0 0 0 rgba(235, 69, 54, .5); animation: dshell-ping 2s ease-out infinite;
}
.dshell-count[hidden] { display: none; }
@keyframes dshell-ping {
  0% { box-shadow: 0 0 0 0 rgba(235, 69, 54, .5); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(235, 69, 54, 0); }
}
/* On the tablet rail the label is a tooltip, so the count sits on the icon's corner. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .dshell-count { position: absolute; top: 5px; left: 30px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
}

/* Search shortcut hint. */
.dshell-search__kbd {
  margin-left: auto; flex: none; min-width: 20px; height: 20px; padding: 0 6px;
  border: 1px solid #2A3441; border-radius: 5px; background: #0D1219;
  color: var(--ex-muted, #858C97); font: 600 11px/18px var(--ex-font, inherit); text-align: center;
}
@media (max-width: 1023.98px) { .dshell-search__kbd { display: none; } }

/* Flags in the language menu. */
.dshell-flag { width: 20px; height: 14px; margin-right: 10px; border-radius: 3px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }

/* Page-load progress bar. */
.dshell-progress {
  position: fixed; top: 0; left: 0; z-index: 2147483000; height: 2px; width: 0; opacity: 0;
  background: linear-gradient(90deg, #18BB59, #5CF29A, #2FE0C8);
  box-shadow: 0 0 8px rgba(92, 242, 154, .6); pointer-events: none;
}
.dshell-progress.is-loading { opacity: 1; animation: dshell-progress 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes dshell-progress { 0% { width: 0; } 10% { width: 35%; } 40% { width: 65%; } 100% { width: 92%; } }

/* Back to top (desktop shell widths only; the mobile chrome has its own bottom bar). */
.dshell-totop { display: none; }
@media (min-width: 768px) {
  html[data-desktop-shell] .dshell-totop {
    position: fixed; right: 22px; bottom: 92px; z-index: 1200;
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #2A3441; background: rgba(20, 26, 34, .92); color: #EAECEF;
    font-size: 20px; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s, border-color .15s ease;
  }
  html[data-desktop-shell] .dshell-totop.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  html[data-desktop-shell] .dshell-totop:hover { border-color: var(--ex-accent, #18BB59); }
  html[data-desktop-shell] .dshell-totop:focus-visible { outline: none; box-shadow: var(--ex-focus); }
}

/* Footer pairs: 24h change. */
.dshell-footer__chg { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--ex-muted, #858C97); }
.dshell-footer__chg.is-up { color: #2EBD85; }
.dshell-footer__chg.is-down { color: #F6465D; }

/* Price flash on Markets when a price moves. */
.px-flash-up b, .px-flash-down b { border-radius: 4px; padding: 0 2px; margin: 0 -2px; }
.px-flash-up b   { animation: px-flash-up 1.1s ease-out; }
.px-flash-down b { animation: px-flash-down 1.1s ease-out; }
@keyframes px-flash-up   { 0% { background: rgba(46, 189, 133, .35); color: #2EBD85; } 100% { background: transparent; } }
@keyframes px-flash-down { 0% { background: rgba(246, 70, 93, .35); color: #F6465D; } 100% { background: transparent; } }

/* Staking "My stakes" empty state button. */
.sk-empty-cta {
  margin-top: 14px; padding: 9px 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: #18BB59; color: #05130A; font-weight: 700; font-size: 13px;
}
.sk-empty-cta:hover { background: #1FD068; }

@media (prefers-reduced-motion: reduce) {
  .dshell-tag--new, .dshell-skel, .dshell-count { animation: none; }
  .dshell-progress.is-loading { animation: none; width: 70%; }
  .px-flash-up b, .px-flash-down b { animation: none; }
  .dshell-btn--primary .mdi-arrow-down, .dshell-totop { transition: none; }
}

/* ---------- Top-bar search (real input + results panel) ---------- */
.dshell-search { position: relative; margin: 0; cursor: text; }
.dshell-search:focus-within { border-color: var(--ex-accent, #18BB59); background: #0D1219; }
.dshell-search.is-open { border-radius: 20px; }
.dshell-search__input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: none;
  color: var(--ex-text, #EAECEF); font: 500 14px var(--ex-font, inherit);
}
.dshell-search__input::placeholder { color: var(--ex-muted, #858C97); opacity: 1; }
.dshell-search__clear {
  flex: none; display: inline-flex; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--ex-muted, #858C97); font-size: 17px;
}
.dshell-search__clear:hover { color: var(--ex-text, #EAECEF); }
.dshell-search__clear[hidden], .dshell-search:focus-within .dshell-search__kbd { display: none; }

.dshell-search__panel {
  position: absolute; left: -1px; right: -1px; top: calc(100% + 8px); z-index: 1270;
  min-width: 360px; max-height: min(480px, 70vh); overflow-y: auto; padding: 6px;
  background: var(--ex-card, #12171F); border: 1px solid var(--ex-line-2, #222A35); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  scrollbar-width: thin; scrollbar-color: #2A3441 transparent;
}
.dshell-search__panel[hidden] { display: none; }
.dshell-search__list { margin: 0; padding: 0; list-style: none; }
.dshell-shead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 6px; color: var(--ex-muted, #858C97);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.dshell-shead__clear {
  padding: 0; border: 0; background: none; cursor: pointer; text-transform: none; letter-spacing: 0;
  color: var(--ex-muted, #858C97); font: 600 12px var(--ex-font, inherit);
}
.dshell-shead__clear:hover { color: var(--ex-accent, #18BB59); }
.dshell-sopt {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 10px;
  border-radius: 10px; cursor: pointer; color: var(--ex-text, #EAECEF);
}
.dshell-sopt.is-active { background: var(--ex-hover, #1A212B); }
.dshell-sopt__ic {
  position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #1E2632; color: var(--ex-text-2, #B7BDC6); font-weight: 700; font-size: 13px;
}
.dshell-sopt__ic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #1E2632; }
.dshell-sopt__ic--page { border-radius: 9px; background: rgba(24, 187, 89, .10); color: var(--ex-accent, #18BB59); }
.dshell-sopt__ic--page .mdi { font-size: 17px; }
.dshell-sopt__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dshell-sopt__main b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dshell-sopt__main b small { color: var(--ex-muted, #858C97); font-weight: 500; font-size: 12px; }
.dshell-sopt__main span { color: var(--ex-muted, #858C97); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dshell-sopt__px { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-variant-numeric: tabular-nums; }
.dshell-sopt__px b { font-size: 13px; font-weight: 600; }
.dshell-sopt__px small { font-size: 12px; font-weight: 600; color: var(--ex-muted, #858C97); }
.dshell-sopt__px small.is-up { color: #2EBD85; }
.dshell-sopt__px small.is-down { color: #F6465D; }
.dshell-sopt__go { color: var(--ex-muted, #858C97); font-size: 16px; opacity: 0; transition: opacity .12s ease, transform .12s ease; }
.dshell-sopt.is-active .dshell-sopt__go { opacity: 1; transform: translateX(2px); }
.dshell-sopt--all { min-height: 42px; margin-top: 4px; border-top: 1px solid var(--ex-line, #1A212B); border-radius: 0 0 10px 10px; color: var(--ex-accent, #18BB59); font-size: 13px; font-weight: 600; }
.dshell-sopt--all .mdi { font-size: 18px; }
.dshell-sempty { padding: 18px 10px 12px; text-align: center; color: var(--ex-muted, #858C97); font-size: 13px; }

/* Tablet: the box is an icon until focused, then opens out over the bar. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .dshell-search { flex: 0 0 40px; width: 40px; padding: 0; justify-content: center; transition: flex-basis .18s ease; }
  .dshell-search__input, .dshell-search__clear { width: 0; flex: 0 0 0; opacity: 0; }
  .dshell-search:focus-within { flex: 0 0 260px; padding: 0 14px; justify-content: flex-start; }
  .dshell-search:focus-within .dshell-search__input { flex: 1; width: auto; opacity: 1; }
  .dshell-search:focus-within .dshell-search__clear:not([hidden]) { width: auto; flex: none; opacity: 1; }
  .dshell-search__panel { left: 0; right: auto; min-width: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  .dshell-search, .dshell-sopt__go { transition: none; }
}
