/* Edge Matrix — BARE backbone v1 (no placeholders) */
:root{
  --bg0:#06080d;
  --bg1:#070b12;
  --text: rgba(235,245,255,.92);
  --muted: rgba(235,245,255,.62);
  --green:#43ffa4;
  --blue:#56a2ff;
  --stroke: rgba(130,255,185,.14);
  --shadow: 0 18px 60px rgba(0,0,0,.55);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 15% -10%, rgba(67,255,164,.12), transparent 55%),
              radial-gradient(1200px 800px at 85% 10%, rgba(86,162,255,.10), transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow:hidden;
}

/* Background */
.bg{position:fixed; inset:0; z-index:-5; pointer-events:none}
.glow{position:absolute; filter: blur(44px); opacity:.85}
.g1{width:720px; height:520px; left:-240px; top:-240px; background: radial-gradient(circle at 30% 30%, rgba(67,255,164,.28), transparent 58%)}
.g2{width:820px; height:620px; right:-260px; top:-180px; background: radial-gradient(circle at 60% 40%, rgba(86,162,255,.18), transparent 62%)}
.g3{width:720px; height:520px; left:18%; bottom:-280px; background: radial-gradient(circle at 40% 40%, rgba(20,217,122,.14), transparent 62%)}

.grid{
  position:absolute; inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity:.16;
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 72%);
}

.noise{
  position:absolute; inset:0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  opacity:.22;
  mix-blend-mode: overlay;
}

/* Topbar */
.topbar{
  height: 64px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-bottom: 1px solid rgba(130,255,185,.12);
  background: linear-gradient(180deg, rgba(6,8,13,.92), rgba(6,8,13,.62));
  backdrop-filter: blur(14px);
}
.topbar__inner{
  width:min(1200px, calc(100% - 32px));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{display:flex; align-items:center; gap:10px}
.mark{
  width: 28px; height:28px; border-radius: 10px;
  display:inline-block;
  background:
    radial-gradient(circle at 30% 30%, rgba(67,255,164,.95), rgba(67,255,164,.22) 58%, transparent 62%),
    radial-gradient(circle at 70% 70%, rgba(86,162,255,.55), transparent 56%);
  box-shadow: 0 0 0 1px rgba(130,255,185,.16), 0 12px 40px rgba(67,255,164,.10);
}
.name{
  font-weight:700;
  letter-spacing:.14em;
  font-size:.82rem;
  opacity:.9;
}
.title{
  font-weight:700;
  letter-spacing:.02em;
  color: rgba(235,245,255,.86);
}
.status{
  display:flex; align-items:center; gap:10px;
  color: rgba(235,245,255,.58);
  font-weight:600;
  font-size:.9rem;
}
.dot{
  width:9px; height:9px; border-radius:50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(67,255,164,.45);
}

/* Bare stage */
.stage{
  height: calc(100vh - 64px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: 0 18px;
}
.h1{
  margin:0;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -.02em;
}
.sub{
  margin: 10px 0 0;
  color: var(--muted);
  font-weight:600;
}

/* Mobile */
@media (max-width: 520px){
  .title{display:none}
  .status{font-size:.85rem}
}


/* v2 product page overrides */
body{overflow-x:hidden; overflow-y:auto;}
.shellWrap{width:min(1400px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 48px;}
/* Hide any legacy left nav if present in old CSS/HTML */
.nav, .rail, .sidebar, .sidenav, .leftbar, .nav-rail{display:none !important;}
/* Keep topbar title centered on small screens */
@media (max-width: 520px){ .title{display:block !important;} }
/* Ensure old "placeholder" container doesn't look broken */
.placeholder{background: transparent !important; border: 0 !important; box-shadow: none !important;}
.content{padding: 0 !important;}



/* =============================
   POLISH PASS — small wins only
   ============================= */

/* Tighten overall vertical rhythm */
.content { margin-top: 6px !important; }
.grid-2 { gap: 14px !important; }
.card { margin-bottom: 14px !important; }
.card-head { padding: 12px 14px !important; }
.card-title { letter-spacing: -0.01em; }

/* Smoother hover transitions */
button,
.seg,
.btn,
.am-pill {
  transition: 
    background-color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    color .18s ease,
    transform .15s ease;
}

/* Subtle lift on hover (no gimmicks) */
.seg:hover,
.btn:hover,
.am-pill:hover {
  transform: translateY(-1px);
}

/* Active timeframe — subtle green glow */
.seg.active,
.seg[data-active="true"] {
  border-color: rgba(67,255,164,.55) !important;
  background: rgba(67,255,164,.14) !important;
  color: rgba(235,245,255,.95) !important;
  box-shadow:
    0 0 0 1px rgba(67,255,164,.35),
    0 0 18px rgba(67,255,164,.22);
}

/* Matrix pills active state polish */
.am-pill.active {
  border-color: rgba(67,255,164,.45) !important;
  background: rgba(67,255,164,.12) !important;
  box-shadow: 0 0 16px rgba(67,255,164,.18);
}

/* Right list rows — cleaner hover */
.list__row {
  transition: background .16s ease, border-color .16s ease;
}
.list__row:hover {
  background: rgba(67,255,164,.06);
  border-color: rgba(67,255,164,.18);
}

/* Remove any harsh focus outlines, replace with soft glow */
button:focus-visible,
.seg:focus-visible,
.am-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(67,255,164,.25);
}


/* --- Polish pass: spacing + glow + hover (v2) --- */

/* Re-map legacy app.css palette to DXCELL green */
:root{
  --accent: var(--green);
  --accent-2: #1ff0a0;
  --border: rgba(130,255,185,.16);
  --panel: rgba(10,18,28,.58);
  --bg: #06080d;
  --bg-2:#070b12;
  --text: rgba(235,245,255,.92);
  --muted: rgba(235,245,255,.62);
}

/* Tighten spacing */
.content{ padding: 8px !important; }
.cat-bar{ margin: 0 0 6px 0 !important; gap: 10px !important; }
.cat-bar .btn{ padding: 6px 10px !important; border-radius: 999px !important; }
.grid-2{ gap: 10px !important; margin-top: 10px !important; grid-template-columns: 1fr 320px !important; }
.card{ border-radius: 16px !important; background: rgba(10,18,28,.52) !important; }
.card-head{ padding: 9px 10px !important; }
.card-title{ letter-spacing: -.01em; }

/* Smoother hovers */
.btn, .seg, .am-pill, .row, .list__row, button{
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease, color .14s ease, opacity .14s ease;
}
.seg:hover, .am-pill:hover, .cat-bar .btn:hover{
  transform: translateY(-1px);
  border-color: rgba(67,255,164,.30) !important;
  box-shadow: 0 0 0 1px rgba(67,255,164,.16), 0 14px 40px rgba(0,0,0,.35);
}

/* Subtle green glow on active timeframes */
.seg.active{
  background: linear-gradient(90deg, rgba(67,255,164,.95), rgba(31,240,160,.80)) !important;
  color: #05110a !important;
  box-shadow: 0 0 0 1px rgba(67,255,164,.22), 0 0 28px rgba(67,255,164,.18) !important;
}
/* Active state for matrix filter pills */
.am-pill.active{
  background: linear-gradient(90deg, rgba(67,255,164,.92), rgba(31,240,160,.78)) !important;
  color: #05110a !important;
  box-shadow: 0 0 0 1px rgba(67,255,164,.22), 0 0 26px rgba(67,255,164,.16) !important;
}

/* Keep list/card readability */
.placeholder .card, .placeholder{ color: rgba(235,245,255,.72) !important; }
@media (max-width: 980px){
  .grid-2{ grid-template-columns: 1fr !important; }
}


/* TradingView disclaimer line */
.tv-note{
  text-align:center;
  font-size:.9rem;
  color: rgba(235,245,255,.55);
  margin: 8px 0 6px;
}

/* Asset search */
.asset-search{
  margin-bottom:8px;
}
.asset-search input{
  width: 240px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(130,255,185,.22);
  background: rgba(10,18,28,.55);
  color: rgba(235,245,255,.9);
  outline: none;
}
.asset-search input::placeholder{
  color: rgba(235,245,255,.45);
}
.asset-search input:focus{
  border-color: rgba(67,255,164,.45);
  box-shadow: 0 0 0 3px rgba(67,255,164,.12);
}


/* --- Search + TradingView note --- */
.tv-note{
  margin: 6px 0 10px;
  color: rgba(235,245,255,.58);
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .01em;
}

.asset-search{
  display:flex;
  align-items:center;
}
.asset-search input{
  width: 240px;
  max-width: 44vw;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(130,255,185,.16);
  background: rgba(6,8,13,.55);
  color: rgba(235,245,255,.90);
  outline: none;
}
.asset-search input::placeholder{ color: rgba(235,245,255,.45); }
.asset-search input:focus{
  border-color: rgba(67,255,164,.30);
  box-shadow: 0 0 0 3px rgba(67,255,164,.10);
}
@media (max-width: 520px){
  .asset-search input{ width: 100%; max-width: 100%; }
  .cat-bar{ justify-content:flex-start !important; }
}


/* --- Micro copy refinement --- */
.tv-note{
  font-size: .78rem !important;
  opacity: .65;
  margin-top: 4px;
  margin-bottom: 8px;
  letter-spacing: .02em;
}

/* Remove any residual note spacing */
.tv-note{display:none !important}


/* --- Final spacing fix (top gap) --- */
/* Remove excess space between topbar and category bar */
.shellWrap{
  padding-top: 6px !important;
}

.content{
  margin-top: 0 !important;
}

.cat-bar{
  margin-top: 0 !important;
}

/* Ensure no phantom spacing from any removed notes */
.tv-note, .status-note, .header-note{
  display:none !important;
  margin:0 !important;
  padding:0 !important;
}

.edgeHomeLink{margin-left:14px;color:rgba(235,245,255,.75);font-weight:700;font-size:.9rem;}
.edgeHomeLink:hover{color:rgba(235,245,255,.95);}

/* --- Alpha Matrix loading polish --- */
#alphaMatrix[data-state="loading"]{ filter: saturate(1.05); }
#alphaMatrix[data-state="loading"] .am-grid{ opacity:.75; }
#alphaMatrix[data-state="loading"] .am-pill.active{ box-shadow: 0 0 0 1px rgba(67,255,164,.18), 0 0 22px rgba(67,255,164,.12); }

#mrmoon-chat{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  display:flex;
  gap:8px;
  padding:12px 16px;
  background:#0b0f14;
  border-top:1px solid rgba(255,255,255,0.08);
  z-index:999;
}
#mrmoon-chat input{
  flex:1;
  background:#111827;
  border:1px solid rgba(255,255,255,0.12);
  color:#fff;
  padding:10px 12px;
  border-radius:8px;
}
#mrmoon-chat button{
  background:#1f2937;
  color:#fff;
  border:0;
  padding:10px 14px;
  border-radius:8px;
  cursor:pointer;
}


/* Mr Moon position tweak */
.mr-moon, .mrmoon, #mr-moon, [data-agent="mr-moon"] {
  margin-left: 48px !important;
}


/* Edge Matrix premium polish */
.card.chart-card, .card.side-card, .alpha-matrix{
  border: 1px solid rgba(130,255,185,.12) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.02);
  background:
    linear-gradient(180deg, rgba(9,16,24,.74), rgba(8,14,22,.62)) !important;
}
.chart-box{
  min-height: 520px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(130,255,185,.08);
}
.asset-search input{
  min-width: 220px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(130,255,185,.14);
  color: rgba(235,245,255,.92);
  border-radius: 999px;
  padding: 10px 14px;
}
.asset-search input::placeholder{ color: rgba(235,245,255,.42); }
.asset-search input:focus{
  outline: none;
  border-color: rgba(67,255,164,.38);
  box-shadow: 0 0 0 3px rgba(67,255,164,.10);
}
.table tbody tr{
  transition: background .18s ease, transform .18s ease;
}
.table tbody tr:hover{
  background: rgba(67,255,164,.06);
  transform: translateX(2px);
}
.am-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.am-row{
  position: relative;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(130,255,185,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}
.am-row.good{ box-shadow: inset 0 0 0 1px rgba(67,255,164,.06), 0 0 20px rgba(67,255,164,.06); }
.am-row.bad{ box-shadow: inset 0 0 0 1px rgba(255,106,106,.06), 0 0 18px rgba(255,106,106,.04); }
.am-row .name{ font-size: .95rem; font-weight: 700; letter-spacing: -.01em; }
.am-row .chip{
  margin-top: 8px;
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(130,255,185,.12);
  font-weight: 700;
}
.am-row .sub{ margin-top: 8px; color: rgba(235,245,255,.62); font-size: .9rem; }
.am-bar{
  margin-top: 12px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.am-bar .fill{
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(67,255,164,.92), rgba(86,162,255,.85));
  box-shadow: 0 0 16px rgba(67,255,164,.18);
}
.am-summary{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.am-meter{
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(130,255,185,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}
.am-meter .label{ color: rgba(235,245,255,.60); font-size: .85rem; }
.am-meter .val{ margin-top: 8px; font-size: 1.5rem; font-weight: 800; }
.am-empty{
  grid-column: 1 / -1;
  padding: 22px;
  border-radius: 16px;
  border: 1px dashed rgba(130,255,185,.18);
  background: rgba(255,255,255,.03);
  color: rgba(235,245,255,.78);
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.am-empty--error{
  border-color: rgba(255,106,106,.26);
  color: rgba(255,220,220,.85);
}
@media (max-width: 900px){
  .chart-box{ min-height: 420px; }
  .am-summary{ grid-template-columns: 1fr; }
}
