/* =========================================================================
   MMP Client Portal (LGIPS) – Multiple Trades prototype
   Tokens taken from the Figma variables of file wlgURDKgNwPXqQkZv7lEC4
   ========================================================================= */
:root {
  /* UI primary */
  --c-text: #2b2b2d;            /* UI-primary */
  --c-text-15: #505054;         /* UI-primary-lighten-15 */
  --c-text-25: #69696e;         /* UI-primary-lighten-25 */
  --c-border: #909094;          /* UI-primary-lighten-40 */
  --c-disabled: #9d9da1;        /* UI-primary-lighten-45 */
  --c-divider: #d9dadb;         /* UI-primary-lighten-70 */
  --c-surface-2: #f8f8f8;       /* UI-primary-lighten-80 */
  --c-white: #ffffff;
  /* UI secondary */
  --c-sec-8: #e9eef4;           /* UI-secondary-lighten-8 */
  --c-sec-11: #f3f6f9;          /* UI-secondary-lighten-11 */
  /* Brand */
  --c-primary: #0058aa;         /* brand-primary / signal-info */
  --c-secondary: #012169;       /* brand-secondary */
  --c-masthead: #011441;        /* brand-masthead */
  --c-accent: #77bdff;          /* brand-primary-lighten-40 */
  /* Signal */
  --c-error: #ce1234;
  --c-error-d8: #a80f2b;
  --c-error-l44: #fac6d0;
  --c-error-l52: #fef5f7;
  --c-success: #14a760;
  /* A11y adjustment: #14A760 with white 14px text is 3.1:1 (fails AA 1.4.3).
     Darkened success button background → 5.4:1. */
  --c-success-a11y: #0e7a46;
  --c-info-l59: #d8ecff;
  --c-info-d8: #004381;

  --shadow-dropdown: 0 4px 10px rgba(0, 0, 0, 0.14);
  --radius: 2px;
  --focus: 0 0 0 2px var(--c-white), 0 0 0 4px var(--c-primary);

  --font: "Avenir", "Avenir Next", "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --masthead-h: 60px;
  --sticky-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 14px;
  line-height: 16px;
  color: var(--c-text);
  background: var(--c-white);
}
img { display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }

/* ---------- Accessibility helpers ---------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 1000;
  background: var(--c-white); color: var(--c-primary); font-weight: 800;
  padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow-dropdown);
}
.skip-link:focus { top: 12px; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.masthead :focus-visible { outline-color: var(--c-white); outline-offset: -4px; }
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText; }
  .ico img { forced-color-adjust: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Icons (SVGs rendered at their native size, centred in a box) ---------- */
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ico-24 { width: 24px; height: 24px; }
.ico-16 { width: 16px; height: 16px; }
.ico-40 { width: 40px; height: 40px; }
.ico-rot180 img { transform: rotate(180deg); }

/* ---------- Typography ---------- */
.t-h1 { font-size: 24px; line-height: 32px; font-weight: 800; }
.t-h2 { font-size: 22px; line-height: 28px; font-weight: 800; }
.t-h4 { font-size: 16px; line-height: 20px; font-weight: 800; }
.t-d1 { font-size: 14px; line-height: 16px; font-weight: 800; }
.t-d2 { font-size: 12px; line-height: 12px; font-weight: 800; }
.t-b1 { font-size: 14px; line-height: 16px; font-weight: 500; }
.t-b2 { font-size: 12px; line-height: 14px; font-weight: 500; }
.muted { color: var(--c-text-25); }

/* =========================================================================
   Masthead
   ========================================================================= */
.masthead {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: stretch; justify-content: space-between;
  min-height: var(--masthead-h); background: var(--c-masthead); color: var(--c-white);
}
.masthead__left { display: flex; align-items: center; gap: 28px; padding-left: 20px; min-width: 0; }
.logo { position: relative; width: 52px; height: 35px; flex: none; color: inherit; }
.logo span { position: absolute; display: flex; align-items: center; justify-content: center; }
.logo span.flip img { transform: scaleY(-1); }
.nav { display: flex; align-items: stretch; flex-wrap: wrap; }
.nav__item { position: relative; display: flex; }
.nav__link {
  position: relative; display: flex; align-items: center; gap: 0; padding: 0 16px;
  min-height: var(--masthead-h); color: var(--c-white); text-decoration: none;
  background: none; border: 0; white-space: nowrap;
}
.nav__link:hover { text-decoration: underline; }
.nav__link[aria-current="page"]::after,
.nav__link.is-current::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--c-accent);
}
.nav__badge { position: absolute; top: 20px; right: 39px; width: 8px; height: 8px; }
.nav__menu {
  position: absolute; top: 100%; left: 0; min-width: 220px; z-index: 60;
  background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-dropdown);
  border: 1px solid var(--c-divider); border-radius: var(--radius); padding: 4px 0;
}
.nav__menu a { display: block; padding: 12px 16px; color: var(--c-text); text-decoration: none; }
.nav__menu a:hover { background: var(--c-sec-11); text-decoration: underline; }
.nav__menu a[aria-current="page"] { font-weight: 800; }
.nav__menu--right { left: auto; right: 0; }
.profile {
  display: flex; align-items: center; gap: 19px; padding-right: 20px; background: none; border: 0;
  color: var(--c-white); text-align: left;
}
.profile__divider { width: 1px; align-self: stretch; background: var(--c-text-15); }
.profile__text { display: flex; flex-direction: column; gap: 4px; }
.profile__name { font-size: 14px; line-height: 16px; }
.profile__org { font-size: 12px; line-height: 12px; }
.profile-wrap { position: relative; display: flex; }

/* =========================================================================
   Page layout
   ========================================================================= */
.page { padding-bottom: calc(var(--sticky-h) + 48px); }
.page__title { padding: 22px 20px; }
.page__title--bordered { border-bottom: 1px solid var(--c-divider); }

/* Stepper */
.stepper { background: var(--c-white); border-bottom: 1px solid var(--c-primary); }
.stepper ol { display: flex; gap: 4px; }
.stepper li {
  flex: 1 1 0; display: flex; flex-direction: column; gap: 7px; padding-top: 12px; min-height: 39px;
  background: var(--c-sec-11); color: var(--c-text-25);
}
.stepper li > span:first-child { display: flex; align-items: center; gap: 8px; padding-left: 20px; }
.stepper li::after { content: ""; height: 4px; background: var(--c-sec-11); margin-top: auto; }
.stepper li[aria-current="step"] { background: var(--c-sec-8); color: var(--c-text); font-weight: 800; }
.stepper li[aria-current="step"]::after { background: var(--c-primary); }
.stepper li.is-done { background: var(--c-surface-2); }
.stepper li.is-done::after { background: var(--c-disabled); }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 24px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 14px; line-height: 16px; font-weight: 800; text-transform: uppercase; white-space: nowrap;
  text-decoration: none;
}
.btn--primary { background: var(--c-primary); color: var(--c-white); }
.btn--primary:hover { background: var(--c-info-d8); }
.btn--secondary-dark { background: var(--c-secondary); color: var(--c-white); }
.btn--outline { background: var(--c-white); color: var(--c-primary); border-color: var(--c-primary); }
.btn--outline:hover { background: var(--c-sec-11); }
.btn--outline-danger { background: var(--c-white); color: var(--c-error); border-color: var(--c-error); }
.btn--outline-danger:hover { background: var(--c-error-l52); }
.btn--danger { background: var(--c-error); color: var(--c-white); }
.btn--danger:hover { background: var(--c-error-d8); }
.btn--success { background: var(--c-success-a11y); color: var(--c-white); }
.btn--small { min-height: 32px; padding: 0 16px; font-size: 12px; line-height: 12px; }
.btn--xs { min-height: 24px; padding: 0 12px; font-size: 12px; line-height: 12px; }
.btn--ghost { background: none; color: var(--c-text-25); }
.btn--wide { min-width: 206px; }
.btn[aria-disabled="true"], .btn:disabled {
  cursor: not-allowed; background: var(--c-white); color: var(--c-divider); border-color: var(--c-divider);
}
.btn--primary[aria-disabled="true"], .btn--primary:disabled { background: var(--c-divider); color: var(--c-white); border-color: var(--c-divider); }
.btn--select-toggle { width: 100%; }
.btn--deselect { background: var(--c-white); color: var(--c-error); border-color: var(--c-error); }

.link {
  background: none; border: 0; padding: 0; color: var(--c-primary); font-weight: 800;
  text-decoration: underline; text-transform: uppercase; text-underline-offset: 2px;
}
.link[aria-disabled="true"] { color: var(--c-divider); cursor: not-allowed; }
.link-info {
  display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0;
  color: var(--c-primary); font-size: 12px; line-height: 12px; font-weight: 500; text-align: left;
}
.link-info:hover > span:last-child { text-decoration: underline; }
.text-btn {
  background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit;
}
.text-btn:hover { text-decoration: underline; }
.text-btn .sub { display: block; }

/* =========================================================================
   Form controls
   ========================================================================= */
.field {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px;
  background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius);
  text-align: left; color: var(--c-text);
}
.field:hover { border-color: var(--c-text-25); }
.field__value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field__value.is-placeholder { color: var(--c-text-25); }
.field > .ico-24:last-child { width: 16px; }
.field[aria-disabled="true"], .field:disabled, .field.is-disabled {
  background: var(--c-surface-2); border-color: var(--c-divider); color: var(--c-text-25); cursor: not-allowed;
}
.field[aria-invalid="true"] { border-color: var(--c-error); }
.field[aria-expanded="true"] { border-color: var(--c-primary); }
.field--lg { min-height: 36px; }
.field input, .field textarea {
  flex: 1 1 auto; min-width: 0; border: 0; padding: 0; background: transparent; outline: none;
}
.field:focus-within { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.field:has(> [role="combobox"]:focus-visible) { outline: none; }
.field input::placeholder, .field textarea::placeholder { color: var(--c-text-25); opacity: 1; }
.field--amount { justify-content: flex-end; }
.field--amount .prefix { color: var(--c-text-25); font-size: 12px; line-height: 12px; flex: none; }
.field--amount input { text-align: right; }
@supports (field-sizing: content) {
  .field--amount input { flex: 0 1 auto; field-sizing: content; min-width: 4ch; }
  .field--amount { cursor: text; }
}
.field--textarea { align-items: stretch; padding: 8px; min-height: 100px; }
.field--textarea textarea { resize: vertical; min-height: 82px; }

.label { display: block; color: var(--c-text-25); font-size: 12px; line-height: 12px; }
.label .req { color: var(--c-primary); }
.error-msg { color: var(--c-error); font-size: 12px; line-height: 14px; margin-top: 6px; }
.hint { color: var(--c-text-25); font-size: 12px; line-height: 14px; }

/* Select-only combobox */
.combo { position: relative; width: 100%; }
.combo [role="combobox"] { cursor: pointer; }
.combo [role="combobox"][aria-disabled="true"] { cursor: not-allowed; }
.listbox {
  position: absolute; z-index: 40; top: calc(100% + 1px); left: 0; min-width: 100%;
  max-height: 280px; overflow-y: auto;
  background: var(--c-white); box-shadow: var(--shadow-dropdown); border-radius: 0 0 var(--radius) var(--radius);
}
.listbox [role="option"] {
  padding: 8px 12px; min-height: 32px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  cursor: pointer; white-space: nowrap;
}
.listbox [role="option"]:hover { background: var(--c-sec-11); }
.listbox [role="option"].is-active { background: var(--c-primary); color: var(--c-white); font-weight: 800; }
.listbox [role="option"].is-active .t-b2 { color: var(--c-white); }
.listbox [role="option"][aria-selected="true"]:not(.is-active) { font-weight: 800; }
.listbox [role="option"].is-active { outline: 2px solid var(--c-info-d8); outline-offset: -2px; }
.listbox__empty { padding: 12px; color: var(--c-text-25); }

/* Participant picker (button + searchable listbox) */
.picker { display: flex; align-items: center; gap: 4px; width: 472px; max-width: 100%; position: relative; }
.picker .label { white-space: nowrap; }
.picker__control { position: relative; flex: 1 1 auto; min-width: 0; }
.picker__panel {
  position: absolute; z-index: 45; top: calc(100% + 1px); left: 0; right: 0;
  background: var(--c-white); box-shadow: var(--shadow-dropdown);
}
.picker__search { padding: 12px; }
.picker__panel .listbox { position: static; box-shadow: none; max-height: 240px; }

/* Date field */
.date-wrap { position: relative; width: 100%; }

/* Popovers (Holdings info, Additional details, Full liquidation) */
.pop-wrap { position: relative; display: inline-block; }
.popover {
  position: absolute; z-index: 35; top: calc(100% + 6px); left: 0;
  background: var(--c-white); box-shadow: var(--shadow-dropdown); border-radius: 4px;
  padding: 16px; color: var(--c-text); font-size: 14px; line-height: 20px; white-space: nowrap;
}
.popover--small { padding: 4px 8px; border: 1px solid var(--c-divider); box-shadow: none; border-radius: 0; font-size: 12px; line-height: 16px; white-space: normal; width: 200px; }
.popover dl { display: grid; grid-template-columns: auto auto; column-gap: 24px; row-gap: 2px; margin: 0; }
.popover dt { font-weight: 500; }
.popover dd { margin: 0; text-align: right; font-weight: 800; }
.popover dd .cur { font-weight: 500; font-size: 12px; }

/* Calendar dialog */
.calendar {
  position: absolute; z-index: 45; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  width: 312px; background: var(--c-white); border: 1px solid var(--c-divider); border-radius: var(--radius);
  box-shadow: var(--shadow-dropdown);
}
.calendar__top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; border-bottom: 1px solid var(--c-divider); }
.calendar__nav { background: none; border: 0; padding: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.calendar__nav:hover { background: var(--c-sec-11); }
.calendar__title { display: flex; gap: 12px; font-size: 16px; line-height: 20px; font-weight: 800; }
.calendar__grid { border-collapse: separate; border-spacing: 8px; margin: 0 12px; }
.calendar__grid th { width: 32px; height: 32px; font-size: 12px; line-height: 12px; font-weight: 500; color: var(--c-text-25); text-align: center; padding: 0; }
.calendar__grid td { padding: 0; width: 32px; height: 32px; }
.day {
  width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--radius);
  background: none; font-weight: 800; color: var(--c-text);
}
.day:hover:not([aria-disabled="true"]) { background: var(--c-sec-11); }
.day[aria-disabled="true"] { background: var(--c-surface-2); color: var(--c-disabled); cursor: not-allowed; }
.day.is-outside { color: var(--c-disabled); }
.day[aria-selected="true"] { border-color: var(--c-border); }
.day.is-today { text-decoration: underline; }
.calendar__msg { margin: 0 16px 12px; padding: 8px; font-size: 12px; line-height: 16px; background: var(--c-error-l52); border-left: 3px solid var(--c-error); }
.calendar__actions { display: flex; justify-content: space-between; padding: 12px 15px; border-top: 1px solid var(--c-divider); }

/* =========================================================================
   Badges / alerts
   ========================================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 8px;
  border-radius: var(--radius); background: var(--c-error-l44); font-weight: 800; white-space: nowrap;
}
.alert-bar {
  position: fixed; left: 0; right: 0; bottom: var(--sticky-h); z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 4px 360px; min-height: 32px;
  background: var(--c-error-l52); font-weight: 800;
}
.info-banner { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--c-info-l59); border-radius: var(--radius); font-weight: 800; }
.info-banner a { color: inherit; }

/* =========================================================================
   Sticky action bar
   ========================================================================= */
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  min-height: var(--sticky-h); padding: 14px 360px; background: var(--c-white); border-top: 1px solid var(--c-divider);
}
.sticky-bar__right { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.count { color: var(--c-text-15); }
.count strong { font-weight: 800; }
@media (max-width: 1440px) { .sticky-bar, .alert-bar { padding-left: 20px; padding-right: 20px; } }

/* =========================================================================
   Trade entry groups + table
   ========================================================================= */
.groups { min-width: 1600px; }
.group__head {
  display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 8px 20px;
  border-bottom: 1px solid var(--c-divider); background: var(--c-white);
}
.group__toggle { display: inline-flex; align-items: center; gap: 16px; background: none; border: 0; padding: 0; font-size: 16px; line-height: 20px; font-weight: 800; color: var(--c-text); }
.group__toggle:hover .group__name { text-decoration: underline; }
.group__badges { display: flex; gap: 12px; flex-wrap: wrap; }
.group__body { border-bottom: 1px solid var(--c-text); }
.group--last-open .group__body { border-bottom-color: var(--c-primary); }

.tt { width: 100%; border-collapse: separate; border-spacing: 2px 0; table-layout: fixed; margin: 0 -2px; width: calc(100% + 4px); }
.tt > thead > tr > th {
  background: var(--c-surface-2); font-weight: 800; text-align: left; vertical-align: middle;
  padding: 8px 12px; min-height: 47px; height: 47px; border-bottom: 1px solid var(--c-divider);
}
.tt > thead > tr > th.num { text-align: right; }
.tt > thead > tr > th.first { padding-left: 60px; }
.tt > tbody > tr > td, .tt > tbody > tr > th {
  vertical-align: top; text-align: left; font-weight: 500; padding: 16px 12px 8px;
  border-bottom: 1px solid var(--c-divider);
}
.tt > tbody > tr:last-child > * { border-bottom: 0; }
.tt > tbody > tr > th.first { padding-left: 60px; }
.tt > tbody > tr > .num { text-align: right; }
.tt > tbody > tr > .ctl { padding: 8px 4px; }
.tt > tbody > tr > .cell-date { padding: 8px 4px 9px; }
.tt .acct__nbr { display: block; font-size: 14px; line-height: 16px; }
.tt .acct__sub { display: block; color: var(--c-text-25); font-size: 12px; line-height: 14px; }
.tt .acct__info { margin-top: 10px; }
.tt .muted-cell { color: var(--c-text-25); }
.tt .stack { display: flex; flex-direction: column; gap: 8px; }
.tt .time { text-align: right; }
.cutoff-cell { background: var(--c-error-l44); }
.cutoff-note { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 12px; line-height: 14px; font-weight: 800; margin-top: 4px; }
.tt > tbody > tr > .cell-del { padding: 0 4px; vertical-align: middle; text-align: center; }
.icon-btn { background: none; border: 0; padding: 0; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.icon-btn:hover { background: var(--c-error-l52); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.bank__sub, .sub { display: block; color: var(--c-text-25); font-size: 12px; line-height: 14px; }

/* Inline delete confirmation */
.tt > tbody > tr.confirm-row > td { background: var(--c-error-l44); padding: 24px 20px 24px 60px; vertical-align: middle; }
.confirm-row__inner { display: flex; align-items: center; gap: 16px; }
.confirm-row__msg { display: flex; align-items: center; gap: 8px; font-weight: 800; flex: 1 1 auto; }
.confirm-row__msg .ico { margin-left: -2px; }
.confirm-row__actions { display: flex; gap: 10px; }

.add-account {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 48px; padding: 12px 12px 12px 20px;
  background: var(--c-sec-8); border: 0; color: var(--c-secondary); font-size: 12px; line-height: 12px; font-weight: 800; text-align: left; text-transform: uppercase;
}
.add-account:hover span:last-child { text-decoration: underline; }
.add-account:disabled { color: var(--c-disabled); cursor: not-allowed; }
.add-account:disabled img { opacity: .4; }

/* Empty state */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 200px 20px;
  text-align: center;
}
.empty--error .empty__msg { color: var(--c-error); }

/* Review table tweaks */
.tt--review > tbody > tr > td, .tt--review > tbody > tr > th { vertical-align: middle; padding-top: 8px; padding-bottom: 8px; min-height: 76px; height: 76px; }
.tt--review .amount-sub { display: block; font-size: 12px; line-height: 14px; color: var(--c-text-25); }
.tt--review .cur { font-size: 12px; color: var(--c-text-25); margin-right: 4px; }

/* =========================================================================
   Confirmation
   ========================================================================= */
.confirm-hero { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 20px 40px; text-align: center; }
.confirm-hero p { max-width: 720px; }
.scroll-region { overflow-x: auto; border-bottom: 1px solid var(--c-divider); }
.scroll-region:focus-visible { outline-offset: -2px; }
.ct { border-collapse: separate; border-spacing: 2px 0; min-width: 2066px; width: 100%; table-layout: fixed; }
.ct thead th { background: var(--c-surface-2); font-weight: 800; text-align: left; padding: 8px 12px; height: 47px; border-bottom: 1px solid var(--c-divider); }
.ct thead th.num { text-align: right; }
.ct tbody td, .ct tbody th { padding: 8px 12px; font-weight: 500; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--c-divider); height: 64px; }
.ct .num { text-align: right; }
.ct .status-col { position: sticky; right: 0; z-index: 1; border-left: 3px solid var(--c-text-15); }
.ct thead .status-col { background: var(--c-surface-2); border-left-color: transparent; }
.ct tbody .status-col { background: var(--c-white); border-left-color: var(--c-text-15); }
.ct tbody .status--accepted { background: #eef6fd; border-left-color: var(--c-primary); }
.ct tbody .status--rejected { background: var(--c-error-l52); border-left-color: var(--c-error); }
.ct .part { display: flex; align-items: flex-start; gap: 8px; }
.ct .part__toggle-space { width: 24px; flex: none; }
.ct tr.is-expanded > * { background: var(--c-sec-11); }
.ct tr.detail-row > td { background: var(--c-sec-11); padding: 20px 52px; height: auto; border-bottom: 1px solid var(--c-primary); }
.ct tr.detail-row .detail { position: sticky; left: 52px; display: inline-flex; align-items: center; gap: 16px; padding: 24px; background: var(--c-white); border-radius: var(--radius); }
.copy-btn { background: none; border: 0; padding: 0; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.copy-ico { position: relative; width: 16px; height: 16px; display: inline-block; }
.copy-ico::before, .copy-ico::after { content: ""; position: absolute; width: 8px; height: 8px; background: var(--c-white); border: 1px solid var(--c-secondary); border-radius: 1px; }
.copy-ico::before { left: 2.67px; top: 5.33px; }
.copy-ico::after { left: 5.33px; top: 2.67px; }
.add-details { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================================================
   Modal dialogs
   ========================================================================= */
.overlay {
  position: fixed; inset: var(--masthead-h) 0 0 0; z-index: 100;
  background: rgba(43, 43, 45, 0.85);
  display: flex; align-items: flex-start; justify-content: center; padding: 210px 20px 20px; overflow-y: auto;
}
.overlay--center { align-items: center; padding-top: 20px; }
.modal {
  position: relative; width: 1200px; max-width: 100%; background: var(--c-white); border-radius: var(--radius);
  display: flex; flex-direction: column; max-height: calc(100vh - var(--masthead-h) - 40px);
}
.modal--md { width: 1024px; }
.modal--confirm { width: 840px; min-height: 396px; }
.modal--sm { width: 480px; }
.modal__head { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--c-divider); }
.modal__head h2 { flex: 1 1 auto; }
.modal__close { background: none; border: 0; padding: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.modal__close:hover { background: var(--c-sec-11); }
.modal__body { padding: 24px 20px 20px; overflow-y: auto; flex: 1 1 auto; }
.modal__body--center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--c-divider); flex-wrap: wrap; }
.modal__foot .error-msg { margin: 0 auto 0 0; }
.modal-search { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; }
.modal-search .label { padding-left: 8px; }
.mt { width: 100%; border-collapse: separate; border-spacing: 2px 0; margin-top: 16px; table-layout: fixed; }
.mt thead th { background: var(--c-surface-2); padding: 0; height: 47px; border-bottom: 1px solid var(--c-divider); font-weight: 800; text-align: left; }
.mt thead th.num { text-align: right; }
.sort-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 100%; min-height: 47px; padding: 8px 12px; background: none; border: 0; font-weight: 800; text-align: left; }
.num .sort-btn { justify-content: flex-end; text-align: right; }
.sort-btn:hover span:first-child { text-decoration: underline; }
.sort-ind { font-size: 10px; color: var(--c-text-25); }
.sort-ind:empty { display: none; }
.sort-btn > span:first-child { white-space: nowrap; }
.sort-btn > span.wrap { white-space: normal; }
.mt tbody td, .mt tbody th { padding: 8px 12px; text-align: left; font-weight: 500; border-bottom: 1px solid var(--c-divider); vertical-align: middle; height: 48px; }
.mt tbody .num { text-align: right; }
.mt tbody .act { padding: 8px 4px; }
.mt .cur { font-size: 12px; color: var(--c-text-25); margin-right: 4px; }
/* The table reaches 2px past each side (its outer cell spacing), which put a 4px sideways scrollbar under
   the list; only the vertical scroll is wanted, so that empty spacing is clipped */
.mt-scroll { max-height: 400px; overflow-y: auto; overflow-x: hidden; }
.mt-empty { padding: 32px; text-align: center; color: var(--c-text-25); }
.counter { text-align: right; font-size: 12px; line-height: 14px; color: var(--c-text-25); margin-top: 6px; padding-right: 8px; }

/* Toast / status */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--sticky-h) + 48px); transform: translateX(-50%); z-index: 200;
  background: var(--c-text); color: var(--c-white); padding: 12px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow-dropdown); max-width: 90vw;
}

/* ---------- Polish ---------- */
.calendar__grid td { text-align: center; }
.cutoff-note { white-space: nowrap; }
.tt--review > tbody > tr > .cutoff-cell { padding-left: 4px; }
h1[tabindex="-1"] { display: inline-block; }

/* Portfolio embed: the table reaches 2px past each side to cancel its outer cell spacing, which put a
   2px horizontal scrollbar in the 1600px window. Clipping that empty spacing removes it; cells are unchanged. */
.groups { overflow-x: clip; }

/* Portfolio embed: no vertical scrollbar inside the case study's frame; the page still scrolls with the
   wheel, trackpad and keys. Chrome and Safari keep a visible horizontal bar for a window narrower than the
   1600px table (the embed never is). Firefox can't hide one axis only, so there both go, which loses
   nothing here. Opened on its own, the prototype keeps its normal scrollbars. */
html.is-embedded::-webkit-scrollbar { width: 0; height: 12px; }
html.is-embedded::-webkit-scrollbar-track { background: #f0f0f0; }
html.is-embedded::-webkit-scrollbar-thumb { border: 3px solid #f0f0f0; border-radius: 6px; background: #a8a8a8; }
@supports not selector(::-webkit-scrollbar) {
  html.is-embedded { scrollbar-width: none; }
}

/* Portfolio embed: the case study's frame is a 1600 x 905 window, too short for a modal 210px down.
   Every modal is centred in the space under the masthead instead, so it fits without the overlay
   scrolling. Opened on its own, the prototype keeps its normal placement. */
html.is-embedded .overlay { align-items: center; padding-top: 20px; overflow-y: hidden; }
/* Portfolio embed: with no trades yet, the page ran 7px past the 905px frame and scrolled. A little less
   room under the content (41px above the sticky bar instead of 48px) makes it fit. */
html.is-embedded .page { padding-bottom: calc(var(--sticky-h) + 41px); }
