/* Magic on bearcosuite.com (2026-11-07) - same look as Magic on Riser: dark, green accents, mono numbers. */
:root { --bg: #0a0e0f; --panel: #10171a; --card: #141c1f; --border: #1f2a2c; --text: #EEF5F2; --dim: #8FA39D; --green: #39FF88;
  --red: #FF5C5C; --orange: #FFA630; --blue: #3DA9FF; --newbg: #3A3300; --newfg: #FFE14D;
  --mono: ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif; }
button { font: inherit; }
.mg-top { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--panel); }
.mg-logo { font: 800 26px/1 var(--mono); letter-spacing: 4px; color: var(--green); }
.mg-sub { color: var(--dim); margin-left: 10px; font-size: 12px; }
.mg-pills { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.mg-pill { font: 12px var(--mono); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; color: var(--green); }
.mg-pill.warn { color: var(--orange); } .mg-pill.bad { color: var(--red); }
.mg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mg-btn { background: #121a1c; color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.mg-btn:hover { border-color: var(--green); }
.mg-btn.primary { background: var(--green); color: #04130a; border-color: var(--green); font-weight: 700; }
.mg-btn.danger { color: var(--red); border-color: #5a2020; }
.mg-btn.tiny { padding: 2px 8px; font-size: 12px; }
.mg-btn:disabled { opacity: .5; cursor: default; }
.mg-banner { margin: 10px 16px 0; padding: 8px 12px; border-radius: 6px; background: #2a1d05; color: var(--orange); border: 1px solid #4a3510; }
.mg-banner.ok { background: #062314; color: var(--green); border-color: #0f4a2a; }
.mg-tabs { display: flex; gap: 2px; padding: 10px 16px 0; overflow-x: auto; }
.mg-tabs button { background: transparent; border: 1px solid var(--border); border-bottom: none; color: var(--dim); padding: 7px 14px; border-radius: 6px 6px 0 0; cursor: pointer; white-space: nowrap; }
.mg-tabs button.on { color: var(--green); background: var(--panel); }
main { margin: 0 16px 24px; border: 1px solid var(--border); background: var(--panel); border-radius: 0 6px 6px 6px; padding: 10px; min-height: 300px; }
.mg-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; color: var(--dim); }
.mg-bar select, .mg-bar input { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; }
.mg-scroll { overflow-x: auto; }
table.mg { border-collapse: collapse; width: 100%; font-size: 13px; }
table.mg th { text-align: left; color: var(--green); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
table.mg td { padding: 6px 8px; border-bottom: 1px solid #172124; white-space: nowrap; }
table.mg td.num { text-align: right; font-family: var(--mono); }
table.mg td.wrap { white-space: normal; min-width: 220px; }
table.mg tr.new td { background: var(--newbg); }
table.mg tr.new td.hl { color: var(--newfg); font-weight: 600; }
table.mg tr.dim td { color: var(--dim); }
.up { color: var(--green); } .down { color: var(--red); } .warn { color: var(--orange); } .blue { color: var(--blue); } .dimt { color: var(--dim); }
a.tok { color: var(--blue); text-decoration: underline; cursor: pointer; }
.mono { font-family: var(--mono); }
.mg-empty { color: var(--dim); padding: 30px; text-align: center; }
.mg-dlg { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px; width: min(640px, 94vw); padding: 0; }
.mg-dlg::backdrop { background: rgba(0,0,0,.6); }
.mg-dlg form { padding: 16px; display: grid; gap: 10px; }
.mg-dlg h3 { margin: 0; color: var(--green); }
.mg-dlg label { display: grid; grid-template-columns: 170px 1fr; gap: 8px; align-items: center; color: var(--dim); }
.mg-dlg input, .mg-dlg select, .mg-dlg textarea { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; width: 100%; font: inherit; }
.mg-dlg .row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.mg-dlg .note { color: var(--dim); font-size: 12px; }
.mg-dlg .err { color: var(--red); }
.mg-fund { font: 15px var(--mono); background: var(--card); border: 1px solid var(--border); padding: 8px; border-radius: 6px; word-break: break-all; }
@media (max-width: 600px) { .mg-dlg label { grid-template-columns: 1fr; } }

a.mg-btn { text-decoration: none; display: inline-block; }
/* 2026-11-07 additions: chart window, sortable headers, icons, wide dialogs */
table.mg th { cursor: pointer; user-select: none; }
table.mg th.sorted::after { content: ' ▾'; color: var(--dim); }
table.mg th.sorted.asc::after { content: ' ▴'; }
img.ic { width: 18px; height: 18px; border-radius: 50%; vertical-align: -4px; margin-right: 6px; background: #1b2427; object-fit: cover; }
.mg-dlg.mg-chart { width: min(1300px, 97vw); height: 92vh; }
.mg-dlg.wide { width: min(1000px, 96vw); }
#chartBox { display: grid; grid-template-rows: auto auto 1fr auto; height: 100%; padding: 12px; gap: 6px; }
#chartBox iframe { width: 100%; height: 100%; border: 0; border-radius: 6px; background: #0a0e0f; min-height: 300px; }
.mg-chart .tbl { max-height: 22vh; overflow: auto; }
.mg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.mg-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.mg-card b { display: block; font: 700 20px var(--mono); margin-top: 4px; }
.mg-card span { color: var(--dim); font-size: 12px; }
#eqChart { height: 300px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 12px; }
h4.mg-h { margin: 14px 0 6px; color: var(--green); }
#addrPanel { margin: 0 16px 24px; }
[hidden] { display: none !important; }

/* 2026-11-09 TOTAL rows */
table.mg tfoot td { font-weight: 600; border-top: 2px solid var(--border); border-bottom: none; background: var(--card); }

/* 2026-11-09: the sell box names its token big, so a mis-click is caught before OK */
.mg-sellname { font-size: 1.35em; color: var(--accent, #F5B83D); }

/* 2026-11-09 (Jeff: "make the column labels stay at top of screen when i scroll down"): each table scrolls in its own box,
   at most a screen tall, so its title row sticks at the top and the TOTAL row at the bottom */
.mg-scroll { overflow: auto; max-height: calc(100vh - 170px); }
table.mg th { z-index: 2; box-shadow: 0 1px 0 var(--border); }
table.mg tfoot td { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 -1px 0 var(--border); }

/* 2026-11-09: write-down-your-seed step after a bot is made */
.mg-seeds { display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.mg-seed { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.mg-seedv { font-size: 15px; letter-spacing: .04em; color: var(--accent, #F5B83D); word-break: break-all; margin-top: 4px; user-select: all; }

/* 2026-11-10: a sideways scrollbar on top of every wide table (the table's own one sits at the bottom of its box) */
.mg-hbar { overflow-x: auto; overflow-y: hidden; height: 16px; margin-bottom: 2px; }
.mg-hbar > div { height: 1px; }
.mg-hbar::-webkit-scrollbar { height: 12px; }
.mg-hbar::-webkit-scrollbar-track { background: var(--panel); border-radius: 6px; }
.mg-hbar::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 6px; }
.mg-hbar::-webkit-scrollbar-thumb:hover { background: var(--green); }
.mg-scroll::-webkit-scrollbar { height: 12px; width: 10px; }
.mg-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
/* 2026-11-11: chart window view switch (All bots / This position) */
.mg-seg { display: inline-flex; gap: 0; }
.mg-seg .mg-btn { border-radius: 0; }
.mg-seg .mg-btn:first-child { border-radius: 6px 0 0 6px; }
.mg-seg .mg-btn:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.mg-seg .mg-btn.on { background: var(--green); color: #06120c; border-color: var(--green); }

/* 2026-11-11: one bot's own window (/magic/?bot=<id>): only Positions / Trades / Orders */
.mg-solohead { display: none; }
.mg-solo .mg-solohead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 10px 16px 0; font-size: 14px; }
.mg-solo .mg-actions, .mg-solo .mg-brand .mg-sub { display: none; }
.mg-solo #tabs button[data-t]:not([data-t="positions"]):not([data-t="trades"]):not([data-t="orders"]) { display: none; }

/* SwarmBots for everyone (2026-11-12): the simplified page */
.mg-simple #bRun, .mg-simple #bBatch, .mg-simple #bOrders, .mg-simple #bRapid, .mg-simple #bR5, .mg-simple #bR6,
.mg-simple #tabs [data-t="picks"], .mg-simple #tabs [data-t="blocked"], .mg-simple #tabs [data-t="reports"], .mg-simple #tabs [data-t="study"], .mg-simple #tabs [data-t="addresses"],
.mg-simple [data-edit], .mg-simple #soloEdit, .mg-simple [data-block] { display: none !important; }
.mg-styles { display: grid; gap: 8px; margin: 10px 0; }
.mg-style { display: grid !important; grid-template-columns: 22px 1fr !important; gap: 2px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line, #2a3330); border-radius: 10px; cursor: pointer; }
.mg-style input { grid-row: span 2; margin-top: 3px; width: auto !important; }
.mg-style span { grid-column: 2; color: var(--dim); font-size: 13px; }
.mg-style:has(input:checked) { border-color: var(--accent, #39FF88); }
#bRestore { display: none; } .mg-simple #bRestore { display: inline-block; }
#bPasskey { display: none; } .mg-simple #bPasskey { display: inline-block; }

/* SwarmBot device guide (2026-11-12) */
.mg-guide { display: none; margin: 10px 16px; padding: 10px 14px; border: 1px solid var(--line, #2a3330); border-radius: 10px; font-size: 13px; }
.mg-simple .mg-guide { display: block; }
.mg-guide summary { cursor: pointer; }
.mg-guide ol { margin: 6px 0 6px 18px; padding: 0; } .mg-guide li { margin: 3px 0; }
.mg-dgtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.mg-dgtabs button { background: transparent; color: inherit; border: 1px solid var(--line, #2a3330); border-radius: 6px; padding: 4px 10px; cursor: pointer; font: inherit; }
.mg-dgtabs button.on { border-color: var(--accent, #39FF88); color: var(--accent, #39FF88); }

/* 2026-11-13: the bot picture dialog */
.pic-row { display: flex; gap: 22px; margin: 10px 0 6px; }
.pic-row figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pic-row figcaption { font-size: 11px; opacity: .7; }
.pic-img, .pic-none { width: 96px; height: 96px; border-radius: 50%; background: #1A130B; object-fit: cover; }
.pic-none { display: flex; align-items: center; justify-content: center; font-size: 12px; opacity: .6; border: 1px dashed currentColor; box-sizing: border-box; }
.pic-none[hidden], .pic-img[hidden] { display: none; }
.pic-acts { align-items: center; gap: 10px; }
/* 2026-11-13: on the SwarmBot page a bot's buttons sit under its name (no scrolling sideways to find them) */
.mg-under { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-width: 520px; white-space: normal; }

/* 2026-11-13: 'More styles coming soon' under the SwarmBot styles */
.mg-soon { opacity: .6; border-style: dashed !important; cursor: default; }
.mg-soon b { grid-column: 2; }

/* 2026-11-13: Quiet receipts box on the SwarmBot page */
.mg-quietbox p { margin: 8px 0; } .mg-quietbox ul { margin: 6px 0 4px; padding-left: 20px; } .mg-quiet { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; cursor: pointer; }
.mg-quiet input { width: auto !important; }

.mg-pillbtn { cursor: pointer; font: inherit; background: transparent; } .mg-pillbtn:hover { border-color: currentColor; }

/* 2026-11-13: SwarmBot fund box - just the QR, the address and Copy */
.mg-fundqr { background: #fff; padding: 8px; border-radius: 10px; width: 220px; height: 220px; margin: 8px auto; } .mg-fundqr svg { width: 100%; height: 100%; display: block; }

/* 2026-11-13: Show passphrases switch under passphrase boxes */
.mg-showpass { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-size: 13px; margin-top: -2px; cursor: pointer; }
.mg-showpass input { width: auto !important; }

/* 2026-11-13: 'allow notifications' alert in Make your SwarmBot */
.mg-notif { border: 1px solid #F5B83D; background: rgba(245,184,61,.10); border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px; font-size: 14px; line-height: 1.45; }
.mg-notif.ok { border-color: #2EBD85; background: rgba(46,189,133,.08); }
.mg-notif.bad { border-color: #F6465D; background: rgba(246,70,93,.10); }

/* 2026-11-13: SwarmBot health (owner only) */
.mg-simple #bHealth { display: none !important; }
.mg-simple #bHot, .mg-simple #bFleet { display: none !important; }   /* 2026-11-16 Hotpicks (owner only) */
.mg-hot { border: 1px solid rgba(127,127,127,.25); border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.mg-hot-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mg-hot-h .mg-btn { margin-left: auto; padding: 2px 10px; }
.mg-hot-b { margin-top: 4px; font-weight: 600; }
.mg-hot .bad { color: #F6465D; } .mg-hot .ok { color: var(--green); font-weight: 700; } .mg-hot .bad:first-of-type { margin-top: 4px; }
.mg-hot-sug { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.mg-hot-sug .mg-btn { text-align: left; }
.mg-health td, .mg-health th { padding: 5px 8px; font-size: 12.5px; white-space: nowrap; } .mg-health .bad { color: #F6465D; font-weight: 700; } .mg-health .ok { color: #2EBD85; }

/* 2026-11-13: background signing off on the SwarmBot page */
.mg-pillgo { color: #0F1211 !important; background: #F5B83D !important; border-color: #F5B83D !important; font-weight: 700; }
.mg-bgwarn { display: block; border: 1px solid #F5B83D; background: rgba(245,184,61,.12); padding: 10px 14px; border-radius: 10px; margin: 10px 16px; } .mg-bgwarn .mg-btn { margin: 0 8px; }

/* 2026-11-14: SwarmBot "GOOD TO GO" checklist */
#readyBox { margin: 10px 16px 0; display: grid; gap: 10px; }
.mg-ready { border-radius: 10px; padding: 12px 16px; border: 1.5px solid #4a3510; background: #1c1405; }
.mg-ready.go { border-color: #1f8a4c; background: linear-gradient(135deg, #062314, #0a1a10); box-shadow: 0 0 22px rgba(57,255,136,.12); }
.mg-ready-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.mg-ready-big { font-size: 26px; font-weight: 900; letter-spacing: .08em; color: var(--orange); }
.mg-ready.go .mg-ready-big { color: var(--green); text-shadow: 0 0 14px rgba(57,255,136,.45); }
.mg-ready-name { font-size: 14px; color: #d8dcd6; }
.mg-ready ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 18px; }
.mg-ready li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c9d2cc; min-height: 30px; }
.mg-ready li i { font-style: normal; width: 20px; text-align: center; }
.mg-ready li.bad span { color: #ff8a7a; } .mg-ready li.warn span { color: var(--orange); } .mg-ready li.wait span { color: #a8b3ad; }
.mg-ready li .mg-btn { padding: 3px 10px; font-size: 12px; margin-left: auto; }
@media (max-width: 600px) { .mg-ready-big { font-size: 22px; } .mg-ready ul { grid-template-columns: 1fr; } }

/* 2026-11-15: SwarmBot buy-size slider */
.mg-size { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; padding: 8px 10px; border: 1px solid rgba(245,184,61,.35); border-radius: 8px; background: rgba(245,184,61,.05); }
.mg-size label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mg-size input[type=range] { width: 180px; accent-color: #F5B83D; }
.mg-size output { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; color: #F5B83D; }
.mg-size small { flex: 1 1 100%; font-size: 11px; opacity: .7; white-space: normal; }
/* 2026-11-17 show my seed: drawn on a canvas, nothing to select or copy */
.mg-seedwarn { border-left: 3px solid var(--red); padding-left: 10px; }
.mg-seedshow { margin-top: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mg-seedshow canvas { border: 1px solid var(--border); border-radius: 8px; pointer-events: none; }
.mg-seedtimer { font: 12px var(--mono); color: var(--orange); }
.mg-noshot { display: block; color: var(--red); font-weight: 800; letter-spacing: .02em; }
.mg-seedshow .mg-noshot { font-size: 14px; }
