:root {
  --bg: #f7f8f9;
  --surface: #ffffff;
  --border: #e6e8eb;
  --border-strong: #d9dce0;
  --text: #1f2328;
  --text-muted: #5f6670;
  --text-faint: #8a9099;
  --accent: #0f8a8a;
  --accent-soft: #e8f4f4;
  --info-bg: #e9f8fb;
  --hover: #f1f3f5;
  --chart-bar: #d4d7dc;
  --chart-grid: #e3e5e8;
  --radius: 8px;
  --sidebar-w: 300px;
  --topbar-h: 72px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }

html, body { margin: 0; }
body { min-height: 100vh; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- Top bar ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 20px; }
.brand-mark { width: 30px; height: auto; display: block; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.org-switch { background: none; border: 0; font-size: 16px; padding: 6px 4px; }
.icon-btn {
  background: none; border: 0; width: 28px; height: 28px; padding: 4px;
  color: var(--text-muted); border-radius: 6px;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn svg { width: 100%; height: 100%; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #f1f3f5; display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
}

/* ---------- Shell ---------- */
.shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 14px 14px 20px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: var(--surface);
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 10px 8px; margin: 2px 0;
  border: 0; background: none; border-radius: 6px;
  font-size: 16px; text-align: left;
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--hover); color: var(--accent); }
.nav-item .icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--text-muted); }
.nav-item.active .icon { color: var(--accent); }
.nav-item .chevron { margin-left: auto; width: 18px; height: 18px; transition: transform .15s; }
.nav-group.collapsed .chevron { transform: rotate(180deg); }
.nav-group.collapsed .subnav { display: none; }
.subnav { list-style: none; margin: 4px 0 6px; padding: 0; }
.subnav .nav-item { padding: 10px 8px 10px 42px; }
.nav-footer { margin-top: auto; }

.content {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  padding: 28px 18px 40px;
}
.page-title { font-size: 24px; font-weight: 600; margin: 0 0 20px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 22px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title { font-size: 20px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 10px; }
.card-title .icon { width: 28px; height: 28px; }
.card-actions { margin-left: auto; display: flex; gap: 10px; }
.section-title { font-size: 20px; font-weight: 600; margin: 0; }
.subtle { color: var(--text-muted); }
.hint { color: var(--text-muted); font-size: 15px; display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.hint svg { width: 14px; height: 14px; }

.btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 13px;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.btn:hover { background: var(--hover); }
.btn-icon { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: var(--text-faint); }
.btn-icon svg { width: 16px; height: 16px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.stack > * + * { margin-top: 18px; }

.notice {
  background: var(--info-bg);
  border-radius: 6px;
  padding: 18px;
  color: #2b6874;
}
.event-name { font-size: 17px; color: var(--text-muted); margin: 0 0 12px; }
.meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--hover); border-radius: 4px; padding: 4px 10px;
  font-size: 15px; color: var(--text);
}
.pill svg { width: 14px; height: 14px; }

/* ---------- News carousel ---------- */
.carousel { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; scroll-behavior: smooth; }
.news-card {
  flex: 0 0 calc((100% - 36px) / 3.2);
  min-width: 300px;
  scroll-snap-align: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  display: flex; flex-direction: column;
}
.news-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.news-thumb.t1 { background: #fff7f8; color: #c0264f; font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: clamp(18px, 2.1vw, 34px); line-height: 1.15; justify-content: flex-start; }
.news-thumb.t2 { background: linear-gradient(180deg, #eef8ee 0 62%, #fff 62%); color: #333; flex-direction: column; align-items: stretch; font-size: 12px; }
.news-thumb.t3 { background: linear-gradient(135deg, #c9b79c, #8c7a62 60%, #5f5446); }
.speakers { display: flex; justify-content: center; gap: 18px; }
.speaker { width: 70px; height: 70px; border-radius: 10px; background: #cfd8dc; border: 2px solid #4b5563; }
.speaker.mod { border-color: #db2777; }
.news-title { font-size: 19px; font-weight: 600; line-height: 1.45; margin: 0 0 14px; }
.news-desc {
  color: var(--text-muted); line-height: 1.55; margin: 0 0 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card .btn { align-self: flex-start; margin-top: auto; padding: 9px 22px; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 280px; margin-top: 18px; }
.chart text { font-size: 13px; fill: var(--text-muted); font-family: inherit; }
.chart .grid { stroke: var(--chart-grid); stroke-dasharray: 3 3; }
.chart .bar { fill: var(--chart-bar); }
.chart .bar:hover { fill: #b8bcc3; }

/* ---------- Placeholder pages ---------- */
.empty {
  text-align: center; padding: 64px 24px; color: var(--text-muted);
}
.empty h2 { color: var(--text); font-size: 20px; margin: 0 0 8px; }

/* ---------- Peer Monitoring ---------- */
:root {
  --up: #12805c;
  --up-bg: #e7f5ef;
  --down: #c2312f;
  --down-bg: #fcebea;
  --buy: #2f9e6f;
  --hold: #c4c9cf;
  --sell: #d9534f;
}
.up { color: var(--up); }
.down { color: var(--down); }
.small { font-size: 13px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .page-title { margin: 0; }
.crumb { color: var(--text-muted); font-size: 13px; margin-bottom: 4px; }
.page-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.seg-control { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 3px; box-shadow: var(--shadow); }
.seg-control button { border: 0; background: none; padding: 6px 12px; border-radius: 4px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.seg-control button.on { background: var(--accent-soft); color: var(--accent); }

.pm-scroll { overflow-x: auto; padding-bottom: 8px; }
.pm-sentinel { height: 1px; margin-bottom: -1px; }
.pm-sticky {
  position: sticky; top: var(--topbar-h); z-index: 5;
  overflow: hidden; background: var(--bg);
}
.pm-sticky.stuck {
  background: var(--surface);
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 6px 10px -8px rgba(16, 24, 40, .25);
}
.pm-sticky .pm-grid { min-width: min-content; }
.pm-id { min-width: 0; }

/* Compact header once pinned */
.pm-sticky.stuck .pm-top { padding: 9px 14px; border-top-width: 1px; border-bottom: 1px solid var(--border); border-radius: var(--radius); }
.pm-sticky.stuck .pm-top.is-client { border-width: 2px; border-color: var(--accent); }
.pm-sticky.stuck .pm-head { display: flex; align-items: center; gap: 10px; text-align: left; }
.pm-sticky.stuck .pm-logo { width: 34px; height: 34px; font-size: 13px; border-radius: 8px; margin: 0; flex-shrink: 0; }
.pm-sticky.stuck .pm-ticker { font-size: 18px; }
.pm-sticky.stuck .pm-exchange { display: inline; margin: 0 0 0 6px; font-size: 11px; }
.pm-sticky.stuck .pm-ticker, .pm-sticky.stuck .pm-exchange { vertical-align: baseline; }
.pm-sticky.stuck .pm-id > .pm-ticker { display: inline; }
.pm-sticky.stuck .pm-name { font-size: 12px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-sticky.stuck .pm-id { flex: 1; }
.pm-sticky.stuck .pm-id > .pm-ticker, .pm-sticky.stuck .pm-exchange { white-space: nowrap; }
.pm-grid { display: grid; column-gap: 14px; min-width: min-content; }
.pm-cell {
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
  padding: 16px 18px 18px;
  min-width: 0;
}
.pm-top { border-radius: var(--radius) var(--radius) 0 0; border-top: 3px solid var(--border-strong); padding-top: 18px; }
.pm-bottom { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.pm-cell.is-client { background: #fbfefe; border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.pm-top.is-client { border-top-color: var(--accent); }
.pm-bottom.is-client { border-bottom: 2px solid var(--accent); }

.pm-head { position: relative; text-align: center; }
.pm-menu-btn {
  position: absolute; top: -8px; right: -10px;
  width: 30px; height: 30px; padding: 6px; border: 0; border-radius: 6px;
  background: none; color: var(--text-faint);
}
.pm-menu-btn svg { width: 100%; height: 100%; fill: currentColor; }
.pm-menu-btn:hover, .pm-menu-btn[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.pm-sticky.stuck .pm-menu-btn { top: 50%; right: -8px; transform: translateY(-50%); }
.pm-sticky.stuck .pm-head { padding-right: 22px; }

.popover {
  position: fixed; z-index: 50; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .14); padding: 6px;
}
.popover button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 10px; border-radius: 5px; font-size: 14px;
}
.popover button:hover:not([disabled]), .popover button:focus-visible { background: var(--hover); outline: none; }
.popover button[disabled] { color: var(--text-faint); cursor: default; }
.popover button.danger { color: var(--down); }
.popover hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

.btn-sm { padding: 6px 12px; font-size: 13px; font-weight: 500; }
.btn-ghost { background: none; box-shadow: none; border-color: transparent; color: var(--accent); }
.btn[disabled] { opacity: .5; cursor: default; }

.picker {
  border: 0; border-radius: 10px; padding: 0; width: min(440px, calc(100vw - 32px));
  box-shadow: 0 20px 48px rgba(16, 24, 40, .25); color: var(--text);
}
.picker::backdrop { background: rgba(16, 24, 40, .35); }
.picker form { padding: 20px; }
.picker h2 { margin: 0 0 12px; font-size: 18px; }
.picker input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 6px; font: inherit;
}
.picker input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.picker-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 340px; overflow-y: auto; }
.picker-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; background: none; padding: 8px; border-radius: 6px;
}
.picker-list button:hover { background: var(--hover); }
.picker-list .tag { margin-left: auto; }
.pm-logo.xs { width: 32px; height: 32px; font-size: 12px; border-radius: 8px; margin: 0; flex-shrink: 0; }
.picker-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.stub-note { margin: 0; }
.pm-logo {
  width: 52px; height: 52px; border-radius: 12px; margin: 0 auto 10px;
  display: grid; place-items: center; font-weight: 700; font-size: 20px; letter-spacing: -.02em;
}
.pm-logo { position: relative; overflow: hidden; }
.pm-logo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; padding: 7px; background: #fff;
}
.pm-logo:has(img) { box-shadow: inset 0 0 0 1px var(--border); }
.pm-logo:has(img) img { border-radius: inherit; box-shadow: inset 0 0 0 1px var(--border); }
.pm-logo.xs img { padding: 4px; }
.pm-sticky.stuck .pm-logo img { padding: 4px; }

.delay-note { font-size: 11px; color: var(--text-faint); margin: -8px 0 12px; }
.delay-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #7a5b00; background: #fff8e1; border: 1px solid #f3e1a6;
  border-radius: 999px; padding: 4px 10px;
}
.delay-badge svg { width: 13px; height: 13px; }

.pm-ticker { font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.pm-exchange { font-size: 12px; font-weight: 600; color: var(--accent); margin-top: 2px; letter-spacing: .03em; }
.pm-name { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.pm-section {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); margin: 0 0 12px;
}
.pm-price { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.pm-price.sm { font-size: 22px; }
.pm-change { font-size: 14px; font-weight: 600; margin: 2px 0 12px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 10px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

.range { margin-top: 14px; }
.range-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-faint); }
.range-label.strong { color: var(--text-muted); font-weight: 500; margin-top: 6px; }
.range-track { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #f3c4c2, #e3e5e8 50%, #bfe3d2); margin-top: 6px; }
.range-track.target { background: #e3e5e8; }
.range-dot, .range-mark { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.range-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); }
.range-mark { width: 4px; height: 16px; border-radius: 2px; }
.range-mark.current, .range-key i.current { background: var(--text); }
.range-mark.avg, .range-key i.avg { background: var(--accent); }
.range-key { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.range-key i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.chart-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.chip.up { background: var(--up-bg); color: var(--up); }
.chip.down { background: var(--down-bg); color: var(--down); }
.spark { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.spark-svg { width: 100%; height: 120px; display: block; overflow: visible; }
.spark-grid { stroke: var(--chart-grid); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.spark-line { fill: none; stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-svg.up .spark-line { stroke: var(--up); }
.spark-svg.down .spark-line { stroke: var(--down); }
.spark-svg.up .spark-area { fill: rgba(18, 128, 92, .08); }
.spark-svg.down .spark-area { fill: rgba(194, 49, 47, .07); }
.spark-cursor { stroke: var(--text-faint); vector-effect: non-scaling-stroke; }
.spark-y { order: 2; display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--text-faint); padding: 0 0 2px; }
.spark-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 6px; }
.spark-tip {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none;
}

.ratings-total { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.ratings-total strong { color: var(--text); font-size: 18px; }
.stack-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.seg.buy, .legend i.buy { background: var(--buy); }
.seg.hold, .legend i.hold { background: var(--hold); }
.seg.sell, .legend i.sell { background: var(--sell); }
.legend { list-style: none; padding: 0; margin: 10px 0 0; display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.legend b { color: var(--text); margin-left: 5px; }

.consensus-label { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.consensus-label.buy, .consensus-label.strong.buy { color: var(--up); }
.consensus-label.hold { color: #7a6b2e; }
.consensus-label.sell { color: var(--down); }

.earn-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 8px; }
.earn-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.earn-table th { font-weight: 500; color: var(--text-faint); text-align: right; padding: 0 0 6px; font-size: 12px; }
.earn-table td { padding: 6px 0; border-top: 1px solid var(--border); text-align: right; }
.earn-table td:first-child { text-align: left; color: var(--text-muted); }
.earn-table td:last-child { width: 48px; }

.call-bar {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin-top: 14px; padding: 8px 12px 8px 8px;
  background: var(--accent-soft); border: 1px solid #c9e6e6; border-radius: 8px; text-align: left;
}
.call-bar:hover { background: #dcefef; }
.call-play { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.call-play svg { width: 14px; height: 14px; }
.call-body { flex: 1; min-width: 0; }
.call-title { display: block; font-size: 13px; font-weight: 600; color: #0b6262; }
.call-progress { display: block; height: 4px; background: #c9e6e6; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.call-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.call-time { font-size: 12px; color: #0b6262; font-variant-numeric: tabular-nums; }
.call-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 13px; color: var(--accent); font-weight: 500; }
.call-link:hover { text-decoration: underline; }
.call-link svg { width: 14px; height: 14px; }

.pm-events, .feed { list-style: none; margin: 0; padding: 0; }
.pm-events li, .feed li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--border); }
.pm-events li:first-child, .feed li:first-child { border-top: 0; padding-top: 0; }
.feed li.col { flex-direction: column; gap: 6px; }
.date-badge {
  flex-shrink: 0; width: 44px; text-align: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.date-badge span { display: block; background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; text-transform: uppercase; padding: 2px 0; }
.date-badge strong { display: block; font-size: 16px; padding: 2px 0 3px; }
.ev-title, .feed-title { font-size: 14px; font-weight: 500; line-height: 1.35; }
.form-badge {
  flex-shrink: 0; min-width: 48px; text-align: center; font-size: 11px; font-weight: 700;
  background: var(--hover); border: 1px solid var(--border); border-radius: 4px; padding: 3px 6px; color: var(--text);
}
.sent-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--hold); }
.sent-dot.positive { background: var(--buy); }
.sent-dot.negative { background: var(--sell); }
.social-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 12px; background: var(--hover); border-radius: 999px; padding: 3px 9px; color: var(--text-muted); }
.odds { position: relative; height: 22px; background: var(--hover); border-radius: 4px; overflow: hidden; }
.odds-fill { position: absolute; inset: 0 auto 0 0; background: #cdeaea; }
.odds-label { position: relative; font-size: 12px; font-weight: 600; line-height: 22px; padding-left: 8px; color: #0b6262; }

/* Sub-rows continue the section above with a lighter dashed divider */
.pm-cell.is-sub { border-top: 1px dashed var(--border-strong); padding-top: 12px; }
.pm-cell.is-sub .pm-section { font-size: 11px; margin-bottom: 8px; }

/* Cells stack vertically so trailing elements (ranges, call bar) sit on a common baseline */
.pm-cell:not(.pm-top) { display: flex; flex-direction: column; }
.pm-cell .range { margin-top: auto; padding-top: 14px; }
.pm-cell .call-bar { margin-top: auto; }
.pm-cell .earn-table { margin-bottom: 14px; }
.ext {
  flex-shrink: 0; display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 5px; color: var(--text-faint);
}
.ext svg { width: 13px; height: 13px; }
.ext:hover, .ext:focus-visible { background: var(--accent-soft); color: var(--accent); }
.pm-section .ext { margin: -4px -4px -4px 0; }
.feed li .ext, .people li .ext, .pm-events li .ext { margin-left: auto; margin-top: -2px; }
.pred-head { display: flex; align-items: flex-start; gap: 8px; }
.pred-head .feed-title { flex: 1; }
a.tag:hover { background: var(--accent-soft); color: var(--accent); }

.pm-subhead {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); margin: 16px 0 8px; padding-top: 12px; border-top: 1px dashed var(--border-strong);
}
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; }
.people li > div { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-avatar {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: #e8edf3; color: #3b4a5c;
}
.person-avatar { position: relative; overflow: hidden; }
.person-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.person-avatar.yt { background: #fdecec; color: #b42318; }
.person-avatar.x { background: #eceff3; color: #1f2328; }
.person-avatar.outlet { border-radius: 7px; border: 1px solid var(--border); background: #fff; }
.person-avatar.outlet img { object-fit: contain; padding: 4px; }
.avatar-wrap { position: relative; flex-shrink: 0; width: 34px; height: 34px; }
.avatar-wrap .person-avatar { width: 34px; height: 34px; }
.platform-badge {
  position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center; font-size: 8px; line-height: 1; color: #fff; border: 2px solid #fff; box-sizing: content-box;
}
.platform-badge.yt { background: #ff0000; }
.platform-badge.x { background: #000; font-size: 9px; }

.token-summary { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.token-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.token-sym { font-size: 14px; font-weight: 600; min-width: 0; }
.token-price { font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }

.tenure {
  flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 8px;
}
.chip.neutral { background: var(--hover); color: var(--text-muted); }
.unconfirmed { font-style: italic; color: var(--text-faint); }
.note-warn { color: #8a5a00; margin-top: 2px; }
.insiders li { padding: 6px 0; }
.holding-bar { height: 5px; background: var(--hover); border-radius: 3px; margin: 5px 0 4px; overflow: hidden; }
.holding-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.as-of { margin-top: auto; padding-top: 8px; }

/* ---------- See more + side drawer ---------- */
.see-more {
  align-self: flex-start; margin-top: 12px; padding: 4px 0; border: 0; background: none;
  font-size: 13px; font-weight: 500; color: var(--accent);
}
.see-more:hover { text-decoration: underline; }
.pm-cell .see-more { margin-top: auto; padding-top: 12px; }
.pm-cell .range + .see-more, .pm-cell .call-link + .see-more { margin-top: 0; }

.drawer-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(16, 24, 40, .12); }
.drawer {
  position: fixed; z-index: 40; top: 0; right: 0; bottom: 0;
  width: min(480px, 100vw); background: var(--surface);
  box-shadow: -12px 0 32px rgba(16, 24, 40, .18); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; animation: drawer-in .18s ease-out;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 16px 20px 0; border-bottom: 1px solid var(--border); }
.drawer-title { display: flex; align-items: center; gap: 10px; }
.drawer-ticker { font-weight: 700; font-size: 18px; }
.drawer-close {
  margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none;
  font-size: 16px; color: var(--text-muted);
}
.drawer-close:hover { background: var(--hover); color: var(--text); }
.drawer-issuers { display: flex; gap: 4px; margin: 14px 0 0; overflow-x: auto; }
.drawer-issuers button {
  border: 0; background: none; padding: 7px 10px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
}
.drawer-issuers button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.drawer-nav { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.drawer-nav h2 { flex: 1; margin: 0; font-size: 16px; text-align: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; }
.drawer-body .feed li, .drawer-body .people li { padding: 9px 0; }
.drawer-sub {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--border);
}
.drawer-ranges { margin-bottom: 12px; }
.drawer-chart .spark-svg { height: 220px; }
.drawer-src { color: var(--accent); font-weight: 500; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.detail-table th { text-align: left; font-weight: 500; color: var(--text-muted); padding: 8px 10px 8px 0; vertical-align: top; }
.detail-table td { text-align: right; padding: 8px 0; font-variant-numeric: tabular-nums; vertical-align: top; }
.detail-table tr + tr th, .detail-table tr + tr td { border-top: 1px solid var(--border); }
.compare { list-style: none; margin: 0; padding: 0; }
.compare li { display: grid; grid-template-columns: 48px 1fr 72px; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.compare li.is-client .compare-t { color: var(--accent); }
.compare-t { font-weight: 600; }
.compare li:has(.compare-t.wide) { grid-template-columns: 90px 1fr 40px; }
.compare-bar { height: 8px; background: var(--hover); border-radius: 4px; overflow: hidden; }
.compare-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.compare-bar > span.neg { background: var(--sell); }
.compare-v { text-align: right; font-variant-numeric: tabular-nums; }
.bullets { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }
.legend.inline { display: flex; gap: 16px; margin: 0 0 12px; font-size: 13px; color: var(--text-muted); }
.legend.inline i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.xpost-head { display: flex; align-items: baseline; gap: 6px; }
.xpost-head .ext { margin-left: auto; }
.xpost-text { font-size: 13px; line-height: 1.45; }
.xpost-stats { display: flex; gap: 12px; }

/* ---------- Section groups ---------- */
.pm-band { padding: 26px 2px 10px; }
.pm-band h2 {
  margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); display: flex; align-items: center; gap: 12px;
}
.pm-band h2::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.pm-cell.group-first { border-top: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.pm-cell.group-last { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.pm-cell.group-first.group-last { border-radius: var(--radius); }
.pm-cell.is-client.group-first { border-top: 2px solid var(--accent); }
.pm-cell.is-client.group-last { border-bottom: 2px solid var(--accent); }
.pm-sticky:not(.stuck) .pm-top { border-bottom: 1px solid var(--border); border-radius: var(--radius); }
.pm-sticky:not(.stuck) .pm-top.is-client { border: 2px solid var(--accent); border-top-width: 3px; }
.cell-split { height: 1px; background: var(--border); margin: 14px 0; }
.drawer-group { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }

/* Rich media / journalist panels */
.topic { color: var(--accent); }
.story-summary { margin-top: 3px; color: var(--text); line-height: 1.45; }
.profiles { list-style: none; margin: 0; padding: 0; }
.profile { border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.profile + .profile { margin-top: 12px; }
.profile-head { display: flex; gap: 10px; align-items: center; }
.profile-why { margin: 10px 0 0; line-height: 1.45; }
.profile-sub { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin: 12px 0 4px; }
.profile-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 13px; }
.profile-links a { color: var(--accent); font-weight: 500; }

.footnote { font-size: 12px; color: var(--text-faint); line-height: 1.5; max-width: 1100px; margin: 14px 0 0; }
.feed li > div { flex: 1; min-width: 0; }
.feed-title .tag { font-size: 11px; padding: 1px 7px; vertical-align: 1px; }

/* ---------- Freshness tags, ranking, full-width cards ---------- */
.pm-section { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.as-of-tag { font-size: 10px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-faint); white-space: nowrap; }
.rank-badge { align-self: flex-start; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; margin: -4px 0 8px; }
.rank-badge.best { background: var(--up-bg); color: var(--up); }
.rank-badge.worst { background: var(--down-bg); color: var(--down); }
.pm-full {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.relperf { display: flex; flex-direction: column-reverse; gap: 10px; }
.relperf-svg { width: 100%; height: 260px; display: block; }
.relperf-plot { position: relative; }
.relperf-plot .axis-y { position: absolute; left: 0; width: 38px; text-align: right; transform: translateY(-50%); font-size: 11px; color: var(--text-faint); background: rgba(255,255,255,.85); padding-right: 2px; }
.relperf-plot .axis-x { position: absolute; bottom: 0; font-size: 11px; color: var(--text-faint); }
.relperf-plot .axis-x.end { right: 0; }
.relperf-legend { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.relperf-legend li { display: inline-flex; gap: 6px; align-items: center; }
.relperf-legend i { width: 14px; height: 3px; border-radius: 2px; }
.relperf-legend b { font-variant-numeric: tabular-nums; }

/* ---------- New section details ---------- */
.guidance { margin-top: 12px; }
.guide-row { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; }
.guide-row .chip { flex-shrink: 0; text-transform: capitalize; }
.bullets.small { font-size: 13px; }
.bullets.subtle { color: var(--text-muted); }
.activist { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--down); }
.cap-note { margin: 10px 0 0; line-height: 1.45; }
.rating-pill { display: inline-block; font-weight: 700; font-size: 12px; border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 6px; }

/* ---------- Toolbar, menus, dialogs ---------- */
.page-head .delay-badge { margin-top: 8px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #0b7373; }
.picker-foot { gap: 8px; }
.digest .field { display: block; margin: 12px 0 0; font-size: 13px; font-weight: 500; }
.digest .field select, .digest .field input[type="text"] { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 6px; font: inherit; font-weight: 400; }
.digest fieldset.field { border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.digest fieldset label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

/* ---------- Alerts ---------- */
.alerts-btn { position: relative; width: 34px; height: 34px; }
.alert-count {
  position: absolute; top: 0; right: -2px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--down); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}
.alerts { list-style: none; margin: 0; padding: 0; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0 9px 10px; border-left: 3px solid var(--border-strong); }
.alert + .alert { margin-top: 6px; }
.alert.pos { border-left-color: var(--buy); }
.alert.neg { border-left-color: var(--sell); }
.alert > div { flex: 1; min-width: 0; }
.alert-rules { padding: 10px 0 12px; font-size: 13px; }
.alert-rules summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 10px 0 6px; }
.rules label { display: flex; gap: 6px; align-items: center; }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-wide { grid-column: 1 / -1; }
.table-scroll { overflow-x: auto; }
.snapshot { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.snapshot th, .snapshot td { padding: 10px 12px; text-align: right; border-top: 1px solid var(--border); white-space: nowrap; }
.snapshot thead th { border-top: 0; font-size: 12px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.snapshot tbody th { text-align: left; font-weight: 400; }
.snapshot tr.is-client { background: #f3fafa; box-shadow: inset 3px 0 0 var(--accent); }
.snapshot td.best { font-weight: 700; }
.snapshot td.best::after { content: ' ▲'; font-size: 9px; }
.snapshot td.worst { font-weight: 700; }
.snapshot td.worst::after { content: ' ▼'; font-size: 9px; }
.snap-co { display: inline-flex; gap: 10px; align-items: center; }

/* Customizable widgets */
.widget { min-width: 0; }
.widget .card-head { flex-wrap: wrap; }
.widget.editing { outline: 2px dashed var(--border-strong); outline-offset: -2px; cursor: grab; }
.widget.editing .widget-body { opacity: .55; pointer-events: none; max-height: 220px; overflow: hidden; }
.widget.dragging { opacity: .4; }
.widget.drop-target { outline-color: var(--accent); background: var(--accent-soft); }
.drag-handle { color: var(--text-faint); font-size: 18px; line-height: 1; }
.btn-danger { color: var(--down); }
.edit-hint { margin: -6px 0 14px; font-size: 13px; color: var(--text-muted); }

/* ---------- IR Assistant suggestions ---------- */
.suggestions { list-style: none; margin: 0; padding: 0; }
.suggestion { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border); }
.suggestion:first-child { border-top: 0; padding-top: 0; }
.prio { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: center; border-radius: 4px; padding: 3px 0; margin-top: 2px; }
.suggestion.high .prio { background: var(--down-bg); color: var(--down); }
.suggestion.medium .prio { background: #fff4dc; color: #8a5a00; }
.suggestion.low .prio { background: var(--hover); color: var(--text-muted); }
.sug-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.sug-meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.assistant-note { margin: 10px 0 0; }

/* ---------- Digest email preview ---------- */
.email-frame { background: #eef0f3; border-radius: var(--radius); padding: 28px 16px; }
.email { max-width: 680px; margin: 0 auto; background: #fff; border-radius: 6px; padding: 28px 32px; box-shadow: var(--shadow); font-size: 14px; line-height: 1.5; }
.email-head { display: flex; align-items: center; gap: 8px; border-bottom: 3px solid var(--accent); padding-bottom: 12px; }
.email-brand { font-weight: 700; font-size: 16px; }
.email-date { margin-left: auto; color: var(--text-muted); font-size: 13px; }
.email-title { font-size: 21px; margin: 18px 0 4px; }
.email-intro { color: var(--text-muted); font-size: 13px; margin: 0 0 8px; }
.email-h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 22px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.email-list { margin: 0; padding-left: 18px; }
.email-list li { margin: 4px 0; }
.email-list li.neg::marker { color: var(--down); }
.email-list li.pos::marker { color: var(--up); }
.email-actions { margin: 0; padding-left: 20px; }
.email-actions li { margin: 6px 0; }
.email-actions span { color: var(--text-muted); font-size: 13px; }
.email-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.email-table th { text-align: right; color: var(--text-faint); font-weight: 600; font-size: 11px; text-transform: uppercase; padding: 4px 6px; }
.email-table td { text-align: right; padding: 6px; border-top: 1px solid var(--border); }
.email-table td:first-child, .email-table th:first-child { text-align: left; }
.email-table.compact td { text-align: left; vertical-align: top; }
.email-table tr.is-client td { background: #f3fafa; }
.email-table .nowrap { white-space: nowrap; color: var(--text-muted); }
.email-chart { margin-top: 12px; }
.email-chart .relperf-svg { height: 170px; }
.email-cta { text-align: center; margin: 24px 0 8px; }
.email-foot { font-size: 11px; color: var(--text-faint); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 20px; }

/* ---------- Capture mode (documentation screenshots) ---------- */
.capture-mode body { background: #f7f8f9; min-height: 0; }
#capture-root { padding: 16px; box-sizing: content-box; background: #f7f8f9; }
#capture-root .pm-sticky { margin-bottom: 10px; background: transparent; }
#capture-root .pm-sticky .pm-top { border-bottom: 1px solid var(--border); border-radius: var(--radius); }
#capture-root .pm-sticky .pm-top.is-client { border: 2px solid var(--accent); border-top-width: 3px; }
#capture-root .pm-sticky.stuck { background: #fff; padding: 8px; border: 1px solid var(--border-strong); box-shadow: 0 6px 10px -8px rgba(16,24,40,.25); }
#capture-root .pm-sticky.stuck .pm-top.is-client { border-width: 2px; }
#capture-root .capture-row .pm-cell { border-top: 1px solid var(--border); }
#capture-root .capture-row .pm-cell.is-client { border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
#capture-root .capture-drawer { position: static; height: auto; width: 480px; box-shadow: 0 8px 24px rgba(16,24,40,.12); border: 1px solid var(--border); animation: none; }
#capture-root .capture-drawer .drawer-body { overflow: visible; }
#capture-root .capture-dialog { display: block; position: static; box-shadow: 0 20px 48px rgba(16,24,40,.18); background: #fff; border-radius: 10px; }
#capture-root .capture-menu { display: flex; gap: 12px; align-items: flex-start; }
#capture-root .capture-pop { position: static; }
#capture-root .capture-pad { padding: 8px 4px 0; background: transparent; }
#capture-root .widget { margin: 0; }

/* ---------- Print / single-page PDF ---------- */
.print-mode body { width: 1800px; min-height: 0; }
.print-mode .topbar, .print-mode .sidebar, .print-mode .pm-sticky { position: static; }
.print-mode .sidebar { height: auto; transform: none; }
.print-mode .pm-scroll { overflow: visible; }
.print-mode .menu-toggle, .print-mode .pm-menu-btn, .print-mode [data-peer-add],
.print-mode [data-peer-reset], .print-mode [data-export-pdf], .print-mode .seg-control,
.print-mode .see-more, .print-mode .drawer, .print-mode .drawer-scrim,
.print-mode [data-share-menu], .print-mode .alerts-btn { display: none !important; }
.print-mode .shell { min-height: 0; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pm-cell, .pm-sticky, .card { break-inside: auto; }
  .popover, dialog { display: none !important; }
}

/* ---------- Responsive ---------- */
.menu-toggle { display: none; }
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  :root { --sidebar-w: 260px; }
  .menu-toggle { display: grid; }
  .sidebar { position: fixed; left: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 16px rgba(0,0,0,.08); }
  body.nav-open .sidebar { transform: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 32px; }
  .org-switch { display: none; }
  .news-card { flex-basis: 85%; min-width: 0; }
  .card-head { flex-wrap: wrap; }
}
