/* ==========================================================================
   Aurum — design tokens
   ========================================================================== */
:root {
  --bg: #08090b;
  --bg-2: #0d0f12;
  --bg-3: #13161a;
  --surface: rgba(255, 255, 255, 0.022);
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);

  --text: #ece8df;
  --text-2: #a8a399;
  --text-3: #6f6b63;

  --gold: #d9b26f;
  --gold-2: #f3dca4;
  --gold-3: #9a773a;
  --gold-soft: rgba(217, 178, 111, 0.12);
  --gold-grad: linear-gradient(135deg, #f6dfa8 0%, #d4ac64 48%, #8e6b2e 100%);

  --up: #7fe0b6;
  --up-soft: rgba(127, 224, 182, 0.1);
  --down: #f38c95;
  --down-soft: rgba(243, 140, 149, 0.1);

  --c-etf: #d9b26f;
  --c-stock: #86aaf0;
  --c-metal: #e6dfcf;
  --c-crypto: #b892f2;
  --c-cash: #7cc9bf;
  --c-trading: #ef9f67;
  --c-property: #9d968a;

  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --sidebar: 248px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--sans);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient light and film grain give the dark canvas depth. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(217, 178, 111, 0.09), transparent 60%),
    radial-gradient(700px 500px at 100% 110%, rgba(110, 160, 170, 0.05), transparent 60%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(217, 178, 111, 0.3); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.serif { font-family: var(--serif); font-weight: 400; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
}

body.privacy .money { filter: blur(9px); transition: filter 0.2s; }
body.privacy .money:hover { filter: blur(0); }

/* ==========================================================================
   Boot
   ========================================================================== */
#root { position: relative; z-index: 1; }
.boot { display: grid; place-items: center; min-height: 100vh; }
.boot-mark {
  position: relative;
  width: 72px; height: 72px;
  display: grid; place-items: center;
  font: 34px var(--serif);
  color: var(--gold);
  border: 1px solid var(--gold-3);
  border-radius: 16px;
  animation: breathe 1.8s var(--ease) infinite;
}
.boot-mark span { position: absolute; top: 6px; left: 8px; font: 10px var(--mono); color: var(--text-3); }
@keyframes breathe { 50% { opacity: 0.45; transform: scale(0.96); } }

/* ==========================================================================
   Auth screen
   ========================================================================== */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}
.auth-art {
  position: relative;
  overflow: hidden;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(800px 500px at 0% 0%, rgba(217, 178, 111, 0.12), transparent 60%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35));
}
.auth-art .grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 30% 40%, black 20%, transparent 75%);
  opacity: 0.5;
}
.auth-headline {
  position: relative;
  font: 400 clamp(52px, 6.4vw, 96px)/0.95 var(--serif);
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 11ch;
}
.auth-headline em { font-style: italic; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.08em; }
.auth-sub { position: relative; color: var(--text-2); max-width: 44ch; font-size: 15px; margin-top: 22px; }
.auth-chart { position: absolute; left: 0; right: 0; bottom: 120px; height: 46%; pointer-events: none; }
.auth-chart path.line { stroke-dasharray: 2600; stroke-dashoffset: 2600; animation: draw 3.2s var(--ease) 0.3s forwards; }
.auth-chart path.fill { opacity: 0; animation: fadein 1.4s ease 1.8s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }
.auth-tiles { position: relative; display: flex; gap: 14px; flex-wrap: wrap; }
.auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font: 400 40px/1.05 var(--serif); margin: 0 0 6px; }
.auth-card p.lead { color: var(--text-2); margin: 0 0 28px; }
.auth-switch { margin-top: 22px; color: var(--text-2); font-size: 13px; text-align: center; }
.auth-switch button { background: none; border: 0; color: var(--gold); padding: 0; }
.auth-foot { position: relative; display: flex; justify-content: space-between; align-items: end; gap: 24px; color: var(--text-3); font-size: 12px; }

/* ==========================================================================
   Brand
   ========================================================================== */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-tile {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  font: 21px/1 var(--serif);
  color: var(--gold-2);
  background: linear-gradient(160deg, rgba(217, 178, 111, 0.22), rgba(217, 178, 111, 0.04));
  border: 1px solid rgba(217, 178, 111, 0.35);
  box-shadow: 0 0 24px -6px rgba(217, 178, 111, 0.35);
}
.brand-tile small { position: absolute; top: 3px; left: 5px; font: 7.5px var(--mono); color: var(--gold-3); }
.brand-name { font: 26px/1 var(--serif); letter-spacing: 0.01em; }
.brand-name i { color: var(--gold); }

/* ==========================================================================
   Element tile (periodic table look, used for metals)
   ========================================================================== */
.element {
  --c: var(--gold);
  position: relative;
  min-width: 132px;
  padding: 12px 14px 12px;
  border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, transparent), rgba(255, 255, 255, 0.015) 60%);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.element:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.element .z { font: 10px var(--mono); color: var(--text-3); }
.element .sym { font: 40px/1 var(--serif); color: var(--c); margin: 2px 0 2px; }
.element .nm { font-size: 11px; color: var(--text-2); letter-spacing: 0.06em; text-transform: uppercase; }
.element .px { margin-top: 10px; font: 500 14px var(--mono); }
.element .px small { color: var(--text-3); font-weight: 400; }
.element .chg { position: absolute; top: 12px; right: 12px; font: 11px var(--mono); }
.element.au { --c: #e2bb72; }
.element.ag { --c: #cfd5de; }
.element.pt { --c: #b7c9cf; }
.element.pd { --c: #c4b9d6; }

/* ==========================================================================
   App shell
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 28px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
}
.sidebar .brand { padding: 4px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 0 12px 8px; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 450;
  transition: color 0.2s, background 0.2s;
}
.nav a svg { width: 18px; height: 18px; opacity: 0.8; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav a.active::before {
  content: '';
  position: absolute; left: -16px; top: 9px; bottom: 9px;
  width: 2px; border-radius: 2px;
  background: var(--gold-grad);
  box-shadow: 0 0 12px var(--gold);
}
.nav a.active svg { color: var(--gold); opacity: 1; }
.nav kbd { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  width: 100%;
  text-align: left;
}
.user-chip:hover { border-color: var(--line-2); }
.avatar {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  display: grid; place-items: center;
  font: 16px var(--serif);
  color: var(--bg);
  background: var(--gold-grad);
}
.user-chip .who { min-width: 0; line-height: 1.25; }
.user-chip .who b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 12px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.ticker { height: 46px; border-bottom: 1px solid var(--line); overflow: hidden; }
.ticker .tradingview-widget-copyright { display: none; }
.topbar {
  display: flex; align-items: end; justify-content: space-between; gap: 16px;
  padding: 30px 40px 6px;
}
.topbar h1 { font: 400 44px/1 var(--serif); margin: 6px 0 0; letter-spacing: -0.01em; }
.topbar h1 em { color: var(--gold); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.live {
  display: inline-flex; align-items: center; gap: 8px;
  font: 12px var(--mono);
  color: var(--text-3);
  padding: 0 6px;
}
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(127, 224, 182, 0.6); animation: pulse 2.2s infinite; }
.live.stale i { background: var(--text-3); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(127, 224, 182, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 224, 182, 0); } }
.view { padding: 22px 40px 64px; flex: 1; }

/* ==========================================================================
   Buttons, inputs
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.gold {
  color: #1a1408;
  border: 0;
  background: var(--gold-grad);
  box-shadow: 0 8px 24px -10px rgba(217, 178, 111, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--down); border-color: rgba(243, 140, 149, 0.25); background: var(--down-soft); }
.btn.sm { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

kbd {
  font: 10.5px var(--mono);
  color: var(--text-3);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, select.input, textarea.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.25);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
textarea.input { height: auto; min-height: 70px; padding: 11px 14px; resize: vertical; }
.input:focus { border-color: rgba(217, 178, 111, 0.6); box-shadow: 0 0 0 4px rgba(217, 178, 111, 0.1); background: rgba(0, 0, 0, 0.35); }
.input.num { text-align: right; }
.input::placeholder { color: var(--text-3); }
input[type='date'].input { color-scheme: dark; }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a8a399' stroke-width='1.5'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
select.input option { background: var(--bg-3); }
.input-affix { position: relative; }
.input-affix .input { padding-right: 38px; }
.input-affix > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font: 13px var(--mono); pointer-events: none; }
.input-group { display: flex; gap: 8px; }
.input-group > * { flex: 1; min-width: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-error { color: var(--down); font-size: 13px; min-height: 18px; }

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  height: 32px; padding: 0 14px;
  border-radius: 9px;
  font-size: 13px; font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.segmented.gold button.on { background: var(--gold-soft); color: var(--gold-2); }
.segmented.wide { display: flex; }
.segmented.wide button { flex: 1; }

.choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.choice:hover { border-color: var(--line-3); }
.choice.on { border-color: rgba(217, 178, 111, 0.6); background: var(--gold-soft); }
.choice b { font-weight: 500; font-size: 13px; }
.choice small { color: var(--text-3); font-size: 11px; }
.choice .sym { font: 26px/1 var(--serif); color: var(--c, var(--gold)); }

/* ==========================================================================
   Cards & layout
   ========================================================================== */
.card {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
  box-shadow: var(--shadow);
  padding: 22px;
  isolation: isolate;
}
/* Cursor spotlight: --mx/--my are set from JS on pointer move. */
.card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(217, 178, 111, 0.07), transparent 45%);
}
.card:hover::before { opacity: 1; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h3 { margin: 0; font: 400 24px/1.1 var(--serif); }
.card-head .eyebrow + h3 { margin-top: 4px; }

.grid { display: grid; gap: 18px; }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 18px; }

.reveal { opacity: 0; transform: translateY(10px); animation: rise 0.7s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ==========================================================================
   Dashboard hero
   ========================================================================== */
.hero { padding: 26px 26px 10px; overflow: hidden; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 20px; flex-wrap: wrap; }
.hero-top > div:first-child { flex: 1 1 360px; min-width: 0; }
.hero-top > .segmented { flex: none; }
.hero-value { font: 400 clamp(54px, 7vw, 92px)/0.95 var(--serif); letter-spacing: -0.025em; margin: 10px 0 14px; white-space: nowrap; }
.hero-value .dec { color: var(--text-3); font-size: 0.55em; letter-spacing: 0; }
.hero-value .cur { color: var(--gold); font-size: 0.55em; margin-left: 0.15em; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px;
  border-radius: 99px;
  font: 500 12.5px var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.up { background: var(--up-soft); border-color: rgba(127, 224, 182, 0.18); }
.pill.down { background: var(--down-soft); border-color: rgba(243, 140, 149, 0.18); }
.pill svg { width: 12px; height: 12px; }
.pill .lbl { font-family: var(--sans); font-weight: 400; color: var(--text-2); }
.chart-box { position: relative; height: 330px; margin: 18px -26px 0; }
.chart-box.sm { height: 280px; margin: 0; }
.chart-tip {
  position: absolute; top: 10px; left: 26px;
  pointer-events: none;
  font-size: 12px;
  color: var(--text-2);
  z-index: 3;
}
.chart-tip b { color: var(--text); font: 500 15px var(--mono); }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  margin: 0 -26px;
}
.hero-stats > div { padding: 16px 26px; border-right: 1px solid var(--line); }
.hero-stats > div:last-child { border-right: 0; }
.hero-stats .v { font: 500 clamp(14px, 1.15vw, 17px) var(--mono); margin-top: 4px; white-space: nowrap; }

/* ==========================================================================
   Donut
   ========================================================================== */
.donut-wrap { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 22px; align-items: center; }
.donut { position: relative; width: 170px; height: 170px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { transition: stroke-width 0.25s var(--ease), opacity 0.25s; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font: 400 26px/1 var(--serif); }
.donut-center span { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.legend { display: flex; flex-direction: column; gap: 4px; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 9px; cursor: default; }
.legend-row:hover { background: var(--surface-2); }
.legend-row i { width: 10px; height: 10px; border-radius: 3px; }
.legend-row .pct { font: 12px var(--mono); color: var(--text-3); }
.legend-row .val { font: 13px var(--mono); display: block; text-align: right; }

/* ==========================================================================
   Lists & tables
   ========================================================================== */
.asset-ico {
  --c: var(--gold);
  flex: none;
  position: relative;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font: 17px/1 var(--serif);
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  overflow: hidden;
}
.asset-ico small { position: absolute; top: 2px; left: 4px; font: 7px var(--mono); color: var(--text-3); }
.asset-ico.etf { --c: var(--c-etf); font: 600 10px var(--mono); letter-spacing: 0.04em; }
.asset-ico.stock { --c: var(--c-stock); font: 600 11px var(--mono); }
.asset-ico.crypto { --c: var(--c-crypto); font: 600 11px var(--mono); }
.asset-ico.metal.au { --c: #e2bb72; }
.asset-ico.metal.ag { --c: #cfd5de; }
.asset-ico.metal.pt { --c: #b7c9cf; }
.asset-ico.metal.pd { --c: #c4b9d6; }
.asset-name { min-width: 0; line-height: 1.3; }
.asset-name b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-name span { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.list { display: flex; flex-direction: column; }
.list-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 12px;
  transition: background 0.2s;
}
a.list-row:hover { background: var(--surface-2); }
.list-row .right { text-align: right; line-height: 1.3; }
.list-row .right b { display: block; font: 500 14px var(--mono); }
.list-row .right span { font: 12px var(--mono); }
.bar { height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--gold-grad); }

.table-card { padding: 6px 0 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-card .card-head { padding: 16px 22px 0; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: right;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table th:first-child, .table td:first-child { text-align: left; padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table td { text-align: right; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background 0.2s; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td .num { white-space: nowrap; }
.table td .sub { display: block; font: 12px var(--mono); color: var(--text-3); margin-top: 2px; white-space: nowrap; }
.table .asset-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.table .weight { width: 110px; margin-left: auto; }
.table .actions { white-space: nowrap; }
.table .actions .btn { opacity: 0.55; }
.table tr:hover .actions .btn { opacity: 1; }
.month-row td {
  background: rgba(255, 255, 255, 0.015);
  font-size: 12px;
  color: var(--text-2);
  padding-top: 10px; padding-bottom: 10px;
}
.month-row td b { font: 400 18px var(--serif); color: var(--text); margin-right: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px; font-weight: 500;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  white-space: nowrap;
}
.badge.buy { color: var(--up); border-color: rgba(127, 224, 182, 0.25); background: var(--up-soft); }
.badge.sell { color: var(--down); border-color: rgba(243, 140, 149, 0.25); background: var(--down-soft); }
.badge.plan { color: var(--gold-2); border-color: rgba(217, 178, 111, 0.3); background: var(--gold-soft); }
.badge svg { width: 11px; height: 11px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  transition: all 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip.on { color: var(--text); background: var(--surface-3); border-color: var(--line-3); }
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.chip .count { font: 11px var(--mono); color: var(--text-3); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search-box .input { padding-left: 38px; height: 40px; min-width: 240px; }

/* ==========================================================================
   Stat tiles
   ========================================================================== */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.stat { padding: 18px 22px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .v { font: 500 20px var(--mono); margin-top: 6px; white-space: nowrap; }
.stat .s { font: 12px var(--mono); margin-top: 2px; }
.stats-card { padding: 0; }

/* ==========================================================================
   Asset page
   ========================================================================== */
.asset-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.asset-head .left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.asset-head .asset-ico { width: 56px; height: 56px; border-radius: 14px; font-size: 26px; }
.asset-head .asset-ico.etf, .asset-head .asset-ico.stock, .asset-head .asset-ico.crypto { font-size: 13px; }
.asset-head h2 { margin: 0; font: 400 34px/1.05 var(--serif); }
.asset-head .meta { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.asset-price { text-align: right; }
.asset-price b { font: 400 40px/1 var(--serif); display: block; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.back svg { width: 14px; height: 14px; }
.tv-box { height: 520px; border-radius: var(--r); overflow: hidden; }
.tv-edit { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.tv-edit code { font: 12px var(--mono); color: var(--text-2); }

/* ==========================================================================
   Plans
   ========================================================================== */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.plan-card { display: flex; flex-direction: column; gap: 18px; }
.plan-card.paused { opacity: 0.62; }
.plan-rate { font: 400 38px/1 var(--serif); }
.plan-rate small { font: 14px var(--sans); color: var(--text-2); margin-left: 6px; }
.plan-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.plan-kv .v { font: 500 14px var(--mono); margin-top: 2px; }
.plan-next {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--line-2);
  font-size: 13px;
}
.plan-next .cal {
  width: 40px; flex: none;
  text-align: center;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  line-height: 1;
}
.plan-next .cal span { display: block; background: var(--gold-soft); color: var(--gold-2); font-size: 9px; padding: 3px 0; letter-spacing: 0.1em; text-transform: uppercase; }
.plan-next .cal b { display: block; font: 18px var(--serif); padding: 4px 0 5px; }

.calc-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0 8px; }
.proj-axis { display: flex; justify-content: space-between; font: 10.5px var(--mono); color: var(--text-3); margin-top: 6px; }
.calc-out .v { font: 400 28px/1.1 var(--serif); margin-top: 4px; white-space: nowrap; }
.range-row { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 14px; padding: 6px 0; }
.range-row output { font: 500 13px var(--mono); text-align: right; }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold) var(--p, 50%), var(--surface-3) var(--p, 50%)); outline: none; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--gold-2); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--gold); cursor: grab; }
input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold-2); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--gold); cursor: grab; }

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0;
  z-index: 50;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(4, 5, 6, 0.65);
  backdrop-filter: blur(8px);
  animation: fadein 0.2s ease forwards;
  opacity: 0;
}
.modal {
  width: 100%; max-width: 620px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 24px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #15181c, #0f1114);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: pop 0.35s var(--ease);
}
.modal.sm { max-width: 440px; }
@keyframes pop { from { transform: translateY(14px) scale(0.98); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 26px 6px; }
.modal-head h3 { margin: 0; font: 400 30px/1.05 var(--serif); }
.modal-body { padding: 18px 26px 6px; display: flex; flex-direction: column; gap: 18px; }
[data-picker], [data-fields] { display: flex; flex-direction: column; gap: 18px; }
[data-fields]:empty, [data-picker]:empty { display: none; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 26px 24px; }
.modal-foot .spacer { flex: 1; }

.search-results {
  margin-top: 6px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--bg-3);
  max-height: 260px;
  overflow: auto;
}
.search-results:empty { display: none; }
.result {
  width: 100%;
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 9px 12px;
  border: 0; border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.result:last-child { border-bottom: 0; }
.result:hover, .result.active { background: var(--surface-2); }
.result .asset-ico { width: 34px; height: 34px; }
.result .ex { font: 11px var(--mono); color: var(--text-3); text-align: right; }
.search-state { padding: 14px; color: var(--text-3); font-size: 13px; }

.selected-asset {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(217, 178, 111, 0.35);
  background: var(--gold-soft);
}
.selected-asset .asset-ico { width: 44px; height: 44px; }
.selected-asset .px { text-align: right; font: 500 14px var(--mono); line-height: 1.3; }
.selected-asset .px span { display: block; font-size: 12px; }

.summary-box {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}
.summary-box > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.summary-box > div:last-child { border-right: 0; }
.summary-box .v { font: 500 15px var(--mono); margin-top: 3px; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold); font-size: 12px; }
.link-btn:hover { text-decoration: underline; }

/* ==========================================================================
   Toasts, empty states, skeletons, menus
   ========================================================================== */
#toasts { position: fixed; bottom: 24px; right: 24px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #16191d;
  box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.7);
  font-size: 13px;
  animation: pop 0.3s var(--ease);
}
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.toast.err i { background: var(--down); }

.empty {
  text-align: center;
  padding: 64px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.empty h3 { font: 400 34px/1.1 var(--serif); margin: 8px 0 0; }
.empty p { color: var(--text-2); max-width: 46ch; margin: 0; }
.empty .row { margin-top: 10px; justify-content: center; flex-wrap: wrap; }

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.menu {
  position: absolute;
  z-index: 40;
  min-width: 220px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: #15181c;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  animation: pop 0.2s var(--ease);
}
.menu button {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  text-align: left;
}
.menu button:hover { background: var(--surface-2); color: var(--text); }
.menu button svg { width: 16px; height: 16px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.tv-frame { border-radius: var(--r); overflow: hidden; }
.tv-frame .tradingview-widget-copyright { font-size: 11px; padding: 6px 2px; color: var(--text-3); }
.tv-frame .tradingview-widget-copyright a { color: var(--text-3); }
.note { font-size: 12px; color: var(--text-3); }
.note a { color: var(--gold); }

/* ==========================================================================
   Mobile nav & responsive
   ========================================================================== */
.mobile-nav { display: none; }

@media (max-width: 1180px) {
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .hero-stats, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats > div:nth-child(2), .stat:nth-child(2) { border-right: 0; }
  .hero-stats > div:nth-child(-n + 2), .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .hide-lg { display: none; }
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 46vh; padding: 28px 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-chart { bottom: 40px; height: 50%; }
  .auth-foot { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 20px 16px 4px; }
  .topbar h1 { font-size: 34px; }
  .live span { display: none; }
  .view { padding: 16px 16px 110px; }
  .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 20px 18px 6px; }
  .chart-box { margin: 14px -18px 0; height: 260px; }
  .hero-stats { margin: 0 -18px; }
  .hero-stats > div { padding: 14px 18px; }
  .chart-tip { left: 18px; }
  .hide-md { display: none; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .table .hide-sm { display: none; }
  .table .asset-cell { min-width: 0; }
  .table th, .table td { padding: 12px 10px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal { max-height: 92vh; border-radius: 22px 22px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .calc-out { grid-template-columns: 1fr; }
  .range-row { grid-template-columns: 1fr 80px; }
  .range-row input { grid-column: span 2; grid-row: 2; }
  .tv-box { height: 420px; }
  .search-box .input { min-width: 0; width: 100%; }
  .toolbar > * { flex: 1 1 auto; }
  #toasts { left: 16px; right: 16px; bottom: 90px; }
  .mobile-nav {
    display: flex;
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 30;
    padding: 6px;
    gap: 2px;
    border-radius: 18px;
    border: 1px solid var(--line-2);
    background: rgba(16, 18, 21, 0.86);
    backdrop-filter: blur(16px);
  }
  .mobile-nav a, .mobile-nav button {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 0 5px;
    border-radius: 12px;
    border: 0; background: none;
    color: var(--text-3);
    font-size: 10px;
  }
  .mobile-nav svg { width: 19px; height: 19px; }
  .mobile-nav a.active { color: var(--gold-2); background: var(--surface-2); }
  .mobile-nav .add { color: #1a1408; background: var(--gold-grad); }
}

@media (max-width: 520px) {
  .hero-value { font-size: 48px; }
  .element { min-width: 0; }
  .summary-box { grid-template-columns: 1fr; }
  .summary-box > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .selected-asset { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .selected-asset .px { display: none; }
  .plan-kv { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .auth-chart path.line { stroke-dashoffset: 0; }
  .auth-chart path.fill, .reveal { opacity: 1; transform: none; }
}

/* Embedded widgets render a light document; a matching color-scheme keeps their iframes transparent
   instead of painting an opaque white backdrop on our dark page. */
.tradingview-widget-container,
.tradingview-widget-container iframe { color-scheme: normal; }
