/* AK LEADS Connect — Menus step 1 · shared components + sidebar. Loads after styles.css and only uses its tokens. */
:root { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b9da3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
:root[data-theme="light"] { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23585a60' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }

/* ───────── sidebar: groups ───────── */
.side-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px 8px; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 2px; }
.nav-gh { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--muted); font-size: var(--fs-md); font-weight: 600; text-align: left; }
.nav-gh:hover { background: var(--bg-3); color: var(--text); }
.nav-gl { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group.here > .nav-gh { color: var(--text); }
.nav-group.single .nav-gh[aria-current="page"] { background: var(--bg-3); box-shadow: inset 2px 0 0 var(--accent); }
.nav-chev { width: 14px; height: 14px; color: var(--faint); transition: transform .15s; }
.nav-group:not(.open) .nav-chev { transform: rotate(-90deg); }
.nav-lock { width: 13px; height: 13px; color: var(--faint); }
.nav-lock.open { color: var(--muted); }
.nav-gi { display: flex; flex-direction: column; gap: 1px; padding: 1px 0 4px; }
.nav-group:not(.open) .nav-gi { display: none; }
.nav-gi .nav-item { min-height: 32px; padding: 0 10px 0 38px; font-size: 13.5px; }
.nav-gi .nav-item span:first-child { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-btn { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding: 4px; border-radius: var(--r-md); text-align: left; }
.me-btn:hover { background: var(--bg-3); }
.nav-scrim { display: none; position: fixed; inset: 0; background: var(--scrim); z-index: 74; }

/* top bar: dashboard controls only on My dashboard; page controls come from the page */
body:not([data-area="dash"]) .dash-ctl { display: none; }
.page-ctl:empty { display: none; }
.page-ctl .select { width: auto; min-width: 160px; height: var(--ctl-h); }

/* ───────── View-as banner ───────── */
.viewas { display: flex; align-items: center; gap: 10px; padding: 8px var(--sp-8); font-size: var(--fs-sm); flex-wrap: wrap;
  background: color-mix(in oklch, var(--info) 14%, var(--bg)); border-bottom: 1px solid color-mix(in oklch, var(--info) 45%, transparent); }
.viewas svg { color: var(--info); }
.viewas-r { color: var(--muted); }
.viewas .btn { margin-left: auto; }
body.viewing [aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ───────── buttons ───────── */
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary:disabled:hover { background: var(--accent); border-color: var(--accent); }
.btn.danger:disabled:hover { background: var(--neg-solid); }
.btn.sm { height: 28px; padding: 0 10px; font-size: var(--fs-xs); gap: 6px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--text); font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.linkbtn:hover { text-decoration-color: currentColor; }
.spin-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }

/* ───────── form fields ───────── */
.field { display: grid; gap: 6px; min-width: 0; }
.field-l { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.field-h { font-size: var(--fs-xs); color: var(--muted); }
.input, .select, .textarea { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); color: var(--text); font-size: var(--fs-sm); }
.textarea { height: auto; min-height: 88px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in oklch, var(--text) 45%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select { appearance: none; -webkit-appearance: none; padding-right: 30px; background: var(--bg) var(--chev) no-repeat right 10px center / 14px; }
.ck { display: flex; align-items: flex-start; gap: 10px; min-height: 36px; padding: 8px 0; font-size: var(--fs-sm); cursor: pointer; }
.ck input, .ck-tbl input, .tile input { width: 16px; height: 16px; margin: 1px 0 0; flex: none; accent-color: var(--text); }
.ck-l small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.ck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.fs { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.fs legend { padding: 0; margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 320px)); gap: 12px; margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
/* toggle tiles: checkbox or radio as a selectable card */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.tile { position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 40px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); cursor: pointer; }
.tile input { position: absolute; left: 14px; top: 14px; }
.tile:hover { background: var(--bg-3); }
.tile:has(input:checked) { border-color: var(--text); background: var(--bg-3); }
.tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-t { font-weight: 600; font-size: var(--fs-sm); }
.tile-d { font-size: var(--fs-xs); color: var(--muted); }

/* ───────── wizard steps (vertical) ───────── */
.wz { list-style: none; margin: 0; padding: 0; }
.wz-s { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.wz-s:first-child { border-top: 0; padding-top: 4px; }
.wz-h { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.wz-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: var(--fs-xs); font-weight: 700; border: 1px solid var(--line); color: var(--muted); }
.wz-n svg { width: 14px; height: 14px; }
.wz-s[data-state="current"] .wz-n { background: var(--text); border-color: var(--text); color: var(--bg); }
.wz-s[data-state="done"] .wz-n { background: var(--bg-3); color: var(--text); }
.wz-t { font-weight: 600; }
.wz-s[data-state="next"] .wz-t { color: var(--muted); font-weight: 500; }
.wz-sum { color: var(--muted); font-size: var(--fs-sm); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-h .linkbtn { margin-left: auto; }
.wz-b { margin: 12px 0 0 34px; }
.wz-b .form-grid, .wz-b > .field { max-width: 360px; }

/* ───────── token / code box with Copy ───────── */
.codebox { display: flex; align-items: flex-start; gap: 8px; padding: 10px 10px 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); }
.codebox pre { flex: 1 1 auto; min-width: 0; margin: 0; font: 12.5px/1.5 var(--font-mono); color: var(--text); white-space: pre-wrap; word-break: break-all; }
.codebox-n { margin: 6px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* ───────── confirm dialog ───────── */
.dialog-b .cf-what { color: var(--text); font-size: var(--fs-md); line-height: 1.5; }
.cf-list { margin: -4px 0 14px; padding: 8px 12px 8px 28px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--r-md); font-size: var(--fs-sm); max-height: 160px; overflow: auto; }
.cf-strong { margin-bottom: 8px; }

/* ───────── passkey lock card ───────── */
.lock-in { max-width: 460px; margin: 0 auto; padding: 44px 24px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.lock-ic { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--bg-3); border-radius: var(--r-md); }
.lock-ic svg { width: 22px; height: 22px; }
.lock-in h2 { margin: 4px 0 0; font-size: var(--fs-xl); font-weight: 750; font-variation-settings: "wdth" 110; }
.lock-in p { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
.lock-in .btn.primary { height: 40px; padding: 0 18px; }
.lock-alt { font-size: var(--fs-sm); }

/* ───────── result card, banners, rows ───────── */
.result { display: grid; gap: 10px; justify-items: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }
.result.has-fail { border-color: color-mix(in oklch, var(--neg) 45%, var(--line)); }
.result-h { font-size: var(--fs-lg); }
.result-l { list-style: none; margin: 0; padding: 0; width: 100%; font-size: var(--fs-sm); }
.result-l li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.banner { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: var(--r-md); font-size: var(--fs-sm); border: 1px solid; }
.banner span { flex: 1 1 auto; }
.banner.ok { background: var(--pos-soft); border-color: color-mix(in oklch, var(--pos) 40%, transparent); }
.banner.bad { background: var(--neg-soft); border-color: color-mix(in oklch, var(--neg) 40%, transparent); }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.row:first-child { border-top: 0; }
.card-b.flush .row, .card-b.flush .rows > .empty { padding-left: var(--sp-4); padding-right: var(--sp-4); }
.row-ic { color: var(--muted); }
.row-m { flex: 1 1 200px; min-width: 0; display: grid; }
.row-m b { font-weight: 600; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-m small { color: var(--muted); font-size: var(--fs-xs); }
.row-a { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.row-x { flex-basis: 100%; padding: 2px 0 4px 44px; }
.plat-ic { width: 32px; height: 32px; display: grid; place-items: center; flex: none; border-radius: var(--r-md); background: var(--bg-3); font-weight: 800; font-variation-settings: "wdth" 112; }
.pill svg { width: 13px; height: 13px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.facts dt { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; }

/* ───────── page bits ───────── */
.lead-p { margin: 0 0 12px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; max-width: 62ch; }
.lead-p b { color: var(--text); }
.note-inline { grid-column: span 12; margin: 0; padding: 8px 12px; font-size: var(--fs-sm); color: var(--muted); border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--bg-2); }
.team-line { grid-column: span 12; margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.team-line b { color: var(--text); font-weight: 600; }
.big-empty { padding: 48px 24px; display: grid; gap: 16px; justify-items: center; max-width: 580px; margin: 0 auto; font-size: var(--fs-md); line-height: 1.5; }
.big-empty p { margin: 0; }
.sub-h { margin: 14px var(--sp-4) 2px; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cr-v { font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.toolbar.flush-x { padding: 0 0 10px; }
.search-wrap.wide { margin-bottom: 4px; }
.search-wrap.wide .search { width: 100%; }
.ck-tbl th:first-child, .ck-tbl td:first-child { width: 40px; }
.pop-sub { padding: 6px 10px 2px; font-size: var(--fs-xs); color: var(--muted); }
.pop-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; margin-top: 4px; border-top: 1px solid var(--line-soft); }
.pop-range .btn { grid-column: span 2; justify-content: center; }
#popWork { min-width: 280px; }

/* ───────── responsive ───────── */
@media (max-width: 1024px) and (min-width: 761px) {
  .nav-gl, .nav-chev, .nav-lock, .nav-gi { display: none !important; }
  .nav-gh { justify-content: center; padding: 0; width: 44px; min-height: 40px; }
  .nav-group.here > .nav-gh { background: var(--bg-3); box-shadow: inset 2px 0 0 var(--accent); }
  .side-scroll { overflow: visible; }
  .viewas { padding-left: var(--sp-6); padding-right: var(--sp-6); }
}
@media (max-width: 760px) {
  .bnav { grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .app.nav-open .side { display: flex; position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100%; z-index: 75; background: var(--bg);
    padding: var(--sp-4) var(--sp-3); align-items: stretch; box-shadow: var(--shadow); }
  .app.nav-open .side .brand-name { display: block; }
  .app.nav-open .side .me-name { display: block; }
  .app.nav-open .side .sync-btn span { display: inline; }
  .app.nav-open .side .sync-btn { justify-content: flex-start; }
  .app.nav-open .side .me { flex-direction: row; padding: 6px 8px; }
  .app.nav-open .side .nav-gh, .app.nav-open .side .nav-gi .nav-item { min-height: 44px; }
  .app.nav-open .side .nav-item span, .app.nav-open .side .nav-item .tag-co { display: inline; }
  .app.nav-open .side .nav-gi .nav-item { justify-content: flex-start; padding: 0 10px 0 38px; }
  .app.nav-open ~ .nav-scrim { display: block; }
  .viewas { padding: 8px 16px; }
  .two-col { grid-template-columns: 1fr; }
  .wz-b { margin-left: 0; }
  .content .btn, .content .btn.sm, .input, .select { min-height: 44px; }
  .ck { min-height: 44px; }
  .row-x { padding-left: 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .page-ctl .select { flex: 1; height: 44px; }
}

/* ───────── Your work v2 · My team: filter bar, multi-select, grouped tri-state lists, picked bar, review ───────── */
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.fbar .search-wrap { flex: 1 1 200px; min-width: 0; }
.fbar .search { width: 100%; }
.btn.msel { max-width: 320px; }
.btn.msel { overflow: hidden; text-overflow: ellipsis; }
.pick-tools { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.pick-n { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.pick-n b { color: var(--text); font-weight: 650; }
.ck-pop { cursor: pointer; }
.ck-pop input { width: 16px; height: 16px; accent-color: var(--text); flex: none; }
.pop-row .linkbtn + .linkbtn { margin-left: 4px; }
.glist { border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--bg); max-height: 420px; overflow: auto; }
.gl-g + .gl-g { border-top: 1px solid var(--line); }
.gl-h, .gl-r { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; min-height: 40px; }
.gl-h { position: sticky; top: 0; z-index: 1; background: var(--bg-3); font-size: var(--fs-sm); }
.gl-h .muted { margin-left: auto; font-size: var(--fs-xs); white-space: nowrap; }
.gl-r { border-top: 1px solid var(--line-soft); }
.gl-g .gl-r:first-of-type { border-top: 0; }
.plist .gl-r:first-child { border-top: 0; }
.gl-r:hover { background: var(--bg-2); }
.gl-r.on { background: color-mix(in oklch, var(--text) 6%, var(--bg)); }
.gl-h input, .gl-r input { width: 16px; height: 16px; flex: none; accent-color: var(--text); margin: 0; }
.gl-m { flex: 1 1 auto; min-width: 0; display: grid; }
.gl-m b { font-weight: 600; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.gl-m small { font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.gl-x { flex: none; font-size: var(--fs-xs); color: var(--muted); text-align: right; }
.gl-r .avatar { width: 26px; height: 26px; font-size: 11px; }
.list-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 8px; }
.list-h .sub-h { margin: 0; }
.px-cols { gap: 16px 20px; align-items: start; }
/* picked summary: sticks to the bottom of the screen while you scroll the lists */
.picked-bar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 10px 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 -8px 20px oklch(0% 0 0 / 0.18); }
.pb-l { font-size: var(--fs-sm); white-space: nowrap; }
.pchips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 200px; min-width: 0; max-height: 64px; overflow: auto; }
.pchip { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 2px 0 9px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: var(--fs-xs); background: var(--bg); max-width: 100%; }
.pchip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; }
.pchip button:hover { background: var(--bg-3); color: var(--text); }
.pb-a { display: flex; gap: 8px; margin-left: auto; }
.picked-bar > .btn { margin-left: auto; }
/* review */
.rv-sent { margin: 0 0 12px; font-size: var(--fs-lg); line-height: 1.4; }
.rv-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.rv-l { margin: 0 0 8px; padding-left: 18px; font-size: var(--fs-sm); line-height: 1.6; }
.rv-g { margin: 6px 0 2px; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.warns { margin: 8px 0 12px; padding: 10px 12px 10px 28px; border: 1px solid color-mix(in oklch, var(--warn-c) 40%, transparent); background: var(--warn-soft); border-radius: var(--r-md); font-size: var(--fs-sm); }
.small-note { font-size: var(--fs-xs); }
a.btn { text-decoration: none; }
@media (max-width: 760px) {
  .picked-bar { bottom: 64px; }
  .pb-a, .picked-bar > .btn { margin-left: 0; width: 100%; }
  .pb-a .btn, .picked-bar > .btn { flex: 1; justify-content: center; }
  .rv-cols { grid-template-columns: 1fr; }
  .btn.msel { max-width: 100%; flex: 1 1 100%; }
  .gl-h, .gl-r { min-height: 44px; }
  .pick-tools .btn { min-height: 44px; }
}

/* v2 on real data */
.v2-badge { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 3px; background: var(--accent, #ff3b2f); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; vertical-align: 1px; }
.frame-page .page-ctl { display: none; }
:root { --beta-h: 0px; }
.card.fill-row .chart.fill { flex: 1 1 0; min-height: 260px; overflow: hidden; padding-top: 10px; }
.vt.vt-m td { white-space: nowrap; }
.vt.vt-m td .delta { display: block; font-size: 10.5px; margin-top: 1px; }
.vt.vt-m th[scope="row"] { font-weight: 500; color: var(--muted); white-space: nowrap; }
.vt-note { font-size: 11px; margin-top: 6px; }

/* Accounts → Alerts: each box shows ~5 accounts and scrolls inside, so all of them fit on one screen */
.alert-grid .card .alist { max-height: 268px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
[data-card="al-sync"] .alist { max-height: 188px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
@media (max-width: 760px) { .alert-grid .card .alist { max-height: 220px; } }
.vt-scroll { overflow-x: auto; scrollbar-width: thin; margin: 0 -2px; }
.vt.vt-m { font-size: 11.5px; min-width: 520px; }
.vt.vt-m th, .vt.vt-m td { padding: 5px 0 5px 7px; }
.vt.vt-m thead th { font-size: 10px; letter-spacing: .03em; }
.vt.vt-m td .delta { font-size: 10px; }
