/* The client portal's top bar and Portfolio tabs (static/shared/clientTop.js,
 * docs/systems/UI_PARTS.md "Client portal"). Every rule is under body.ct-on, which
 * clientTop.js sets only for a client (or View as client) on a desktop with the new
 * look switched on, so with it off nothing here applies. Brand colours from the firm's
 * --brand-* variables only; the fixed tones are ui.css's --vx-* tokens. */
body.ct-on { --ct-h: 60px; }
body.ct-on .shell-sidebar,
body.ct-on #shell-hamburger,
body.ct-on #vtop { display: none !important; }
body.ct-on .content-area { margin-top: var(--ct-h); height: calc(100vh - var(--ct-h)); margin-left: 0; }
body.ct-on .ws-preview-bar { position: fixed; top: var(--ct-h); left: 0; right: 0; z-index: 880; }
body.ct-on.ws-previewing .content-area { padding-top: 40px; }

/* The bar */
.ct-bar { display: none; }
body.ct-on .ct-bar {
  display: flex; align-items: center; gap: 4px; position: fixed; top: 0; left: 0; right: 0; height: var(--ct-h); z-index: 900;
  padding: 0 20px; background: var(--brand-ink); color: #fff; font-family: var(--brand-font-body);
}
body.ct-on .ct-logo { display: flex; align-items: center; margin-right: 18px; flex: none; text-decoration: none; }
body.ct-on .ct-logo img, body.ct-on .ct-logo svg { width: 108px !important; height: auto; display: block; }
body.ct-on .ct-nav { display: flex; align-items: center; gap: 2px; flex: none; }
body.ct-on .ct-item {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  color: rgba(255, 255, 255, .72); font: 600 14px/1 var(--brand-font-body); padding: 10px 13px; border-radius: 8px;
}
body.ct-on .ct-item:hover, body.ct-on .ct-item[aria-expanded="true"] { background: rgba(255, 255, 255, .08); color: #fff; }
body.ct-on .ct-item.on { background: rgba(var(--brand-accent-rgb), .32); color: #fff; }
body.ct-on .ct-item:focus-visible, body.ct-on .ct-mi:focus-visible, body.ct-on .ct-msg:focus-visible,
body.ct-on .ct-me:focus-visible, body.ct-on .ct-tab:focus-visible, body.ct-on .ct-seg button:focus-visible {
  outline: 3px solid rgba(var(--brand-accent-rgb), .45); outline-offset: 1px;
}
body.ct-on .ct-caret { width: 12px; height: 12px; opacity: .8; }
body.ct-on .ct-b {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--vx-badge); color: #fff;
  font: 700 11px/18px var(--brand-font-body); text-align: center;
}
body.ct-on .ct-grow { flex: 1; }
body.ct-on .ct-dd { position: relative; }
body.ct-on .ct-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px; background: var(--vx-surface); color: var(--brand-ink);
  border: 1px solid var(--vx-line); border-radius: 10px; box-shadow: 0 16px 36px rgba(var(--brand-ink-rgb), .2); padding: 8px; z-index: 910;
}
body.ct-on .ct-menu[hidden] { display: none; }
body.ct-on .ct-menu-r { left: auto; right: 0; }
body.ct-on .ct-mg { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--vx-text-3); padding: 10px 10px 4px; }
body.ct-on .ct-mi {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; border: 0; background: none; cursor: pointer;
  text-align: left; font: 500 14px var(--brand-font-body); color: var(--brand-ink); padding: 8px 10px; border-radius: 8px;
}
body.ct-on .ct-mi:hover, body.ct-on .ct-mi.on { background: rgba(var(--brand-accent-rgb), .10); color: var(--brand-accent); }
body.ct-on .ct-mi.on { font-weight: 700; }
body.ct-on .ct-mehead { padding: 6px 10px 8px; border-bottom: 1px solid var(--vx-line); margin-bottom: 4px; }
body.ct-on .ct-mehead b { display: block; font-size: 14px; }
body.ct-on .ct-mehead small { display: block; font-size: 12px; color: var(--vx-text-3); }
body.ct-on .ct-prem {
  display: inline-flex; align-items: center; gap: 4px; flex: none; font: 700 10px/1 var(--brand-font-body);
  color: var(--vx-warn); background: var(--vx-warn-bg); border-radius: 999px; padding: 3px 7px;
}
body.ct-on .ct-lk { width: 11px; height: 11px; }

/* Stock search in the bar */
body.ct-on .ct-search { display: flex; align-items: center; flex: 0 1 300px; min-width: 150px; margin: 0 12px 0 14px; }
body.ct-on .ct-search .vqs { margin: 0; width: 100%; position: relative; }
body.ct-on .ct-search .vqs-input {
  width: 100%; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff;
}
body.ct-on .ct-grow { min-width: 0; }
@media (max-width: 1180px) {
  body.ct-on .ct-msg small { display: none; }
  body.ct-on .ct-logo img, body.ct-on .ct-logo svg { width: 88px !important; }
  body.ct-on .ct-item { padding: 10px 10px; }
  body.ct-on .ct-search .vqs-kbd { display: none; }
}
body.ct-on .ct-search .vqs-input::placeholder { color: rgba(255, 255, 255, .6); }
body.ct-on .ct-search .vqs-icon, body.ct-on .ct-search .vqs-kbd { color: rgba(255, 255, 255, .6); border-color: rgba(255, 255, 255, .2); background: transparent; }
body.ct-on .ct-search .vqs-results { color: var(--brand-ink); }

/* Message my adviser: the one button */
body.ct-on .ct-msg {
  display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px 0 5px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--brand-accent); color: #fff; font: 700 14px/1.15 var(--brand-font-body); white-space: nowrap; text-align: left;
  box-shadow: 0 2px 10px rgba(var(--brand-accent-rgb), .35);
}
body.ct-on .ct-msg[hidden] { display: none; }
body.ct-on .ct-msg:hover { filter: brightness(1.06); }
body.ct-on .ct-msg.open { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
body.ct-on .ct-msg:disabled { opacity: .55; cursor: default; filter: none; }
body.ct-on .ct-msg svg { width: 17px; height: 17px; flex: none; }
body.ct-on .ct-msg small { display: block; font-weight: 500; font-size: 11.5px; opacity: .9; }
body.ct-on .ct-face {
  width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--brand-ink); display: grid; place-items: center;
  font: 700 11.5px/1 var(--brand-font-body); overflow: hidden; flex: none;
}
body.ct-on .ct-face img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
body.ct-on .ct-face svg { width: 16px; height: 16px; }
body.ct-on .ct-signin {
  height: 34px; padding: 0 14px; margin-right: 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .3); background: transparent;
  color: #fff; font: 600 13px var(--brand-font-body); cursor: pointer;
}
body.ct-on .ct-me {
  width: 34px; height: 34px; margin-left: 10px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255, 255, 255, .14); color: #fff;
  font: 700 12px/34px var(--brand-font-body); text-align: center; padding: 0;
}

/* Chat moved to the button: the Live Feed's own panel and the old column's launcher go */
body.ct-on #vfeed-chat, body.ct-on #tp-sidebar-adviser { display: none !important; }
body.ct-on.pc-panel-open .content-area { margin-right: 360px; }
body.ct-on #pc-panel { top: var(--ct-h); }

/* Page headers: white under the navy bar (their controls are drawn for a light ground;
   only the header and its title were navy), one navy bar at the top of the screen. */
body.ct-on .topbar { background: var(--vx-surface); border-bottom: 1px solid var(--vx-line); }
body.ct-on .topbar .page-title { font-family: var(--brand-font-display); font-weight: 400; font-size: 22px; color: var(--brand-ink); }

/* Portfolio: ONE page, five tabs */
/* Reloading after an account switch: nothing shows until the bar and the page they were on are drawn (clientTop.js, at most 4 s). */
html.ct-wait body { visibility: hidden; }
body.ct-on .ct-pf .topbar .page-title { display: none; }
body.ct-on .ct-pf[id^="page-taxrep-"] .topbar { display: none; }   /* a title and nothing else */
body.ct-on .ct-pf .topbar { height: auto; min-height: 52px; padding-top: 8px; padding-bottom: 8px; }
body.ct-on .ct-phead { padding: 18px 28px 0; background: var(--vx-page); display: grid; gap: 12px; }
body.ct-on .ct-band {
  background: var(--brand-ink); color: #fff; border-radius: 14px; padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px;
}
body.ct-on .ct-title { margin: 0; font-family: var(--brand-font-display); font-weight: 400; font-size: 26px; line-height: 1.15; color: #fff; }
body.ct-on .ct-meta { display: flex; flex-wrap: wrap; font-size: 13px; color: rgba(255, 255, 255, .7); }
body.ct-on .ct-meta span + span { margin-left: 10px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .2); }
body.ct-on .ct-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--vx-line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
body.ct-on .ct-tabs::-webkit-scrollbar { display: none; }
body.ct-on .ct-tab {
  display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font: 600 14px/1 var(--brand-font-body); color: var(--vx-text-2); padding: 10px 0 11px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
body.ct-on .ct-tab:hover { color: var(--brand-ink); }
body.ct-on .ct-tab.on { color: var(--brand-ink); border-bottom-color: var(--brand-accent); }
body.ct-on .ct-tab.locked { color: var(--vx-text-3); }
body.ct-on .ct-seg { display: inline-flex; flex-wrap: wrap; justify-self: start; background: var(--vx-fill); border-radius: 8px; padding: 3px; gap: 2px; }
body.ct-on .ct-seg button {
  border: 0; background: none; cursor: pointer; font: 600 12.5px/1 var(--brand-font-body); color: var(--vx-text-2); padding: 7px 11px; border-radius: 6px;
}
body.ct-on .ct-seg button.on { background: var(--vx-surface); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(var(--brand-ink-rgb), .12); }
@media (prefers-reduced-motion: reduce) { body.ct-on .ct-item, body.ct-on .ct-msg { transition: none; } }

/* Options on its own tab (17 Nov): the Open Options card alone; under Portfolio it is hidden. */
body.ct-on #page-dashboard:not(.ct-opts) #cd-options-card { display: none !important; }
body.ct-on #page-dashboard.ct-opts .content > :not(#cd-options-card):not(.disclaimer),
body.ct-on #page-dashboard.ct-opts .topbar { display: none !important; }
body.ct-on #page-dashboard.ct-opts #cd-options-card { margin-top: 18px; }

/* The cards under the holdings (17 Nov), the adviser record's look. The dated list replaces
   the old Dividend & Corporate Calendar card. */
body.ct-on #cd-events-card { display: none !important; }
body.ct-on .ct-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; align-items: stretch; }
@media (max-width: 1280px) { body.ct-on .ct-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.ct-on .ct-card { background: var(--vx-surface); border: 1px solid var(--vx-line); border-radius: 12px; display: flex; flex-direction: column; min-width: 0; }
body.ct-on .ct-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--vx-line); }
body.ct-on .ct-card-h h4 { margin: 0; font: 700 11.5px/1.2 var(--brand-font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); }
body.ct-on .ct-card-h span { font-size: 12px; color: var(--vx-text-3); text-align: right; }
body.ct-on .ct-card-b { flex: 1; padding: 8px 16px 14px; font-size: 13px; color: var(--brand-ink); }
body.ct-on .ct-empty { padding: 10px 0; font-size: 13px; color: var(--vx-text-3); }
body.ct-on .ct-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--vx-line); }
body.ct-on .ct-row:first-child, body.ct-on .ct-move:first-child, body.ct-on .ct-up:first-child { border-top: 0; }
body.ct-on .ct-row-m { min-width: 0; }
body.ct-on .ct-row-m a { color: var(--brand-ink); font-weight: 600; text-decoration: none; }
body.ct-on .ct-row-m a:hover { color: var(--brand-accent); text-decoration: underline; }
body.ct-on .ct-row-m small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--vx-text-3); }
body.ct-on .ct-row-w { font-size: 11.5px; color: var(--vx-text-3); white-space: nowrap; }
body.ct-on .ct-tag { display: inline-block; font: 700 11px/1 var(--brand-font-body); color: var(--brand-ink); border: 1px solid var(--vx-line); border-radius: 5px; padding: 4px 6px; min-width: 38px; text-align: center; }
body.ct-on .ct-move { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--vx-line); }
body.ct-on .ct-move-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--vx-text-2); }
body.ct-on .ct-move > span:nth-child(n+3) { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 56px; }
body.ct-on .ct-pos { color: var(--vx-good); }
body.ct-on .ct-neg { color: var(--vx-bad); }
body.ct-on .ct-up { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--vx-line); }
body.ct-on .ct-up-d { font-size: 11.5px; font-weight: 700; color: var(--vx-text-3); letter-spacing: .04em; }
body.ct-on .ct-shape { display: grid; grid-template-columns: 130px minmax(0, 1fr) 44px; gap: 10px; align-items: center; padding: 4px 0; font-size: 12.5px; }
body.ct-on .ct-shape span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--vx-text-2); }
body.ct-on .ct-shape i { display: block; height: 8px; border-radius: 6px; background: var(--vx-fill); overflow: hidden; }
body.ct-on .ct-shape b { display: block; height: 100%; border-radius: 6px; background: var(--brand-accent); }
body.ct-on .ct-shape em { font-style: normal; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
body.ct-on .ct-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; margin: 4px 0 0; }
body.ct-on .ct-kv dt { color: var(--vx-text-2); }
body.ct-on .ct-kv dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
body.ct-on .ct-note { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--vx-line); font-size: 12px; color: var(--vx-text-2); }
body.ct-on .ct-extra { display: none; }
body.ct-on .ct-all .ct-extra { display: grid; }
body.ct-on .ct-more { margin-top: 6px; border: 0; background: none; padding: 4px 0; cursor: pointer; font: 600 12.5px var(--brand-font-body); color: var(--brand-accent); }
