  :root{
    --bg: #F6F7FB;
    --sidebar-bg: #FFFFFF;
    --panel: #FFFFFF;
    --panel-2: #F6F7FB;
    --panel-3: #EEF0F6;
    --line: #E7E9F1;
    --line-soft: #EEF0F6;
    --text: #12131A;
    --text-dim: #666B80;
    --text-faint: #9498A8;
    --brand: #5B4FE9;
    --brand-dim: #EEECFD;
    --brand-glow: #EEECFD;
    --green: #17A672;
    --green-dim: #E4F7EF;
    --red: #E5484D;
    --red-dim: #FDECEC;
    --amber: #C4841D;
    --amber-dim: #FBF1DE;
    --radius: 16px;
    --font-display: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --sidebar-w: 250px;
    --shadow-card: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.03);
    --shadow-lift: 0 6px 16px rgba(16,24,40,0.08), 0 2px 4px rgba(16,24,40,0.04);
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  html,body{background:var(--bg); color:var(--text); font-family:var(--font-body); font-size:14px; -webkit-font-smoothing:antialiased;}
  a{color:inherit; text-decoration:none;}
  .num{font-family:var(--font-mono); font-variant-numeric:tabular-nums; letter-spacing:-0.01em;}
  ::-webkit-scrollbar{width:8px; height:8px;}
  ::-webkit-scrollbar-thumb{background:#D2D5E0; border-radius:4px;}
  ::-webkit-scrollbar-track{background:transparent;}
  button{font-family:inherit;}

  .app{display:flex; min-height:100vh;}

  /* ---------- Sidebar ---------- */
  .sidebar{width:var(--sidebar-w); flex-shrink:0; background:var(--sidebar-bg); border-right:1px solid var(--line); display:flex; flex-direction:column; position:sticky; top:0; height:100vh;}
  .side-brand{display:flex; align-items:center; gap:10px; padding:21px 16px; border-bottom:1px solid var(--line-soft);}
  .side-brand .mark{width:28px; height:28px; border-radius:8px; flex-shrink:0; background:linear-gradient(135deg, var(--brand), #8B7FFF); display:flex; align-items:center; justify-content:center; font-family:var(--font-display); font-weight:700; font-size:13px; color:#fff;}
  .side-brand .name{font-family:var(--font-display); font-weight:600; font-size:14.5px;}
  .side-brand > div:not(.mark){min-width:0; flex:1;}
  .side-search{padding:12px 14px;}
  .side-search-btn{width:100%; display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:7px; border:1px solid var(--line); background:var(--panel); color:var(--text-faint); font-size:12px; cursor:pointer;}
  .side-search-btn .kbd{margin-left:auto; font-family:var(--font-mono); font-size:10px; color:var(--text-faint); border:1px solid var(--line); border-radius:4px; padding:1px 5px;}
  .side-nav{flex:1; padding:6px 10px; display:flex; flex-direction:column; gap:2px; overflow-y:auto;}
  .nav-label{font-size:10px; color:var(--text-faint); text-transform:uppercase; letter-spacing:0.07em; padding:14px 10px 6px;}
  .nav-item{display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:7px; color:var(--text-dim); font-size:13px; font-weight:500; cursor:pointer; position:relative;}
  .nav-item .ic{width:16px; text-align:center; flex-shrink:0; font-size:13.5px;}
  .nav-item:hover{background:var(--panel); color:var(--text);}
  .nav-item.active{background:var(--brand-glow); color:var(--text);}
  .nav-item.active::before{content:''; position:absolute; left:-10px; top:8px; bottom:8px; width:3px; border-radius:2px; background:var(--brand);}
  .nav-item .count{margin-left:auto; font-family:var(--font-mono); font-size:10.5px; color:var(--text-faint); background:var(--panel-2); padding:1px 6px; border-radius:8px;}
  .nav-item.active .count{background:var(--brand-dim); color:var(--brand);}
  .side-footer{padding:12px; border-top:1px solid var(--line-soft); display:flex; flex-direction:column; gap:8px;}
  .wallet-card{background:var(--panel-2); border:1px solid var(--line); border-radius:12px; padding:12px 13px; display:flex; flex-direction:column; gap:8px;}
  .wallet-row{display:flex; align-items:center; justify-content:space-between; font-size:11.5px;}
  .wallet-row .l{color:var(--text-faint);}
  .wallet-row .v{font-family:var(--font-mono); color:var(--text);}
  .rpc-dot{width:6px; height:6px; border-radius:50%; background:var(--green); display:inline-block; margin-right:6px; position:relative;}
  .rpc-dot::after{content:''; position:absolute; inset:-3px; border-radius:50%; border:1px solid var(--green); animation:pulse 2s ease-out infinite;}
  @keyframes pulse{ 0%{transform:scale(0.6); opacity:0.8;} 100%{transform:scale(1.9); opacity:0;} }

  /* ---------- Main shell ---------- */
  .main{flex:1; min-width:0; display:flex; flex-direction:column;}
  .topbar{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:17px 26px; border-bottom:1px solid var(--line); background:rgba(255, 255, 255, 0.6); backdrop-filter:blur(6px); position:sticky; top:0; z-index:5;}
  .topbar-left{display:flex; align-items:center; gap:12px; min-width:0; flex:1;}
  .topbar-title{display:flex; flex-direction:column; gap:2px; min-width:0;}
  .topbar-title h1{font-family:var(--font-display); font-weight:600; font-size:17px;}
  .topbar-title .sub{font-size:11.5px; color:var(--text-faint);}
  .topbar-actions{display:flex; align-items:center; gap:10px; flex-shrink:0;}
  .menu-btn{display:none; width:38px; height:38px; border-radius:10px; border:1px solid var(--line); background:#fff; align-items:center; justify-content:center; cursor:pointer; box-shadow:var(--shadow-card); flex-shrink:0; padding:0;}
  .menu-btn-bars, .menu-btn-bars::before, .menu-btn-bars::after{display:block; width:16px; height:2px; background:var(--text); border-radius:1px; position:relative;}
  .menu-btn-bars::before, .menu-btn-bars::after{content:''; position:absolute; left:0;}
  .menu-btn-bars::before{top:-5px;}
  .menu-btn-bars::after{top:5px;}
  .sidebar-close{display:none; margin-left:auto; width:32px; height:32px; border-radius:8px; border:1px solid var(--line); background:var(--panel-2); color:var(--text-dim); cursor:pointer; font-size:14px; align-items:center; justify-content:center;}
  .sidebar-overlay{display:none;}
  .form-sticky-actions{position:sticky; bottom:0; background:rgba(246,247,251,0.92); backdrop-filter:blur(10px); border-top:1px solid var(--line); padding:14px 0; display:flex; justify-content:flex-end; gap:10px; margin-top:8px; z-index:4;}
  .btn{font-family:var(--font-body); font-weight:600; font-size:12.5px; padding:8px 14px; border-radius:10px; border:1px solid var(--line); background:#fff; color:var(--text); cursor:pointer; box-shadow:var(--shadow-card); transition:border-color .15s, box-shadow .15s; display:inline-flex; align-items:center; justify-content:center;}
  .btn:hover{border-color:#C7CAD6; box-shadow:var(--shadow-lift);}
  .btn.primary{background:var(--brand); border-color:var(--brand); color:#fff; box-shadow:0 4px 10px rgba(91,79,233,0.22);}
  .btn.primary:hover{background:#4A3FD6;}
  .btn.ghost{background:transparent; box-shadow:none;}
  .btn.sm{padding:7px 12px; font-size:12px;}
  .btn.danger-outline{border-color:var(--red-dim); color:var(--red);}

  .content{padding:22px 26px 40px; display:none; flex-direction:column; gap:16px; max-width:1420px;}
  .content.active{display:flex;}

  /* KPIs */
  .kpis{display:grid; grid-template-columns:repeat(5,1fr); gap:14px;}
  .kpis.cols-1{grid-template-columns:1fr;}
  .kpis.cols-2{grid-template-columns:repeat(2,1fr);}
  .kpis.cols-3{grid-template-columns:repeat(3,1fr);}
  .kpis.cols-4{grid-template-columns:repeat(4,1fr);}
  .dash-hidden{display:none !important;}
  .bottom-grid.single-col{grid-template-columns:1fr;}
  .kpi{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:18px 20px; display:flex; flex-direction:column; gap:9px; box-shadow:var(--shadow-card);}
  .kpi .label{font-size:11px; color:var(--text-faint); text-transform:uppercase; letter-spacing:0.06em;}
  .kpi .value{font-family:var(--font-mono); font-size:22px; font-weight:600; letter-spacing:-0.02em;}
  .kpi .sub{font-size:11.5px; color:var(--text-dim); display:flex; align-items:center; gap:5px;}
  .up{color:var(--green);} .down{color:var(--red);}

  .main-grid{display:grid; grid-template-columns:1.15fr 1.55fr; gap:14px; align-items:stretch;}
  .col{display:flex; flex-direction:column; gap:14px;}
  .panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); display:flex; flex-direction:column; overflow:hidden; box-shadow:var(--shadow-card);}
  .panel-head{display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--line-soft);}
  .panel-title{font-family:var(--font-display); font-weight:600; font-size:13.5px;}
  .panel-title .count{color:var(--text-faint); font-weight:500; margin-left:6px; font-family:var(--font-mono); font-size:12px;}
  .panel-link{font-size:11.5px; color:var(--text-dim);}
  .panel-link:hover{color:var(--brand);}

  .equity-body{padding:14px 16px 6px;}
  .equity-top{display:flex; align-items:baseline; gap:10px; margin-bottom:10px;}
  .equity-top .big{font-family:var(--font-mono); font-size:19px; font-weight:600;}
  .equity-top .chip{font-family:var(--font-mono); font-size:11.5px; padding:2px 7px; border-radius:5px; background:var(--green-dim); color:var(--green);}
  svg.spark{width:100%; height:88px; display:block;}
  .equity-range{display:flex; gap:4px; padding:10px 16px 14px; border-top:1px solid var(--line-soft); margin-top:8px;}
  .range-btn{font-family:var(--font-mono); font-size:11px; color:var(--text-faint); padding:4px 8px; border-radius:5px; cursor:pointer;}
  .range-btn.active{background:var(--panel-2); color:var(--text);}

  .feed{list-style:none; display:flex; flex-direction:column;}
  .feed li{display:flex; gap:10px; align-items:flex-start; padding:10px 16px; border-bottom:1px solid var(--line-soft);}
  .feed li:last-child{border-bottom:none;}
  .feed .ic{width:26px; height:26px; border-radius:7px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:12px; margin-top:1px;}
  .ic.buy{background:var(--green-dim); color:var(--green);}
  .ic.sell{background:var(--red-dim); color:var(--red);}
  .ic.warn{background:var(--amber-dim); color:var(--amber);}
  .feed .body{flex:1; min-width:0;}
  .feed .line1{font-size:12.5px; line-height:1.4;}
  .feed .line1 b{font-weight:600;}
  .feed .line1 .tag{color:var(--text-dim); font-family:var(--font-mono); font-size:11px;}
  .feed .time{font-size:10.5px; color:var(--text-faint); font-family:var(--font-mono); margin-top:2px;}
  .feed .pnl{font-family:var(--font-mono); font-size:12px; font-weight:600; flex-shrink:0;}

  table{width:100%; border-collapse:collapse;}
  thead th{text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-faint); font-weight:600; padding:9px 14px; border-bottom:1px solid var(--line-soft);}
  thead th.num-col{text-align:right;}
  tbody td{padding:10px 14px; font-size:12.5px; border-bottom:1px solid var(--line-soft); vertical-align:middle;}
  tbody tr:last-child td{border-bottom:none;}
  tbody tr:hover{background:rgba(255,255,255,0.015);}
  td.num-col{text-align:right; font-family:var(--font-mono);}
  .token-cell{display:flex; align-items:center; gap:9px;}
  .token-avatar{width:26px; height:26px; border-radius:50%; flex-shrink:0; background:linear-gradient(135deg, var(--brand-dim), #DCD8FF); display:flex; align-items:center; justify-content:center; font-family:var(--font-mono); font-size:10px; font-weight:700; color:var(--brand);}
  .token-name{font-weight:600; font-size:12.5px;}
  .token-sub{font-size:10.5px; color:var(--text-faint); font-family:var(--font-mono);}
  .badge{font-family:var(--font-mono); font-size:10px; padding:2px 7px; border-radius:5px; display:inline-block;}
  .badge.tp{background:var(--green-dim); color:var(--green);}
  .badge.sl{background:var(--red-dim); color:var(--red);}
  .badge.trail{background:var(--brand-dim); color:var(--brand);}
  .badge.closed{background:var(--panel-3); color:var(--text-faint);}
  .mini-actions{display:flex; gap:6px; justify-content:flex-end;}
  .icon-btn{width:24px; height:24px; border-radius:6px; border:1px solid var(--line); background:transparent; color:var(--text-dim); font-size:11px; cursor:pointer; display:flex; align-items:center; justify-content:center;}
  .icon-btn:hover{border-color:var(--red-dim); color:var(--red);}

  /* ---- New widgets: gauge / histogram / fees ---- */
  .widgets-row{display:grid; grid-template-columns:1fr 1fr 0.8fr; gap:14px;}
  .widget-label{font-weight:700; font-size:12.5px; padding:16px 18px 4px; letter-spacing:-0.01em;}
  .widget-gauge{display:flex; flex-direction:column; align-items:center; padding-bottom:16px;}
  .gauge-value{font-family:var(--font-mono); font-size:24px; font-weight:700; margin-top:-8px;}
  .gauge-sub{font-size:11px; color:var(--text-faint); font-weight:500; text-align:center; margin-top:2px; padding:0 16px;}
  .widget-hist{padding-bottom:16px;}
  .hist-bars{display:flex; align-items:flex-end; gap:10px; height:96px; padding:14px 20px 0;}
  .hist-col{flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; height:100%; justify-content:flex-end;}
  .hist-bar{width:100%; border-radius:6px 6px 2px 2px; position:relative;}
  .hist-bar.up{background:var(--green-dim); border:1px solid var(--green);}
  .hist-bar.down{background:var(--red-dim); border:1px solid var(--red);}
  .hist-bar.neutral{background:var(--panel-3); border:1px solid var(--line);}
  .hist-bar .n{position:absolute; top:-16px; left:0; right:0; text-align:center; font-family:var(--font-mono); font-size:10px; font-weight:700; color:var(--text-dim);}
  .hist-lbl{font-size:9px; color:var(--text-faint); font-weight:600; font-family:var(--font-mono); text-align:center;}
  .widget-fees{display:flex; flex-direction:column; gap:10px; padding-bottom:16px;}
  .fees-row{display:flex; justify-content:space-between; align-items:baseline; padding:0 18px;}
  .fees-row .l{font-size:11.5px; color:var(--text-dim); font-weight:500;}
  .fees-row .v{font-family:var(--font-mono); font-size:14px; font-weight:700;}

  /* ---- Leaderboard rows ---- */
  .lb-row{display:grid; grid-template-columns:36px 1.4fr 1.1fr auto; align-items:center; gap:12px; padding:12px 20px; border-bottom:1px solid var(--line-soft); cursor:pointer;}
  .lb-row:last-child{border-bottom:none;}
  .lb-row:hover{background:var(--panel-2);}
  .lb-rank{width:30px; height:30px; border-radius:9px; background:var(--panel-2); border:1px solid var(--line); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px;}
  .lb-rank.gold{background:#FEF3C7; border-color:#F5D273;}
  .lb-rank.silver{background:#F1F2F6; border-color:#D6D9E3;}
  .lb-rank.bronze{background:#FBE8DA; border-color:#EAB88B;}
  .lb-contrib{display:flex; flex-direction:column; gap:4px;}
  .lb-contrib .n{font-family:var(--font-mono); font-size:12.5px; font-weight:700;}
  .lb-track{height:5px; border-radius:20px; background:var(--panel-3); overflow:hidden;}
  .lb-fill{height:100%; background:var(--green); border-radius:20px;}
  .lb-fill.down{background:var(--red);}

  /* ---- Dashboard strategy rows ---- */
  .st-row{grid-template-columns:1.2fr 1.1fr auto;}
  .st-row .st-params{display:flex; flex-direction:column; gap:5px; min-width:0;}
  .st-row .strat-bar{margin-top:0;}
  .st-row .strat-labels{font-size:9px; gap:4px;}
  .st-row .row-actions{align-items:center;}

  /* ---- Ticker tape ---- */
  .ticker-wrap{background:#12131A; border-bottom:1px solid var(--line); overflow:hidden; position:relative; height:36px; flex-shrink:0;}
  .ticker-track{display:flex; align-items:center; gap:26px; white-space:nowrap; position:absolute; animation:ticker-scroll 30s linear infinite; height:100%;}
  .ticker-item{display:flex; align-items:center; gap:7px; font-family:var(--font-mono); font-size:11.5px; font-weight:600; color:#B8BBCC;}
  .ticker-item b{color:#fff;}
  .ticker-item .chg.up{color:#4ADE9A;}
  .ticker-item .chg.down{color:#FF8085;}
  .ticker-dot{color:#454858;}
  @keyframes ticker-scroll{ from{transform:translateX(0);} to{transform:translateX(-50%);} }

  /* ---- Notification bell ---- */
  .bell-btn{position:relative; width:34px; height:34px; border-radius:9px; border:1px solid var(--line); background:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; box-shadow:var(--shadow-card);}
  .bell-btn:hover{border-color:#C7CAD6;}
  .bell-dot{position:absolute; top:6px; right:7px; width:7px; height:7px; border-radius:50%; background:var(--red); border:1.5px solid #fff;}

  .bottom-grid{display:grid; grid-template-columns:1.3fr 1fr; gap:14px;}
  .mon-row{display:grid; grid-template-columns:1.4fr 1fr 1fr 0.9fr auto; align-items:center; gap:10px; padding:11px 16px; border-bottom:1px solid var(--line-soft); cursor:pointer;}
  .mon-row:last-child{border-bottom:none;}
  .mon-row:hover{background:rgba(255,255,255,0.015);}
  .mon-name b{font-size:12.5px; font-weight:600;}
  .mon-name .filters-count{font-size:10.5px; color:var(--text-faint); font-family:var(--font-mono);}
  .status-pill{font-family:var(--font-mono); font-size:10px; padding:3px 8px; border-radius:12px; display:inline-flex; align-items:center; gap:5px; width:fit-content;}
  .status-pill.on{background:var(--green-dim); color:var(--green);}
  .status-pill.off{background:var(--panel-3); color:var(--text-faint);}
  .status-pill .dot{width:5px; height:5px; border-radius:50%; background:currentColor;}
  .stat-col{display:flex; flex-direction:column; gap:1px;}
  .stat-col .n{font-family:var(--font-mono); font-size:12.5px; font-weight:600;}
  .stat-col .l{font-size:10px; color:var(--text-faint); text-transform:uppercase; letter-spacing:0.04em;}
  .row-actions{display:flex; gap:6px; justify-content:flex-end;}

  .strat-row{padding:13px 16px; border-bottom:1px solid var(--line-soft); display:flex; flex-direction:column; gap:8px;}
  .strat-row:last-child{border-bottom:none;}
  .strat-top{display:flex; align-items:center; justify-content:space-between;}
  .strat-name{display:flex; align-items:center; gap:8px;}
  .strat-name b{font-size:13px; font-weight:600;}
  .tag-testmode{font-family:var(--font-mono); font-size:9.5px; padding:2px 6px; border-radius:4px; background:var(--amber-dim); color:var(--amber);}
  .strat-meta{display:flex; gap:16px; font-size:11.5px; color:var(--text-dim);}
  .strat-meta .num{color:var(--text);}
  .strat-bar{height:5px; border-radius:3px; background:var(--panel-2); position:relative; overflow:hidden; margin-top:2px;}
  .strat-bar .seg{position:absolute; top:0; bottom:0;}
  .strat-bar .sl{background:var(--red); opacity:0.55; left:0; width:16.6%;}
  .strat-bar .entry{background:var(--text-faint); width:2px; left:16.6%;}
  .strat-bar .trail{background:var(--brand); opacity:0.55; left:18%; width:8%;}
  .strat-bar .tp{background:var(--green); opacity:0.55; left:26%; width:74%;}
  .strat-labels{display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:9.5px; color:var(--text-faint);}

  /* --- Toolbar (search + filter chips) reused across list views --- */
  .toolbar{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
  .search-box{flex:1; min-width:220px; display:flex; align-items:center; gap:8px; background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:9px 12px;}
  .search-box input{flex:1; background:transparent; border:none; outline:none; color:var(--text); font-size:13px;}
  .search-box .ic{color:var(--text-faint); font-size:13px;}
  .chip-group{display:flex; gap:6px;}
  .chip{font-size:12px; padding:7px 12px; border-radius:8px; border:1px solid var(--line); background:var(--panel); color:var(--text-dim); cursor:pointer;}
  .chip.active{background:var(--brand-glow); border-color:var(--brand); color:var(--text);}

  /* --- Monitoring list view --- */
  .mon-toolbar{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:4px;}
  .mon-net-filters{display:flex; flex-wrap:wrap; gap:8px; align-items:center;}
  .mon-filter-chip{display:inline-flex; align-items:center; gap:7px; padding:7px 11px; border-radius:999px; border:1px solid var(--line); background:#fff; color:var(--text-dim); font-size:12px; font-weight:600; cursor:pointer; box-shadow:var(--shadow-card);}
  .mon-filter-chip:hover{border-color:#C7CAD6;}
  .mon-filter-chip.on{border-color:var(--brand); background:var(--brand-glow); color:var(--text);}
  .mon-filter-count{font-family:var(--font-mono); font-size:10.5px; color:var(--text-faint); background:var(--panel-3); padding:1px 6px; border-radius:8px;}
  .mon-filter-chip.on .mon-filter-count{background:var(--brand-dim); color:var(--brand);}
  .mon-toolbar-meta{font-size:12px; color:var(--text-faint); font-family:var(--font-mono);}
  #monitoring-list,
  #strategies-list,
  #chats-list{display:flex; flex-direction:column; gap:12px;}
  .mon-card{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-card); transition:box-shadow .15s, opacity .15s, transform .15s;}
  .mon-card.dragging,
  .mon-card.drag-source{display:none !important;}
  .mon-card-placeholder{
    border:2px dashed var(--brand);
    border-radius:var(--radius);
    background:var(--brand-glow);
    box-sizing:border-box;
    transition:transform .12s ease;
  }
  .mon-card-ghost{
    position:fixed; left:0; top:0; z-index:80; margin:0; pointer-events:none;
    box-shadow:0 18px 44px rgba(16,24,40,0.24), 0 6px 14px rgba(16,24,40,0.12);
    will-change:transform; border:1px solid var(--brand); opacity:0.98;
    border-radius:var(--radius); background:var(--panel);
  }
  .mon-card-ghost .mon-card-body{display:none;}
  body.mon-dragging{cursor:grabbing !important; user-select:none; -webkit-user-select:none;}
  body.mon-dragging *{cursor:grabbing !important;}
  .mon-card-head{display:flex; align-items:stretch; gap:10px; padding:14px 16px; cursor:pointer;}
  .mon-drag-handle{width:32px; flex-shrink:0; border:1px solid var(--line); border-radius:8px; background:var(--panel-2); color:var(--text-faint); cursor:grab; display:inline-flex; align-items:center; justify-content:center; touch-action:none; user-select:none; padding:0;}
  .mon-drag-handle:active{cursor:grabbing; color:var(--text); border-color:var(--brand);}
  .mon-card-main{
    flex:1; min-width:0;
    display:grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(220px, 0.9fr) auto;
    align-items:center;
    gap:16px;
  }
  .mon-card-left{display:flex; flex-direction:column; gap:6px; min-width:0;}
  .mon-card-title{display:flex; align-items:center; gap:8px; min-width:0;}
  .mon-card-title b{font-family:var(--font-display); font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .mon-card-tags{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
  .mon-name-line{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
  .net-badge{font-family:var(--font-mono); font-size:10px; font-weight:700; text-transform:lowercase; padding:2px 7px; border-radius:6px; background:var(--panel-3); border:1px solid var(--line); color:var(--text-dim); letter-spacing:0.02em; flex-shrink:0;}
  .net-badge--solana{background:#E8F8F1; border-color:#B8E6D4; color:#0D7A52;}
  .net-badge--base{background:#EEF0FF; border-color:#C9CEF8; color:#4A52B8;}
  .net-badge--bsc{background:#FFF7E6; border-color:#F5D9A8; color:#9A6B00;}
  .net-badge--robinhood{background:#F3ECFF; border-color:#D8C4F5; color:#6B3FA0;}
  .mon-card-left .fc{font-family:var(--font-mono); font-size:10.5px; color:var(--text-faint); background:var(--panel-3); padding:2px 8px; border-radius:10px;}
  .mon-card-stats{
    display:grid;
    grid-template-columns: 72px 72px 110px;
    align-items:center;
    gap:12px;
    justify-self:end;
  }
  .mon-stat-sig, .mon-stat-win{min-width:0;}
  .mon-stat-empty{visibility:hidden;}
  .mon-stat-status{display:flex; justify-content:flex-start;}
  .mon-card-actions{display:flex; gap:6px; align-items:center; justify-content:flex-end;}
  .mon-icon-btn{
    width:34px; height:34px; border-radius:9px; border:1px solid var(--line);
    background:#fff; color:var(--text-dim); cursor:pointer;
    display:inline-flex; align-items:center; justify-content:center;
    box-shadow:var(--shadow-card); transition:border-color .15s, color .15s, background .15s, box-shadow .15s;
  }
  .mon-icon-btn:hover{border-color:#C7CAD6; color:var(--text); box-shadow:var(--shadow-lift);}
  .mon-icon-btn.is-on{color:var(--green); background:var(--green-dim); border-color:#B8E6D4;}
  .mon-icon-btn.is-on:hover{background:#D7F5E8;}
  .mon-icon-btn.is-off{color:var(--text-faint);}
  .mon-icon-btn.danger:hover{border-color:var(--red-dim); color:var(--red); background:var(--red-dim);}
  a.mon-icon-btn{text-decoration:none;}
  .row-actions .mon-icon-btn{width:30px; height:30px; border-radius:8px;}
  .strat-list-main{
    grid-template-columns: minmax(180px, 1.4fr) minmax(280px, 1fr) auto;
  }
  .strat-list-stats{
    grid-template-columns: 64px 64px 64px 110px;
  }
  .strat-list-viz{padding:0 16px 14px; display:flex; flex-direction:column; gap:6px;}
  .strat-list-head{cursor:default;}
  .chat-card-main{
    grid-template-columns: minmax(180px, 1.5fr) minmax(160px, 0.7fr) auto;
  }
  .chat-card-stats{
    grid-template-columns: 72px 110px;
  }
  .chat-card-head{cursor:default;}
  .chevron{color:var(--text-faint); font-size:11px; transition:transform .2s; flex-shrink:0;}
  .mon-card.open .chevron{transform:rotate(180deg);}
  .mon-card-body{max-height:0; overflow:hidden; transition:max-height .25s ease; border-top:1px solid var(--line-soft);}
  .mon-card.open .mon-card-body{max-height:400px;}
  .filters-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:14px; padding:16px 18px;}
  .filter-item{display:flex; flex-direction:column; gap:3px;}
  .filter-item .l{font-size:10px; color:var(--text-faint); text-transform:uppercase; letter-spacing:0.04em;}
  .filter-item .v{font-size:12.5px; font-family:var(--font-mono);}

  /* --- Strategy list view --- */
  .strat-card{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:20px 22px; display:flex; flex-direction:column; gap:12px; box-shadow:var(--shadow-card);}
  .strat-card-top{display:flex; align-items:center; justify-content:space-between;}
  .strat-card-name{display:flex; align-items:center; gap:10px;}
  .strat-card-name b{font-family:var(--font-display); font-size:15px; font-weight:600;}
  .strat-card-meta{display:flex; gap:20px; font-size:12px; color:var(--text-dim);}
  .strat-card-meta .num{color:var(--text);}
  .strat-card-foot{display:flex; justify-content:space-between; align-items:center; margin-top:4px;}

  /* --- Trades view --- */
  .tabs-seg{display:inline-flex; background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:4px;}
  .tabs-seg .seg-btn{padding:7px 14px; border-radius:6px; font-size:12.5px; font-weight:600; color:var(--text-faint); cursor:pointer;}
  .tabs-seg .seg-btn.active{background:var(--panel-3); color:var(--text);}

  /* --- Chats view --- */
  .chat-row{display:grid; grid-template-columns:1.6fr 1fr 1fr auto; align-items:center; gap:10px; padding:13px 16px; border-bottom:1px solid var(--line-soft);}
  .chat-row:last-child{border-bottom:none;}
  .chat-name{display:flex; align-items:center; gap:10px;}
  .chat-ava{width:30px; height:30px; border-radius:8px; background:var(--panel-3); display:flex; align-items:center; justify-content:center; font-size:14px;}
  .chat-name b{font-size:12.5px; font-weight:600;}
  .chat-name .sub{font-size:10.5px; color:var(--text-faint); font-family:var(--font-mono);}
  .chat-tag{font-size:11px; color:var(--text-dim);}

  /* --- Settings view --- */
  .settings-panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden;}
  .settings-section{padding:20px 22px; border-bottom:1px solid var(--line-soft);}
  .settings-section:last-child{border-bottom:none;}
  .settings-section h3{font-family:var(--font-display); font-weight:600; font-size:14px; margin-bottom:3px;}
  .settings-section p.desc{font-size:12px; color:var(--text-dim); margin-bottom:16px;}
  .field{display:flex; flex-direction:column; gap:7px; margin-bottom:14px;}
  .field:last-child{margin-bottom:0;}
  .field label{font-size:12.5px; font-weight:600;}
  .field .hint{font-size:11.5px; color:var(--text-faint); line-height:1.5;}
  .row2{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
  .row3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px;}
  input[type=text], input[type=number], input[type=password], select{width:100%; background:var(--panel-3); border:1px solid var(--line); border-radius:7px; padding:10px 12px; color:var(--text); font-family:var(--font-mono); font-size:13px; outline:none;}
  input:focus, select:focus{border-color:var(--brand); background:#EEECFD;}
  .check-row{display:flex; align-items:flex-start; gap:10px; cursor:pointer;}
  .check-row input[type=checkbox]{appearance:none; width:18px; height:18px; border-radius:5px; border:1px solid var(--line); background:var(--panel-3); flex-shrink:0; margin-top:1px; cursor:pointer; position:relative;}
  .check-row input[type=checkbox]:checked{background:var(--brand); border-color:var(--brand);}
  .check-row input[type=checkbox]:checked::after{content:''; position:absolute; left:5px; top:1px; width:5px; height:9px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg);}
  .check-row .ctext .title{font-size:13px; font-weight:600;}
  .check-row .ctext .desc{font-size:11.5px; color:var(--text-dim); margin-top:2px;}
  .amber-note{margin-top:14px; padding:11px 13px; border-radius:8px; background:var(--amber-dim); border:1px solid rgba(245,180,84,0.25); font-size:11.5px; color:#8A5A00; display:flex; gap:8px;}

  /* --- Strategy edit sub-view --- */
  .layout-edit{display:grid; grid-template-columns:1fr 340px; gap:20px; align-items:start;}
  .tabs{display:flex; gap:2px; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:5px; margin-bottom:16px;}
  .tab{flex:1; text-align:center; padding:9px 10px; border-radius:7px; cursor:pointer; font-size:12px; font-weight:600; color:var(--text-faint);}
  .tab.active{background:var(--panel-2); color:var(--text);}
  .form-view{display:none; flex-direction:column;}
  .form-view.active{display:flex;}
  .section{padding:20px 22px; border-bottom:1px solid var(--line-soft);}
  .section:last-child{border-bottom:none;}
  .preview{position:sticky; top:88px; display:flex; flex-direction:column; gap:0;}
  .compact-form{gap:0;}
  .compact-section{padding:14px 20px;}
  .compact-section + .compact-section{border-top:1px solid var(--line-soft);}
  .compact-divider{font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-faint); margin-bottom:10px;}
  .compact-form .field{margin-bottom:0;}
  .compact-form .field label{font-size:11.5px; margin-bottom:5px; display:block;}
  .compact-form input[type=text], .compact-form input[type=number], .compact-form input[type=password], .compact-form select{padding:8px 10px; font-size:12.5px;}
  .compact-form .hint{font-size:11px; color:var(--text-faint); line-height:1.5;}
  .compact-form .check-row{gap:8px;}
  .compact-form .row3{gap:10px;}
  .preview-summary{padding:14px 18px; font-size:12px; line-height:1.7; color:var(--text-dim);}
  .preview-summary b{color:var(--text);}
  .tpsl-viz{padding:6px 18px 18px;}
  .tpsl-track{height:8px; border-radius:4px; background:var(--panel-3); position:relative; overflow:hidden; margin:22px 0 8px;}
  .tpsl-track .seg{position:absolute; top:0; bottom:0;}
  .tpsl-labels{display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:10px; color:var(--text-faint);}

  /* Command palette */
  .cmdk-overlay{position:fixed; inset:0; background:rgba(6,7,10,0.6); backdrop-filter:blur(3px); display:none; align-items:flex-start; justify-content:center; padding-top:14vh; z-index:50;}
  .cmdk-overlay.open{display:flex;}
  .cmdk-box{width:560px; max-width:90vw; background:var(--panel-2); border:1px solid var(--line); border-radius:12px; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,0.5);}
  .cmdk-input{width:100%; padding:15px 18px; background:transparent; border:none; border-bottom:1px solid var(--line-soft); color:var(--text); font-size:14px; outline:none;}
  .cmdk-list{max-height:320px; overflow-y:auto; padding:6px;}
  .cmdk-group{font-size:10px; color:var(--text-faint); text-transform:uppercase; letter-spacing:0.06em; padding:10px 12px 4px;}
  .cmdk-item{display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:7px; font-size:13px; cursor:pointer; color:var(--text-dim);}
  .cmdk-item:hover{background:var(--panel-3); color:var(--text);}
  .cmdk-item .ic{width:15px; text-align:center; font-size:13px;}
  .cmdk-item .kbd{margin-left:auto; font-family:var(--font-mono); font-size:10px; color:var(--text-faint); border:1px solid var(--line); border-radius:4px; padding:1px 5px;}

  .empty-state{padding:40px 20px; text-align:center; color:var(--text-faint); font-size:12.5px;}

  /* --- Monitoring editor --- */
  .net-chips{display:flex; gap:8px; flex-wrap:wrap;}
  .net-chips--single .net-chip.on .box{border-radius:50%;}
  .net-chips--single .net-chip.on .box::after{left:3px; top:1px; width:5px; height:9px;}
  .net-chip{display:flex; align-items:center; gap:7px; padding:8px 14px; border-radius:8px; border:1px solid var(--line); background:var(--panel-3); color:var(--text-dim); font-size:12.5px; font-weight:600; cursor:pointer;}
  .net-chip .box{width:14px; height:14px; border-radius:4px; border:1px solid var(--line-soft); background:var(--panel); flex-shrink:0; position:relative;}
  .net-chip.on{border-color:var(--brand); background:var(--brand-glow); color:var(--text);}
  .net-chip.on .box{background:var(--brand); border-color:var(--brand);}
  .net-chip.on .box::after{content:''; position:absolute; left:4px; top:0px; width:4px; height:8px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg);}
  .gmgn-safety-grid{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px;}
  .gmgn-safety-chip{display:flex; align-items:center; gap:7px; padding:7px 12px; border-radius:8px; border:1px solid var(--line); background:var(--panel-3); color:var(--text-dim); font-size:12px; font-weight:500; cursor:pointer;}
  .gmgn-safety-chip input{display:none;}
  .gmgn-safety-chip.on{border-color:var(--brand); background:var(--brand-glow); color:var(--text);}
  .req-tag{font-family:var(--font-mono); font-size:9.5px; color:var(--amber); background:var(--amber-dim); padding:2px 7px; border-radius:5px; margin-left:8px;}
  .opt-tag{font-family:var(--font-mono); font-size:9.5px; color:var(--text-faint); background:var(--panel-3); padding:2px 7px; border-radius:5px; margin-left:8px;}

  .active-filters-groups{display:flex; flex-direction:column; gap:12px;}
  .filter-group{border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#fff; box-shadow:var(--shadow-card);}
  .filter-group-head{display:flex; align-items:center; gap:8px; padding:9px 14px; border-bottom:1px solid var(--line-soft); font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.05em;}
  .filter-group-count{font-family:var(--font-mono); font-size:10px; font-weight:600; padding:1px 6px; border-radius:8px; background:rgba(255,255,255,0.65); border:1px solid rgba(0,0,0,0.06);}
  .filter-group--market .filter-group-head{background:#EEF4FF; color:#3B5BDB;}
  .filter-group--volume .filter-group-head{background:#EEFBF3; color:#0D7A52;}
  .filter-group--price .filter-group-head{background:#FFF7ED; color:#B45309;}
  .filter-group--swaps .filter-group-head{background:#F5F0FF; color:#6D28D9;}
  .filter-group--liquidity .filter-group-head{background:#ECFEFF; color:#0E7490;}
  .filter-group--extra .filter-group-head{background:#FFF1F2; color:#BE123C;}
  .filter-group-body{display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px 14px; padding:14px;}
  .filter-field{display:flex; flex-direction:column; gap:6px; min-width:0;}
  .filter-field-label{font-size:11.5px; font-weight:500; color:var(--text); margin:0; line-height:1.3;}
  .filter-field-row{display:flex; align-items:center; gap:8px; min-width:0;}
  .filter-field-row .finputs{flex:1; min-width:0;}
  .filter-field .finputs{display:grid; grid-template-columns:1fr auto 1fr auto; gap:6px; align-items:center;}
  .filter-field .finputs-single{grid-template-columns:1fr auto;}
  .filter-field .finputs input{width:100%; min-width:0; padding:8px 10px; font-size:12.5px; text-align:left; border:1px solid var(--line); border-radius:8px; background:#fff;}
  .filter-field .finputs input:focus{outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-glow);}
  .filter-field .finputs .fsep{color:var(--text-faint); font-size:11px; text-align:center;}
  .filter-field .funit{font-size:11px; color:var(--text-faint); white-space:nowrap;}
  .filter-field .fremove{width:28px; height:28px; border-radius:6px; border:1px solid var(--line); background:#fff; color:var(--text-faint); cursor:pointer; flex-shrink:0; font-size:12px; padding:0; display:inline-flex; align-items:center; justify-content:center; line-height:1;}
  .filter-field .fremove:hover{border-color:var(--red-dim); color:var(--red); background:var(--red-dim);}
  .filters-empty-hint{padding:16px; text-align:center; color:var(--text-faint); font-size:12px; border:1px dashed var(--line); border-radius:8px; background:var(--panel-2);}
  .add-filter-wrap{margin-top:12px;}
  .add-filter-wrap > .btn{border-style:dashed; background:var(--panel-2); box-shadow:none;}
  .add-filter-wrap > .btn:hover{background:#fff;}

  .add-filter-wrap{position:relative;}
  .add-filter-panel{
    display:none; margin-top:10px; background:var(--panel-3); border:1px solid var(--line);
    border-radius:9px; padding:14px; max-height:360px; overflow-y:auto;
  }
  .add-filter-panel.open{display:block;}
  .af-search{display:flex; align-items:center; gap:8px; background:var(--panel); border:1px solid var(--line); border-radius:7px; padding:8px 10px; margin-bottom:12px;}
  .af-search input{flex:1; background:transparent; border:none; outline:none; color:var(--text); font-size:12.5px;}
  .af-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:16px;}
  .af-group h4{font-size:10.5px; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-faint); margin-bottom:8px;}
  .af-item{display:flex; align-items:center; gap:8px; padding:5px 0; font-size:12px; color:var(--text-dim); cursor:pointer;}
  .af-item:hover{color:var(--text);}
  .af-item .box{width:14px; height:14px; border-radius:4px; border:1px solid var(--line-soft); background:var(--panel); flex-shrink:0; position:relative;}
  .af-item.added .box{background:var(--brand); border-color:var(--brand);}
  .af-item.added .box::after{content:''; position:absolute; left:4px; top:0px; width:4px; height:8px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg);}
  .af-item.added{color:var(--text);}
  .af-item.hidden{display:none;}

  @media (max-width: 1100px){
    .kpis{grid-template-columns:repeat(2,1fr);}
    .main-grid, .bottom-grid, .layout-edit, .widgets-row{grid-template-columns:1fr;}
    .filters-grid{grid-template-columns:repeat(2,1fr);}
    .filter-group-body{grid-template-columns:1fr;}
  }

  @media (max-width: 860px){
    html,body{overflow-x:hidden;}
    .app{min-height:100dvh;}

    .menu-btn{display:inline-flex;}
    .sidebar-close{display:inline-flex;}
    .sidebar-overlay{
      display:block; position:fixed; inset:0; background:rgba(6,7,10,0.45);
      backdrop-filter:blur(2px); z-index:40; opacity:0; pointer-events:none;
      transition:opacity .2s ease;
    }
    body.menu-open .sidebar-overlay{opacity:1; pointer-events:auto;}
    body.menu-open{overflow:hidden;}

    .sidebar{
      position:fixed; top:0; left:0; bottom:0; width:min(288px, 86vw);
      z-index:50; transform:translateX(-105%);
      transition:transform .22s ease; box-shadow:none; height:100dvh;
    }
    body.menu-open .sidebar{
      transform:translateX(0);
      box-shadow:12px 0 40px rgba(16,24,40,0.18);
    }
    .side-brand{padding-right:12px;}

    .topbar{
      flex-wrap:wrap; align-items:flex-start; padding:12px 14px;
      gap:10px;
    }
    .topbar-left{width:100%;}
    .topbar-title .sub{
      white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%;
    }
    .topbar-actions{
      width:100%; flex-wrap:wrap; justify-content:flex-start; gap:8px;
    }
    .topbar-actions .btn{flex:1 1 auto; min-height:40px;}

    .content{padding:14px 14px 28px; gap:12px; max-width:100%;}
    .kpis, .kpis.cols-2, .kpis.cols-3, .kpis.cols-4, .kpis.cols-5{
      grid-template-columns:1fr;
    }
    #trades-kpis{grid-template-columns:repeat(2,1fr) !important;}
    .kpi{padding:14px 16px;}
    .kpi .value{font-size:20px;}

    .panel-head{padding:12px 14px; flex-wrap:wrap; gap:8px;}
    .lb-row, .st-row{
      grid-template-columns:1fr; gap:8px; padding:12px 14px;
    }
    .lb-row .row-actions, .st-row .row-actions{
      justify-content:flex-start;
    }
    .lb-contrib, .st-params{width:100%;}

    .mon-card-head{
      flex-direction:row; align-items:flex-start; gap:8px; padding:14px;
    }
    .mon-card-main{
      grid-template-columns:1fr;
      gap:12px;
    }
    .mon-drag-handle{width:36px; min-height:44px; align-self:stretch;}
    .mon-card-left{gap:8px;}
    .mon-card-stats{
      width:100%;
      grid-template-columns:1fr 1fr auto;
      justify-self:stretch;
      gap:10px;
    }
    .mon-card-actions{
      width:100%;
      justify-content:flex-start;
    }
    .mon-icon-btn{width:40px; height:40px;}
    .mon-toolbar{align-items:flex-start;}
    .mon-toolbar-meta{width:100%;}
    .filters-grid{grid-template-columns:1fr; gap:10px; padding:14px;}
    .mon-card.open .mon-card-body{max-height:none;}

    .strat-list-main,
    .chat-card-main{
      grid-template-columns:1fr;
      gap:12px;
    }
    .strat-list-stats{
      width:100%;
      grid-template-columns:repeat(3, 1fr) auto;
      justify-self:stretch;
    }
    .chat-card-stats{
      width:100%;
      grid-template-columns:1fr auto;
      justify-self:stretch;
    }

    .strat-card{padding:14px;}
    .strat-card-meta{flex-wrap:wrap; gap:10px;}
    .strat-card-foot{flex-direction:column; align-items:stretch; gap:10px;}
    .strat-card-foot .btn{min-height:40px;}

    .panel{overflow-x:auto; -webkit-overflow-scrolling:touch;}
    table{min-width:560px;}
    .users-table-wrap table{min-width:640px;}

    .compact-section{padding:14px;}
    .row2, .row3{grid-template-columns:1fr;}
    .filter-group-body{grid-template-columns:1fr;}
    .filter-field .finputs input{min-height:40px; font-size:16px;}
    .compact-form input[type=text],
    .compact-form input[type=number],
    .compact-form input[type=password],
    .compact-form select{
      min-height:40px; font-size:16px;
    }
    .af-grid{grid-template-columns:1fr;}
    .net-chips{gap:8px;}
    .net-chip{min-height:40px;}
    .filter-form-row{grid-template-columns:1fr; gap:8px;}
    .preview{position:static;}
    .form-sticky-actions{
      margin-left:-14px; margin-right:-14px; padding:12px 14px;
      flex-wrap:wrap;
    }
    .form-sticky-actions .btn{flex:1; min-height:44px;}

    .chat-row{grid-template-columns:1fr; gap:8px; padding:12px 14px;}
    .toast{left:14px; right:14px; bottom:14px;}
    .cmdk-overlay{padding-top:8vh;}
    .modal-overlay{padding:12px; align-items:flex-end;}
    .modal-box{width:100%; max-height:88vh; border-radius:14px 14px 0 0;}
  }

  @media (max-width: 480px){
    #trades-kpis{grid-template-columns:1fr !important;}
    .mon-card-stats{grid-template-columns:1fr 1fr; gap:8px;}
    .mon-stat-status{grid-column:1 / -1;}
    .mon-icon-btn{width:42px; height:42px;}
    .btn.sm{padding:10px 12px;}
  }

/* ---- Доп. стили для рабочей версии: загрузка, тосты, живые бейджи ---- */
.loading-row{padding:24px; text-align:center; color:var(--text-faint); font-size:12.5px;}
.toast{
  position:fixed; bottom:22px; right:22px; background:var(--text); color:#fff;
  padding:11px 16px; border-radius:10px; font-size:12.5px; font-weight:600;
  box-shadow:var(--shadow-lift); z-index:100; opacity:0; transform:translateY(8px);
  transition:opacity .2s, transform .2s; pointer-events:none;
}
.toast.show{opacity:1; transform:translateY(0);}
.live-flash{animation:flash-bg .6s ease;}
@keyframes flash-bg{ 0%{background:var(--brand-dim);} 100%{background:transparent;} }
.empty-note{padding:22px; text-align:center; color:var(--text-faint); font-size:12.5px; border:1px dashed var(--line); border-radius:10px; margin:16px 20px;}

/* Login page */
.login-page{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;}
.login-card{width:100%; max-width:420px; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:28px; box-shadow:var(--shadow-lift);}
.login-card h2{font-family:var(--font-display); font-size:20px; margin-bottom:8px;}
.login-card .muted{color:var(--text-dim); font-size:13px;}
.login-card hr{border:none; border-top:1px solid var(--line-soft); margin:20px 0;}
.login-card .btn-full{width:100%; margin-top:8px;}
.alert{padding:12px 14px; border-radius:8px; font-size:13px; margin-bottom:14px;}
.alert-error{background:var(--red-dim); color:var(--red); border:1px solid rgba(229,72,77,0.2);}
.alert-success{background:var(--green-dim); color:var(--green); border:1px solid rgba(23,166,114,0.2);}
.hide{display:none !important;}
.hidden{display:none !important;}

/* Modal */
.modal-overlay{position:fixed; inset:0; background:rgba(6,7,10,0.55); backdrop-filter:blur(3px); display:none; align-items:center; justify-content:center; z-index:60; padding:20px;}
.modal-overlay.open{display:flex;}
.modal-box{background:var(--panel); border:1px solid var(--line); border-radius:12px; width:min(720px, 96vw); max-height:85vh; display:flex; flex-direction:column; box-shadow:var(--shadow-lift);}
.modal-head{padding:16px 20px; border-bottom:1px solid var(--line-soft); display:flex; justify-content:space-between; align-items:flex-start; gap:12px;}
.modal-head h3{font-size:16px; font-weight:600;}
.modal-head .sub{font-size:12px; color:var(--text-faint); margin-top:4px;}
.modal-body{padding:16px 20px; overflow-y:auto; flex:1;}
.modal-foot{padding:14px 20px; border-top:1px solid var(--line-soft); display:flex; justify-content:flex-end; gap:8px;}
.events-list{display:flex; flex-direction:column; gap:8px; font-size:12px;}
.event-row{padding:10px 12px; border:1px solid var(--line-soft); border-radius:8px; background:var(--panel-2);}
.event-row .meta{color:var(--text-faint); font-family:var(--font-mono); font-size:10.5px; margin-bottom:4px;}
.event-row.success{border-color:rgba(23,166,114,0.3);}
.event-row.error{border-color:rgba(229,72,77,0.3);}
.event-row.warning{border-color:rgba(196,132,29,0.3);}

/* Users */
.users-form{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:20px; margin-bottom:16px;}
.users-table-wrap{overflow-x:auto;}
.perm-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:8px; margin-top:8px;}

/* Strategy form extras */
.radio-row{display:flex; gap:16px; flex-wrap:wrap; margin:8px 0;}
.source-block{margin-top:12px; padding-top:12px; border-top:1px dashed var(--line);}
.monitoring-checkboxes{display:flex; flex-direction:column; gap:8px;}
.filter-form-row{display:grid; grid-template-columns:2fr 1fr 1fr auto; gap:10px; align-items:end; margin-bottom:8px;}
.topic-hint{font-size:11.5px; color:var(--text-dim); margin-top:6px;}
.topic-hint a{color:var(--brand);}

/* Nav permission hidden */
.nav-item.hidden-nav{display:none !important;}
.topbar-actions .hidden-action{display:none !important;}

/* Fees unavailable */
.fees-unavailable{color:var(--text-faint); font-size:12px; padding:0 18px 16px;}

/* ---------- Tokens page ---------- */
.tokens-filters{padding:16px;}
.tokens-filters-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
  gap:12px;
}
.tokens-filters-grid .field{margin-bottom:0;}
.tokens-filters-grid input,
.tokens-filters-grid select{
  width:100%;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  font-size:12.5px;
  color:var(--text);
}
.tokens-filters-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:14px;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--line-soft);
}
.tokens-check{margin:0;}
.tokens-check .title{font-size:12px;}
.tokens-filters-btns{margin-left:auto; display:flex; gap:8px;}
.tokens-meta{font-size:12px; color:var(--text-faint); font-family:var(--font-mono);}
.tokens-pager{display:flex; align-items:center; gap:8px;}
.tokens-table-wrap{overflow-x:auto;}
.tokens-table{width:100%; border-collapse:collapse;}
.tokens-table th,
.tokens-table td{
  padding:10px 12px;
  text-align:left;
  border-bottom:1px solid var(--line-soft);
  font-size:12.5px;
  vertical-align:middle;
}
.tokens-table th{
  font-size:10.5px;
  text-transform:uppercase;
  letter-spacing:0.04em;
  color:var(--text-faint);
  font-weight:600;
  background:var(--panel-2);
}
.tokens-table .num-col{text-align:right;}
.tokens-row{cursor:pointer;}
.tokens-row:hover{background:var(--panel-2);}
.token-cell{display:flex; flex-direction:column; gap:2px;}
.token-cell b{font-size:12.5px;}
.mint{font-family:var(--font-mono); font-size:10.5px; color:var(--text-faint);}
a.nav-item{text-decoration:none;}

.token-drawer-overlay{
  position:fixed; inset:0; background:rgba(6,7,10,0.35);
  backdrop-filter:blur(2px); z-index:50; display:none;
}
.token-drawer-overlay.open{display:block;}
.token-drawer{
  position:fixed; top:0; right:0; bottom:0; width:min(640px, 100vw);
  background:var(--panel); border-left:1px solid var(--line);
  box-shadow:var(--shadow-lift); z-index:55;
  transform:translateX(100%); transition:transform .2s ease;
  display:flex; flex-direction:column;
}
.token-drawer.open{transform:translateX(0);}
.token-drawer-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:12px; padding:18px 18px 14px; border-bottom:1px solid var(--line-soft);
}
.token-drawer-head h2{font-size:16px; font-weight:600;}
.token-drawer-head .sub{font-size:11.5px; color:var(--text-faint); margin-top:4px; word-break:break-all;}
.token-drawer-body{flex:1; overflow-y:auto; padding:16px 18px 28px; display:flex; flex-direction:column; gap:18px;}
.token-section-title{
  font-size:11px; text-transform:uppercase; letter-spacing:0.06em;
  color:var(--text-faint); font-weight:600; margin-bottom:10px;
}
.token-kv-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:8px 14px;
}
.token-kv{display:flex; flex-direction:column; gap:2px;}
.token-kv .l{font-size:10.5px; color:var(--text-faint);}
.token-kv .v{font-size:12.5px; font-weight:500;}
.token-links{font-size:12.5px; display:flex; gap:6px; flex-wrap:wrap;}
.token-links a{color:var(--brand); font-weight:600;}
.token-empty{padding:12px 0; color:var(--text-dim); line-height:1.5;}
.token-empty .hint{font-size:12px; color:var(--text-faint); margin-top:6px;}
.holders-table th, .holders-table td{padding:7px 8px; font-size:11.5px;}

.token-kpi-strip{display:grid; grid-template-columns:repeat(3,1fr); gap:10px;}
.token-kpi{
  background:var(--panel-2); border:1px solid var(--line); border-radius:10px; padding:10px 12px;
}
.token-kpi .l{font-size:10.5px; color:var(--text-faint); text-transform:uppercase; letter-spacing:0.04em;}
.token-kpi .vals{display:flex; flex-direction:column; gap:2px; margin-top:6px;}
.token-kpi .t0{font-size:11px; color:var(--text-dim);}
.token-kpi .now{font-family:var(--font-mono); font-size:14px; font-weight:600;}
.token-kpi .delta{font-family:var(--font-mono); font-size:11.5px;}
.token-kpi .delta.up{color:var(--green);}
.token-kpi .delta.down{color:var(--red);}
.badge.track-active{background:var(--green-dim); color:var(--green);}
.badge.track-done{background:var(--brand-dim); color:var(--brand);}
.badge.track-fail{background:var(--red-dim); color:var(--red);}
.badge.track-none{background:var(--panel-3); color:var(--text-faint);}
.token-chart-wrap{background:var(--panel-2); border:1px solid var(--line); border-radius:10px; padding:12px;}
.token-chart-tabs{display:flex; gap:6px; margin-bottom:10px; flex-wrap:wrap;}
.token-chart-tabs .chip{padding:5px 10px; font-size:11.5px;}
.token-chart-svg{width:100%; height:120px; display:block;}
.token-timeline-row{cursor:pointer;}
.token-timeline-row:hover{background:var(--panel-2);}
.token-point-detail{
  margin-top:8px; padding:12px; background:var(--panel-2); border:1px solid var(--line);
  border-radius:10px;
}

@media (max-width: 860px){
  .token-kv-grid{grid-template-columns:1fr;}
  .token-kpi-strip{grid-template-columns:1fr;}
  .tokens-filters-btns{margin-left:0; width:100%;}
  .tokens-filters-btns .btn{flex:1;}
}
