/* Manage page redesign (ET-31818) — presentation only.
   Palette: bg rgb(10,14,23)/rgb(13,21,32)/rgb(17,26,40), panels rgba(17,24,39,.6) + rgba(0,150,255,.15),
   accent rgb(0,207,255), positive rgb(0,255,136), negative rgb(255,68,68), blue rgb(59,130,246), slate-blue neutrals.
   Header font stays Archivo Black via var(--font-display). */
.mg-page { --mg-line: rgba(0,150,255,0.15); --mg-line2: rgba(0,150,255,0.3); --mg-dim: rgb(126,144,161); --mg-acc:rgb(0,207,255); --mg-pos:rgb(0,255,136); --mg-neg:rgb(255,68,68); --mg-blue:rgb(59,130,246);
    max-width: 1376px; margin: 0 auto; padding: 0 16px 48px; font-family: var(--font-mono, monospace); text-align:left; }
.mg-page [hidden] { display:none !important; }
.mg-sr { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.mg-hide { display:none !important; }
.mg-eyebrow { font-size:0.66rem; letter-spacing:.16em; text-transform:uppercase; color:var(--mg-dim); margin:18px 0 10px; }
.mg-back { display:inline-flex; align-items:center; gap:8px; margin:18px 0 14px; color:var(--mg-dim); text-decoration:none; font-size:0.72rem; letter-spacing:.14em; text-transform:uppercase; }
.mg-back:hover { color:var(--mg-acc); }
.mg-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 18px; border-radius:10px; border:1px solid var(--mg-line2); background:rgba(17,26,40,0.7); color:rgb(207,227,245);
    font:700 0.72rem/1 var(--font-mono, monospace); letter-spacing:.12em; text-transform:uppercase; cursor:pointer; }
.mg-btn:hover { border-color:var(--mg-acc); color:rgb(255,255,255); }
.mg-btn.sm { padding:7px 12px; }
.mg-btn.fund { background:var(--mg-pos); border-color:var(--mg-pos); color:rgb(4,20,11); }
.mg-btn.fund:hover { filter:brightness(1.1); color:rgb(4,20,11); }
.mg-btn.danger { border-color:rgba(255,68,68,0.5); color:var(--mg-neg); background:rgba(255,68,68,0.07); }
.mg-iconbtn { width:40px; height:40px; display:inline-flex; align-items:center; justify-content:center; border-radius:10px; border:1px solid transparent; background:transparent; color:var(--mg-dim); cursor:pointer; }
.mg-iconbtn:hover { color:rgb(255,255,255); border-color:var(--mg-line2); }
.mg-iconbtn.del:hover { color:var(--mg-neg); border-color:rgba(255,68,68,0.4); }
.mg-i { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; border-radius:50%; border:1px solid var(--mg-line2); color:var(--mg-dim); font:700 0.62rem var(--font-mono, monospace); cursor:help; flex-shrink:0; text-transform:none; letter-spacing:0; }
.mg-i:hover, .mg-i:focus-visible { color:var(--mg-acc); border-color:var(--mg-acc); outline:none; }
.mg-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:6px; border:1px solid rgba(0,150,255,0.35); background:rgba(0,207,255,0.05); color:var(--mg-acc); font:700 0.64rem/1.2 var(--font-mono, monospace); letter-spacing:.12em; text-transform:uppercase; }
.mg-chip.mute { color:var(--mg-dim); border-color:var(--mg-line); }
.mg-chip.on { color:var(--mg-pos); border-color:rgba(0,255,136,0.35); background:rgba(0,255,136,0.06); }
.mg-chips { display:flex; flex-wrap:wrap; gap:6px; }

/* Header */
.mg-page .profile-header.mg-header { display:flex; align-items:center; gap:24px; padding:24px 28px; text-align:left; background:linear-gradient(180deg, rgba(17,26,40,0.9), rgba(13,21,32,0.9));
    border:1px solid var(--mg-line); border-radius:18px; flex-wrap:wrap; }
.mg-page .profile-avatar-wrapper { flex-shrink:0; margin:0; }
.mg-page .profile-avatar { width:76px; height:76px; margin:0; border-radius:20px; font-size:34px; background:rgba(0,207,255,0.06); border:1px solid rgba(0,207,255,0.5); box-shadow:0 0 28px rgba(0,207,255,0.18); }
.mg-ident { flex:1 1 280px; min-width:0; }
.mg-namerow { display:flex; align-items:center; gap:10px; }
.mg-page .profile-name { font-family:var(--font-display); font-size:clamp(1.5rem,3vw,2.1rem); line-height:1.1; margin:0; color:var(--text-heading, rgb(255,255,255)); text-align:left; }
.mg-pencil { all:unset; cursor:pointer; color:var(--mg-dim); display:inline-flex; padding:4px; border-radius:6px; }
.mg-pencil:hover { color:var(--mg-acc); }
.mg-page .profile-tagline { display:inline; margin:6px 0 0; color:var(--mg-dim); font-size:0.8rem; }
.mg-page .profile-ref { display:inline; margin:0 !important; font-size:0.8rem !important; color:var(--mg-dim) !important; }
.mg-page .profile-ref:not(:empty)::before { content:" \00b7  "; }
.mg-page .profile-badges { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; justify-content:flex-start; }
.mg-page .profile-badge { padding:4px 10px; border-radius:6px; font:700 0.64rem/1.2 var(--font-mono, monospace); letter-spacing:.12em; text-transform:uppercase; background:rgba(0,207,255,0.05); border:1px solid rgba(0,150,255,0.35); color:var(--mg-acc); }
.mg-page .profile-badge.mode-badge { color:rgb(207,227,245); border-color:var(--mg-line2); background:rgba(17,26,40,0.7); }
.mg-page .profile-badge.team-badge.team-blue { color:var(--mg-blue); border-color:rgba(59,130,246,0.5); }
.mg-page .profile-badge.team-badge.team-red, .mg-page .mg-risk.high { color:var(--mg-neg); border-color:rgba(255,68,68,0.5); }
.mg-page .trading-status { display:none; }
.mg-page .readiness-warning { display:none !important; }
.mg-actions { display:flex; align-items:center; gap:10px; margin-left:auto; flex-wrap:wrap; }
.mg-switchcard { display:flex; align-items:center; gap:14px; padding:12px 18px; border:1px solid var(--mg-line); border-radius:12px; background:rgba(10,14,23,0.7); }
.mg-page .toggle-switch { width:56px; height:30px; margin:0; }
.mg-page .toggle-slider { background:rgba(59,130,246,0.22); border:1px solid rgba(0,150,255,0.25); }
.mg-page .toggle-switch input:checked + .toggle-slider { background:rgba(0,255,136,0.28); border-color:rgba(0,255,136,0.6); }
.mg-page .toggle-slider::before { background:rgb(159,179,200); }
.mg-page .toggle-switch input:checked + .toggle-slider::before { background:var(--mg-pos); }
.mg-switchtxt b { display:block; font:700 0.78rem var(--font-mono, monospace); letter-spacing:.16em; color:rgb(255,255,255); }
.mg-switchtxt b.on { color:var(--mg-pos); }
.mg-switchtxt small { display:block; font-size:0.66rem; color:var(--mg-dim); letter-spacing:.06em; margin-top:2px; max-width:200px; }
.mg-wallet { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin:8px 4px 12px; font-size:0.66rem; color:var(--mg-dim); }
.mg-wallet .wallet-badge { padding:2px 8px; font-size:0.62rem; text-transform:none; letter-spacing:0; display:inline-flex; gap:6px; align-items:center; border-radius:6px; border:1px solid var(--mg-line); color:var(--mg-dim); background:transparent; text-decoration:none; max-width:100%; overflow:hidden; text-overflow:ellipsis; }
.mg-wallet .wallet-badge svg { width:12px; height:12px; }
.mg-cant { display:flex; align-items:center; gap:12px; padding:12px 18px; margin:0 0 12px; border:1px solid rgba(255,68,68,0.4); background:rgba(255,68,68,0.07); border-radius:12px; color:rgb(255,208,208); font-size:0.8rem; }
.mg-cant #mgCantText { flex:1; } .mg-cant-ico { color:var(--mg-neg); }

/* Strip */
.mg-page .stats-grid.mg-strip { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)) minmax(0,1.5fr); gap:12px; padding:0; margin:0 0 16px; max-width:none; }
.mg-page .stat-card { padding:18px 20px; text-align:left; border:1px solid var(--mg-line); border-radius:14px; background:rgba(10,14,23,0.7); min-width:0; }
.mg-page .stat-value { font-family:var(--font-display); font-size:1.7rem; color:rgb(255,255,255); text-align:left; line-height:1.1; }
.mg-page .stat-value.positive { color:var(--mg-pos); } .mg-page .stat-value.negative { color:var(--mg-neg); } .mg-page .stat-value.muted { color:var(--mg-dim); }
.mg-page .stat-label { margin-top:8px; font-size:0.64rem; letter-spacing:.16em; text-transform:uppercase; color:var(--mg-dim); text-align:left; }
.mg-page .stat-sublabel { font-size:0.62rem; margin-top:6px; color:rgb(96,165,250); }
.mg-markets-card .stat-label { margin:0 0 10px; }
.mg-markets-card .mg-chip { color:var(--mg-pos); border-color:rgba(0,255,136,0.35); background:rgba(0,255,136,0.05); }

/* Columns */
.mg-columns { display:grid; grid-template-columns:minmax(0,1fr) 380px; gap:20px; align-items:start; }
.mg-glance { position:sticky; top:84px; border:1px solid var(--mg-line); border-radius:16px; background:rgba(13,21,32,0.9); overflow:hidden; }
.mg-glance-title { font-family:var(--font-display); font-size:1rem; margin:0; padding:20px 22px; color:rgb(255,255,255); border-bottom:1px solid var(--mg-line); }
.mg-glance-body { padding:4px 22px 18px; }
.mg-checks { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; font-size:0.78rem; }
.mg-checks li { display:flex; gap:10px; align-items:center; color:rgb(226,232,240); }
.mg-checks li i { width:16px; height:16px; border-radius:50%; flex-shrink:0; background:var(--mg-pos); position:relative; }
.mg-checks li i::after { content:"\2713"; position:absolute; inset:0; font:700 0.6rem/16px var(--font-mono, monospace); text-align:center; color:rgb(4,20,11); font-style:normal; }
.mg-checks li.bad { color:var(--mg-neg); } .mg-checks li.bad i { background:var(--mg-neg); } .mg-checks li.bad i::after { content:"\2715"; color:rgb(26,5,5); }
.mg-bar { display:flex; height:10px; border-radius:3px; overflow:hidden; margin:2px 0 14px; }
.mg-bar i { display:block; height:100%; } .mg-bar .neg { background:var(--mg-neg); } .mg-bar .pos { background:var(--mg-pos); }
.mg-dl { margin:0; font-size:0.76rem; } .mg-dl > div { display:flex; justify-content:space-between; gap:12px; padding:9px 0; border-bottom:1px dashed rgba(0,150,255,0.18); }
.mg-dl > div:last-child { border-bottom:0; }
.mg-dl dt { color:var(--mg-dim); } .mg-dl dd { margin:0; color:rgb(255,255,255); font-weight:700; text-align:right; } .mg-dl .flag { color:var(--mg-neg); }
.mg-glance-foot { padding:16px 22px 22px; border-top:1px solid var(--mg-line); display:flex; flex-direction:column; gap:10px; }
.mg-unsaved { text-align:center; font-size:0.66rem; letter-spacing:.16em; text-transform:uppercase; color:var(--mg-dim); }
.mg-unsaved.dirty { color:var(--mg-acc); } .mg-unsaved b { color:inherit; }
.mg-page .settings-save-btn.mg-save { width:100%; margin:0; padding:16px; border-radius:12px; border:0; background:var(--mg-pos); color:rgb(4,20,11); font:800 0.8rem var(--font-mono, monospace); letter-spacing:.16em; text-transform:uppercase; cursor:pointer; }
.mg-page .settings-save-btn.mg-save:disabled { opacity:.45; cursor:not-allowed; }
.mg-discard { padding:12px; border-radius:10px; border:1px solid var(--mg-line2); background:transparent; color:rgb(207,227,245); font:700 0.7rem var(--font-mono, monospace); letter-spacing:.16em; text-transform:uppercase; cursor:pointer; }
.mg-discard:hover { border-color:var(--mg-acc); }

/* Tabs card */
.mg-tabs-card { border:1px solid var(--mg-line); border-radius:16px; background:rgba(13,21,32,0.7); margin-bottom:16px; }
.mg-tablist { display:flex; gap:6px; padding:12px; border-bottom:1px solid var(--mg-line); overflow-x:auto; }
.mg-tab { display:inline-flex; align-items:center; gap:8px; padding:11px 16px; border-radius:10px; border:1px solid transparent; background:transparent; color:var(--mg-dim); font:700 0.72rem/1 var(--font-mono, monospace); letter-spacing:.14em; text-transform:uppercase; cursor:pointer; white-space:nowrap; }
.mg-tab:hover { color:rgb(255,255,255); }
.mg-tab.active { color:rgb(255,255,255); border-color:rgba(0,207,255,0.55); background:rgba(0,207,255,0.08); box-shadow:0 0 18px rgba(0,207,255,0.12); }
.mg-badge { padding:2px 7px; border-radius:20px; background:rgba(59,130,246,0.25); color:rgb(156,196,255); font-size:0.62rem; letter-spacing:.06em; }
.mg-tab.active .mg-badge { background:var(--mg-acc); color:rgb(4,34,43); }
.mg-panes { padding:22px; }
.mg-panes [data-pane]:not(.mg-pane-on) { display:none !important; }
.mg-panes .mg-pane > .section { margin:18px 0 0; padding:0; border:0; background:none; }
.mg-panes fieldset.mg-pane { border:0; padding:0; margin:0; min-width:0; }
.mg-panes .section-title { font-size:0.7rem; letter-spacing:.16em; text-transform:uppercase; color:var(--mg-dim); font-family:var(--font-mono, monospace); }
.mg-form { padding:0; margin:0; background:none; border:0; }

/* Tiles */
.mg-tilegrid { display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
.mg-tile { border:1px solid var(--mg-line); border-radius:14px; background:rgba(10,14,23,0.6); padding:18px; min-width:0; }
.mg-tile.wide { grid-column:1 / -1; }
.mg-tile.on { border-color:rgba(0,255,136,0.35); background:linear-gradient(180deg, rgba(0,255,136,0.05), rgba(10,14,23,0.6)); box-shadow:0 0 24px rgba(0,255,136,0.05); }
.mg-tile-head { display:flex; align-items:center; gap:12px; }
.mg-ico { width:38px; height:38px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; background:rgba(59,130,246,0.12); border:1px solid rgba(0,150,255,0.25); color:rgb(156,196,255); font-size:1rem; flex-shrink:0; }
.mg-tile.on .mg-ico { background:rgba(0,255,136,0.1); border-color:rgba(0,255,136,0.35); color:var(--mg-pos); }
.mg-tile-t { flex:1; min-width:0; } .mg-tile-t b { display:block; color:rgb(255,255,255); font-size:0.9rem; } .mg-tile-t small { display:block; color:var(--mg-dim); font-size:0.7rem; margin-top:3px; }
.mg-tile-body { display:none; margin-top:16px; }
.mg-tile.on .mg-tile-body { display:block; }
.mg-gate .mg-tile-body { display:block; }
.mg-gate .mg-gnrow { opacity:.55; transition:opacity .15s; } .mg-gate.on .mg-gnrow { opacity:1; }
.mg-gnstate { font:700 0.62rem var(--font-mono, monospace); letter-spacing:.14em; padding:3px 8px; border-radius:10px; background:rgba(59,130,246,0.2); color:rgb(156,196,255); }
.mg-gate.on .mg-gnstate { background:rgba(0,255,136,0.15); color:var(--mg-pos); }
.mg-gnrow { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.mg-gnrow label, #gnExtraConditions label { display:flex; flex-direction:column; gap:6px; font-size:0.64rem; letter-spacing:.12em; text-transform:uppercase; color:var(--mg-dim); }
.mg-page .form-input, .mg-page .mg-form input[type=text], .mg-page .mg-form input[type=number], .mg-page .mg-form select { background:rgba(10,14,23,0.8); border:1px solid var(--mg-line); border-radius:8px; color:rgb(255,255,255); padding:10px 12px; font:0.78rem var(--font-mono, monospace); width:100%; box-sizing:border-box; }
.mg-page .mg-form input:focus, .mg-page .mg-form select:focus { outline:none; border-color:var(--mg-acc); }
#gnExtraConditions .gn-cond-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:10px; margin-top:10px; align-items:end; }
.mg-btnrow { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:12px; }
.mg-pill { padding:9px 14px; border-radius:8px; border:1px solid var(--mg-line2); background:rgba(17,26,40,0.7); color:rgb(207,227,245); font:700 0.66rem var(--font-mono, monospace); letter-spacing:.12em; text-transform:uppercase; cursor:pointer; }
.mg-pill.acc { border-color:rgba(0,207,255,0.5); color:var(--mg-acc); background:rgba(0,207,255,0.07); }
.mg-pill:hover { border-color:var(--mg-acc); }

/* Switch */
.mg-switch { position:relative; display:inline-block; width:50px; height:28px; flex:0 0 50px; margin:0; cursor:pointer; }
.mg-switch input { opacity:0; width:0; height:0; position:absolute; }
.mg-switch span { position:absolute; inset:0; border-radius:28px; background:rgba(59,130,246,0.22); border:1px solid rgba(0,150,255,0.25); transition:background .2s; }
.mg-switch span::before { content:""; position:absolute; width:20px; height:20px; left:3px; top:3px; border-radius:50%; background:rgb(159,179,200); transition:transform .2s, background .2s; }
.mg-switch input:checked + span { background:rgba(0,255,136,0.28); border-color:rgba(0,255,136,0.6); }
.mg-switch input:checked + span::before { transform:translateX(22px); background:var(--mg-pos); }
.mg-switch input:focus-visible + span { outline:2px solid var(--mg-acc); outline-offset:2px; }
.mg-switch input:disabled + span { opacity:.4; cursor:not-allowed; }

/* Chips for markets */
.mg-chipset { display:flex; flex-wrap:wrap; gap:8px; }
.mg-page .market-toggle { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:8px; border:1px solid var(--mg-line2); background:rgba(17,26,40,0.7); color:rgb(207,227,245); font:700 0.72rem var(--font-mono, monospace); cursor:pointer; }
.mg-page .market-toggle:has(input:checked) { border-color:rgba(0,207,255,0.6); color:var(--mg-acc); background:rgba(0,207,255,0.08); }
.mg-page .market-toggle input { accent-color:rgb(0,207,255); }
.mg-chip-off { padding:8px 12px; border-radius:8px; border:1px solid var(--mg-line); color:rgb(74,91,108); font:700 0.68rem var(--font-mono, monospace); text-decoration:line-through; cursor:help; }

/* Sliders */
.mg-sliders { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.mg-slider-tile { border:1px solid var(--mg-line); border-radius:10px; padding:12px 14px; background:rgba(7,11,16,0.6); }
.mg-st-h { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px; font-size:0.62rem; letter-spacing:.14em; text-transform:uppercase; color:var(--mg-dim); }
.mg-st-h b { font-family:var(--font-display); font-size:1.15rem; color:rgb(255,255,255); letter-spacing:0; }
.mg-page input[type=range] { -webkit-appearance:none; appearance:none; width:100%; height:4px; border-radius:4px; background:rgba(59,130,246,0.3); outline:none; padding:0; border:0; }
.mg-page input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:16px; height:16px; border-radius:50%; background:var(--mg-acc); border:3px solid rgb(10,14,23); box-shadow:0 0 0 1px var(--mg-acc), 0 0 10px rgba(0,207,255,0.5); cursor:pointer; }
.mg-page input[type=range]::-moz-range-thumb { width:12px; height:12px; border-radius:50%; background:var(--mg-acc); border:3px solid rgb(10,14,23); cursor:pointer; }
.mg-page input[type=range]:disabled { opacity:.4; }

/* Risk */
.mg-bracket { border:1px solid var(--mg-line); border-radius:14px; padding:14px 18px 12px; background:rgba(7,11,16,0.5); margin-bottom:16px; }
.mg-bracket-top { display:flex; justify-content:space-between; font-family:var(--font-display); font-size:1rem; margin-bottom:6px; }
.mg-bracket-top .neg, .neg { color:var(--mg-neg); } .mg-bracket-top .pos, .pos { color:var(--mg-pos); }
.mg-bracket-bar { position:relative; display:flex; height:22px; border-radius:4px; overflow:hidden; }
.mg-bracket-bar i { display:block; height:100%; }
.mg-bracket-bar .neg { background:linear-gradient(90deg, rgba(255,68,68,0.75), rgba(255,68,68,0.12)); }
.mg-bracket-bar .pos { background:linear-gradient(90deg, rgba(0,255,136,0.12), rgba(0,255,136,0.6)); }
.mg-bracket-bar u { position:absolute; top:-3px; bottom:-3px; width:2px; background:rgb(255,255,255); }
.mg-bracket-lbl { display:flex; justify-content:space-between; margin-top:8px; font-size:0.62rem; letter-spacing:.14em; text-transform:uppercase; color:var(--mg-dim); }
.mg-bigsliders { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.mg-big { border:1px solid var(--mg-line); border-radius:14px; padding:16px 18px; background:rgba(10,14,23,0.6); position:relative; }
.mg-big-v { font-family:var(--font-display); font-size:2rem; line-height:1; color:rgb(255,255,255); } .mg-big.neg .mg-big-v { color:var(--mg-neg); } .mg-big.pos .mg-big-v { color:var(--mg-pos); }
.mg-big-l { margin:8px 0 16px; font-size:0.62rem; letter-spacing:.14em; text-transform:uppercase; color:var(--mg-dim); display:flex; align-items:center; gap:8px; }
.mg-big-r { display:flex; justify-content:space-between; margin-top:10px; font-size:0.6rem; color:var(--mg-dim); }
.mg-big .mg-num { width:76px; margin-top:12px; padding:6px 8px; }
.mg-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.mg-row-tile { display:flex; align-items:center; gap:12px; flex-wrap:wrap; border:1px solid var(--mg-line); border-radius:14px; padding:16px 18px; background:rgba(10,14,23,0.6); }
.mg-rt-t { flex:1 1 130px; min-width:0; } .mg-rt-t b { display:block; color:rgb(255,255,255); font-size:0.84rem; } .mg-rt-t small { display:block; font-size:0.68rem; color:var(--mg-dim); margin-top:4px; }
.mg-rt-extra { flex-basis:100%; display:flex; gap:10px; align-items:center; font-size:0.7rem; color:var(--mg-dim); } .mg-rt-extra input { width:90px; }
.mg-inline-range { flex:1 1 90px; min-width:70px; width:auto !important; } .mg-inline-v { color:rgb(255,255,255); font-size:0.84rem; min-width:40px; text-align:right; }
.mg-seg { display:inline-flex; border:1px solid var(--mg-line); border-radius:10px; overflow:hidden; background:rgba(7,11,16,0.7); flex-wrap:wrap; }
.mg-seg button { padding:9px 12px; border:0; background:transparent; color:var(--mg-dim); font:700 0.74rem var(--font-mono, monospace); cursor:pointer; min-width:34px; }
.mg-seg button.on { background:rgba(0,207,255,0.14); color:var(--mg-acc); }
.mg-vol { width:130px !important; }
.mg-page .sector-cap-row { display:flex; gap:8px; margin-bottom:8px; align-items:center; }

/* Strategy */
.mg-stratcards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.mg-stratcard { text-align:left; padding:16px; border-radius:14px; border:1px solid var(--mg-line); background:rgba(10,14,23,0.6); color:rgb(226,232,240); cursor:pointer; display:flex; flex-direction:column; gap:8px; font-family:var(--font-mono, monospace); }
.mg-stratcard b { font-family:var(--font-display); font-size:1.1rem; color:rgb(255,255,255); } .mg-stratcard span { font-size:0.74rem; color:rgb(207,227,245); }
.mg-stratcard u { text-decoration:none; align-self:flex-start; font-size:0.6rem; letter-spacing:.12em; text-transform:uppercase; padding:3px 8px; border:1px solid var(--mg-line2); border-radius:5px; color:var(--mg-dim); }
.mg-stratcard.on { border-color:var(--mg-acc); background:linear-gradient(180deg, rgba(0,207,255,0.1), rgba(10,14,23,0.6)); box-shadow:0 0 22px rgba(0,207,255,0.12); } .mg-stratcard.on u { color:var(--mg-acc); border-color:rgba(0,207,255,0.5); }
.mg-strat-select { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.mg-rule { margin-top:12px; border-left:2px solid var(--mg-acc); background:rgba(0,207,255,0.05); padding:14px 16px; font-size:0.78rem; line-height:1.55; color:rgb(226,232,240); border-radius:0 10px 10px 0; }
.mg-page .mg-rule .form-hint { display:block !important; color:inherit; font-size:inherit; }
.mg-equip { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:16px; }
.mg-equip-tile { display:flex; align-items:center; gap:14px; padding:16px 18px; border:1px dashed rgba(0,150,255,0.35); border-radius:14px; }
.mg-equip-tile b { font-family:var(--font-display); font-size:1.6rem; color:rgb(255,255,255); } .mg-equip-tile span { flex:1; font-size:0.64rem; letter-spacing:.14em; text-transform:uppercase; color:var(--mg-dim); }

/* Modals */
.mg-modal { position:fixed; inset:0; z-index:10000; background:rgba(0,0,0,0.7); display:flex; align-items:center; justify-content:center; padding:16px; overflow:auto; }
.mg-modal-card { width:100%; max-width:440px; background:rgb(13,21,32); border:1px solid var(--mg-line2); border-radius:16px; padding:22px; color:rgb(226,232,240); }
.mg-modal-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; } .mg-modal-head h3 { font-family:var(--font-display); margin:0; font-size:1.1rem; color:rgb(255,255,255); }
.mg-x { all:unset; cursor:pointer; font-size:1.5rem; color:var(--mg-dim); line-height:1; }
.mg-facts { display:flex; gap:12px; margin-bottom:12px; } .mg-facts > div { flex:1; padding:10px 12px; border:1px solid var(--mg-line); border-radius:10px; background:rgba(17,24,39,0.6); }
.mg-facts span { display:block; font-size:0.6rem; letter-spacing:.14em; text-transform:uppercase; color:var(--mg-dim); } .mg-facts b { display:block; margin-top:4px; color:rgb(255,255,255); } .mg-facts b.pos { color:var(--mg-pos); } .mg-facts b.neg { color:var(--mg-neg); }
.mg-facts-col { flex-direction:column; gap:8px; } .mg-facts-col > div { display:flex; justify-content:space-between; align-items:center; } .mg-facts-col b { margin:0; }
.mg-sim { font-size:0.76rem; color:var(--mg-acc); margin:0 0 12px; }
.mg-quick { display:flex; gap:8px; margin-bottom:12px; } .mg-quick button { flex:1; padding:9px 0; border-radius:8px; border:1px solid var(--mg-line2); background:rgba(0,207,255,0.06); color:var(--mg-acc); font:700 0.8rem var(--font-mono, monospace); cursor:pointer; }
.mg-modal input[type=number] { width:100%; box-sizing:border-box; padding:11px 12px; border-radius:8px; border:1px solid var(--mg-line2); background:rgba(10,14,23,0.8); color:rgb(255,255,255); font:0.85rem var(--font-mono, monospace); }
.mg-row { display:flex; gap:8px; } .mg-err { min-height:1.2em; color:var(--mg-neg); font-size:0.76rem; margin-top:8px; }
.mg-modal-btns { display:flex; gap:8px; justify-content:flex-end; margin-top:10px; }
.mg-modal .fund-section { margin-top:16px; }

/* legacy sections inside panes */
.mg-toggle-legacy { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.mg-page .trading-toggle-section { border:1px solid var(--mg-line); border-radius:16px; background:rgba(13,21,32,0.7); padding:18px 22px; margin:0 0 16px; }
.mg-page .trading-toggle-section:not(:has(#testLoadoutSection:not([style*="none"]), #goLiveSection:not([style*="none"]), #closeAllSection:not([style*="none"]))) { display:none; }
.mg-page .trading-toggle-section #testLoadoutSection:first-of-type { margin-top:0 !important; padding-top:0 !important; border-top:0 !important; }

/* read-only (non-owner): same page, without switches, Fund or Save */
.mg-page.mg-readonly [data-owner-only], .mg-page.mg-readonly .mg-switch, .mg-page.mg-readonly .mg-glance-foot, .mg-page.mg-readonly .mg-switchcard .toggle-switch, .mg-page.mg-readonly .mg-pencil { display:none !important; }
.mg-page.mg-readonly .mg-tile-body { pointer-events:none; }
.mg-page.mg-readonly .mg-tile-body input[type=text] { pointer-events:none; }

@media (max-width: 1100px) { .mg-columns { grid-template-columns:minmax(0,1fr); } .mg-glance { position:static; } .mg-page .stats-grid.mg-strip { grid-template-columns:repeat(2,minmax(0,1fr)); } .mg-markets-card { grid-column:1 / -1; } }
@media (max-width: 760px) {
  .mg-page { padding:0 12px 48px; } .mg-page .profile-header.mg-header { padding:18px; gap:16px; } .mg-actions { margin-left:0; width:100%; } .mg-switchcard { flex:1; }
  .mg-tilegrid, .mg-grid2, .mg-bigsliders, .mg-stratcards, .mg-equip, .mg-sliders { grid-template-columns:1fr; } .mg-gnrow { grid-template-columns:1fr 1fr; } .mg-panes { padding:14px; }
  #gnExtraConditions .gn-cond-row { grid-template-columns:1fr 1fr; }
}
.mg-tab { flex:0 0 auto; }
@media (max-width:600px) { .mg-tab { padding:10px 12px; letter-spacing:.08em; } }

/* ET-31818 fail list: Close All + Chat live in the header beside the trading switch */
.mg-actions .mg-hdr-act { margin:0; padding:0; border:0; display:inline-flex; }
.mg-actions .mg-hdr-act[style*="display: none"] { display:none; }
.mg-actions .mg-hdr-act .mg-btn { white-space:nowrap; }
/* Test / Go Live / Promo now sit inside the Strategy and Advanced tabs */
.mg-page .mg-pane #testLoadoutSection, .mg-page .mg-pane #goLiveSection { margin:16px 0 0 !important; padding:16px 18px !important; border:1px solid var(--mg-line) !important; border-radius:16px; background:rgba(13,21,32,0.7); }
.mg-page .mg-pane #promoVideoSection { max-width:none !important; padding:0 !important; margin:16px 0 0 !important; }

/* ET-31818 (expire76 "build the full redesign"): every section inside a tab pane uses the pane's full width
   (adaptive learning, heartbeat and intercom were capped at 600px by the legacy page rules, leaving the Advanced tab half empty) */
.mg-page .mg-pane > .section, .mg-page .mg-pane > section { max-width:none !important; margin-left:0 !important; margin-right:0 !important; padding-left:0 !important; padding-right:0 !important; }

/* ET-32264: Strategy tab - ONE equipped block: the two count tiles (with Add) sit on top of the two lists they count
   (with View All), in one card, instead of tiles plus two more bordered boxes repeating the same titles */
.mg-equip-block { border:1px solid var(--mg-line, rgba(0,150,255,0.15)); border-radius:14px; background:rgba(13,21,32,0.55); margin-bottom:16px; overflow:hidden; }
.mg-equip-block .mg-equip { margin:0; gap:0; }
.mg-equip-block .mg-equip-tile { border:0; border-radius:0; border-bottom:1px solid var(--mg-line, rgba(0,150,255,0.15)); }
.mg-equip-block .mg-equip-tile + .mg-equip-tile { border-left:1px solid var(--mg-line, rgba(0,150,255,0.15)); }
.mg-equip-block .sap-container { display:grid; grid-template-columns:1fr 1fr; gap:0; max-width:none; margin:0; padding:0; }
.mg-equip-block .sap-section { max-width:none; margin:0; padding:12px 18px 16px; border:0; border-radius:0; background:none; box-shadow:none; }
.mg-equip-block .sap-section + .sap-section { border-left:1px solid var(--mg-line, rgba(0,150,255,0.15)); }
.mg-equip-block .sap-title { display:none; }
.mg-equip-block .sap-header { justify-content:flex-end; margin-bottom:6px; }
@media (max-width:900px) { .mg-equip-block .sap-container, .mg-equip-block .mg-equip { grid-template-columns:1fr; } .mg-equip-block .sap-section + .sap-section, .mg-equip-block .mg-equip-tile + .mg-equip-tile { border-left:0; } }
