:root {
  --workbench-bg: #07111f;
  --workbench-sidebar: #081321;
  --workbench-surface: #0d1929;
  --workbench-surface-raised: #111f31;
  --workbench-surface-soft: #142237;
  --workbench-line: rgba(148, 163, 184, 0.17);
  --workbench-line-strong: rgba(96, 165, 250, 0.42);
  --workbench-text: #f8fafc;
  --workbench-muted: #a8b5c7;
  --workbench-blue: #3b82f6;
  --workbench-blue-soft: rgba(59, 130, 246, 0.14);
  --workbench-green: #35d07f;
  --workbench-red: #ff6174;
  --workbench-amber: #f6c453;
}

html {
  background: var(--workbench-bg);
}

body.tool-position-page {
  min-height: 100vh;
  background: var(--workbench-bg);
  color: var(--workbench-text);
}

body.tool-position-page::before,
body.tool-position-page::after {
  display: none !important;
}

body.tool-position-page .wrap {
  width: calc(100% - 178px);
  max-width: none;
  min-height: 100vh;
  margin: 0 0 0 178px;
  padding: 0 22px 44px;
}

.workbench-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 110;
  display: flex;
  width: 178px;
  flex-direction: column;
  padding: 26px 14px 18px;
  border-right: 1px solid var(--workbench-line);
  background: var(--workbench-sidebar);
}

.workbench-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  color: var(--workbench-text);
  text-decoration: none;
}

.workbench-brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: var(--workbench-blue);
  color: #eff6ff;
  font-size: 15px;
}

.workbench-brand strong {
  font-size: 21px;
  letter-spacing: -0.04em;
}

.workbench-brand strong span {
  color: #6ea8ff;
}

.workbench-sidebar-nav {
  display: grid;
  gap: 7px;
  margin-top: 42px;
}

.workbench-sidebar-nav button,
.workbench-mobile-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--workbench-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.workbench-sidebar-nav button {
  width: 100%;
  padding: 0 12px;
}

.workbench-sidebar-nav button i,
.workbench-mobile-nav button i {
  width: 18px;
  font-size: 17px;
  text-align: center;
}

.workbench-sidebar-nav button:hover,
.workbench-sidebar-nav button:focus-visible,
.workbench-mobile-nav button:hover,
.workbench-mobile-nav button:focus-visible {
  color: var(--workbench-text);
  background: rgba(148, 163, 184, 0.08);
}

.workbench-sidebar-nav button.active,
.workbench-mobile-nav button.active {
  color: #70a7ff;
  background: var(--workbench-blue-soft);
}

.workbench-sidebar-nav button:focus-visible,
.workbench-mobile-nav button:focus-visible,
.workbench-primary-button:focus-visible,
.workbench-secondary-button:focus-visible,
.workbench-search:focus-within {
  outline: 2px solid #70a7ff;
  outline-offset: 2px;
}

.workbench-sync-card {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 13px 12px;
  border: 1px solid var(--workbench-line);
  border-radius: 12px;
  color: var(--workbench-muted);
}

.workbench-sync-card span,
.workbench-sync-card small {
  font-size: 11px;
}

.workbench-sync-card span {
  color: var(--workbench-green);
  font-weight: 850;
}

.workbench-sync-card strong {
  color: var(--workbench-text);
  font-size: 13px;
}

.workbench-header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  min-height: 108px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--workbench-line);
  background: rgba(7, 17, 31, 0.96);
  backdrop-filter: blur(18px);
}

.workbench-heading {
  min-width: 180px;
}

.workbench-heading p {
  margin: 0 0 3px;
  color: #6ea8ff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.workbench-heading h1 {
  margin: 0;
  color: var(--workbench-text);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.workbench-heading span {
  display: block;
  margin-top: 5px;
  color: var(--workbench-muted);
  font-size: 12px;
}

.workbench-header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.workbench-search {
  display: flex;
  width: clamp(190px, 22vw, 300px);
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--workbench-line);
  border-radius: 11px;
  background: var(--workbench-surface);
  color: var(--workbench-muted);
}

.workbench-search input {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--workbench-text);
  box-shadow: none;
  font-size: 14px;
}

.workbench-search input:focus {
  border: 0;
  box-shadow: none;
}

.workbench-search input::placeholder {
  color: #77869a;
}

.workbench-primary-button,
.workbench-secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  border-radius: 11px;
  color: var(--workbench-text);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.workbench-primary-button {
  border: 1px solid #4c8dff;
  background: var(--workbench-blue);
  color: #fff;
}

.workbench-primary-button:hover {
  background: #4b8cf7;
}

.workbench-secondary-button {
  border: 1px solid var(--workbench-line);
  background: var(--workbench-surface);
}

.workbench-secondary-button[aria-expanded="true"] {
  border-color: var(--workbench-line-strong);
  background: var(--workbench-blue-soft);
  color: #8db8ff;
}

.workbench-header .tool-utility-nav {
  display: flex;
  width: auto;
  margin: 0;
  padding: 0;
  gap: 7px;
}

.workbench-header .tool-utility-link,
.workbench-header .tool-utility-nav button {
  display: grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--workbench-line);
  border-radius: 10px;
  background: var(--workbench-surface);
  color: var(--workbench-muted);
  font-size: 14px;
}

.workbench-header .tool-utility-nav button span:not(.sr-only) {
  display: none;
}

.workbench-header .tool-utility-nav button i {
  display: block;
  line-height: 1;
}

body:not([data-workbench-view="holdings"]) .workbench-search,
body:not([data-workbench-view="holdings"]) #workbenchFilterButton {
  display: none;
}

body[data-workbench-view="add"] .workbench-primary-button {
  display: none;
}

.workbench-mobile-nav {
  display: none;
}

.hero-shell,
.legacy-page-title,
.legacy-page-title + .sub,
.page-bookmarks-dock,
.site-mini-footer {
  display: none !important;
}

body.tool-position-page .layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 0 !important;
}

body.tool-position-page .card {
  border: 1px solid var(--workbench-line);
  border-radius: 14px;
  background: var(--workbench-surface);
  box-shadow: none;
}

#portfolioBoard {
  min-width: 0;
  padding: 0 !important;
  border: 0;
  background: transparent !important;
}

#portfolioBoard > .panel-heading {
  display: none;
}

#portfolioSummary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid var(--workbench-line);
  border-radius: 13px;
  background: var(--workbench-surface);
}

#portfolioSummary .kpi {
  min-height: 122px;
  padding: 20px 24px;
  border: 0 !important;
  border-right: 1px solid var(--workbench-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#portfolioSummary .kpi:last-child {
  border-right: 0 !important;
}

#portfolioSummary .kpi.metric-card {
  display: grid;
  min-height: 122px;
  align-content: center;
  gap: 8px;
}

#portfolioSummary .kpi .name {
  color: var(--workbench-muted);
  font-size: 12px;
  font-weight: 750;
}

#portfolioSummary .kpi .value,
#portfolioSummary .kpi.metric-card .value:not(.money-value) {
  min-height: 0;
  margin: 0;
  color: var(--workbench-text);
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.1;
}

#portfolioSummary .kpi .value.money-value {
  min-height: 0;
  gap: 4px;
}

#portfolioSummary .kpi .value.money-value .money-value-currency {
  font-size: 10px;
}

#portfolioSummary .kpi .value.money-value .money-value-amount {
  font-size: clamp(19px, 2vw, 25px);
}

#portfolioSummary .kpi .meta-line {
  min-height: 0;
  margin: 0;
  color: var(--workbench-muted);
  font-size: 11px;
}

#portfolioToolbar {
  display: none;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, 0.6fr));
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--workbench-line);
  border-radius: 12px;
  background: var(--workbench-surface);
}

#portfolioToolbar.open {
  display: grid;
}

#portfolioToolbar #search {
  display: none;
}

#portfolioToolbar input,
#portfolioToolbar select {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--workbench-surface-soft);
  font-size: 13px;
}

#portfolioBulkActions {
  display: none;
  grid-template-columns: repeat(4, max-content);
  justify-content: end;
  gap: 8px;
  margin: 0 0 12px;
}

#portfolioToolbar.open + #portfolioBulkActions {
  display: grid;
}

#portfolioBulkActions .btn {
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12px;
}

body[data-workbench-view="holdings"] #portfolioBoard {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(330px, 0.85fr);
  grid-template-rows: auto auto auto minmax(620px, 1fr);
  gap: 10px;
}

body[data-workbench-view="holdings"] #portfolioSummary {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}

body[data-workbench-view="holdings"] #portfolioSummary .kpi {
  padding-inline: 10px !important;
}

body[data-workbench-view="holdings"] #portfolioSummary .kpi .value.money-value .money-value-amount {
  font-size: clamp(14px, 1.2vw, 16px) !important;
}

body[data-workbench-view="holdings"] #portfolioToolbar {
  grid-column: 1;
  grid-row: 2;
}

body[data-workbench-view="holdings"] #portfolioBulkActions,
body[data-workbench-view="holdings"] #portfolioActionPanel {
  grid-column: 1;
  grid-row: 3;
}

.holdings-workbench {
  display: contents;
}

.holdings-list-panel {
  grid-column: 1;
  grid-row: 4;
  min-height: 620px;
}

.holding-inspector {
  grid-column: 2;
  grid-row: 1 / 5;
}

.holdings-list-panel,
.holding-inspector {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--workbench-line);
  border-radius: 13px;
  background: var(--workbench-surface);
}

.holdings-list-panel {
  margin: 0;
}

.holdings-list-panel table {
  table-layout: fixed;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
}

.holdings-list-panel th:nth-child(1) { width: 28%; }
.holdings-list-panel th:nth-child(2) { width: 10%; }
.holdings-list-panel th:nth-child(3) { width: 19%; }
.holdings-list-panel th:nth-child(4) { width: 19%; }
.holdings-list-panel th:nth-child(5) { width: 13%; }
.holdings-list-panel th:nth-child(6) { width: 11%; }

.holdings-list-panel th {
  position: static;
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--workbench-line);
  background: var(--workbench-surface);
  color: var(--workbench-muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.holdings-list-panel td {
  height: 88px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--workbench-line);
  vertical-align: middle;
}

.holdings-list-panel tbody tr {
  cursor: pointer;
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.holdings-list-panel tbody tr:hover {
  background: rgba(148, 163, 184, 0.05);
}

.holdings-list-panel tbody tr.selected {
  background: rgba(59, 130, 246, 0.1);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.75);
}

.holdings-list-panel tbody tr:focus-visible {
  outline: 2px solid #70a7ff;
  outline-offset: -3px;
}

.holding-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.holding-monogram,
.inspector-monogram {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--workbench-line);
  background: var(--workbench-surface-soft);
  color: var(--workbench-text);
  font-weight: 950;
  text-transform: uppercase;
}

.holding-monogram {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 12px;
}

.holding-monogram.has-logo img,
.inspector-monogram.has-logo img {
  display: block;
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.inspector-monogram.has-logo img {
  width: 68%;
  height: 68%;
}

.holding-identity strong {
  display: block;
  color: var(--workbench-text);
  font-size: 15px;
}

.holding-identity span,
.holding-cell-note {
  display: block;
  margin-top: 3px;
  color: var(--workbench-muted);
  font-size: 11px;
}

.holding-identity span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holding-market {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--workbench-line);
  border-radius: 7px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 850;
}

.holding-value {
  color: var(--workbench-text);
  font-size: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.holding-pnl {
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.holding-weight {
  display: grid;
  gap: 6px;
}

.holding-weight strong {
  font-variant-numeric: tabular-nums;
}

.holding-weight-track {
  display: block;
  width: 76px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
}

.holding-weight-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--workbench-blue);
}

.holding-health {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid rgba(53, 208, 127, 0.19);
  border-radius: 7px;
  background: rgba(53, 208, 127, 0.08);
  color: #7ae3ad;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.holding-health::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.holding-health.warn {
  border-color: rgba(246, 196, 83, 0.2);
  background: rgba(246, 196, 83, 0.08);
  color: var(--workbench-amber);
}

.holding-inspector {
  align-self: stretch;
}

.inspector-empty {
  display: grid;
  min-height: 540px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 30px;
  color: var(--workbench-muted);
  text-align: center;
}

.inspector-empty i {
  font-size: 28px;
  color: #6ea8ff;
}

.inspector-empty h3,
.inspector-empty p {
  margin: 0;
}

.inspector-empty h3 {
  color: var(--workbench-text);
  font-size: 18px;
}

.inspector-empty .workbench-primary-button {
  display: inline-flex;
  margin-top: 10px;
}

.inspector-content {
  display: grid;
  min-height: 100%;
  grid-template-rows: auto auto auto 1fr auto;
}

.inspector-head {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--workbench-line);
}

.inspector-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.inspector-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.inspector-monogram {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  font-size: 14px;
}

.inspector-identity h2,
.inspector-identity p {
  margin: 0;
}

.inspector-identity h2 {
  font-size: 22px;
  letter-spacing: -0.035em;
}

.inspector-identity p {
  margin-top: 4px;
  overflow: hidden;
  color: var(--workbench-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-price {
  flex: 0 0 auto;
  text-align: right;
}

.inspector-price span,
.inspector-price small {
  display: block;
  color: var(--workbench-muted);
  font-size: 10px;
}

.inspector-price strong {
  display: block;
  margin: 3px 0;
  color: var(--workbench-text);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.inspector-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.inspector-tags span {
  padding: 4px 7px;
  border: 1px solid var(--workbench-line);
  border-radius: 6px;
  color: var(--workbench-muted);
  font-size: 10px;
  font-weight: 800;
}

.inspector-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px 14px;
  border-bottom: 1px solid var(--workbench-line);
}

.inspector-metric {
  min-width: 0;
  padding: 0 10px;
  border-right: 1px solid var(--workbench-line);
}

.inspector-metric:last-child {
  border-right: 0;
}

.inspector-metric span,
.inspector-metric small {
  display: block;
  color: var(--workbench-muted);
  font-size: 10px;
}

.inspector-metric strong {
  display: block;
  margin: 6px 0 3px;
  color: var(--workbench-text);
  font-size: clamp(11px, 1vw, 14px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.inspector-chart {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--workbench-line);
}

.inspector-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.inspector-section-title h3,
.inspector-section-title p {
  margin: 0;
}

.inspector-section-title h3 {
  font-size: 13px;
}

.inspector-section-title p {
  color: var(--workbench-muted);
  font-size: 10px;
}

#inspectorCanvas {
  display: block;
  width: 100%;
  height: 112px;
}

.inspector-lots {
  min-height: 190px;
  padding: 18px 22px;
}

.inspector-lot-list {
  display: grid;
  gap: 0;
}

.inspector-lot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--workbench-line);
}

.inspector-lot:last-child {
  border-bottom: 0;
}

.inspector-lot strong,
.inspector-lot span {
  display: block;
}

.inspector-lot strong {
  font-size: 12px;
}

.inspector-lot span {
  margin-top: 3px;
  color: var(--workbench-muted);
  font-size: 10px;
}

.inspector-lot-value {
  color: var(--workbench-text);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--workbench-line);
}

.inspector-actions button {
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid var(--workbench-line-strong);
  border-radius: 9px;
  background: transparent;
  color: #8db8ff;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.inspector-actions button.sell {
  border-color: rgba(255, 97, 116, 0.48);
  color: #ff8291;
}

.inspector-actions button:hover,
.inspector-actions button:focus-visible {
  background: rgba(59, 130, 246, 0.1);
  outline: none;
}

.inspector-actions button.sell:hover,
.inspector-actions button.sell:focus-visible {
  background: rgba(255, 97, 116, 0.1);
}

#empty {
  margin: 20px;
  border-radius: 10px;
}

#editorSection {
  width: min(960px, 100%);
  margin: 0 auto;
  border-radius: 14px;
}

#editorSection .card-title .eyebrow,
#editorSection .step-chip {
  background: var(--workbench-blue-soft);
  border-color: rgba(59, 130, 246, 0.3);
  color: #8db8ff;
}

#editorSection .panel-card,
#portfolioBoard .panel-card,
#portfolioBoard .viz-card,
#editorSection .lot-card,
#focusViewSection .viz-card {
  border-color: var(--workbench-line);
  border-radius: 12px;
  background: var(--workbench-surface);
  box-shadow: none;
}

body[data-workbench-view="holdings"] #editorSection,
body[data-workbench-view="overview"] #editorSection,
body[data-workbench-view="performance"] #editorSection,
body[data-workbench-view="realized"] #editorSection {
  display: none;
}

body[data-workbench-view="add"] #portfolioBoard,
body[data-workbench-view="settings"] #portfolioBoard,
body[data-workbench-view="cashflow"] #portfolioBoard {
  display: none;
}

body[data-workbench-view="add"] #settingsPanel {
  display: none;
}

body[data-workbench-view="settings"] #editorSection > .card-title,
body[data-workbench-view="settings"] #editorSection > .notice,
body[data-workbench-view="settings"] #editorSection > #editorNotice,
body[data-workbench-view="settings"] #posForm,
body[data-workbench-view="cashflow"] #editorSection > .card-title,
body[data-workbench-view="cashflow"] #editorSection > .notice,
body[data-workbench-view="cashflow"] #editorSection > #editorNotice,
body[data-workbench-view="cashflow"] #posForm {
  display: none !important;
}

body[data-workbench-view="cashflow"] #settingsPanel > :not(h3):not(.panel-copy):not(.stack) {
  display: none !important;
}

body[data-workbench-view="cashflow"] #settingsPanel > .stack > :not(#cashFlowDetails):not(#apiStatus):not(#statusActions) {
  display: none !important;
}

body[data-workbench-view="cashflow"] #cashFlowDetails {
  display: block !important;
}

body[data-workbench-view="holdings"] #portfolioBoard > :not(#portfolioSummary):not(#portfolioToolbar):not(#portfolioBulkActions):not(#portfolioActionPanel):not(#holdingsWorkbench),
body[data-workbench-view="holdings"] #portfolioBoard > details {
  display: none !important;
}

body[data-workbench-view="overview"] #realizedSection,
body[data-workbench-view="overview"] #chartsSection,
body[data-workbench-view="overview"] #portfolioToolbar,
body[data-workbench-view="overview"] #portfolioBulkActions,
body[data-workbench-view="overview"] #portfolioActionPanel,
body[data-workbench-view="overview"] #holdingsWorkbench,
body[data-workbench-view="overview"] #portfolioBoard > details {
  display: none !important;
}

body[data-workbench-view="performance"] #realizedSection,
body[data-workbench-view="performance"] #riskSection,
body[data-workbench-view="performance"] #portfolioToolbar,
body[data-workbench-view="performance"] #portfolioBulkActions,
body[data-workbench-view="performance"] #portfolioActionPanel,
body[data-workbench-view="performance"] #holdingsWorkbench,
body[data-workbench-view="performance"] #portfolioBoard > details {
  display: none !important;
}

body[data-workbench-view="realized"] #portfolioSummary,
body[data-workbench-view="realized"] #insightsSection,
body[data-workbench-view="realized"] #portfolioToolbar,
body[data-workbench-view="realized"] #portfolioBulkActions,
body[data-workbench-view="realized"] #portfolioActionPanel,
body[data-workbench-view="realized"] #holdingsWorkbench,
body[data-workbench-view="realized"] #portfolioBoard > details {
  display: none !important;
}

body[data-workbench-view="overview"] #insightsSection {
  display: block;
}

body[data-workbench-view="performance"] #insightsSection {
  display: block;
}

#realizedSection,
#chartsSection,
#riskSection {
  margin-top: 0;
}

#focusViewSection:not(.hidden) {
  position: relative;
  z-index: 95;
  display: block;
  margin-top: 20px;
}

body.embedded-tool-frame .workbench-sidebar {
  display: none;
}

body.embedded-tool-frame .wrap {
  width: 100%;
  margin-left: 0;
}

@media (max-width: 1240px) {
  body.tool-position-page .wrap {
    width: calc(100% - 152px);
    margin-left: 152px;
    padding-inline: 18px;
  }

  .workbench-sidebar {
    width: 152px;
    padding-inline: 10px;
  }

  .workbench-brand {
    padding-inline: 8px;
  }

  .workbench-header-actions {
    gap: 7px;
  }

  .workbench-search {
    width: 200px;
  }

  .workbench-header .tool-utility-nav {
    display: none;
  }

  .holdings-workbench {
    display: contents;
  }

  body[data-workbench-view="holdings"] #portfolioBoard {
    grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.8fr);
  }

  .holdings-list-panel th,
  .holdings-list-panel td {
    padding-inline: 11px;
  }
}

@media (max-width: 980px) {
  body.tool-position-page .wrap {
    width: 100%;
    margin-left: 0;
    padding: 0 16px 34px;
  }

  .workbench-sidebar {
    display: none;
  }

  .workbench-header {
    min-height: 96px;
  }

  .workbench-mobile-nav {
    position: sticky;
    top: 96px;
    z-index: 85;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin: 0 -16px;
    padding: 8px 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--workbench-line);
    background: rgba(7, 17, 31, 0.96);
    backdrop-filter: blur(18px);
  }

  .workbench-mobile-nav button {
    min-width: 0;
    justify-content: center;
    padding: 0 10px;
    white-space: nowrap;
  }

  .workbench-header .tool-utility-nav {
    display: none !important;
  }

  .workbench-heading span {
    display: none;
  }

  .holdings-workbench {
    display: grid;
    grid-template-columns: 1fr !important;
  }

  body[data-workbench-view="holdings"] #portfolioBoard {
    display: block;
  }

  body[data-workbench-view="holdings"] #portfolioSummary {
    margin-bottom: 12px;
  }

  body[data-workbench-view="holdings"] #holdingsWorkbench {
    display: grid;
    grid-template-columns: 1fr !important;
  }

  body[data-workbench-view="holdings"] #holdingsSection,
  body[data-workbench-view="holdings"] #holdingInspector {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .holding-inspector {
    min-height: 0;
  }

  #portfolioSummary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #portfolioSummary .kpi:nth-child(2) {
    border-right: 0;
  }

  #portfolioSummary .kpi:nth-child(-n + 2) {
    border-bottom: 1px solid var(--workbench-line);
  }

  #portfolioToolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-visual-grid.performance-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body.tool-position-page .wrap {
    padding-inline: 12px;
  }

  .workbench-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    align-items: flex-start;
    padding: 18px 0 68px;
  }

  .workbench-heading {
    min-width: 0;
  }

  .workbench-heading p {
    display: none;
  }

  .workbench-heading h1 {
    font-size: 28px;
  }

  .workbench-header-actions {
    align-self: start;
    gap: 7px;
  }

  .workbench-search {
    position: absolute;
    top: 72px;
    left: 0;
    width: calc(100% - 112px);
  }

  .workbench-secondary-button {
    position: absolute;
    top: 72px;
    right: 0;
    width: 102px;
  }

  .workbench-primary-button {
    min-width: 46px;
    padding: 0 13px;
  }

  .workbench-primary-button span {
    display: none;
  }

  .workbench-mobile-nav {
    position: relative;
    top: auto;
    margin: 0 -12px;
    padding-inline: 12px;
  }

  .workbench-mobile-nav button {
    min-width: 0;
    min-height: 50px;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
  }

  .workbench-mobile-nav button i {
    font-size: 15px;
  }

  body.tool-position-page .layout {
    margin-top: 12px;
  }

  #portfolioSummary {
    margin-bottom: 12px;
  }

  #portfolioSummary .kpi {
    min-height: 102px;
    padding: 15px;
  }

  #portfolioSummary .kpi.metric-card {
    min-height: 102px;
  }

  #portfolioToolbar {
    grid-template-columns: 1fr;
  }

  #portfolioBulkActions,
  #portfolioToolbar.open + #portfolioBulkActions {
    grid-template-columns: 1fr 1fr;
  }

  .holdings-list-panel table,
  .holdings-list-panel tbody {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.tool-position-page .holdings-list-panel table {
    min-width: 0 !important;
  }

  .holdings-list-panel tr,
  .holdings-list-panel td {
    min-width: 0;
    max-width: 100%;
  }

  .holdings-list-panel thead {
    display: none;
  }

  .holdings-list-panel tbody tr {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 12px 14px;
    overflow: hidden;
    border-bottom: 1px solid var(--workbench-line);
  }

  .holdings-list-panel td {
    display: grid;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 58px;
    align-content: center;
    padding: 8px;
    overflow: hidden;
    border: 0;
    text-align: left !important;
  }

  .holdings-list-panel .holding-value,
  .holdings-list-panel .holding-pnl {
    min-width: 0;
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .holdings-list-panel td:first-child {
    grid-column: 1 / -1;
  }

  .holdings-list-panel .holding-identity,
  .holdings-list-panel .holding-identity > div:last-child {
    min-width: 0;
  }

  .holdings-list-panel td::before {
    margin-bottom: 5px;
    color: var(--workbench-muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 800;
  }

  .holdings-list-panel td:first-child::before {
    display: none;
  }

  .holding-weight-track {
    width: min(120px, 100%);
  }

  .inspector-title-row {
    align-items: flex-start;
  }

  .inspector-price strong {
    font-size: 19px;
  }

  .inspector-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .inspector-metric {
    min-height: 68px;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--workbench-line);
  }

  .inspector-actions {
    position: sticky;
    bottom: 0;
    background: rgba(13, 25, 41, 0.97);
  }

  #editorSection {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .holdings-list-panel tbody tr {
    transition: none;
  }
}
