/* Asset Management Simulation, participant app.

   am.html loads participant-shell.css and portfolio-sim.css: the shell, the
   sidebar, the tiled panels and the hedge fund pages' rules, which the
   fund's pages reuse class for class. This file holds only what this sim
   adds (design spec section 2), every rule under am-, and uses the
   platform's and the participant shell's own variables only. */

/* The lockup name at the size the Capital Markets header has, for the same
   reason (console.css has the same rule for the trainer and admin headers). */
body[data-sim="assetmanagement"] .header-logo-mount .lockup-led {
  --led-name-size: 19px;
}

/* ── Trading Desk: the market grid ─────────────────────────────────────

   Seven columns: symbol, bid, ask, daily %, the fund's weight, the
   benchmark's weight, the active weight. Every column is given a share, as
   on the hedge fund grid, because under `table-layout: fixed` an unsized
   column takes only the remainder. Each variant is redeclared in full. */
#pm-workspace .am-market th:nth-child(1) { width: 12%; }
#pm-workspace .am-market th:nth-child(2),
#pm-workspace .am-market th:nth-child(3) { width: 15%; }
#pm-workspace .am-market th:nth-child(4) { width: 13%; }
#pm-workspace .am-market th:nth-child(5),
#pm-workspace .am-market th:nth-child(6),
#pm-workspace .am-market th:nth-child(7) { width: 15%; }
/* The international grid leads on the name (the hedge fund rule). */
#pm-workspace .am-market--named th:nth-child(1) { width: 25%; }
#pm-workspace .am-market--named th:nth-child(2),
#pm-workspace .am-market--named th:nth-child(3) { width: 13%; }
#pm-workspace .am-market--named th:nth-child(4) { width: 11%; }
#pm-workspace .am-market--named th:nth-child(5),
#pm-workspace .am-market--named th:nth-child(6),
#pm-workspace .am-market--named th:nth-child(7) { width: 12.6%; }
/* The bond grid: name, rating, bid and ask yields, the move in basis
   points, and the three weights. */
#pm-workspace .am-market--rated th:nth-child(1) { width: 23%; }
#pm-workspace .am-market--rated th:nth-child(2) { width: 8%; }
#pm-workspace .am-market--rated th:nth-child(3),
#pm-workspace .am-market--rated th:nth-child(4) { width: 11%; }
#pm-workspace .am-market--rated th:nth-child(5) { width: 10%; }
#pm-workspace .am-market--rated th:nth-child(6),
#pm-workspace .am-market--rated th:nth-child(7),
#pm-workspace .am-market--rated th:nth-child(8) { width: 12.3%; }

/* The ticket: the target weight takes the fourth column of the size row,
   where the hedge fund ticket has its four scale buttons, and the five
   weight buttons take a row of their own under it, one size each, so the
   Benchmark label fits whole. The label is a word, so it keeps the body
   font; the steps are figures and keep the mono face of the hedge fund
   buttons (.pm-ticket-close .btn). */
#pm-workspace .am-ticket-steps { grid-column: 1 / -1; }
#pm-workspace .am-ticket-steps .am-step-bench { font-family: var(--font); }

/* ── The fill pages' content box, for the page the hedge fund app has not
   got (portfolio-sim.css lists its own pages by id). ─────────────────── */
#pm-workspace.pm-fill-active .am-fill-content {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  font-feature-settings: 'tnum' 1, 'lnum' 1, 'zero' 1;
  /* The Trading Desk's table size (participant-shell.css .pm-table): the
     two working pages read alike (owner, 2026-11-08). */
  font-size: 0.85rem;
  color: var(--text);
}

/* ── Portfolio construction ────────────────────────────────────────── */

/* The type of the Trading Desk, not of the redesigned reading pages
   (owner, 2026-11-08): a pane's title as a desk card's title
   (participant-shell.css .pm-frame-title), its note as the card's note
   (.pm-frame-note), the column headings as the desk tables' headings
   (.pm-table th) further down. */
#pm-workspace #pm-portfolio-content .pm-pane-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-secondary);
}
#pm-workspace #pm-portfolio-content .pm-pane-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

#pm-workspace .am-pc {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#pm-workspace .am-pc .num { font-family: var(--font-mono); }
#pm-workspace .am-pc .is-pos { color: var(--positive); }
#pm-workspace .am-pc .is-neg { color: var(--negative); }
#pm-workspace .am-pc-grid {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  gap: 8px;
  padding: 8px;
  grid-template-columns: minmax(0, 800fr) minmax(0, 640fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: 'book cash' 'book preview';
}
#pm-workspace .am-pc-book { grid-area: book; }
#pm-workspace .am-pc-cash { grid-area: cash; }
#pm-workspace .am-pc-preview { grid-area: preview; }
#pm-workspace .am-pc-scroll,
#pm-workspace .am-pc-preview-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

/* The target weights: the name, the three weights, the target, the weight
   after the previewed orders and the order. At 1366 wide the name keeps
   about 180px, enough for the longest bond name the grid shows. */
#pm-workspace .am-pc-thead,
#pm-workspace .am-pc-row,
#pm-workspace .am-pc-group {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 88px 76px 80px 84px 76px 100px;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
#pm-workspace .am-pc-thead {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 28px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  /* The desk tables' heading (participant-shell.css .pm-table th). */
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
#pm-workspace .am-pc-row {
  height: 32px;
  border-bottom: 1px solid var(--pm-subtle);
  cursor: default;
}
#pm-workspace .am-pc-row:hover { background: var(--pm-hover); }
#pm-workspace .am-pc-row.is-sel { background: var(--pm-sel); }
#pm-workspace .am-pc-group {
  height: 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--pm-subtle);
  font-weight: 600;
  color: var(--text-secondary);
}
#pm-workspace .am-pc-name { font-weight: 500; }
#pm-workspace .am-pc-input {
  height: 26px;
  padding: 2px 6px;
  text-align: right;
  font-family: var(--font-mono);
}

/* Invest or raise cash. */
#pm-workspace .am-pc-cash-body { padding: 8px 10px 10px; }
#pm-workspace .am-pc-kv,
#pm-workspace .am-pr-kv {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  height: 28px;
  align-items: center;
  border-bottom: 1px solid var(--pm-subtle);
  white-space: nowrap;
}
#pm-workspace .am-pc-notice {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
#pm-workspace .am-pc-invest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 96px;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}

/* The preview: the fund now and after, the orders, the limits after. */
#pm-workspace .am-pc-preview-body { padding: 0 0 8px; }
#pm-workspace .am-pc-preview-body > .pm-ticket-message,
#pm-workspace .am-pc-preview-body > .pm-placeholder { margin: 8px 10px; }
#pm-workspace .am-pc-sub {
  padding: 10px 10px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
#pm-workspace .am-pc-note {
  margin: 6px 10px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
#pm-workspace .am-pc-ahead,
#pm-workspace .am-pc-arow,
#pm-workspace .am-pr-ahead,
#pm-workspace .am-pr-arow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 110px;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
#pm-workspace .am-pc-ahead,
#pm-workspace .am-pr-ahead,
#pm-workspace .am-pc-ohead,
#pm-workspace .am-pc-lhead {
  height: 26px;
  border-bottom: 1px solid var(--border);
  font-size: var(--pm-fs-note);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* On Portfolio construction the headings take the desk tables' type
   (participant-shell.css .pm-table th); Performance & Risk keeps the
   redesigned pages' type above. */
#pm-workspace .am-pc-ahead,
#pm-workspace .am-pc-ohead,
#pm-workspace .am-pc-lhead {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
#pm-workspace .am-pc-arow,
#pm-workspace .am-pr-arow,
#pm-workspace .am-pc-orow,
#pm-workspace .am-pc-lrow {
  height: 28px;
  border-bottom: 1px solid var(--pm-subtle);
}
#pm-workspace .am-pc-ohead,
#pm-workspace .am-pc-orow {
  display: grid;
  grid-template-columns: 44px 76px minmax(0, 1fr) 112px 72px 72px;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
#pm-workspace .am-pc-lhead,
#pm-workspace .am-pc-lrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 92px 90px 52px;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
#pm-workspace .am-pc-lrow.is-breach { background: var(--pm-sel); }
#pm-workspace .am-pc-meter { margin: 0; }

/* ── Performance & Risk ───────────────────────────────────────────── */

#pm-workspace .am-pr-grid--return {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: 'index active' 'since income';
}
#pm-workspace .am-pr-index { grid-area: index; }
#pm-workspace .am-pr-active { grid-area: active; }
#pm-workspace .am-pr-since { grid-area: since; }
#pm-workspace .am-pr-income { grid-area: income; }
#pm-workspace .am-pr-kvs { padding: 0 10px 6px; }
#pm-workspace .am-pr-kvs--two { padding: 0 0 6px; }

#pm-workspace .am-pr-grid--te {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: 'band contrib' 'groups contrib';
}
#pm-workspace .am-pr-grid--te.has-bond {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto;
  grid-template-areas: 'band contrib' 'groups contrib' 'bond contrib';
}
#pm-workspace .am-pr-band { grid-area: band; }
#pm-workspace .am-pr-contrib { grid-area: contrib; }
#pm-workspace .am-pr-groups { grid-area: groups; }
#pm-workspace .am-pr-bond { grid-area: bond; }
#pm-workspace .am-pr-bandkey { background: var(--info); opacity: 0.35; }

#pm-workspace .am-pr-ctable,
#pm-workspace .am-pr-gtable {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}
#pm-workspace .am-pr-chead,
#pm-workspace .am-pr-crow {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 104px 104px minmax(80px, 160px);
  gap: 10px;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
#pm-workspace .am-pr-ghead,
#pm-workspace .am-pr-grow {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 76px 92px 80px minmax(80px, 160px);
  gap: 10px;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
#pm-workspace .am-pr-chead,
#pm-workspace .am-pr-ghead {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 28px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-size: var(--pm-fs-note);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
#pm-workspace .am-pr-crow,
#pm-workspace .am-pr-grow {
  height: 30px;
  border-bottom: 1px solid var(--pm-subtle);
}

#pm-workspace .am-pr-grid--limits {
  grid-template-columns: minmax(0, 640fr) minmax(0, 494fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: 'limits breaches';
}
/* The fund's limits table: measure, value, limit, the meter, the usage and
   the state; the hedge fund table's "quoted against" column has no
   counterpart, every weight being against the fund's value. */
#pm-workspace .am-pr-limtable {
  grid-template-columns: minmax(80px, 1fr) auto auto minmax(120px, 170px) auto auto;
}

/* ── Debrief ──────────────────────────────────────────────────────── */

#pm-workspace .am-db-srow { grid-template-columns: 30px minmax(0, 1fr) 64px 100px 100px; }
#pm-workspace .am-db-irow { grid-template-columns: 36px minmax(0, 1fr) repeat(4, 104px); }

#pm-workspace .am-db-grid--attribution {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  align-content: start;
}
#pm-workspace .am-db-grid--readings {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-auto-rows: auto;
  align-content: start;
}
#pm-workspace .am-db-bhead,
#pm-workspace .am-db-brow {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) repeat(6, 112px);
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
#pm-workspace .am-db-fhead,
#pm-workspace .am-db-frow {
  display: grid;
  grid-template-columns: minmax(140px, 260px) 112px minmax(120px, 320px);
  gap: 12px;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
#pm-workspace .am-db-mthead,
#pm-workspace .am-db-mtrow {
  display: grid;
  grid-template-columns: 60px 100px repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
#pm-workspace .am-db-brhead,
#pm-workspace .am-db-brrow {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 70px 70px 190px 100px;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
#pm-workspace .am-db-bhead,
#pm-workspace .am-db-fhead,
#pm-workspace .am-db-mthead,
#pm-workspace .am-db-brhead {
  min-height: 28px;
  border-bottom: 1px solid var(--border);
  font-size: var(--pm-fs-note);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
#pm-workspace .am-db-brow,
#pm-workspace .am-db-frow,
#pm-workspace .am-db-mtrow,
#pm-workspace .am-db-brrow {
  height: 30px;
  border-bottom: 1px solid var(--pm-subtle);
}
#pm-workspace .am-db-brow.is-ruled,
#pm-workspace .am-db-frow.is-ruled { border-top: 1px solid var(--border); }
#pm-workspace .am-db-brow.is-strong,
#pm-workspace .am-db-frow.is-strong { font-weight: 600; }
/* The readings' rows: the name takes what is left, the result and the
   median their own columns. */
#pm-workspace .am-db-mrow { grid-template-columns: minmax(0, 1fr) 130px 130px; }
#pm-workspace .am-db-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 10px 10px;
}
#pm-workspace .am-db-lists ul { margin: 6px 0 0; padding-left: 18px; }

/* The count on the Portfolio construction tab (pb-sim.css and st-sim.css,
   the same rule): the name stays where it is whether a count shows or
   not, and the gap before the count is a margin, not a space character. */
#header-tab-nav .tab-btn .badge[data-count] {
  vertical-align: middle;
  margin-block: -1em;
  margin-left: 8px;
  border-radius: 0;
}
