/* Boston Made Shell — one shell, twelve tribes. Dark glass on every theme; the tribe only changes --bm-accent. */
:root {
  --bm-accent: #D9B76A;
  --bm-ink: #0b0c10;
  --bm-ink-2: #12141a;
  --bm-line: rgba(255, 255, 255, .12);
  --bm-text: #f3f4f6;
  --bm-muted: #a2a7b3;
  --bm-font: Inter, "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bm-radius: 14px;
  --bm-bar-h: 40px;
  --bm-dock-h: 64px;
  --bm-glass: linear-gradient(180deg, rgba(26, 29, 37, .82) 0%, rgba(7, 8, 12, .92) 100%);
  --bm-shadow: 0 18px 44px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08) inset;
}

/* ---------- reset inside the shell only ---------- */
#bm-bar, #bm-bar *, #bm-universe, #bm-universe *, #bms-dock, #bms-dock *, #bms-sheet, #bms-sheet * {
  box-sizing: border-box;
  font-family: var(--bm-font);
  letter-spacing: 0;
  text-transform: none;
}
#bm-bar a, #bm-universe a, #bms-dock a, #bms-sheet a, .bm-btn, .bm-invest { text-decoration: none !important; }
#bm-bar img, #bm-universe img, #bms-sheet img { max-width: none; border: 0; box-shadow: none; margin: 0; display: block; }
.bm-i { flex: none; }

/* ---------- buttons ---------- */
.bm-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--bm-line);
  background: rgba(255, 255, 255, .06); color: var(--bm-text) !important;
  font: 600 14px/1 var(--bm-font); cursor: pointer; white-space: nowrap;
  transition: background .2s, transform .2s, border-color .2s;
}
.bm-btn:hover { background: rgba(255, 255, 255, .11); transform: translateY(-1px); }
.bm-btn-accent { background: var(--bm-accent); border-color: var(--bm-accent); color: #0b0c10 !important; }
.bm-btn-accent:hover { background: var(--bm-accent); filter: brightness(1.08); }
.bm-btn-ghost { background: transparent; }
.bm-btn-lg { padding: 13px 22px; font-size: 15px; }

/* ---------- network bar (static, scrolls away: it never adds to the fixed-chrome budget) ---------- */
#bm-bar {
  position: relative; z-index: 9000; width: 100%;
  background: var(--bm-ink); color: var(--bm-text);
  border-bottom: 1px solid var(--bm-line);
  font-size: 13px; line-height: 1;
}
.bm-bar-in {
  max-width: 1280px; margin: 0 auto; padding: 0 16px; height: var(--bm-bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.bm-bar-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--bm-text) !important; font-weight: 600; min-width: 0; }
.bm-bar-brand img { width: 18px; height: 18px; border-radius: 5px; }
.bm-bar-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-bar-right { display: flex; align-items: center; gap: 4px; flex: none; }
.bm-bar-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; color: var(--bm-muted) !important;
  font: 600 12.5px/1 var(--bm-font); cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.bm-bar-btn:hover, .bm-bar-btn[aria-expanded="true"] { color: var(--bm-text) !important; background: rgba(255, 255, 255, .08); border-color: var(--bm-line); }
.bm-bar-invest { color: #0b0c10 !important; background: var(--bm-accent); border-color: var(--bm-accent); }
.bm-bar-invest:hover { color: #0b0c10 !important; background: var(--bm-accent); filter: brightness(1.08); }
#bm-bar.bm-quiet { background: #0b0c10; }
#bm-bar.bm-quiet .bm-bar-brand { font-weight: 500; color: var(--bm-muted) !important; }

/* tribes panel (drops under the bar) */
.bm-panel {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 9001;
  background: var(--bm-ink-2); color: var(--bm-text);
  border-bottom: 1px solid var(--bm-line); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8);
}
.bm-panel[hidden], .bms-sheet[hidden] { display: none !important; }
.bm-panel-in { max-width: 1280px; margin: 0 auto; padding: 16px 16px 20px; }
.bm-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 15px; }
.bm-x { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--bm-line); background: transparent; color: var(--bm-text); font-size: 20px; line-height: 1; cursor: pointer; }
.bm-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--bm-line); }
.bm-menu { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.bm-menu a { color: var(--bm-muted) !important; font: 600 13px/1.6 var(--bm-font); }
.bm-menu a:hover { color: var(--bm-text) !important; }
.bm-menu-col { flex-direction: column; gap: 2px; }
.bm-menu-col a { font-size: 15px; padding: 6px 0; }

/* ---------- tribe grid (shared by panel, footer, sheet, [bm_tribes]) ---------- */
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }
.bm-grid-intro { color: var(--bm-muted); font-size: 15px; line-height: 1.5; max-width: 720px; margin: 0 0 14px; }
.bm-tribe {
  --c: var(--bm-accent);
  display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start;
  padding: 12px; border-radius: var(--bm-radius); border: 1px solid var(--bm-line);
  background: rgba(255, 255, 255, .035); color: var(--bm-text) !important;
  transition: border-color .2s, background .2s, transform .2s;
}
.bm-tribe:hover { border-color: var(--c); background: rgba(255, 255, 255, .06); transform: translateY(-2px); }
.bm-tribe.is-current { border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.bm-tribe-ic { position: relative; width: 40px; height: 40px; border-radius: 11px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(150deg, var(--c), #0e0e16); box-shadow: 0 0 0 1px rgba(255, 255, 255, .14) inset; }
.bm-tribe-ic i { position: absolute; inset: 0; display: grid; place-items: center; font: 800 17px/1 var(--bm-font); font-style: normal; color: #fff; }
.bm-tribe-ic img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; background: linear-gradient(150deg, #1d1d29, #07070c); }
.bm-tribe-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bm-tribe-txt strong { font-size: 14px; line-height: 1.25; font-weight: 700; }
.bm-tribe-txt small { font-size: 12.5px; line-height: 1.4; color: var(--bm-muted); }
.bm-tribe-txt em { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.bm-grid-compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.bm-grid-compact .bm-tribe { grid-template-columns: 32px 1fr; padding: 10px; }
.bm-grid-compact .bm-tribe-ic { width: 32px; height: 32px; border-radius: 9px; }
.bm-grid-compact .bm-tribe-txt small { display: none; }

/* ---------- footer universe (sits above the theme footer; JS moves it there) ---------- */
#bm-universe { background: #07080c; color: var(--bm-text); border-top: 1px solid var(--bm-line); }
.bm-universe-in { max-width: 1280px; margin: 0 auto; padding: 56px 16px 40px; }
.bm-universe-head { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; margin-bottom: 22px; }
.bm-universe-head img { width: 36px; height: 36px; border-radius: 9px; }
#bm-universe h2 { margin: 0 0 6px; font: 800 24px/1.15 var(--bm-font); color: var(--bm-text); letter-spacing: -.01em; }
.bm-universe-head p { margin: 0; color: var(--bm-muted); font-size: 15px; line-height: 1.5; max-width: 720px; }
.bm-universe-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.bm-universe-legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--bm-line); color: var(--bm-muted); font-size: 12.5px; line-height: 1.55; }
.bm-universe-legal p { margin: 0 0 8px; }
.bm-universe-legal strong { color: var(--bm-text); }
.bm-universe-links a { color: var(--bm-text) !important; }
.bm-ver { opacity: .55; }

/* ---------- dock (the only fixed element the shell adds; 64px, full mode only) ---------- */
body.bm-has-dock { padding-bottom: calc(var(--bm-dock-h) + 24px + env(safe-area-inset-bottom)); }
#bms-dock {
  position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9002;
  display: flex; align-items: stretch; gap: 2px; height: var(--bm-dock-h); padding: 6px;
  border-radius: 24px; background: var(--bm-glass); box-shadow: var(--bm-shadow);
  -webkit-backdrop-filter: blur(26px) saturate(1.8); backdrop-filter: blur(26px) saturate(1.8);
  max-width: calc(100vw - 20px);
}
.bms-dock-it {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 64px; padding: 0 10px; border-radius: 18px; border: 0; background: transparent;
  color: var(--bm-muted) !important; font: 600 10.5px/1 var(--bm-font); cursor: pointer; transition: color .15s, background .15s;
}
.bms-dock-it:hover, .bms-dock-it[aria-expanded="true"] { color: var(--bm-text) !important; background: rgba(255, 255, 255, .08); }
.bms-dock-it.is-accent { color: var(--bm-accent) !important; }
.bms-dock-it .bm-i { width: 20px; height: 20px; }

/* "More" sheet */
.bms-sheet { position: fixed; inset: 0; z-index: 9003; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.bms-sheet-in {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(760px, 100%); max-height: 86vh; overflow: auto;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0;
  background: var(--bm-ink-2); color: var(--bm-text); box-shadow: 0 -20px 60px rgba(0, 0, 0, .6);
}
.bms-sheet-acct { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .bm-bar-btn span { display: none; }
  .bm-bar-invest span { display: inline; }
  .bm-bar-btn { padding: 0 8px; }
  .bm-universe-in { padding: 40px 16px 28px; }
  #bm-universe h2 { font-size: 21px; }
  .bm-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bm-tribe { grid-template-columns: 32px 1fr; padding: 10px; }
  .bm-tribe-ic { width: 32px; height: 32px; border-radius: 9px; }
  .bm-tribe-txt small { display: none; }
  .bm-panel-in { max-height: calc(100vh - var(--bm-bar-h)); overflow: auto; }
}
@media (max-width: 420px) {
  .bm-bar-brand span { font-size: 12px; }
  .bms-dock-it { min-width: 56px; padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .bm-btn, .bm-tribe, .bm-bar-btn, .bms-dock-it { transition: none; }
  .bm-btn:hover, .bm-tribe:hover { transform: none; }
}
@media print {
  #bm-bar, #bms-dock, #bms-sheet { display: none !important; }
  body.bm-has-dock { padding-bottom: 0; }
}
