/* ==========================================================================
   NOVE nx · the trader app layout
   Rail on desktop, floating dock on phones, one sheet for everything else.
   Tokens come from nove-night.css. Urbanist is self-hosted (SIL OFL 1.1).
   ========================================================================== */
@font-face { font-family: "Urbanist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/urbanist-var-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Urbanist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/urbanist-var-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root, html[data-theme] {
  --font-head: "Urbanist", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font: "Urbanist", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --mono: "Urbanist", "Segoe UI", -apple-system, sans-serif;
  --nx-rail: 84px;
  --nx-gap: clamp(16px, 2.4vw, 28px);
}
/* Urbanist has no Vietnamese tone marks: keep a font that does */
:root:lang(vi), html[data-theme]:lang(vi) { --font-head: "Be Vietnam Pro", sans-serif; --font: "Be Vietnam Pro", sans-serif; --mono: "Be Vietnam Pro", sans-serif; }
body { font-family: var(--font); font-weight: 450; letter-spacing: .005em; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; letter-spacing: -.02em; }

/* ---------- frame ---------- */
.nx-app { min-height: 100vh; }
.nx-frame { margin-left: calc(var(--nx-rail) + 24px); min-height: 100vh; display: flex; flex-direction: column; }
.nx-main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 8px var(--nx-gap) 120px; }
.nx-main.content { background: transparent; }

/* ---------- desktop rail: a floating vertical pill ---------- */
.nx-rail {
  position: fixed; z-index: 60; left: 16px; top: 16px; bottom: 16px; width: var(--nx-rail);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 0; border-radius: 42px;
  background: rgba(18, 20, 16, .82); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.nx-rail-brand { display: grid; place-items: center; }
.nx-rail-brand > span:not(.brand-mark) { display: none; }
.nx-rail-brand .brand-mark { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; }
.nx-rail-brand .brand-mark svg { width: 26px; height: 26px; }
.nx-rail-items { display: flex; flex-direction: column; gap: 12px; }

/* round icon buttons, used by the rail, the dock and the top bar */
.nx-ico, .nx-round {
  position: relative; display: grid; place-items: center; flex: none;
  width: 56px; height: 56px; border-radius: 50%; cursor: pointer;
  background: var(--night-2); color: #c3c8bb; border: 1px solid var(--border);
  transition: background .2s, color .2s, transform .15s;
}
.nx-ico:hover, .nx-round:hover { background: var(--night-3); color: var(--ink); }
.nx-ico:active { transform: scale(.95); }
.nx-ico.on { background: rgba(198, 243, 107, .12); color: var(--lime); border-color: rgba(198, 243, 107, .3); }
.nx-ico-lime, .nx-ico-lime:hover { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.nx-ico-lime.on { background: var(--lime); color: var(--lime-ink); }
.nx-round { width: 48px; height: 48px; }
.nx-round em, .nx-ico em {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--lime); color: var(--lime-ink); font: 700 .66rem/18px var(--font); font-style: normal; text-align: center;
}

/* ---------- top bar ---------- */
.nx-top {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1280px; width: 100%; margin: 0 auto; padding: 18px var(--nx-gap);
  background: linear-gradient(to bottom, rgba(9, 11, 8, .92) 60%, rgba(9, 11, 8, 0));
}
.nx-hello { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.nx-avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--lime); color: var(--lime-ink); font: 700 1.05rem var(--font-head);
  box-shadow: 0 0 0 4px rgba(198, 243, 107, .14);
}
.nx-hello-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.nx-hello-text small { color: var(--muted); font-size: .92rem; }
.nx-hello-text strong { font-size: 1.12rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-top-actions { display: flex; align-items: center; gap: 10px; }
.nx-top-actions .btn-sm { min-height: 48px; padding: 0 1.25rem; font-size: .95rem; }

/* ---------- phone dock ---------- */
.nx-dock { display: none; }

/* ---------- the menu sheet ---------- */
.nx-sheet {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
  background: rgba(4, 5, 4, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.nx-sheet.open { opacity: 1; pointer-events: auto; }
.nx-sheet-card {
  width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--night-1); border: 1px solid var(--border-bright); border-radius: 32px; padding: 22px;
  transform: translateY(12px) scale(.98); transition: transform .25s var(--ease);
}
.nx-sheet.open .nx-sheet-card { transform: none; }
.nx-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.nx-sheet-brand { display: flex; align-items: center; gap: 10px; font: 700 1.1rem var(--font-head); }
.nx-sheet-brand small { margin-left: 6px; color: var(--muted); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; font-size: .62rem; }
.nx-sheet-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.nx-sheet-brand .brand-mark svg { width: 20px; height: 20px; }
.nx-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.nx-tiles a {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px;
  min-height: 104px; padding: 16px; border-radius: 22px; text-decoration: none;
  background: var(--night-2); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: .95rem;
  transition: background .2s, border-color .2s;
}
.nx-tiles a .ico { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--night-3); color: #c3c8bb; }
.nx-tiles a:hover { background: var(--night-3); }
.nx-tiles a.on { border-color: rgba(198, 243, 107, .4); }
.nx-tiles a.on .ico { background: var(--lime); color: var(--lime-ink); }
.nx-sheet-foot { margin-top: 16px; display: flex; justify-content: flex-end; }
body.nx-sheet-open { overflow: hidden; }

/* ==========================================================================
   Shared components for the new pages
   ========================================================================== */
.nx-hero { margin: 6px 0 22px; }
.nx-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; margin: 0; max-width: 14ch; }
.nx-hero h1 .nx-dot { display: inline-grid; place-items: center; width: .62em; height: .62em; margin-left: .12em; vertical-align: .02em; border-radius: 50%; background: var(--lime); color: var(--lime-ink); font-size: .7em; }
.nx-hero p { color: var(--muted); margin: .7rem 0 0; font-size: 1.05rem; max-width: 52ch; }

.nx-chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin: 0 0 18px; }
.nx-chips::-webkit-scrollbar { display: none; }
.nx-chip {
  flex: none; min-height: 52px; padding: 0 1.4rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--night-1); color: #c3c8bb; font: 600 1rem var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
}
.nx-chip:hover { color: var(--ink); background: var(--night-2); }
.nx-chip.on { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.nx-chip b { font-weight: 700; opacity: .7; }

.nx-card {
  position: relative; background: var(--night-1); border: 1px solid var(--border); border-radius: 32px; padding: 24px;
  overflow: hidden;
}
.nx-card.soft { background: linear-gradient(160deg, #1a1d17, #121410 55%); }
.nx-label { color: var(--muted); font-size: .95rem; font-weight: 500; }
.nx-section { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }
.nx-section h2 { font-size: 1.35rem; margin: 0; letter-spacing: -.02em; }
.nx-section a { color: var(--lime); font-weight: 600; font-size: .95rem; text-decoration: none; }

/* big money figures: whole part bright, cents dim, like a price ticker */
.nx-money { font: 600 clamp(2.2rem, 4vw, 3rem)/1 var(--font-head); letter-spacing: -.035em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nx-money .c { color: #7d8377; }
.nx-money.sm { font-size: 1.6rem; }

.nx-pill { display: inline-flex; align-items: center; gap: .3rem; height: 30px; padding: 0 .75rem; border-radius: 999px; font: 600 .85rem var(--font); background: rgba(198, 243, 107, .14); color: var(--lime); }
.nx-pill.down { background: rgba(255, 107, 107, .14); color: var(--loss); }
.nx-pill.flat { background: var(--night-3); color: var(--muted); }

/* key/value rows, like "Opening price .... $3,967.23" */
.nx-rows { display: flex; flex-direction: column; }
.nx-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.nx-rows > div:last-child { border-bottom: 0; }
.nx-rows span { color: var(--muted); }
.nx-rows b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

.nx-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 60px; border-radius: 999px;
  font: 650 1.05rem var(--font); text-decoration: none; border: 1px solid var(--border-bright); background: var(--night-2); color: var(--ink); cursor: pointer;
}
.nx-btn:hover { background: var(--night-3); }
.nx-btn.lime { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.nx-btn.lime:hover { background: #d6fa86; }

/* ==========================================================================
   Trade desk
   ========================================================================== */
.nx-desk { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.nx-desk-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 96px; }

.nx-accts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.nx-accts::-webkit-scrollbar { display: none; }
.nx-acct { scroll-snap-align: start; display: flex; flex-direction: column; gap: 18px; min-height: 360px; text-decoration: none; color: inherit; transition: border-color .2s, transform .2s; }
.nx-acct:hover { border-color: rgba(198, 243, 107, .3); }
.nx-acct[hidden] { display: none; }
.nx-acct-head { display: flex; align-items: center; gap: 12px; }
.nx-acct-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--night-3); color: var(--ink); font: 800 1.25rem var(--font-head); }
.nx-acct-title { min-width: 0; flex: 1; }
.nx-acct-title strong { display: block; font-size: 1.12rem; font-weight: 700; }
.nx-acct-title span { display: block; color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-acct-go { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--night-3); color: #c3c8bb; flex: none; }
.nx-acct:hover .nx-acct-go { background: var(--lime); color: var(--lime-ink); }
.nx-spark { position: relative; height: 110px; margin: auto -24px -24px; }
.nx-spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nx-spark .area { fill: url(#nxSparkFill); }
.nx-spark .line { fill: none; stroke: #4e5a3a; stroke-width: 2; vector-effect: non-scaling-stroke; }
.nx-spark .last { fill: var(--lime); }
.nx-spark .nx-pill { position: absolute; right: 18px; top: 4px; background: rgba(198, 243, 107, .9); color: var(--lime-ink); }
.nx-spark .nx-pill.down { background: rgba(255, 107, 107, .92); color: #1a0606; }
.nx-progress { height: 8px; border-radius: 999px; background: var(--night-3); overflow: hidden; }
.nx-progress i { display: block; height: 100%; border-radius: inherit; background: var(--lime); }
.nx-progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .86rem; margin-top: 8px; }

.nx-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 300px; justify-content: flex-end; }
.nx-empty h3 { font-size: 1.6rem; margin: 0; max-width: 16ch; }
.nx-empty p { color: var(--muted); margin: 0; max-width: 40ch; }

.nx-total .nx-money { margin: 8px 0 14px; }
.nx-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.nx-quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--muted); font-size: .8rem; font-weight: 600; text-align: center; }
.nx-quick a .nx-ico { width: 54px; height: 54px; }
.nx-quick a:hover { color: var(--ink); }

.nx-score { display: flex; align-items: center; gap: 18px; }
.nx-ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--lime) calc(var(--p) * 1%), var(--night-3) 0); }
.nx-ring b { width: 70px; height: 70px; border-radius: 50%; background: var(--night-1); display: grid; place-items: center; font: 700 1.25rem var(--font-head); }

.nx-trades .nx-rows > div { padding: 13px 0; }
.nx-sym { display: flex; align-items: center; gap: 12px; }
.nx-sym i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--night-3); font: 700 .72rem var(--font); font-style: normal; color: var(--ink); }
.nx-sym div { display: flex; flex-direction: column; line-height: 1.25; }
.nx-sym small { color: var(--muted); }

.nx-board li { list-style: none; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.nx-board { margin: 0; padding: 0; }
.nx-board li:last-child { border-bottom: 0; }
.nx-board .r { color: var(--muted); font-weight: 700; }
.nx-board .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-board .n small { color: var(--muted); margin-left: 6px; }

.nx-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-radius: 24px; margin-bottom: 14px; background: rgba(198, 243, 107, .08); border: 1px solid rgba(198, 243, 107, .25); }
.nx-banner .input { max-width: 240px; }

/* legacy page headers inside the new frame: quieter, the hero is the page title now */
.nx-app .page-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -.03em; }
.nx-app .card { border-radius: 28px; }

/* ==========================================================================
   Phone and tablet
   ========================================================================== */
@media (max-width: 1080px) {
  .nx-desk { grid-template-columns: minmax(0, 1fr); }
  .nx-desk-side { position: static; }
}
@media (max-width: 860px) {
  .nx-rail { display: none; }
  .nx-frame { margin-left: 0; }
  .nx-hide-m { display: none !important; }
  .nx-top { padding: 14px 16px; }
  .nx-main { padding: 4px 16px calc(120px + env(safe-area-inset-bottom, 0px)); }
  .nx-dock {
    display: flex; position: fixed; z-index: 70; left: 50%; transform: translateX(-50%);
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100% - 24px));
    justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 40px;
    background: rgba(24, 27, 22, .9); border: 1px solid var(--border-bright);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .7);
  }
  .nx-dock .nx-ico { width: 54px; height: 54px; }
  .nx-dock .nx-ico-big { width: 64px; height: 64px; }
  .nx-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nx-sheet { place-items: end center; padding: 10px; }
  .nx-sheet-card { border-radius: 30px 30px 26px 26px; max-height: 86vh; }
  .nx-accts { grid-auto-columns: 82%; }
  .nx-acct { min-height: 330px; }
  /* the support bubble sits above the dock */
  .nsc { bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important; }
}
@media (max-width: 480px) {
  .nx-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-tiles a { min-height: 92px; }
  .nx-round { width: 44px; height: 44px; }
  .nx-avatar { width: 46px; height: 46px; }
  .nx-top-actions .lang-switch { display: none; }
  .nx-quick { grid-template-columns: repeat(4, 1fr); }
  .nx-btn-row { grid-template-columns: 1fr 1fr; }
}

/* selects in the dark: one chevron, never tiled */
select.input, .nx-app select, select { background-repeat: no-repeat !important; background-position: right 14px center !important; background-size: 12px 8px !important; padding-right: 36px; }
.nx-acct-hero .row { gap: 10px; }
.nx-acct-hero .btn-sm { min-height: 44px; padding: 0 1.1rem; }
.nx-app .stat { border-radius: 26px; padding: 20px 22px; }
.nx-app .stat .v { font-family: var(--font-head); font-size: 1.7rem; letter-spacing: -.03em; }
.nx-app .acct-card { border-radius: 30px; }
.nx-app .acct-card .btn, .nx-app .btn-block { border-radius: 999px; }
.nx-app .btn-buy, .nx-app .acct-buy { text-transform: none; letter-spacing: 0; }
