:root {
  --ink: #10243e;
  --exchange: #2457a6;
  --signal: #0f8190;
  --paper: #f5f7fa;
  --line: #d8e0e9;
  --amber: #b46b12;
  --loss: #b53a45;
  --white: #ffffff;
  --shadow: 0 8px 30px rgba(16, 36, 62, .07);
}

* { box-sizing: border-box; }
html {
  color-scheme: light;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(36, 87, 166, .025) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper);
  color: var(--ink);
  font-family: Aptos, "Segoe UI", sans-serif;
  font-size: 14px;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.topbar {
  height: 64px;
  padding: 0 clamp(18px, 3vw, 44px);
  display: flex;
  align-items: center;
  gap: 34px;
  background: var(--ink);
  color: white;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(255,255,255,.1);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.55);
  color: #a9e6e8;
  font: 700 14px/1 "Cascadia Mono", Consolas, monospace;
  letter-spacing: -.05em;
}
.brand b { display: block; font: 600 17px/1 Bahnschrift, "Arial Narrow", sans-serif; letter-spacing: .02em; }
.brand small { display: block; margin-top: 4px; color: #9eacbd; font: 10px/1.2 "Cascadia Mono", Consolas, monospace; text-transform: none; }
.fund-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 18px;
}
.fund-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 148px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
}
.fund-card:hover { border-color: var(--exchange); }
.fund-card .eyebrow { margin: 0; color: var(--exchange); }
.fund-card b { font-size: 20px; }
.fund-card small { color: #5b6b7c; }
.funds-panel .empty { padding: 24px 18px; }
.nav-toggle { display: none; }
.topbar nav { display: flex; align-self: stretch; }
.topbar nav a { display: grid; place-items: center; padding: 0 17px; color: #b9c5d3; border-bottom: 2px solid transparent; }
.topbar nav a[hidden] { display: none !important; }
.topbar nav a:hover, .topbar nav a.active { color: white; border-bottom-color: #53bec6; }
.ccy-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 108px;
  height: 32px;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  cursor: pointer;
}
.ccy-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
  transition: transform .22s ease;
}
.ccy-toggle.is-usd .ccy-toggle-knob { transform: translateX(100%); }
.ccy-toggle-opt {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #9eacbd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.ccy-toggle:not(.is-usd) .ccy-toggle-opt[data-value="local"],
.ccy-toggle.is-usd .ccy-toggle-opt[data-value="usd"] { color: #10243e; }
.account-slot {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.account-name {
  color: #e8eef5;
  font-size: 13px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-link {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.2);
  color: #c5d0dc;
}
.settings-link:hover,
.settings-link.active { color: white; border-color: #53bec6; }
body.is-signed-out .topbar nav,
body.is-signed-out .nav-toggle,
body.is-signed-out .account-slot { display: none; }
.settings-desk {
  width: min(620px, 100%);
  margin: 0 auto;
}
.settings-desk .page-head { padding-bottom: 8px; }
.settings-desk .page-head .muted { margin-top: 6px; max-width: 42em; }
.settings-panel + .settings-panel { margin-top: 14px; }
.settings-panel .panel-head { min-height: 0; }
.settings-panel .dialog-form { padding: 16px 18px 18px; }
.settings-panel .dialog-form label {
  display: grid;
  gap: 6px;
}
.settings-panel .dialog-form label span {
  color: #536579;
  font-size: 13px;
}
.settings-panel .dialog-actions { justify-content: flex-start; }
.settings-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 18px;
}
.settings-session .muted { margin: 0; }

main { width: min(1840px, 100%); margin: 0 auto; padding: 0 clamp(18px, 3vw, 44px) 50px; }
.session-rail {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  margin: 0 calc(clamp(18px, 3vw, 44px) * -1);
  padding: 12px clamp(18px, 3vw, 44px);
  background: #eaf0f7;
  border-bottom: 1px solid var(--line);
}
.session-title { min-width: 155px; }
.session-title small, .eyebrow { color: var(--exchange); font: 600 10px/1.3 "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; }
.session-title strong { display: block; margin-top: 7px; font: 600 22px/1 "Cascadia Mono", Consolas, monospace; }
.session-step { min-width: 115px; opacity: .7; }
.session-step.active { opacity: 1; }
.session-step span, .session-step small { display: block; color: #64748a; font-size: 11px; }
.session-step b { display: block; margin: 3px 0; font-family: Bahnschrift, "Arial Narrow", sans-serif; }
.session-step.active b { color: var(--signal); }
.session-line { height: 1px; flex: 1; min-width: 20px; background: #b9c8d9; position: relative; }
.session-line::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: #96a9be; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 34px 0 22px; }
.page-head.compact { padding-bottom: 18px; }
.page-head.compact:has(+ .history-chrome) { padding-bottom: 8px; }
.source-toggle { display: flex; border: 1px solid var(--line); background: white; }
.source-toggle button {
  min-height: 36px; padding: 0 12px; border: 0; background: transparent; color: #536579; cursor: pointer; font-weight: 600;
}
.source-toggle button.active { background: var(--ink); color: white; }
.compare-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  flex: 1 1 100%;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #f2f6fa 100%);
}
.compare-bar[hidden] { display: none; }
.blotter-head { align-items: center; }
.blotter-head .head-actions { justify-content: flex-end; }
.panel > .compare-bar {
  flex: none;
  margin: 0;
  padding: 10px 17px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}
.compare-bar-label {
  font: 700 10px/1 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #536579;
}
.compare-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.compare-pill {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.compare-pill[hidden],
.source-toggle button[hidden] { display: none !important; }
.compare-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.compare-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid #c5d0dc;
  border-radius: 999px;
  background: #fff;
  color: #3d5166;
  font: 600 12px "IBM Plex Sans", "Noto Sans SC", sans-serif;
  transition: background .15s, border-color .15s, color .15s;
}
.compare-pill input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.compare-pill input:focus-visible + span { outline: 2px solid #53bec6; outline-offset: 2px; }
.data-table tbody tr.row-fa,
.data-table tbody tr.row-fa td { background: #eef4fb; }
.data-table tbody tr.row-fa:hover,
.data-table tbody tr.row-fa:hover td { background: #e3edf8; }
.data-table tbody tr.row-broker,
.data-table tbody tr.row-broker td { background: #e8f6ef; }
.data-table tbody tr.row-broker:hover,
.data-table tbody tr.row-broker:hover td { background: #d8efe4; }
.data-table.is-compare tbody tr.row-diff,
.data-table.is-compare tbody tr.row-diff td { background: #f3e2b8; }
.data-table.is-compare tbody tr.row-diff:hover,
.data-table.is-compare tbody tr.row-diff:hover td { background: #edd59a; }
.data-table tbody tr.row-gap td {
  padding: 0;
  border: 0;
  background: #eef1f5;
  line-height: 0;
}
.data-table tbody tr.row-gap:hover td { background: #eef1f5; }
.compare-gap { height: 16px; background: #eef1f5; }
.data-table tbody tr.date-row td {
  background: var(--ink);
  color: #fff;
  font: 600 15px/1.2 Bahnschrift, "Arial Narrow", sans-serif;
  letter-spacing: .06em;
  padding: 12px 12px 10px;
  border: 0;
}
.data-table tbody tr.date-row:hover td { background: var(--ink); }
.data-table tbody tr.row-child td {
  background: #f4f7fb;
  color: #536579;
  font-size: 11px;
}
.data-table tbody tr.row-child td:first-child { padding-left: 22px; }
.data-table tbody tr.recon-note-row td {
  background: #f4f7fb;
  padding-top: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d8e1eb;
}
.recon-note {
  display: block;
  margin-left: 18px;
  padding: 6px 12px 6px 14px;
  border-left: 3px solid #8ea0b5;
  color: #4a5b6e;
  font-size: 12px;
  line-height: 1.45;
}
.row-expand {
  margin-left: 6px;
  border: 1px solid #bdcad8;
  background: white;
  color: var(--exchange);
  font: 600 10px "Cascadia Mono", Consolas, monospace;
  cursor: pointer;
  padding: 1px 6px;
  min-height: 20px;
}
.col-formula {
  display: block;
  margin-top: 3px;
  color: #7a8899;
  font: 500 9px/1.25 "Cascadia Mono", Consolas, monospace;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  max-width: 240px;
}
.eyebrow { margin: 0 0 7px; }
h1, h2 { font-family: Bahnschrift, "Arial Narrow", sans-serif; margin: 0; }
h1 { font-size: clamp(28px, 3vw, 42px); font-weight: 500; letter-spacing: -.025em; }
h1 span { color: #75869b; font-size: .55em; font-weight: 400; margin-left: 8px; }
h1 .instrument-title { color: inherit; font-size: inherit; font-weight: inherit; margin-left: 0; }
h2 { font-size: 18px; font-weight: 550; }
.muted { color: #6d7c8f; margin: 7px 0 0; }
#snapshot-label[title] { cursor: help; }
.page-head .notice { margin: 10px 0 0; }
.snapshot-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #536579;
  font: 600 11px "Cascadia Mono", Consolas, monospace;
}
.snapshot-picker select { width: auto; min-width: 240px; }
.page-head-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.eod-date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.eod-date-nav select {
  box-sizing: border-box;
  min-width: 168px;
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #bdcad8;
  background: white;
  color: var(--ink);
  font: 500 13px/38px "Cascadia Mono", Consolas, monospace;
}
.eod-date-nav .eod-date-step {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  line-height: 0;
}
.eod-date-nav .eod-date-step svg {
  display: block;
}
.eod-date-nav .eod-date-step:hover,
.eod-date-nav .eod-date-step:active {
  transform: none;
}
.eod-date-nav .eod-date-step[hidden] { display: none; }
.eod-date-nav .eod-date-step.is-disabled,
.eod-date-nav .eod-date-step[aria-disabled="true"] {
  opacity: 0.32;
  pointer-events: none;
}
.name-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #536579;
  font: 600 11px "Cascadia Mono", Consolas, monospace;
}
.name-picker-box { position: relative; min-width: min(360px, 72vw); }
.name-picker-box input[type="search"] {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #bdcad8;
  background: white;
  color: var(--ink);
  font: 500 13px "Segoe UI", sans-serif;
}
.name-picker-box input[type="search"]:focus {
  border-color: var(--exchange);
  outline: none;
}
.name-picker-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: min(420px, 60vh);
  overflow: auto;
  background: white;
  border: 1px solid #bdcad8;
  box-shadow: var(--shadow);
}
.name-picker-menu button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f6;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: 500 13px/1.35 "Segoe UI", sans-serif;
}
.name-picker-menu button:hover,
.name-picker-menu button.is-active { background: #f3f7fb; }
.name-picker-menu button small {
  color: #6d7c8f;
  font: 600 11px "Cascadia Mono", Consolas, monospace;
}
.name-picker-menu .is-child { padding-left: 28px; }
.name-picker-menu .is-group strong { font-weight: 650; }
.name-picker-empty { padding: 14px 12px; color: #6d7c8f; }
.name-picker-page {
  display: block;
  width: 100%;
  padding: 16px 18px 22px;
  color: var(--ink);
}
.name-picker-page .name-picker-box {
  min-width: 0;
  width: min(920px, 100%);
}
.name-picker-page .name-picker-box input[type="search"] {
  max-width: 420px;
  min-height: 40px;
  padding: 10px 14px;
  border-color: #c4cfda;
  background: #f7f9fb;
}
.name-picker-page .name-picker-menu {
  position: static;
  z-index: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 8px;
  max-height: min(70vh, 720px);
  margin-top: 14px;
  padding: 4px 2px;
  border-color: var(--line);
  box-shadow: none;
}
.name-picker-page .name-picker-menu button {
  min-width: 0;
  padding: 9px 12px;
  gap: 10px;
}
.name-picker-page .name-picker-menu button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.name-picker-page .name-picker-menu button small {
  flex: 0 0 auto;
  white-space: nowrap;
}
.name-picker-page .name-picker-menu .is-group,
.name-picker-page .name-picker-empty {
  grid-column: 1 / -1;
}
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.book-asof {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: #536579;
}
.book-asof-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.book-asof small {
  font: 600 11px "Cascadia Mono", Consolas, monospace;
}
.book-asof strong {
  font: 500 18px "Cascadia Mono", Consolas, monospace;
  color: var(--ink);
}
.book-eod-jump {
  display: flex;
  align-items: center;
  gap: 8px;
}
.book-eod-jump select,
.book-eod-jump input {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font: 500 13px "Cascadia Mono", Consolas, monospace;
}
.book-eod-jump select { width: 196px; }
.book-eod-jump input { width: 112px; }
.button {
  border: 1px solid transparent;
  padding: 9px 14px;
  min-height: 38px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary { background: var(--exchange); color: white; }
.button.primary:hover { background: #1d4a91; }
.button:disabled { opacity: 0.55; cursor: wait; }
.button.secondary { color: var(--ink); background: white; border-color: #bdcad8; }
.button.secondary:hover { border-color: var(--exchange); color: var(--exchange); }
:focus-visible { outline: 3px solid rgba(36,87,166,.26); outline-offset: 2px; }

.metric-strip {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, 1fr);
  background: var(--ink);
  color: white;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.metric-strip article { padding: 18px 20px; border-right: 1px solid rgba(255,255,255,.12); min-width: 0; }
.metric-strip article:last-child { border-right: 0; }
.metric-strip small, .metric-strip em { display: block; color: #aebccc; font: 10px/1.4 "Cascadia Mono", Consolas, monospace; font-style: normal; text-transform: uppercase; }
.metric-strip strong { display: block; margin: 7px 0 4px; font: 500 clamp(18px, 2vw, 27px)/1 "Cascadia Mono", Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-strip .quality strong { color: #ffd49b; }
.instrument-metrics { grid-template-columns: repeat(6, 1fr); }
.attribution-strip {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  margin-top: -10px;
  background: #0f2438;
}
.attribution-strip strong { font-size: clamp(15px, 1.6vw, 22px); }
.data-table tbody tr.row-newopen td { background: #f4f8ff; }
input.manual-price { width: 96px; min-height: 28px; padding: 3px 6px; text-align: right; font-variant-numeric: tabular-nums; }
.filters.new-open-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.positions-panel .new-open-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 17px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
}
.positions-panel .new-open-bar input#new-open-query { width: 100%; }
.positions-panel .new-open-bar .table-layout-btn { margin-left: auto; }
.pool-search { position: relative; flex: 1 1 280px; min-width: 240px; max-width: 460px; }
.pool-search-hits {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow: auto;
}
.pool-search-hits button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f6;
  background: #fff;
  cursor: pointer;
}
.pool-search-hits button:last-child { border-bottom: 0; }
.pool-search-hits button.active,
.pool-search-hits button:hover { background: #eaf1fa; }
.pool-search-hits strong { display: block; font-size: 13px; }
.pool-search-hits .hit-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: #7b8999; font-size: 11px; }
.pool-search-hits .hit-tag {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef3f8;
  color: #536579;
  font: 700 10px/1.4 "Cascadia Mono", Consolas, monospace;
}
.pool-search-hits .hit-tag-held { background: #e7f6ee; color: #0d6b4c; }
.pool-search-hits .hit-tag-pinned { background: #eaf1fa; color: #1f4d7a; }
.pool-search-hits .hit-tag-onboard { background: #fff4e5; color: #8a5a12; }
.pool-search-empty { padding: 10px 12px; color: #7b8999; font-size: 12px; }
.pool-search-hits button.pool-search-lookup {
  background: #f7f9fc;
  color: #1f4d7a;
  font-weight: 700;
}
.new-open-status {
  color: #1f4d7a;
  font: 700 11px/1.4 "Cascadia Mono", Consolas, monospace;
}
.data-table tbody tr.row-focus td { box-shadow: inset 0 0 0 2px var(--exchange); }
.new-open-label {
  color: #536579;
  font: 700 10px/1 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pick-list { display: grid; gap: 8px; }
.pick-list button { text-align: left; padding: 10px 12px; border: 1px solid #c4cfda; background: white; cursor: pointer; }
.pick-list button:hover { border-color: var(--exchange); background: #eaf1fa; }
.pick-list small { display: block; color: #7b8999; }
.fee-strip { grid-template-columns: repeat(3, 1fr); }
.pnl-strip { grid-template-columns: repeat(4, 1fr); }
.book-privacy-panel { overflow: hidden; }
.book-privacy-panel .metric-strip { margin-bottom: 0; box-shadow: none; }
.book-privacy-panel .metric-strip + .metric-strip { border-top: 1px solid rgba(255,255,255,.12); }
.book-privacy-panel .attribution-strip { margin-top: 0; }
.privacy-eye {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #c5d0dc;
  background: #fff;
  color: #536579;
  cursor: pointer;
}
.privacy-eye:hover,
.privacy-eye.is-open { color: var(--exchange); border-color: var(--exchange); }
.analysis-coming { padding: 0 18px 18px; }
.history-tabs button {
  padding: 10px 18px;
  border: 0;
  background: transparent;
  color: #536579;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
}
.history-tabs button.active,
.history-tabs button:hover { color: var(--ink); border-bottom-color: #53bec6; }
.data-table th.col-layout-head-cell {
  position: sticky;
  right: 0;
  z-index: 4;
  width: 28px;
  min-width: 28px;
  padding: 0;
  text-align: center;
  cursor: default;
  background: #f0f4f8;
  border-left: 0;
  box-shadow: none;
}
.data-table th.col-layout-head-cell .table-layout-gear {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 100%;
  min-height: 31px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #536579;
  cursor: pointer;
  box-shadow: none;
  outline: none;
}
.data-table th.col-layout-head-cell .table-layout-gear:hover,
.data-table th.col-layout-head-cell .table-layout-gear.is-on { color: var(--exchange); }
.data-table td.col-layout-pad {
  width: 28px;
  min-width: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}
.table-block[data-table-block="positions-table"] .table-bar,
.table-block[data-table-block="snapshot-table"] .table-bar,
.table-block[data-table-block="eod-trades-table"] .table-bar { display: none !important; }
.table-block[data-table-block="orders-cancelled-table"] .table-bar,
.table-block[data-table-block="exec-queue-table"] .table-bar,
.table-block[data-table-block="exec-today-table"] .table-bar,
.table-block[data-table-block="exec-recent-table"] .table-bar { display: none !important; }
.table-block[data-table-block="instrument-trades"] .table-bar { display: none !important; }
.table-block[data-table-block="trades-table"] .table-bar,
.table-block[data-table-block="fees-day-table"] .table-bar,
.table-block[data-table-block="fees-name-table"] .table-bar { display: none !important; }
.performance-strip strong.pnl-pos, .metric-strip strong.pnl-pos, .pnl-pos { color: #5ee0b5; }
.performance-strip strong.pnl-neg, .metric-strip strong.pnl-neg, .pnl-neg { color: #ff8b96; }
.data-table .pnl-pos { color: #087f70; }
.data-table .pnl-neg { color: var(--loss); }
.data-table td.num small { display: block; margin-top: 3px; color: #7b8999; font-size: 10px; font-weight: 400; }
.data-table td.num small.pnl-pos { color: #087f70; }
.data-table td.num small.pnl-neg { color: var(--loss); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; margin-bottom: 18px; }
.reconciliation-grid { grid-template-columns: minmax(280px, .6fr) minmax(420px, 1.4fr); }
.panel { background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.workspace-grid .panel { margin-bottom: 0; }
.panel-head { min-height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.panel-head .eyebrow { margin-bottom: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input { width: 160px; }
.filters select { width: auto; min-width: 140px; }
.market-filter { position: relative; min-width: 140px; }
.market-filter-btn {
  width: 100%;
  min-height: 36px;
  border: 1px solid #c4cfda;
  background: white;
  color: var(--ink);
  padding: 7px 28px 7px 9px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.market-filter-btn::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #536579;
  transform: translateY(-40%);
}
.market-filter.is-open .market-filter-btn::after { transform: translateY(-40%) rotate(180deg); }
.market-filter-menu {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  min-width: 140px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.market-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  font-weight: 600;
  color: #3d5166;
  cursor: pointer;
}
.market-filter-item:hover { background: #eaf1fa; }
.market-filter-item input { display: inline-block; width: auto; min-height: 0; margin: 0; accent-color: #2457a6; }
input, select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #c4cfda;
  background: white;
  color: var(--ink);
  padding: 7px 9px;
}
input[type="checkbox"],
input[type="radio"] {
  width: 15px;
  min-width: 15px;
  height: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--exchange);
  flex: 0 0 15px;
}
input[type="file"] {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
select { cursor: pointer; }
label { color: #4f6074; font-size: 12px; font-weight: 600; }
label input, label select { display: block; margin-top: 6px; font-weight: 400; }
label input[type="checkbox"],
label input[type="radio"] {
  display: inline-block;
  margin-top: 0;
}
.stack { display: grid; gap: 14px; padding: 18px; }
.rule { height: 1px; margin: 2px 18px; background: var(--line); }
.definition-list { padding: 8px 18px; margin: 0; }
.definition-list div { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.definition-list dt { color: var(--signal); font-weight: 700; }
.definition-list dd { margin: 0; color: #657488; }
.notice { margin: 4px 18px 18px; padding: 11px 12px; border-left: 3px solid var(--amber); background: #fff7e9; color: #785329; font-size: 12px; line-height: 1.5; }
.stack .notice { margin: 0; }

.table-block { margin: 0 18px 18px; }
.table-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 8px;
}
.table-layout-btn.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.col-layout-drawer {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #f7f9fc;
}
.col-layout-drawer[hidden] { display: none; }
.col-layout-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.col-layout-head strong {
  font: 700 10px/1 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #536579;
}
.col-layout-drawer.is-draft .col-layout-head strong {
  flex: 1;
  font: 600 12px/1.45 "IBM Plex Sans", "Noto Sans SC", sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: #3d5166;
}
.col-layout-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.col-layout-actions .tiny-button {
  width: 72px;
  min-width: 72px;
  box-sizing: border-box;
  text-align: center;
}
.col-layout-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.col-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #c5d0dc;
  border-radius: 8px;
  background: #fff;
  white-space: nowrap;
  cursor: grab;
  user-select: none;
}
.col-chip.is-off { opacity: .45; background: #eef2f6; }
.col-chip.is-locked { cursor: default; }
.col-chip.dragging { opacity: .5; }
.col-chip.drag-over { outline: 2px solid #53bec6; }
.col-chip input { margin: 0; accent-color: #2457a6; }
.col-chip span { font: 600 11px "IBM Plex Sans", "Noto Sans SC", sans-serif; color: #3d5166; }
.table-scroll,
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.table-scroll { border: 1px solid #e5ebf1; border-radius: 0 0 8px 8px; }
.data-table th .fee-expand {
  margin-left: 4px;
  border: 0;
  background: none;
  color: #536579;
  cursor: pointer;
  font: 700 11px "Cascadia Mono", Consolas, monospace;
  padding: 0 2px;
  text-decoration: none;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table.is-book-fixed {
  table-layout: fixed;
}
.data-table.is-book-fixed th,
.data-table.is-book-fixed td {
  overflow: hidden;
}
.data-table.is-book-fixed td.num,
.data-table.is-book-fixed th.num {
  white-space: nowrap;
}
.data-table.is-book-fixed .col-instrument {
  overflow: hidden;
}
.data-table.is-book-fixed .col-instrument a,
.data-table.is-book-fixed .col-instrument button,
.data-table.is-book-fixed .col-instrument span,
.data-table.is-book-fixed .col-instrument small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.data-table th .col-resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}
.data-table.is-layout-edit th:not(.col-layout-head-cell),
.data-table.is-layout-edit td:not(.col-layout-pad) {
  box-shadow: inset -2px 0 0 #6a7f93;
}
.data-table.is-layout-edit th .col-resize::before {
  content: "";
  position: absolute;
  top: 0;
  right: 1px;
  width: 2px;
  height: 100%;
  background: #3d5166;
}
.data-table.is-layout-edit th .col-resize::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 0;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: #3d5166;
}
.data-table.is-layout-edit th.is-resize-hot,
.data-table.is-layout-edit td.is-resize-hot {
  box-shadow: inset -2px 0 0 var(--exchange);
}
.data-table.is-layout-edit th.is-resize-hot .col-resize::before,
.data-table.is-layout-edit th.is-resize-hot .col-resize::after,
.data-table.is-resizing th .col-resize::before,
.data-table.is-resizing th .col-resize::after {
  background: var(--exchange);
}
.data-table.is-resizing,
.data-table.is-resizing th { cursor: col-resize; user-select: none; }
.data-table.is-compare {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}
.data-table.is-compare .col-instrument {
  max-width: 168px;
  min-width: 120px;
}
.data-table.is-compare .col-instrument span,
.data-table.is-compare .col-instrument small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 156px;
}
.data-table.is-compare .col-fx {
  min-width: 108px;
  max-width: 128px;
}
.data-table.is-compare .col-fx .muted {
  display: block;
  font-size: 10px;
  margin-top: 2px;
}
.data-table th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; background: #f0f4f8; border-bottom: 1px solid #cbd6e1; color: #536579; font: 600 10px "Cascadia Mono", Consolas, monospace; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid #e5ebf1; vertical-align: middle; white-space: nowrap; }
.data-table tbody tr:hover { background: #f7fbff; }
.data-table tbody tr.section-row td {
  background: #e8eef6;
  color: #2457a6;
  font: 700 10px/1.2 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding-top: 12px;
  padding-bottom: 8px;
}
.data-table tbody tr.section-row:hover td { background: #e8eef6; }
.data-table tbody tr.row-short { background: #f8eef0; }
.data-table tbody tr.row-short:hover { background: #f3e4e8; }
.data-table tbody tr.row-short a.instrument-link { color: #8a3040; }
.data-table tbody tr.row-daytrade { background: #f4f7ee; }
.data-table tbody tr.row-daytrade:hover { background: #eef3e4; }
.data-table th { cursor: pointer; user-select: none; white-space: nowrap; }
.data-table.col-edit th { cursor: grab; }
.data-table th.sort-desc span::after { content: " ▾"; }
.data-table th.sort-asc span::after { content: " ▴"; }
.data-table th.dragging { opacity: .45; }
.data-table th.drag-over { outline: 1px solid #53bec6; }
.data-table th.col-off { opacity: .45; }
.data-table caption { caption-side: top; text-align: right; padding: 0 0 8px; }
.col-check {
  display: none;
  align-items: center;
  margin-right: 6px;
  cursor: pointer;
}
.data-table.col-edit .col-check { display: inline-flex; }
.col-check input { accent-color: #2457a6; cursor: pointer; }
.table-reset {
  border: 0;
  background: transparent;
  color: var(--exchange);
  cursor: pointer;
  font: 600 11px "Cascadia Mono", Consolas, monospace;
}
.acl-empty {
  min-height: 48vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: #536579;
  font-size: 16px;
}
.acl-empty[hidden], #page-content[hidden] { display: none !important; }
.acl-dialog {
  border: 1px solid var(--line);
  padding: 22px 24px;
  max-width: 360px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.acl-dialog p { margin: 0 0 16px; font-size: 16px; }
.risk-flow-dialog { min-width: min(420px, 92vw); }
.risk-flow-title { font-weight: 650; }
.risk-flow-steps {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.risk-flow-steps[hidden],
.risk-force-ask[hidden],
.risk-override-bar[hidden],
.risk-flow-detail[hidden] {
  display: none !important;
}
.risk-flow-steps li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #f6f8fb;
  font-size: 14px;
  font-weight: 600;
}
.risk-flow-steps li.is-pass { color: #0d6b4c; border-color: #b7e0cf; background: #f3fbf7; }
.risk-flow-steps li.is-fail { color: #9d2f3b; border-color: #efc2c8; background: #fff6f7; }
.risk-flow-detail { color: #9d2f3b; font-size: 13px; }
.risk-force-ask { margin: 0 0 12px; }
.risk-force-ask p { margin: 0 0 10px; font-size: 14px; }
.risk-override-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff8e8;
}
.risk-override-bar span { font-size: 13px; }
.risk-override-bar input { flex: 1; min-width: 160px; min-height: 34px; }
.history-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.history-tabs a {
  padding: 10px 18px;
  color: #536579;
  border-bottom: 2px solid transparent;
}
.history-tabs a.active, .history-tabs a:hover { color: var(--ink); border-bottom-color: #53bec6; }
.history-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 8px;
  border-bottom: 1px solid var(--line);
}
.history-chrome .history-tabs {
  flex: 1;
  min-width: 0;
  margin: 0;
  border-bottom: 0;
}
.history-chrome .history-tabs a {
  margin-bottom: -1px;
}
.history-chrome .page-head-tools {
  flex: 0 0 auto;
  padding: 2px 0 3px;
}
.history-view-toggle { margin-top: 0; }
.history-panel .blotter-head { align-items: center; gap: 16px; }
.history-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.history-tools .source-toggle {
  height: 36px;
  flex: 0 0 auto;
}
.history-tools .source-toggle button {
  min-height: 34px;
  height: 34px;
  padding: 0 11px;
}
.range-filter.history-range {
  display: flex;
  align-items: stretch;
  height: 36px;
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  background: white;
}
.history-range label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 8px 0 10px;
  border-right: 1px solid var(--line);
  color: #536579;
}
.history-range label span {
  display: inline;
  margin: 0;
  white-space: nowrap;
  font: 600 10px/1 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .04em;
}
.history-range label input,
.history-range input {
  display: block;
  width: 138px;
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0 4px 0 2px;
  border: 0;
  background: transparent;
}
.history-range .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 0;
  height: auto;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
}
.history-range .button:hover { transform: none; }
#trades-fee-summary { margin: 0 0 10px; }
#trades-fee-summary strong { font-weight: 600; }
.user-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c5d3e2;
  font: 600 11px "Cascadia Mono", Consolas, monospace;
}
.user-switch select { min-width: 120px; }
.range-filter { display: flex; gap: 10px; align-items: end; }
.range-filter label span { display: block; margin-bottom: 4px; color: #536579; font: 600 10px "Cascadia Mono", Consolas, monospace; }
.data-table tbody tr.row-flat { background: #f3f5f8; color: #6b7785; }
.data-table tbody tr.row-flat:hover { background: #eceff3; }
.data-table .num { text-align: right; font-family: "Cascadia Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }
.data-table a.instrument-link { color: var(--exchange); font-weight: 650; }
.data-table a.instrument-link small { display: block; color: #7b8999; font-weight: 400; margin-top: 3px; }
.data-table[data-mode="orders"] {
  table-layout: fixed;
}
.data-table[data-mode="orders"] th,
.data-table[data-mode="orders"] td {
  overflow: hidden;
}
.data-table[data-mode="orders"] th[data-col="instrument"],
.data-table[data-mode="orders"] td.col-instrument { width: 24%; }
.data-table[data-mode="orders"] th[data-col="quantity"] { width: 13%; }
.data-table[data-mode="orders"] th[data-col="price"] { width: 16%; }
.data-table[data-mode="orders"] th[data-col="weight"] { width: 12%; }
.data-table[data-mode="orders"] th[data-col="target"],
.data-table[data-mode="orders"] td.target-cell { width: 22%; white-space: normal; }
.data-table[data-mode="orders"] th[data-col="action"] { width: 13%; }
.data-table[data-mode="orders"] .col-instrument .instrument-link,
.data-table[data-mode="orders"] .col-instrument .instrument-code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table[data-mode="orders"] .instrument-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
}
.data-table[data-mode="orders"] .instrument-name-line .instrument-link,
.data-table[data-mode="orders"] .instrument-name-line span {
  display: inline;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table[data-mode="orders"] .option-chevron {
  display: inline-flex;
  overflow: visible;
  max-width: none;
}
.target-cell { min-width: 0; }
.target-control {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}
.target-main {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
}
.target-control .target-weight { width: 64px; text-align: right; }
.target-control select { width: 92px; }
.target-control input, .target-control select { min-height: 30px; padding: 4px 6px; font-size: 11px; }
.target-control [hidden] { display: none !important; }
.data-table[data-mode="orders"] th[data-col="target"],
.data-table th.col-target {
  text-align: right;
}
.data-table[data-mode="orders"] th[data-col="action"],
.data-table[data-mode="orders"] td.col-size,
.data-table th.col-size,
.data-table td.col-size {
  text-align: center;
}
.target-more { position: relative; }
.target-more[open] { flex: 1 1 100%; }
.target-more > summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #3d5166;
  font-size: 11px;
  line-height: 20px;
  user-select: none;
}
.target-more > summary::-webkit-details-marker { display: none; }
.target-more[open] > summary { border-color: var(--exchange); color: var(--exchange); }
.target-more-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
  padding: 8px;
  background: #f6f7f9;
  border: 1px solid var(--line);
}
.target-more-panel label {
  display: grid;
  gap: 4px;
  color: #5b6b7c;
  font-size: 11px;
}
.target-more-panel input { width: 100%; }
body:has(.orders-workspace) main {
  display: block;
  height: auto;
  min-height: calc(100dvh - 64px);
  padding-bottom: 36px;
  overflow: visible;
}
body:has(.orders-workspace) #page-content {
  display: block;
  height: auto;
  overflow: visible;
}
.orders-workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.orders-workspace .positions-panel {
  height: calc((100dvh - 64px) * 0.8 - 80px);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  overflow: hidden;
}
.orders-workspace .positions-panel .panel-head {
  min-height: 76px;
  align-items: stretch;
  gap: 0;
  padding: 0;
  position: relative;
  z-index: 4;
}
.orders-workspace .positions-panel .panel-head .eyebrow { display: none; }
.orders-workspace .positions-panel .panel-head > div:first-child {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 18px;
}
.orders-workspace .positions-panel .table-bar { display: none; }
.orders-workspace .positions-panel .table-layout-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}
.metric-strip.orders-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
  min-height: 76px;
  margin: 0;
  box-shadow: none;
}
.metric-strip.orders-metrics article {
  padding: 10px 14px;
  border-right: 1px solid rgba(255,255,255,.12);
  border-bottom: 0;
}
.metric-strip.orders-metrics article:last-child { border-right: 0; }
.metric-strip.orders-metrics strong { font-size: 18px; margin: 4px 0 2px; }
.orders-workspace .positions-panel > .table-wrap,
.orders-workspace .positions-panel > .table-block {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  overflow: hidden;
}
.orders-workspace .positions-panel .table-scroll,
.orders-workspace .positions-panel .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
#positions-table[data-mode="orders"] {
  max-width: 100%;
}
.orders-dock {
  flex: 0 0 auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.orders-dock .panel-head {
  min-height: 52px;
  padding: 10px 17px;
}
.orders-dock .table-wrap,
.orders-dock .table-block,
.orders-dock .ticket-dock {
  min-height: 0;
  overflow: auto;
}
.ticket-dock {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 12px 14px;
}
.orders-dock.is-flash { box-shadow: 0 0 0 2px #1f6feb inset; }
.emsx-ticket {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #f4f7fb;
  border: 1px solid #d5deea;
  box-shadow: inset 3px 0 0 var(--exchange);
  color: #2c3a4a;
}
.emsx-ticket.is-empty { background: #f8fafc; box-shadow: none; }
.emsx-body {
  display: grid;
  grid-template-columns: minmax(0, 70%) 1fr;
  align-items: center;
  gap: 12px 20px;
  width: 100%;
  padding: 12px 16px 14px;
}
.emsx-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.emsx-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px 18px;
  width: 100%;
}
.emsx-row-note { grid-template-columns: minmax(0, 1fr); }
.emsx-half {
  display: grid;
  gap: 8px 10px;
  min-width: 0;
  align-items: stretch;
}
.emsx-row-6 .emsx-half { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.emsx-row-8 .emsx-half { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.emsx-row-4 .emsx-half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.emsx-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.emsx-field > span {
  display: flex;
  align-items: flex-end;
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  line-height: 1.25;
  color: #5d6f84;
  font-size: 11px;
}
.emsx-field input,
.emsx-field select,
.emsx-field .emsx-step,
.emsx-field .emsx-cashq-box,
.emsx-field [data-cashq] {
  width: 100%;
}
.emsx-field input,
.emsx-field select {
  box-sizing: border-box;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid #c4cfda;
  background: #fff;
  color: var(--ink);
}
.emsx-field input:focus,
.emsx-field select:focus {
  border-color: var(--exchange);
  outline: 3px solid rgba(36, 87, 166, .16);
}
.emsx-field input[readonly] {
  color: #536579;
  background: #f8fafc;
}
.emsx-field input[disabled],
.emsx-field.is-off input {
  color: #8592a2;
  background: #edf2f6;
}
.emsx-field input[type=number]::-webkit-outer-spin-button,
.emsx-field input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.emsx-field input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.emsx-brief {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 16px;
  background: #e8eef7;
  border-bottom: 1px solid #d5deea;
  color: var(--ink);
}
.emsx-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid #d5deea;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.emsx-chip-name { font-weight: 700; }
.emsx-chip.is-buy { color: #087f70; border-color: #8dcebf; background: #f3fbf8; }
.emsx-chip.is-sell { color: #b53a45; border-color: #efc2c8; background: #fff6f7; }
.emsx-chip-wt { color: var(--exchange); border-color: #c5d4ea; background: #f4f7fb; }
.emsx-note { min-width: 0; }
.emsx-note input::placeholder {
  color: #8a97a8;
  opacity: 1;
}
.emsx-side-pick { position: relative; width: 100%; }
.emsx-side-pick select { display: none; }
.emsx-side-btn {
  width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #c4cfda;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.emsx-side-btn.is-buy { color: #087f70; border-color: #8dcebf; background: #f3fbf8; }
.emsx-side-btn.is-sell { color: #b53a45; border-color: #efc2c8; background: #fff6f7; }
.emsx-side-btn:focus {
  outline: 3px solid rgba(36, 87, 166, .16);
}
.emsx-side-btn.is-buy:focus { outline-color: rgba(8, 127, 112, .18); }
.emsx-side-btn.is-sell:focus { outline-color: rgba(181, 58, 69, .18); }
.emsx-side-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 12;
  border: 1px solid #c4cfda;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 36, 62, .12);
}
.emsx-side-menu button {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-weight: 650;
}
.emsx-side-menu button.is-buy { color: #087f70; }
.emsx-side-menu button.is-sell { color: #b53a45; }
.emsx-side-menu button.is-buy:hover { background: #f3fbf8; }
.emsx-side-menu button.is-sell:hover { background: #fff6f7; }
.emsx-step {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 32px;
  overflow: hidden;
}
.emsx-field .emsx-step button,
.emsx-field .emsx-step input {
  box-sizing: border-box;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid #c4cfda;
  font: inherit;
  line-height: 30px;
  appearance: none;
  -webkit-appearance: none;
}
.emsx-field .emsx-step button {
  flex: 0 0 32px;
  width: 32px;
  padding: 0;
  background: #fff;
  color: var(--exchange);
  cursor: pointer;
  text-align: center;
}
.emsx-field .emsx-step button:hover { background: #eaf1fa; }
.emsx-field .emsx-step input {
  flex: 1 1 auto;
  min-width: 0;
  border-left: 0;
  border-right: 0;
  text-align: right;
}
.emsx-cashq-box {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d5deea;
  background: #fff;
  color: #4b5b6c;
  font-size: 11px;
  line-height: 1.35;
}
.emsx-cashq-box.is-ok { color: #0d6b4c; border-color: #b7e0cf; background: #f3fbf7; }
.emsx-cashq-box.is-short { color: #9d2f3b; border-color: #efc2c8; background: #fff6f7; }
.emsx-cashq-box.is-in { color: #1f4d7a; border-color: #c5d6ee; background: #f5f8fd; }
.emsx-risk-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 4px 10px;
  border: 1px solid #d6b400;
  background: #f5c400;
  color: #5a4300;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}
.emsx-risk-btn.is-pending { background: #f5c400; border-color: #d6b400; color: #5a4300; }
.emsx-risk-btn.is-pass { background: #0d6b4c; border-color: #0d6b4c; color: #fff; }
.emsx-risk-btn.is-fail { background: #9d2f3b; border-color: #9d2f3b; color: #fff; }
.emsx-risk-wrap {
  display: flex;
  min-width: 0;
  min-height: 43px;
}
.emsx-risk-hint { margin: 0; color: #9d2f3b; font-size: 11px; text-align: center; }
.emsx-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  gap: 6px;
  width: 100%;
  padding: 0;
}
.emsx-action-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 43px;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.emsx-action-pair .emsx-placer { min-width: 0; }
.emsx-action-pair .emsx-close { align-self: end; }
.emsx-action-pair select {
  height: 43px;
  min-height: 43px;
  text-align: center;
  text-align-last: center;
}
.emsx-stage,
.emsx-close,
.emsx-actions select,
.emsx-proof {
  min-height: 43px;
  height: 43px;
  min-width: 0;
  width: 100%;
  padding: 0 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}
.emsx-actions select {
  background: #fff;
  color: var(--ink);
  border-color: #bdcad8;
  font-weight: 500;
  text-align: center;
  text-align-last: center;
}
.emsx-proof { background: #fff; color: var(--ink); border-color: #bdcad8; font-weight: 500; text-align: left; }
.emsx-stage { background: var(--exchange); color: #fff; }
.emsx-stage:hover { background: #1d4a91; }
.emsx-stage:disabled,
.emsx-stage.is-locked { background: #c5ced8; color: #fff; cursor: not-allowed; }
.emsx-close { background: #fff; color: var(--ink); border-color: #bdcad8; }
.emsx-close:hover { border-color: var(--exchange); color: var(--exchange); }
.risk-pill.is-override,
.exec-force { color: #9d2f3b; font-weight: 700; }
tr.is-unmatched td { background: #fff6e8; }
.idle-switch { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #5b6b7c; }
.idle-setup { color: var(--exchange); text-decoration: none; white-space: nowrap; }
.idle-setup:hover { text-decoration: underline; }
.idle-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(247, 249, 252, 0.72);
  backdrop-filter: blur(10px);
}
.idle-mask[hidden] { display: none; }
.idle-card {
  width: min(420px, 90vw);
  padding: 22px 24px;
  border: 1px solid #d5deea;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 36, 58, 0.12);
}
.idle-card input { width: 100%; margin: 12px 0 16px; min-height: 36px; }
.idle-error { margin: 0 0 12px; color: #8f2f39; font-size: 13px; }
.risk-form textarea { min-height: 72px; }
.risk-desk {
  display: grid;
  gap: 16px;
  max-width: 960px;
}
.risk-files {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: none;
}
.risk-desk[hidden],
.risk-files[hidden] { display: none !important; }
.risk-status {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.risk-status-value { margin: 6px 0 0; font-size: 15px; font-weight: 600; }
.risk-override-card { margin: 0; }
.risk-override-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}
.risk-override-form input {
  box-sizing: border-box;
  width: 220px;
  min-width: 180px;
  height: 38px;
  min-height: 38px;
  flex: 0 0 220px;
  padding: 0 12px;
}
.risk-override-form .button {
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 14px;
}
#risk-override-status { margin: 8px 16px 16px; }
.risk-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.risk-status-actions .button { min-height: 36px; }
.risk-rules-panel { margin: 0; }
.risk-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}
.risk-check select {
  width: auto;
  min-width: 112px;
  min-height: 32px;
  margin-top: 0;
}
.risk-add-wrap { position: relative; }
.risk-add-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 12;
  min-width: 220px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 36, 62, .12);
}
.risk-add-menu button {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.risk-add-menu button:hover { background: #f4f7fb; }
.risk-rule-list { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.risk-rule-card {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px 16px 16px;
}
.risk-rule-card:focus-within { z-index: 3; }
.risk-rule-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f6;
}
.risk-rule-head strong { font-size: 15px; margin-right: auto; }
.risk-rule-head .risk-check { margin: 0; }
.risk-rule-head .tiny-button { min-height: 32px; }
.risk-rule-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  align-items: start;
}
.risk-rule-fields > p,
.risk-rule-fields > .risk-check { grid-column: 1 / -1; }
.risk-side-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.risk-side-chips label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
}
.risk-rule-card textarea { min-height: 84px; width: 100%; }
.risk-rule-card select,
.risk-rule-card input[type="number"] {
  width: 100%;
  max-width: 220px;
  min-height: 32px;
}
.risk-blacklist { grid-column: 1 / -1; }
.risk-blacklist-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.risk-blacklist-bar .pool-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
.risk-blacklist-bar input {
  box-sizing: border-box;
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
}
.risk-blacklist-bar .tiny-button {
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 12px;
}
.risk-blacklist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.risk-blacklist-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line);
  background: #f7f9fc;
  font-size: 13px;
}
.risk-blacklist-chip strong { font-weight: 600; }
.risk-blacklist-chip small {
  color: #6d7c8f;
  font: 12px "Cascadia Mono", Consolas, monospace;
}
.risk-blacklist-chip button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6d7c8f;
  cursor: pointer;
}
.risk-blacklist-chip button:hover { color: #8f2f39; }
.risk-blacklist-empty { margin: 8px 0 0; color: #8592a2; font-size: 12px; }
.risk-rule-empty { margin: 0; padding: 28px 8px; color: #8592a2; font-size: 13px; text-align: center; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.risk-archive-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 18px 20px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}
.risk-archive-head h2 { margin: 4px 0 0; font-size: 22px; }
.risk-archive-head .eyebrow { color: #9eb4cc; }
.risk-archive-head .muted { margin: 6px 0 0; color: #aebccc; font-size: 12px; }
.risk-archive-search { min-width: min(320px, 100%); }
.risk-archive-search input[type="search"] {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: #fff;
}
.risk-archive-search input[type="search"]::placeholder { color: #9eb4cc; }
.risk-archive-kinds {
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}
.risk-archive-kinds button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.risk-archive-kinds em {
  min-width: 1.4em;
  color: inherit;
  font: 600 11px/1 "Cascadia Mono", Consolas, monospace;
  font-style: normal;
  opacity: .72;
}
.risk-archive-list {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}
.risk-archive-group + .risk-archive-group { border-top: 8px solid var(--paper); }
.risk-archive-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #f3f6f9;
  color: #536579;
  font: 600 11px/1.3 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.risk-archive-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.risk-archive-ext {
  display: grid;
  place-items: center;
  width: 52px;
  height: 36px;
  border: 1px solid #d5dee7;
  background: #edf2f6;
  color: #3d5166;
  font: 700 11px/1 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .02em;
}
.risk-archive-name {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.risk-archive-meta {
  margin: 4px 0 0;
  color: #6d7c8f;
  font-size: 12px;
  line-height: 1.4;
}
.risk-archive-open {
  justify-self: end;
  min-width: 72px;
  flex-shrink: 0;
}
.risk-archive-empty { margin: 0; padding: 36px 16px; color: #8592a2; text-align: center; }
.risk-kind {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid #d5dee7;
  background: #edf2f6;
  color: #52657a;
  font: 10px "Cascadia Mono", Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.risk-kind-broker_daily { color: #2457a6; background: #eaf1fa; border-color: #c5d6ee; }
.risk-kind-fa_monthly { color: #0f6f7a; background: #e7f6f6; border-color: #b7dfe1; }
.risk-kind-order_instruction { color: #94590c; background: #fff6e7; border-color: #eed5aa; }
@media (max-width: 900px) {
  .risk-status { align-items: stretch; }
  .risk-status-actions { margin-left: 0; justify-content: flex-start; }
  .risk-rule-fields { grid-template-columns: 1fr; }
  .risk-override-form { flex-wrap: wrap; }
  .risk-override-form input { flex: 1 1 180px; width: auto; min-width: 180px; }
}
.emsx-side-menu button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
}
.emsx-empty-hint {
  margin: 0;
  padding: 10px 12px 14px;
  color: #8592a2;
  font-size: 12px;
}
@media (max-width: 1100px) {
  .emsx-body { grid-template-columns: 1fr; }
  .emsx-actions { justify-content: center; }
}
.tiny-button { border: 1px solid #b9c7d5; background: white; color: var(--exchange); padding: 6px 8px; cursor: pointer; white-space: nowrap; }
a.tiny-button { display: inline-block; text-decoration: none; }
.tiny-button:hover { background: #eaf1fa; }
tr.size-preview td, tr.order-draft td {
  background: #f4f7fb;
  padding: 10px 14px 8px;
  box-shadow: inset 3px 0 0 #1f6feb;
  overflow: visible;
  white-space: normal;
}
.size-preview-card, .order-draft-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  font-size: 12px;
  color: #2c3a4a;
}
.size-preview-card {
  display: grid;
  grid-template-columns: auto 1300px 150px auto;
  width: max-content;
  column-gap: 0;
  row-gap: 4px;
  align-items: start;
}
.size-preview-card p, .order-draft-card p { margin: 0; }
.size-preview-title {
  grid-column: 1;
  grid-row: 1;
  margin-right: 18px;
  padding-top: 8px;
  font: 700 10px/1 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #536579;
}
.size-preview-main {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 1300px;
  min-width: 1300px;
}
.size-preview-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 1300px;
  min-width: 1300px;
}
.size-preview-meta {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(120px, .8fr) minmax(180px, 1.2fr) minmax(160px, 1fr);
  gap: 8px 18px;
  align-items: baseline;
  color: #5d6f84;
}
.size-preview-meta > span:last-child { grid-column: 2 / -1; }
.cash-status {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  min-width: 0;
  height: 2.25rem;
  box-sizing: border-box;
  padding: 4px 12px;
  border: 1px solid #d5deea;
  background: #fff;
}
.cash-status span:last-child { color: #4b5b6c; }
.cash-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font: 700 10px/1.4 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.size-preview-metrics .cash-pill {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 4.6rem;
  box-sizing: border-box;
  text-align: center;
}
.cash-status.is-ok { border-color: #b7e0cf; background: #f3fbf7; }
.cash-status.is-ok .cash-pill { background: #d8f3e7; color: #0d6b4c; }
.cash-status.is-short { border-color: #efc2c8; background: #fff6f7; }
.cash-status.is-short .cash-pill { background: #fde4e7; color: #9d2f3b; }
.cash-status.is-in { border-color: #c5d6ee; background: #f5f8fd; }
.cash-status.is-in .cash-pill { background: #e4edf8; color: #1f4d7a; }
.cash-status.is-missing { border-color: #d5deea; background: #f7f9fc; }
.cash-status.is-missing .cash-pill { background: #e8eef6; color: #536579; }
.liq-status { align-items: center; }
.size-preview-metrics .cash-copy,
.size-preview-metrics .liq-copy {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.liq-part {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  color: #4b5b6c;
  font: 600 11px/1 "IBM Plex Sans", sans-serif;
  white-space: nowrap;
}
.liq-part-box {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 22px;
  min-width: 3.6rem;
  padding: 0 6px;
  border: 1px solid #c5d0dc;
  background: #fff;
  box-sizing: border-box;
}
.liq-part input.liq-participation {
  display: inline-block;
  width: 2.4rem;
  min-height: 0;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: right;
  color: #2c3a4a;
  font: 600 12px/20px "IBM Plex Sans", sans-serif;
}
.liq-participation::-webkit-outer-spin-button,
.liq-participation::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.liq-participation { appearance: textfield; -moz-appearance: textfield; }
.liq-part-unit { color: #4b5b6c; font: 600 11px/1 "IBM Plex Sans", sans-serif; }
.size-preview-note { color: #5d6f84; }
.size-leg {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(120px, .8fr) minmax(180px, 1.2fr) minmax(160px, 1fr);
  gap: 8px 18px;
  align-items: baseline;
  padding: 4px 0 0;
  border-top: 1px solid #dce4ee;
}
.size-leg strong { font-variant: small-caps; letter-spacing: 0.04em; }
.size-preview-actions, .order-draft-actions { display: flex; gap: 8px; }
.size-preview-card > .size-preview-actions {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  flex-direction: column;
  width: 9.2em;
  gap: 11px;
  margin: 0;
}
.size-preview-card > .size-preview-actions .tiny-button {
  width: 100%;
  box-sizing: border-box;
  padding: 7.8px 10.4px;
  font-size: 15.6px;
  line-height: 1.2;
}
@media (max-width: 1100px) {
  .size-preview-card { grid-template-columns: auto minmax(0, 1fr); width: 100%; }
  .size-preview-title { margin-right: 18px; }
  .size-preview-main, .size-preview-metrics { width: auto; min-width: 0; }
  .size-preview-card > .size-preview-actions { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; width: 9.2em; margin: 0; }
  .size-preview-meta, .size-leg { grid-template-columns: 1fr 1fr; }
  .size-preview-meta > span:last-child { grid-column: auto; }
}
.order-draft-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 14px;
  align-items: end;
}
.order-draft-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #5d6f84;
}
.order-draft-fields input, .order-draft-fields select { min-height: 32px; padding: 4px 8px; }
.order-draft-est { color: #2c3a4a; font-variant-numeric: tabular-nums; }
.status-pill.incomplete { background: #fff4d6; color: #8a5a00; cursor: pointer; }
.side-buy, .side-sell { font-weight: 700; white-space: nowrap; }
.side-buy { color: #087f70; }
.side-sell { color: var(--loss); }
.quote-source { display: inline-flex; align-items: center; gap: 5px; min-height: 8px; }
.quote-source::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #36a28e; }
.quote-source.stale::before { background: var(--amber); }
.status-pill { display: inline-block; padding: 4px 7px; background: #edf2f6; color: #52657a; border: 1px solid #d5dee7; font: 10px "Cascadia Mono", Consolas, monospace; text-transform: uppercase; white-space: nowrap; }
.status-pill.matched, .status-pill.confirmed, .status-pill.confirmed_booked { color: #087466; background: #e8f7f3; border-color: #bce3d9; }
.status-pill.difference, .status-pill.review_required, .status-pill.pending_broker { color: #94590c; background: #fff6e7; border-color: #eed5aa; }
.status-pill.parse_failed, .status-pill.unmatched, .status-pill.no_broker { color: #9d2f3b; background: #fff0f2; border-color: #efc2c8; }
.status-pill.confirmed, .status-pill.confirmed_booked, .status-pill.pending_broker, .status-pill.no_broker { text-transform: none; font-family: inherit; }
.col-check { width: 36px; text-align: center; }
.recon-book-dialog { width: min(520px, calc(100vw - 28px)); }
.recon-book-summary { margin: 0; font-size: 15px; }
.recon-book-list { margin: 0; padding-left: 18px; max-height: 180px; overflow: auto; color: #3d4f63; font-size: 13px; }
.recon-book-list li + li { margin-top: 4px; }
.empty { padding: 30px !important; color: #8592a2; text-align: center !important; }
#exec-queue-table td.empty,
#exec-today-table td.empty,
#exec-recent-table td.empty {
  text-align: center !important;
}

.nav-panel { min-height: 330px; }
.legend { display: flex; gap: 16px; color: #68778a; font-size: 11px; }
.legend i { display: inline-block; width: 18px; height: 2px; margin-right: 5px; vertical-align: middle; background: #8da1ba; }
.legend i.main-series { background: var(--exchange); height: 3px; }
.chart { height: 260px; padding: 14px 18px 20px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #e1e7ed; stroke-width: 1; }
.chart-line { fill: none; stroke: #8da1ba; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-line.main { stroke: var(--exchange); stroke-width: 2.5; }
.chart-label { fill: #708094; font: 9px "Cascadia Mono", Consolas, monospace; }

.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px dashed #96a9bd;
  background: #f6f9fc;
  cursor: pointer;
  text-align: left;
}
.file-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-drop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #bdcad8;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.file-drop:hover .file-drop-btn { border-color: var(--exchange); color: var(--exchange); }
.file-drop-name {
  display: inline-flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  min-height: 36px;
  color: #6d7c8f;
  font-weight: 500;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fa-workbench {
  display: grid;
  gap: 16px;
  padding: 16px 18px 22px;
}
.fa-workbench-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.fa-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.fa-hero article {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #f7f9fb;
}
.fa-hero small {
  display: block;
  color: #536579;
  font: 600 10px/1.35 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.fa-hero strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font: 550 20px/1.2 "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.fa-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
}
.fa-card > header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.fa-card > header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 550;
}
.fa-asof {
  margin-left: auto;
  color: #6d7c8f;
  font: 600 11px "Cascadia Mono", Consolas, monospace;
}
.fa-bs-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 36px;
  padding: 8px 16px 4px;
}
.fa-bs-col { min-width: 0; }
.fa-bs-col h4 {
  margin: 12px 0 4px;
  color: #6d7c8f;
  font: 700 11px/1.4 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.fa-bs-col h4:first-child { margin-top: 4px; }
.fa-bs-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 13px;
}
.fa-bs-row span { color: #4f6074; }
.fa-bs-row strong {
  font: 550 13px/1.3 "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.fa-bs-row.is-total {
  margin-top: 2px;
  border-bottom: 0;
  border-top: 1px solid var(--ink);
}
.fa-bs-row.is-total span,
.fa-bs-row.is-total strong { color: var(--ink); font-weight: 700; }
.fa-bs-balance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 10px 16px 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  font-size: 13px;
}
.fa-bs-balance strong { font-weight: 700; }
.fa-bs-balance small { color: #6d7c8f; }
.fa-bs-balance.is-ok { background: #e7f6ee; border-color: #b7dfc8; color: #0d6b4c; }
.fa-bs-balance.is-off { background: #fdecea; border-color: #f0c4c7; color: #8f2f39; }
.fa-card .table-wrap { margin: 0; }
.fa-monthend { margin-top: 0; }
.fa-trial-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fa-trial-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.fa-trial-list strong { font-family: "Cascadia Mono", Consolas, monospace; }
@media (max-width: 1050px) {
  .fa-workbench-grid,
  .fa-hero { grid-template-columns: 1fr 1fr; }
  .fa-bs-sheet { grid-template-columns: 1fr; }
}
.upload-list { max-height: 280px; overflow: auto; }
.upload-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); text-align: left; cursor: pointer; }
.upload-row:hover { background: #f5f8fb; }
.upload-row b, .upload-row small { display: block; }
.upload-row b { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row small { margin-top: 4px; color: #77869a; font-size: 10px; }

dialog { width: min(480px, calc(100vw - 28px)); border: 1px solid var(--line); padding: 0; color: var(--ink); box-shadow: 0 24px 80px rgba(10,29,50,.25); }
dialog::backdrop { background: rgba(11,26,45,.48); backdrop-filter: blur(2px); }
.dialog-form { display: grid; gap: 13px; padding: 20px; }
.option-build { display: grid; gap: 13px; }
.option-build[hidden], [data-manual-stock][hidden], [data-manual-option][hidden] { display: none !important; }
.option-build label { position: relative; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.icon-button { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #63748a; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.toast {
  position: fixed;
  inset: auto 24px 24px auto;
  z-index: 90;
  margin: 0;
  border: 0;
  width: max-content;
  max-width: min(440px, calc(100vw - 48px));
  padding: 12px 16px;
  background: var(--ink);
  color: white;
  overflow: visible;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #8f2f39; }

@media (max-width: 1050px) {
  .workspace-grid, .reconciliation-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .instrument-metrics { grid-template-columns: repeat(2, 1fr); }
  .metric-strip article:first-child { grid-column: span 2; }
  .session-step:nth-of-type(6), .session-line:nth-of-type(5) { display: none; }
}
.name-edit {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.name-edit:hover span { text-decoration: underline; }
.instrument-cell {
  min-width: 0;
  max-width: 100%;
}
.instrument-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}
.instrument-name-line .instrument-link,
.instrument-name-line .name-edit {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.instrument-code {
  display: block;
  color: #7b8999;
  font-size: 10px;
  margin-top: 3px;
}
.option-chevron {
  flex: 0 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 0;
  background: none;
  padding: 0;
  color: #3d5166;
  cursor: pointer;
}
.option-chevron:hover { color: var(--exchange); }
.option-chevron svg { transition: transform .15s ease; }
.option-chevron.is-open svg { transform: rotate(180deg); }
.data-table.is-book-fixed .col-instrument .instrument-cell,
.data-table.is-book-fixed .col-instrument .instrument-name-line {
  display: flex;
  overflow: hidden;
}
.data-table.is-book-fixed .col-instrument .instrument-cell {
  flex-direction: column;
  align-items: stretch;
}
.data-table.is-book-fixed .col-instrument .instrument-name-line .instrument-link,
.data-table.is-book-fixed .col-instrument .instrument-name-line .name-edit,
.data-table.is-book-fixed .col-instrument .instrument-name-line span {
  display: inline;
  max-width: none;
}
.data-table.is-book-fixed .col-instrument .option-chevron,
.data-table.is-book-fixed .col-instrument button.option-chevron {
  display: inline-flex;
  overflow: visible;
  white-space: nowrap;
  max-width: none;
  text-overflow: clip;
}
tr.option-detail td,
.data-table.is-book-fixed tr.option-detail td {
  background: #f6f7f9;
  padding: 0;
  overflow: visible;
  white-space: normal;
  box-shadow: none;
}
.option-detail-form { margin: 0; width: 100%; }
.option-detail-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 7px 10px 7px 22px;
  background: transparent;
}
.data-table:has(td.col-layout-pad) .option-detail-bar {
  padding-right: 38px;
}
.option-detail-cluster {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  min-width: 0;
  padding: 2px 0 2px 12px;
  border-left: 2px solid #8b97a5;
}
.option-detail-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.option-detail-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 12px;
  flex: 0 0 auto;
  margin-left: 0;
}
.option-detail-history {
  margin: 0 10px 8px 34px;
  padding-left: 16px;
}
.option-dte {
  margin: 0;
  min-width: 0;
}
.option-dte span { display: none; }
.option-dte strong {
  font-size: 12px;
  font-weight: 650;
  color: #2c3a4a;
}
.option-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
}
.option-stat-underlying { min-width: 72px; }
.option-stat span {
  font-size: 10px;
  line-height: 1.2;
  color: #6a7b8d;
}
.option-stat strong {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: #1d2a38;
}
.option-stat .pnl-pos { color: #087f70; }
.option-stat .pnl-neg { color: var(--loss); }
.option-detail-bar label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  color: #6a7b8d;
}
.option-detail-bar input {
  width: 88px;
  min-height: 26px;
  padding: 2px 6px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.option-detail-bar .button { align-self: center; }
.ledger-link {
  margin-left: 8px;
  color: #5d6f84;
  font-size: 10px;
}
tr.row-edit td {
  background: #f3f6fb;
  padding: 10px 12px 12px;
}
.mark-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 160px)) auto;
  gap: 10px 14px;
  align-items: end;
}
.mark-editor label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #5d6f84;
}
.mark-editor input {
  min-height: 32px;
  padding: 4px 8px;
}
.mark-history {
  grid-column: 1 / -1;
  margin: 0;
  padding-left: 16px;
  color: #536579;
  font-size: 12px;
}
.snapshot-dock {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin: 8px 0 18px;
  padding: 12px 4px 0;
  border-top: 1px solid #d5deea;
}
#book-edit-dock {
  align-items: center;
}
#snapshot-dock {
  justify-content: flex-end;
  align-items: flex-start;
}
#book-edit-footer {
  margin: 0;
  flex: 1 1 auto;
}
.book-export-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
}
.book-export-actions .button,
.book-export-date {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  margin: 0;
  border: 1px solid #bdcad8;
  background: #fff;
  color: var(--ink);
  line-height: 1;
}
.book-export-actions .button {
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}
.book-export-actions .button:hover,
.book-export-actions .button:active {
  transform: none;
}
.book-export-date {
  width: 196px;
  padding: 0 10px;
  gap: 8px;
  color: #536579;
}
.book-export-date span {
  flex: 0 0 auto;
  font: 600 12px/1 "Segoe UI", sans-serif;
  white-space: nowrap;
}
.book-export-date input[type="date"] {
  box-sizing: border-box;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 36px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 13px/36px "Cascadia Mono", Consolas, monospace;
}
.book-export-date input[type="date"]::-webkit-calendar-picker-indicator {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  opacity: 0.55;
}
.eod-dock-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}
.eod-dock-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.snapshot-versions-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
}
.snapshot-versions-panel[hidden] { display: none; }
#snapshot-versions-toggle[aria-expanded="true"] { border-color: var(--exchange); color: var(--exchange); }
.snapshot-commit { display: flex; gap: 8px; }
.snapshot-commit[hidden] { display: none; }
.snapshot-meta { text-align: right; min-width: 240px; }
.snapshot-versions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  margin-top: 6px;
}
.snapshot-version {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.snapshot-version-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.snapshot-version-note { font-weight: 400; color: #5b6b7c; }
.snapshot-version.is-current { font-weight: 650; }
.order-actions { white-space: nowrap; }
.exec-account {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #536579;
  font: 600 11px "Cascadia Mono", Consolas, monospace;
}
.exec-form {
  display: grid;
  grid-template-columns: minmax(210px, 2.4fr) minmax(140px, 1.3fr) minmax(72px, 0.7fr) minmax(84px, 0.8fr) minmax(140px, 1.2fr) repeat(4, minmax(104px, 1fr)) max-content;
  align-items: start;
  gap: 12px;
  padding: 14px 17px 16px;
  box-sizing: border-box;
}
.exec-form .exec-field,
.exec-form-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #536579;
  font: 600 11px "Cascadia Mono", Consolas, monospace;
}
.exec-form .exec-field > span,
.exec-form-actions .exec-field-cap {
  display: block;
  min-height: 16px;
  line-height: 16px;
}
.exec-form input,
.exec-form select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 6px 10px;
}
.exec-form input[readonly] { background: #f4f7fa; color: #3d4d5f; }
.exec-instrument,
.exec-account,
.exec-market,
.exec-side,
.exec-date,
.exec-qty,
.exec-gross,
.exec-fees,
.exec-net { width: auto; min-width: 0; max-width: none; }
.exec-instrument-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
}
.exec-instrument-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
}
.exec-instrument-row .tiny-button {
  flex: 0 0 auto;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  line-height: 34px;
}
#exec-instrument-label {
  display: block;
  min-height: 0;
  line-height: 1.3;
}
.exec-form-actions {
  margin-left: 0;
}
.exec-form-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
.exec-form-buttons .button {
  min-height: 36px;
  height: 36px;
  padding: 0 16px;
}
.table-block[data-table-block="exec-queue-table"] .table-scroll,
.table-block[data-table-block="exec-today-table"] .table-scroll,
.panel:has(#exec-queue-table) .table-wrap,
.panel:has(#exec-today-table) .table-wrap {
  overflow-x: hidden;
}
#exec-queue-table,
#exec-today-table,
#exec-recent-table {
  table-layout: fixed;
  width: 100%;
}
#exec-queue-table th,
#exec-queue-table td {
  padding-left: 6px;
  padding-right: 6px;
}
#exec-today-table th,
#exec-today-table td {
  padding-left: 6px;
  padding-right: 6px;
}
#exec-today-table .col-instrument {
  overflow: hidden;
  text-overflow: ellipsis;
}
#exec-today-table .col-instrument,
#exec-queue-table .col-instrument {
  max-width: none;
}
#exec-queue-table th,
#exec-queue-table td,
#exec-recent-table th,
#exec-recent-table td {
  text-align: left;
}
#exec-queue-table th.num,
#exec-queue-table td.num,
#exec-recent-table th.num,
#exec-recent-table td.num { text-align: right; }
#exec-queue-table .exec-tail,
#exec-recent-table .exec-tail {
  text-align: left;
  padding-left: 6px;
  padding-right: 6px;
}
#exec-queue-table th:nth-child(2),
#exec-queue-table td:nth-child(2),
#exec-queue-table th:nth-child(8),
#exec-queue-table td:nth-child(8),
#exec-queue-table th:nth-child(9),
#exec-queue-table td:nth-child(9),
#exec-queue-table th:nth-child(12),
#exec-queue-table td:nth-child(12),
#exec-queue-table th:nth-child(13),
#exec-queue-table td:nth-child(13),
#exec-queue-table th:nth-child(14),
#exec-queue-table td:nth-child(14),
#exec-queue-table th:nth-child(15),
#exec-queue-table td:nth-child(15),
#exec-recent-table th:nth-child(3),
#exec-recent-table td:nth-child(3),
#exec-recent-table th:nth-child(9),
#exec-recent-table td:nth-child(9),
#exec-recent-table th:nth-child(10),
#exec-recent-table td:nth-child(10),
#exec-recent-table th:nth-child(12),
#exec-recent-table td:nth-child(12),
#exec-recent-table th:nth-child(13),
#exec-recent-table td:nth-child(13),
#exec-recent-table th:nth-child(14),
#exec-recent-table td:nth-child(14),
#exec-recent-table th:nth-child(15),
#exec-recent-table td:nth-child(15) { width: 8%; }
#exec-queue-table tbody tr.is-selected td { background: #eef4fb; }
#exec-queue-table tbody tr[data-order],
#exec-recent-table tbody tr:not(:has(.empty)) { cursor: pointer; }
#exec-queue-table .exec-note,
#exec-recent-table .exec-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#exec-queue-table tr.is-note-open .exec-note,
#exec-recent-table tr.is-note-open .exec-note {
  white-space: normal;
  overflow: visible;
}
.exec-fill-bar {
  min-width: 0;
}
.exec-fill-track {
  height: 7px;
  background: #dce4ee;
  overflow: hidden;
}
.exec-fill-meter {
  display: block;
  height: 100%;
  background: #1f6feb;
}
.exec-fill-bar small {
  display: block;
  margin-top: 3px;
  color: #5d6f84;
  font-size: 10px;
}
.exec-cancel-order { font-size: 11px; }
.exec-cancel-order:disabled {
  color: #7a8694;
  background: #e8edf2;
  border-color: #d0d7de;
  cursor: not-allowed;
  opacity: 0.72;
  pointer-events: none;
}
.exec-cancel-order:disabled:hover { background: #e8edf2; }
.exec-cancel-dialog { width: min(420px, calc(100vw - 28px)); border-top: 4px solid #c45b4a; }
.exec-cancel-ask { margin: 0; font-size: 18px; font-weight: 650; color: #2c3a4a; }
.exec-cancel-detail { margin: 0; }
.exec-cancel-ok {
  border: 1px solid #9d2f3b;
  background: #9d2f3b;
  color: #fff;
  cursor: pointer;
  padding: 8px 14px;
}
.exec-cancel-ok:hover { background: #862833; }
.exec-confirm-copy { margin: 0; line-height: 1.55; font-size: 14px; }
@media (max-width: 1100px) {
  .exec-form { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .exec-instrument { grid-column: 1 / -1; }
  .exec-form-actions { grid-column: 1 / -1; justify-self: end; }
}
.broker-desk { display: grid; gap: 18px; padding-bottom: 48px; }
.broker-overview {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.broker-cash-book,
.broker-assets,
.broker-card {
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(17, 36, 56, .04);
}
.broker-cash-book,
.broker-assets { padding: 16px 18px 14px; }
.broker-cash-book header,
.broker-assets header { margin-bottom: 10px; }
.broker-cash-book h2,
.broker-assets h2,
.broker-side h3,
.broker-holdings-wrap h3 { margin: 2px 0 0; font-size: 16px; }
.broker-stack,
.broker-bridge {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.broker-bridge[hidden],
.broker-journal[hidden] { display: none !important; }
.broker-stack li,
.broker-bridge li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 7px 0;
  border-top: 1px solid #eef2f6;
  font-size: 13px;
}
.broker-stack li:first-child,
.broker-bridge li:first-child { border-top: 0; padding-top: 2px; }
.broker-stack span,
.broker-bridge span { color: #536579; min-width: 0; }
.broker-stack small {
  display: block;
  margin-top: 2px;
  color: #7a8794;
  font: 500 11px/1.35 "IBM Plex Sans", "Noto Sans SC", sans-serif;
}
.broker-stack strong,
.broker-bridge strong {
  font: 600 13px/1.3 "Cascadia Mono", Consolas, monospace;
  text-align: right;
  white-space: nowrap;
}
.broker-stack em,
.broker-card-stats em {
  font: 500 11px "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-style: normal;
  color: #7a8794;
  margin-left: 4px;
}
.broker-ccy-note {
  margin: 4px 0 6px;
  color: #7a8794;
  font-size: 11px;
  line-height: 1.4;
}
.broker-cash-book > .fee-toggle { margin: 8px 0 0; }
.broker-journal {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef2f6;
}
.broker-journal summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 12px "IBM Plex Sans", "Noto Sans SC", sans-serif;
  color: #1d4f91;
}
.broker-journal summary em { color: #7a8794; font-style: normal; font-weight: 500; }
.broker-journal .table-wrap { margin-top: 8px; }
.broker-assets .table-wrap { margin: 0; }
#broker-asset-table tfoot td {
  font-weight: 700;
  border-top: 1px solid #cbd6e1;
  background: #f7f9fc;
}
.broker-list { display: grid; gap: 16px; }
.broker-card { padding: 16px 18px 14px; }
.broker-card.readonly { background: #f7f4ee; }
.broker-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}
.broker-card-id { min-width: 0; }
.broker-card-id h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.broker-card-head .code { font: 600 12px "Cascadia Mono", Consolas, monospace; color: #536579; }
.broker-card-head .broker-aliases { font: 500 11px "Cascadia Mono", Consolas, monospace; color: #7a8794; }
.broker-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 6px 0 0;
  color: #536579;
  font-size: 12px;
}
.broker-card-stats strong { font: 600 12px "Cascadia Mono", Consolas, monospace; color: var(--ink); }
.broker-card-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.broker-card-body {
  display: grid;
  grid-template-columns: minmax(196px, 240px) minmax(0, 1fr);
  gap: 14px 18px;
  align-items: start;
}
.broker-card.cash-only .broker-card-body { grid-template-columns: 1fr; }
.broker-card.cash-only .broker-side {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.broker-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.broker-side section {
  padding: 10px 12px;
  border: 1px solid #e4ebf2;
  border-radius: 10px;
  background: #f7f9fc;
}
.broker-side .broker-stack li { padding: 5px 0; }
.broker-holdings-wrap { min-width: 0; }
.broker-holdings-wrap .table-wrap { margin: 0; }
.broker-holdings tfoot td {
  font-weight: 700;
  border-top: 1px solid #cbd6e1;
  background: #f7f9fc;
}
.broker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.broker-fa-slot {
  padding: 12px 14px;
  border: 1px dashed #c9d4e0;
  border-radius: 10px;
  background: #f7f9fc;
  min-height: 88px;
}
.bridge-toggle { margin: 8px 0 0; }
.bridge-list { margin: 8px 0 0; padding-left: 18px; color: #536579; font-size: 13px; }
.fee-toggle {
  border: 0;
  background: none;
  color: #1d4f91;
  cursor: pointer;
  font: 600 12px "IBM Plex Sans", "Noto Sans SC", sans-serif;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fee-editor {
  margin: 0 0 16px;
  padding: 14px 16px 12px;
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #f7f9fc;
}
.fee-editor[hidden] { display: none; }
.fee-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 10px;
}
.fee-picks label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: 600 11px "IBM Plex Sans", "Noto Sans SC", sans-serif;
  color: #536579;
}
.fee-picks select { min-width: 160px; }
.cash-readout { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 0; font: 600 13px "Cascadia Mono", Consolas, monospace; }
.account-editor {
  margin: 0 0 16px;
  padding: 14px 16px 12px;
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #f7f9fc;
}
.account-editor[hidden] { display: none; }
.account-form { display: grid; gap: 10px; }
.cash-edit-row, .move-block { display: grid; gap: 10px; }
.cash-edit-row { grid-template-columns: minmax(120px, 160px) minmax(140px, 1fr); }
.holding-picks { display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.holding-pick { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.fee-markets { display: grid; gap: 12px; }
.fee-market h3 { margin: 0 0 6px; font-size: 13px; }
.fee-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.fee-fields label, .cash-fields label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font: 600 10px "Cascadia Mono", Consolas, monospace;
  color: #536579;
}
.fee-fields small, .cash-fields small { font-weight: 500; color: #7a8899; }
.cash-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.broker-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (max-width: 980px) {
  .broker-overview,
  .broker-card-body,
  .broker-card.cash-only .broker-card-body,
  .broker-card.cash-only .broker-side { grid-template-columns: 1fr; }
  .broker-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; scrollbar-gutter: auto; }
  html, body { overflow-x: hidden; }
  .panel, .broker-card, .broker-list, .workspace-grid,
  .reconciliation-grid, .fa-workbench, .fa-workbench-grid,
  .risk-desk, .risk-status, .orders-workspace, .fund-grid {
    min-width: 0;
    max-width: 100%;
  }
  body.nav-open { overflow: hidden; }

  body.is-signed-out .nav-toggle { display: none !important; }
  .nav-toggle {
    display: grid;
    gap: 5px;
    width: 42px;
    height: 42px;
    margin-left: auto;
    padding: 11px 9px;
    border: 1px solid rgba(255,255,255,.22);
    background: transparent;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    height: 2px;
    background: #e8eef5;
    transition: transform .18s ease, opacity .18s ease;
  }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .topbar {
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 12px 0;
    gap: 8px;
  }
  .brand { min-width: 0; flex: 1 1 auto; max-width: calc(100% - 178px); }
  .brand span { min-width: 0; }
  .brand b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand small, .account-name { display: none; }
  .account-slot { margin-left: 0; gap: 6px; }
  .ccy-toggle { width: 84px; height: 30px; }
  .topbar nav {
    display: none;
    position: fixed;
    top: calc(56px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    margin: 0;
    padding: 8px 0 calc(24px + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    align-items: stretch;
    align-self: auto;
    overflow-y: auto;
    background: #0c1c30;
  }
  body.nav-open .topbar nav { display: flex; }
  .topbar nav a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 48px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  main { padding: 0 12px calc(56px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 24px; }
  .page-head, .page-head.compact, .panel-head, .blotter-head {
    align-items: stretch;
    flex-direction: column;
  }
  .page-head { padding: 18px 0 14px; gap: 12px; }
  .head-actions, .book-asof, .page-head-tools, .eod-date-nav, .book-eod-jump {
    width: 100%;
    align-items: stretch;
  }
  .book-asof { align-items: flex-start; }
  .book-eod-jump select, .book-eod-jump input,
  .snapshot-picker select, .eod-date-nav select,
  .filters input, .filters select {
    width: 100%;
    min-width: 0;
  }
  .snapshot-picker, .eod-date-nav { width: 100%; flex-wrap: wrap; }
  .history-chrome { flex-wrap: wrap; align-items: flex-end; }
  .history-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .history-tabs a, .history-tabs button {
    flex: 0 0 auto;
    padding: 12px 14px;
    white-space: nowrap;
  }
  .source-toggle {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    width: 100%;
    overflow: hidden;
  }
  .source-toggle button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: auto;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    padding: 6px 4px;
    text-align: center;
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
  }
  .filters, .range-filter, .blotter-head .head-actions, .new-open-bar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .range-filter label { width: 100%; display: grid; gap: 4px; }
  .range-filter input { width: 100%; }
  .history-tools {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 8px;
    justify-content: stretch;
    overflow: hidden;
  }
  .history-tools .source-toggle { width: 100%; height: auto; }
  .history-tools .source-toggle button { min-height: 40px; height: 40px; }
  .range-filter.history-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    border: 0;
    background: transparent;
    overflow: hidden;
  }
  .history-range label {
    box-sizing: border-box;
    width: auto;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0 6px;
    border: 1px solid #c4cfda;
    background: #fff;
  }
  .history-range label span {
    display: block;
    margin: 0;
    font-size: 11px;
    line-height: 1;
    text-align: center;
  }
  .history-range label input,
  .history-range input[type="date"] {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
    line-height: 34px;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
  }
  .history-range input[type="date"]::-webkit-datetime-edit,
  .history-range input[type="date"]::-webkit-datetime-edit-fields-wrapper,
  .history-range input[type="date"]::-webkit-date-and-time-value {
    width: 100%;
    min-width: 0;
    padding: 0;
    text-align: center;
  }
  .history-range input[type="date"] {
    position: relative;
  }
  .history-range input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
  }
  .history-range .button {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    min-height: 36px;
    height: 36px;
    border: 1px solid #bdcad8;
  }

  .metric-strip,
  .fee-strip,
  .pnl-strip,
  .instrument-metrics,
  .metric-strip.orders-metrics {
    grid-template-columns: 1fr 1fr !important;
  }
  .metric-strip article:first-child { grid-column: auto; }
  .metric-strip article {
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .metric-strip strong {
    font-size: 16px;
    white-space: normal;
    word-break: break-all;
  }

  .session-rail { margin: 0 -12px; padding: 12px; overflow-x: auto; }
  .session-line { min-width: 34px; }
  .table-wrap, .table-scroll {
    margin: 0 -12px;
    width: calc(100% + 24px);
    max-width: calc(100% + 24px);
    overflow-x: auto !important;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .data-table { font-size: 11px; }
  .data-table th, .data-table td { padding: 8px; white-space: nowrap; }
  .data-table[data-mode="orders"],
  .data-table.is-book-fixed,
  #exec-queue-table,
  #exec-today-table,
  #exec-recent-table {
    table-layout: fixed;
    width: max-content;
    max-width: none;
  }
  .data-table[data-mode="orders"] th,
  .data-table[data-mode="orders"] td,
  #exec-queue-table th,
  #exec-queue-table td,
  #exec-today-table th,
  #exec-today-table td,
  #exec-recent-table th,
  #exec-recent-table td {
    width: auto;
    overflow: visible;
  }
  .panel:has(#exec-queue-table) .table-wrap,
  .panel:has(#exec-today-table) .table-wrap,
  .panel:has(#exec-recent-table) .table-wrap {
    overflow-x: auto !important;
  }

  .workspace-grid, .reconciliation-grid { grid-template-columns: 1fr; }
  body:has(.orders-workspace) main {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .orders-workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
  }
  .orders-workspace .positions-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .orders-workspace .positions-panel .panel-head {
    min-height: 0;
    padding: 12px;
    gap: 12px;
  }
  .orders-workspace .positions-panel .panel-head > div:first-child { padding: 0; }
  .metric-strip.orders-metrics {
    width: 100%;
    min-height: 0;
  }
  .orders-workspace .positions-panel > .table-wrap,
  .orders-workspace .positions-panel > .table-block,
  .orders-workspace .positions-panel .table-scroll,
  .orders-workspace .positions-panel .table-wrap {
    flex: 0 0 auto;
    min-height: 220px;
    overflow-x: auto !important;
    overflow-y: visible;
  }
  .positions-panel .new-open-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 8px;
  }
  .positions-panel .new-open-bar .new-open-label,
  .positions-panel .new-open-bar .pool-search,
  .positions-panel .new-open-bar .new-open-status {
    grid-column: 1 / -1;
  }
  .positions-panel .new-open-bar .pool-search {
    min-width: 0;
    max-width: none;
  }
  .positions-panel .new-open-bar .tiny-button {
    width: 100%;
    min-height: 44px;
  }
  .positions-panel .new-open-bar .table-layout-btn { margin-left: 0; }
  .data-table[data-mode="orders"] th[data-col="target"],
  .data-table[data-mode="orders"] td.target-cell { white-space: normal; min-width: 168px; }
  .target-control { flex-wrap: wrap; justify-content: flex-start; }
  .emsx-brief { gap: 6px; padding: 10px 12px; }
  .emsx-chip { font-size: 12px; min-height: 28px; padding: 4px 8px; }
  .emsx-body { grid-template-columns: 1fr; padding: 12px; gap: 14px; }
  .emsx-row,
  .emsx-row-6 .emsx-half,
  .emsx-row-8 .emsx-half,
  .emsx-row-4 .emsx-half { grid-template-columns: 1fr; }
  .emsx-field { gap: 6px; }
  .emsx-field > span {
    height: auto;
    min-height: 0;
    font-size: 12px;
  }
  .emsx-field input,
  .emsx-field select,
  .emsx-side-btn,
  .emsx-field .emsx-step,
  .emsx-field .emsx-step button,
  .emsx-field .emsx-step input {
    height: 44px;
    min-height: 44px;
    max-height: none;
    font-size: 16px;
  }
  .emsx-field .emsx-step button { flex: 0 0 44px; width: 44px; }
  .emsx-actions { width: 100%; }
  .emsx-action-pair {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 44px;
    gap: 8px;
  }
  .emsx-action-pair .emsx-close { align-self: stretch; }
  .emsx-stage,
  .emsx-close,
  .emsx-actions select,
  .emsx-proof,
  .emsx-risk-btn {
    height: 44px;
    min-height: 44px;
  }

  #snapshot-dock,
  .snapshot-dock {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    margin: 8px -12px 18px;
    padding: 16px 12px 0;
  }
  .eod-dock-tools,
  .eod-dock-bar,
  .snapshot-versions-panel,
  .book-export-actions {
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
  }
  .book-export-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .book-export-actions .button,
  .book-export-date {
    width: 100%;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
  }
  .book-export-date { padding: 0 12px; }
  .book-export-date input[type="date"] {
    height: 42px;
    font-size: 16px;
    line-height: 42px;
  }
  .eod-dock-bar { flex-direction: column; }
  .eod-dock-bar .button,
  .snapshot-commit .button { width: 100%; }
  .snapshot-meta { min-width: 0; text-align: left; }
  .snapshot-versions { align-items: stretch; }

  input, select, textarea { font-size: 16px; min-height: 42px; }
  .button { min-height: 44px; }
  .head-actions .button,
  .page-head-tools > .button { width: 100%; }
  .eod-date-nav {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    width: 100%;
  }
  .eod-date-nav .eod-date-step {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .eod-date-nav select { width: 100%; min-width: 0; height: 44px; min-height: 44px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .button { flex: 1 1 120px; }
  dialog { width: calc(100vw - 16px); max-height: 90vh; overflow: auto; }
  .idle-card { width: calc(100vw - 24px); }
  .name-picker-box { min-width: 0; width: 100%; }
  .name-picker-page { padding: 12px 12px 16px; }
  .name-picker-page .name-picker-box input[type="search"] { max-width: none; }
  .name-picker-page .name-picker-menu { grid-template-columns: 1fr; gap: 0; }
  .exec-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 8px;
    padding: 8px 10px 10px;
  }
  .exec-instrument { grid-column: 1 / -1; grid-row: 1; }
  .exec-account { grid-column: 1; grid-row: 2; }
  .exec-date { grid-column: 2; grid-row: 2; }
  .exec-market { grid-column: 1; grid-row: 3; }
  .exec-side { grid-column: 2; grid-row: 3; }
  .exec-qty { grid-column: 1; grid-row: 4; }
  .exec-gross { grid-column: 2; grid-row: 4; }
  .exec-fees { grid-column: 1; grid-row: 5; }
  .exec-net { grid-column: 2; grid-row: 5; }
  .exec-form-actions { grid-column: 1 / -1; grid-row: 6; }
  .exec-form .exec-field,
  .exec-form-actions { min-width: 0; gap: 3px; }
  #exec-instrument-label:empty { display: none; }
  .exec-form .exec-field > span,
  .exec-form-actions .exec-field-cap {
    font-size: 10px;
    min-height: 0;
    line-height: 1.2;
  }
  .exec-form-actions .exec-field-cap { display: none; }
  .exec-form input,
  .exec-form select,
  .exec-form input[type="date"] {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 36px;
    min-height: 36px;
    padding: 0 8px;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
  }
  .exec-form input[type="date"] {
    text-align: center;
    line-height: 36px;
  }
  .exec-form input[type="date"]::-webkit-datetime-edit,
  .exec-form input[type="date"]::-webkit-date-and-time-value {
    width: 100%;
    min-width: 0;
    text-align: center;
  }
  .exec-form input[type="date"]::-webkit-calendar-picker-indicator {
    width: 14px;
    height: 14px;
    margin: 0;
    padding: 0;
  }
  .exec-form-actions { justify-self: stretch; margin-top: 0; }
  .exec-form-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }
  .exec-form-actions .button,
  .exec-form-buttons .button { width: 100%; height: 36px; min-height: 36px; }
  .broker-grid { grid-template-columns: 1fr; }
  tr.size-preview td,
  tr.order-draft td {
    padding: 0;
    white-space: normal;
  }
  .size-preview-card,
  .order-draft-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px 12px 16px;
    grid-template-columns: none;
  }
  .size-preview-title {
    grid-column: auto;
    grid-row: auto;
    margin: 0;
    padding: 0;
    font-size: 11px;
  }
  .size-preview-main,
  .size-preview-metrics {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
  }
  .size-preview-meta,
  .size-leg {
    display: flex;
    flex-direction: column;
    gap: 6px;
    grid-template-columns: none;
  }
  .size-preview-meta > span:last-child { grid-column: auto; }
  .size-leg { padding: 10px 0 0; }
  .cash-status {
    flex-wrap: wrap;
    height: auto;
    min-height: 0;
    align-items: flex-start;
    padding: 10px 12px;
    gap: 8px;
  }
  .size-preview-metrics .cash-copy,
  .size-preview-metrics .liq-copy {
    flex: 1 1 100%;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    line-height: 1.45;
  }
  .liq-part {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .liq-part-box { height: 36px; min-width: 4.5rem; }
  .liq-part input.liq-participation {
    width: 3.2rem;
    height: 28px;
    min-height: 28px;
    font-size: 16px;
  }
  .size-preview-card > .size-preview-actions {
    display: flex;
    flex-direction: row;
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
    align-self: stretch;
    width: 100%;
    gap: 8px;
  }
  .size-preview-card > .size-preview-actions .tiny-button {
    flex: 1 1 0;
    min-height: 44px;
    font-size: 15px;
  }
  .book-asof-line { width: 100%; }
  .book-eod-jump {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    width: 100%;
  }
  .book-eod-jump select, .book-eod-jump input { width: 100%; }
  .positions-panel .filters {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .market-filter, .market-filter-menu { width: 100%; min-width: 0; }
  .market-filter-btn { width: 100%; min-height: 44px; }
  .privacy-eye { align-self: flex-start; width: 44px; height: 44px; }

  .exec-instrument-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    align-items: stretch;
    height: 36px;
    gap: 6px;
  }
  .exec-instrument-row input,
  .exec-instrument-row .tiny-button {
    width: 100%;
    height: 36px;
    min-height: 36px;
    line-height: 1;
    font-size: 14px;
  }

  .broker-desk { gap: 12px; padding-bottom: 24px; }
  .broker-list { gap: 12px; padding-bottom: 8px; }
  .broker-cash-book,
  .broker-assets,
  .broker-card {
    padding: 14px 12px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .broker-card-head { align-items: stretch; }
  .broker-card-tools { width: 100%; }
  .broker-card-head h2 { flex-wrap: wrap; }
  .cash-edit-row, .move-block, .account-form { grid-template-columns: 1fr; }
  .fee-fields, .cash-fields { grid-template-columns: 1fr 1fr; }
  .fee-picks { flex-direction: column; }
  .fee-picks select { min-width: 0; width: 100%; }
  .broker-actions { flex-direction: column; }
  .broker-actions .button, .broker-card-head .button { width: 100%; }
  .holding-picks { max-height: 220px; }
  .cash-readout { font-size: 12px; }

  .upload-row { align-items: flex-start; gap: 10px; padding: 12px; }
  .upload-row span { min-width: 0; flex: 1 1 auto; }
  .upload-row b { max-width: 100%; }
  .recon-bulk-bar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .recon-bulk-bar .button { width: 100%; }
  .file-drop { padding: 10px 12px; flex-wrap: wrap; }
  .file-drop-btn { min-height: 40px; }

  .compare-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .compare-pill span { min-height: 40px; }

  .fa-monthend, .fa-workbench { padding: 12px 12px 16px; gap: 12px; }
  .fa-workbench-grid,
  .fa-hero { grid-template-columns: 1fr; gap: 12px; }
  .fa-workbench-grid > * { min-width: 0; max-width: 100%; }
  .fa-hero strong { font-size: 18px; }
  .fa-bs-sheet { grid-template-columns: 1fr; padding: 4px 12px 6px; }
  .fa-bs-row { grid-template-columns: minmax(0, 1fr) 120px; }
  .fa-workbench .table-wrap {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .fa-workbench .data-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }
  .fa-workbench .data-table th,
  .fa-workbench .data-table td {
    white-space: nowrap;
  }

  .risk-status { padding: 12px; gap: 12px; }
  .risk-status-actions { width: 100%; }
  .risk-status-actions .button { flex: 1 1 100%; }
  .risk-override-form { flex-direction: column; align-items: stretch; }
  .risk-override-form input,
  .risk-override-form .button { width: 100%; min-width: 0; }
  .risk-rule-fields { grid-template-columns: 1fr; }
  .risk-archive-head { align-items: stretch; }
  .risk-archive-search { min-width: 0; width: 100%; }
  .risk-archive-kinds { width: 100%; }
  .risk-archive-kinds button { flex: 1 1 auto; }
  .risk-archive-row { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 12px; }

  .legend { flex-wrap: wrap; gap: 8px 14px; }
  .chart { height: 220px; padding: 10px 8px 14px; }
  .fund-grid { grid-template-columns: 1fr; padding: 12px; }
  .fund-card { min-height: 120px; }
  .settings-desk { width: 100%; }
  .settings-session { flex-direction: column; align-items: stretch; }
  .settings-panel .dialog-form { padding: 16px 14px; }
  .settings-panel .dialog-actions .button,
  .settings-session .button,
  #login-form .button { width: 100%; }
  .panel-head { padding: 12px; min-height: 0; }
  .attribution-strip { grid-template-columns: 1fr 1fr; }

  .toast { inset: auto 12px 16px 12px; max-width: none; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media print {
  @page { size: A3 landscape; margin: 10mm; }
  body { background: white; font-size: 10px; }
  .topbar, .session-rail, .no-print { display: none !important; }
  main { width: 100%; max-width: none; padding: 0; }
  .page-head { padding: 0 0 12px; }
  .metric-strip, .panel { box-shadow: none; }
  .metric-strip { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  body:has(.orders-workspace) { overflow: visible; }
  body:has(.orders-workspace) main { height: auto; overflow: visible; }
  .orders-workspace { display: block; min-height: 0; }
  .orders-dock { max-height: none; }
  .data-table th { position: static; }
  .data-table th, .data-table td { padding: 5px 6px; }
  .data-table tbody tr.row-short,
  .data-table tbody tr.section-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
