/* Expanded chart pop-up in the Attio look (user, 2026-10-29: "charts when you click on them to expand … mostly the
   buttons … compare with dropdown … Attio style"). Spec: .claude/skills/attio-style §6, §9, §16. Only under
   html.at-nav-h. Attio radii (8 / 12), so excluded in scripts/square_corners.py. Dropdown markup: js/fin-chart-select.js. */
html.at-nav-h #chart-modal {
  --cm-ink: #101112; --cm-sub: rgba(0,0,0,.63); --cm-faint: rgba(0,0,0,.50); --cm-rule: #EEEFF1; --cm-ring: #E6E7EA;
  --cm-hover: #F6F7F7; --cm-track: rgba(0,0,0,.04); --cm-white: #FFFFFF; --cm-blue: #266DF0;
  --cm-btn: inset 0 0 0 1px #0000, 0 0 2px 0 rgba(28,40,64,.18), 0 1px 3px 0 rgba(0,0,0,.04);
}
html[data-theme="dark"].at-nav-h #chart-modal {
  --cm-ink: #F1F2F3; --cm-sub: rgba(255,255,255,.60); --cm-faint: rgba(255,255,255,.45); --cm-rule: #2F3033; --cm-ring: #2F3033;
  --cm-hover: rgba(255,255,255,.06); --cm-track: rgba(255,255,255,.06); --cm-white: #2A2B2E; --cm-blue: #4E8CFC;
  --cm-btn: inset 0 0 0 1px rgba(255,255,255,.08);
}
html.at-nav-h #chart-modal { border-radius: 12px; }
html.at-nav-h #chart-modal .cm-tools { gap: 8px; border-bottom: 1px solid var(--cm-rule); padding: 10px 16px; }

/* Annual | Quarterly, Bar | Line: Attio's segmented control (track .04, white 24px thumb, r8) */
html.at-nav-h #chart-modal .cg-view { display: inline-flex; gap: 0; padding: 2px; height: 28px; box-sizing: border-box; border: 0 !important;
  border-radius: 10px; background: var(--cm-track) !important; box-shadow: none !important; }
html.at-nav-h #chart-modal .cg-view-btn { height: 24px; padding: 0 10px; border: 0 !important; border-radius: 8px; background: transparent !important;
  color: var(--cm-sub) !important; font: 500 13px/24px 'Inter', sans-serif; box-shadow: none !important; transition: none; cursor: pointer; }
html.at-nav-h #chart-modal .cg-view-btn:hover { color: var(--cm-ink) !important; }
html.at-nav-h #chart-modal .cg-view-btn.is-on { background: var(--cm-white) !important; color: var(--cm-ink) !important;
  box-shadow: 0 1px 2px -1px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04) !important; }

/* dropdown triggers: secondary button, 28px, r8, hairline lift */
html.at-nav-h #chart-modal select[data-cmx] { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
html.at-nav-h #chart-modal label.cm-pick:has(select[data-cmx]) { display: none; }
html.at-nav-h .cmx-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 10px; border: 0; border-radius: 8px;
  background: var(--cm-white, #fff); color: var(--cm-ink, #101112); box-shadow: var(--cm-btn); font: 500 13px 'Inter', sans-serif; cursor: pointer; flex: none;
  white-space: nowrap; transition: none; max-width: 220px; }
html.at-nav-h .cmx-btn[hidden] { display: none; }
html.at-nav-h .cmx-btn .cmx-t { overflow: hidden; text-overflow: ellipsis; }
html.at-nav-h .cmx-btn i { font-size: 12px; color: var(--cm-faint); }
html.at-nav-h .cmx-btn:hover, html.at-nav-h .cmx-btn.is-open { background: var(--cm-hover); }
html.at-nav-h .cmx-btn.is-on { color: var(--cm-blue); }
html.at-nav-h .cmx-btn.is-on i { color: var(--cm-blue); }
/* the metric title: heading type, no box */
html.at-nav-h .cmx-btn.cmx-metric { height: 30px; margin-left: -8px; padding: 0 8px; background: transparent; box-shadow: none;
  font: 600 16px/24px 'Inter', sans-serif; letter-spacing: -.1px; max-width: 420px; }
html.at-nav-h .cmx-btn.cmx-metric:hover, html.at-nav-h .cmx-btn.cmx-metric.is-open { background: var(--cm-hover); }

/* icon buttons: ghost, 28px, r8 */
html.at-nav-h #chart-modal .cm-icon { border-radius: 8px; color: var(--cm-faint); }
html.at-nav-h #chart-modal .cm-icon:hover { background: var(--cm-hover); color: var(--cm-ink); }
html.at-nav-h #chart-modal .cm-icon.is-on { background: var(--cm-hover); color: var(--cm-blue); }
html.at-nav-h #chart-modal > .aiq-x { border-radius: 8px; }

/* growth row: Attio count pills, tinted by sign */
html.at-nav-h #chart-modal .cm-cagr { border-top: 1px solid var(--cm-rule); }
html.at-nav-h #chart-modal .cm-cagr-i { border-radius: 8px; padding: 3px 10px; background: var(--cm-track); border: 0; box-shadow: inset 0 0 0 1px var(--cm-rule); }

/* the popover (hangs off <body>) */
.cmx-pop { --p-bg: #FFFFFF; --p-ink: #101112; --p-sub: rgba(0,0,0,.63); --p-rule: #EEEFF1; --p-hover: #F6F7F7; --p-blue: #266DF0;
  position: fixed; z-index: 100000; display: flex; flex-direction: column; padding: 4px; overflow: hidden; box-sizing: border-box;
  background: var(--p-bg); color: var(--p-ink); border-radius: 12px; font: 500 14px/20px 'Inter', sans-serif;
  box-shadow: inset 0 0 0 1px #0000, 0 0 0 1px rgba(28,40,64,.04), 0 4px 8px -4px rgba(28,40,64,.12), 0 4px 12px -2px rgba(24,41,75,.16);
  -webkit-backdrop-filter: none; backdrop-filter: none; -webkit-mask-image: none; mask-image: none; }
html[data-theme="dark"] .cmx-pop { --p-bg: #1B1C1F; --p-ink: #F1F2F3; --p-sub: rgba(255,255,255,.60); --p-rule: #2F3033; --p-hover: rgba(255,255,255,.06); --p-blue: #4E8CFC;
  box-shadow: 0 0 0 1px #2F3033, 0 12px 32px -8px rgba(0,0,0,.6); }
.cmx-pop .cmx-search { display: flex; align-items: center; gap: 8px; height: 40px; margin: -4px -4px 4px; padding: 0 12px; border-bottom: 1px solid var(--p-rule); color: var(--p-sub); flex: none; }
.cmx-pop .cmx-search input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; outline: none !important;
  box-shadow: none !important; padding: 0; color: var(--p-ink); font: 500 14px 'Inter', sans-serif; }
.cmx-pop .cmx-search input::placeholder { color: var(--p-sub); opacity: .8; }
.cmx-pop .cmx-list { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.cmx-pop .cmx-main { flex: 1; }
.cmx-pop .cmx-g { padding: 8px 8px 4px; font: 500 12px/16px 'Inter', sans-serif; color: var(--p-sub); }
.cmx-pop .cmx-rule { height: 1px; margin: 4px -4px; background: var(--p-rule); }
.cmx-pop .cmx-i { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent;
  color: var(--p-ink); font: 500 14px 'Inter', sans-serif; text-align: left; cursor: pointer; transition: none; }
.cmx-pop .cmx-i span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmx-pop .cmx-i:hover, .cmx-pop .cmx-i:focus-visible { background: var(--p-hover); outline: none; }
.cmx-pop .cmx-i.on { color: var(--p-blue); background: var(--p-hover); }
.cmx-pop .cmx-i i { font-size: 14px; color: var(--p-sub); }
.cmx-pop .cmx-i.on i { color: var(--p-blue); }
.cmx-pop .cmx-empty { padding: 12px 8px; color: var(--p-sub); font-size: 13px; }

html.at-nav-h #chart-modal .cg-view[hidden], html.at-nav-h #chart-modal .cm-icon[hidden] { display: none !important; }

/* Compare picker = the Builder picker (.fp-mpick) hung off <body>, above the dialog */
.fp-mpick.cmx-wide { position: fixed; z-index: 100000; }
.cmx-wide .fp-item[hidden], .cmx-wide .fp-cat[hidden] { display: none !important; }
.cmx-wide .cmx-clear2 { height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--mp-sub); font: 500 14px 'Inter', sans-serif; cursor: pointer; }
.cmx-wide .cmx-clear2:hover { background: var(--mp-hover); color: var(--mp-ink); }
.cmx-wide .cmx-clear2[hidden] { display: none; }
