/* Chart event markers (news bolt + economic calendar) and their popovers. Tokens only. */
.ce-layer { position: absolute; inset: 0 0 23px; z-index: 4; pointer-events: none; overflow: hidden; }
.ce-layer[hidden] { display: none; }

.ce-mark {
  position: absolute; left: 0; top: 0; display: grid; place-items: center; padding: 0;
  width: 20px; height: 20px; border: 1px solid var(--border-strong); color: var(--text);
  background: var(--surface3); cursor: pointer; pointer-events: auto; will-change: transform;
  box-shadow: var(--shadow-1);
}
.ce-mark .icon { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ce-mark:hover, .ce-mark[aria-expanded="true"] { border-color: var(--accent); }
.ce-mark:focus-visible { outline: none; box-shadow: var(--focus); }

.ce-news { border-radius: var(--r-pill); background: var(--accent-fill); border-color: var(--accent-hover); color: var(--btn-fg); }
.ce-news .icon { fill: currentColor; stroke: none; width: 11px; height: 11px; }
.ce-count {
  position: absolute; top: -7px; right: -8px; min-width: 15px; height: 15px; padding: 0 3px; box-sizing: border-box;
  border-radius: var(--r-pill); background: var(--panel); border: 1px solid var(--border-strong); color: var(--text);
  font: 600 9px/13px var(--sans); text-align: center; pointer-events: none;
}

.ce-cal { border-radius: var(--r-sm); }
.ce-cal.ce-imp-high { color: var(--warning); border-color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, var(--surface3)); }
.ce-cal.ce-imp-medium { color: var(--accent-hover); }
.ce-cal.ce-imp-low { color: var(--muted); }

/* popover */
.ce-pop {
  position: absolute; z-index: var(--z-popover); width: 340px; max-width: calc(100% - 16px); max-height: calc(100% - 16px); overflow: auto;
  display: flex; flex-direction: column; gap: var(--s3); padding: var(--s3);
  background: var(--surface3); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  font-size: var(--fs-sm); line-height: 1.4;
}
.ce-pop:focus { outline: none; }
.ce-title { font: 600 var(--fs-md)/1.2 var(--sans); }
.ce-sub, .ce-meta { font-size: var(--fs-xs); color: var(--muted); }
.ce-card { padding: var(--s3); background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-sm); display: flex; flex-direction: column; gap: var(--s2); }
.ce-sub { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: var(--fs-2xs); }
.ce-facts { margin: 0; padding: 0 0 0 var(--s4); display: flex; flex-direction: column; gap: var(--s1); }
.ce-headline { margin: 2px 0 var(--s1); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ce-list { display: flex; flex-direction: column; gap: var(--s3); }
.ce-ev + .ce-ev { padding-top: var(--s3); border-top: 1px solid var(--border); }
.ce-ev .ce-headline { display: block; -webkit-line-clamp: unset; }
.ce-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.ce-link { color: var(--accent-hover); text-decoration: none; font-size: var(--fs-xs); font-weight: 500; }
.ce-link:hover { text-decoration: underline; }
.ce-empty { margin: 0; }
.ce-foot {
  align-self: stretch; padding: var(--s2) 0 0; border: 0; border-top: 1px solid var(--border); background: none; color: var(--accent-hover);
  font: 500 var(--fs-xs)/1.2 var(--sans); text-align: left; cursor: pointer;
}
.ce-foot:hover { text-decoration: underline; }
.ce-link:focus-visible, .ce-foot:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

.ce-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.ce-bars i { width: 4px; border-radius: 1px; background: var(--border-strong); }
.ce-bars i:nth-child(1) { height: 5px; } .ce-bars i:nth-child(2) { height: 8px; } .ce-bars i:nth-child(3) { height: 12px; }
.ce-bars.ce-imp-high i.on { background: var(--warning); }
.ce-bars.ce-imp-medium i.on { background: var(--accent-hover); }
.ce-bars.ce-imp-low i.on { background: var(--muted); }

/* phones: smaller markers, bottom-sheet popover */
@media (max-width: 700px) {
  .ce-mark { width: 18px; height: 18px; }
  .ce-count { top: -6px; right: -7px; }
  .ce-pop.ce-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; max-height: 70vh;
    z-index: var(--z-dialog); border-radius: var(--r-lg) var(--r-lg) 0 0; padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom, 0px));
  }
}
