body.portfolio-table-edit .ds-holdings-peek {
  display: none !important;
}
/* Keep holdings colgroup / view table layout — do not force auto */
body.portfolio-table-edit #assets-table.ds-table-edit,
body.portfolio-table-edit #liabilities-table.ds-table-edit,
body.portfolio-table-edit #re-table.ds-table-edit {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}
/* Mobile: horizontal scroll inside the section body so borders/totals don’t clip */
@media (max-width: 640px) {
  body.portfolio-table-edit #holdings-table-container .ds-group-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  body.portfolio-table-edit #assets-table.ds-table-edit,
  body.portfolio-table-edit #liabilities-table.ds-table-edit,
  body.portfolio-table-edit #re-table.ds-table-edit {
    min-width: 28rem; /* keep columns readable; scroll rather than squash totals */
  }
  body.portfolio-table-edit #re-table.ds-table-edit {
    min-width: 22rem;
  }
}

/*
 * Ghost cells — same density as view rows; only a light focus ring when active.
 */
body.portfolio-table-edit .ds-table-edit .ds-input--cell,
body.portfolio-table-edit .ds-table-edit .ds-input--ghost,
body.portfolio-table-edit .ds-table-edit select.ds-input,
body.portfolio-table-edit .ds-table-edit .ds-combobox-input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 0.15rem;
  background: transparent;
  box-shadow: none;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  color: inherit;
  line-height: inherit;
}
body.portfolio-table-edit .ds-table-edit .ds-td-muted .ds-input--cell,
body.portfolio-table-edit .ds-table-edit .ds-td-muted .ds-combobox-input,
body.portfolio-table-edit .ds-table-edit .ds-td-muted select.ds-input {
  color: var(--ds-text-muted);
}
body.portfolio-table-edit .ds-table-edit .ds-input--number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
body.portfolio-table-edit .ds-table-edit .ds-input--cell:hover,
body.portfolio-table-edit .ds-table-edit select.ds-input:hover,
body.portfolio-table-edit .ds-table-edit .ds-combobox-input:hover {
  border-color: transparent;
  background: color-mix(in srgb, var(--ds-brand-hero) 5%, transparent);
}
body.portfolio-table-edit .ds-table-edit .ds-input--cell:focus,
body.portfolio-table-edit .ds-table-edit select.ds-input:focus,
body.portfolio-table-edit .ds-table-edit .ds-combobox-input:focus {
  border-color: rgb(var(--ds-brand-hero-rgb) / 0.35);
  background: var(--ds-surface);
  box-shadow: 0 0 0 1.5px rgb(var(--ds-brand-hero-rgb) / 0.12);
  outline: none;
  color: var(--ds-text);
  padding: 0.05rem 0.2rem;
}
body.portfolio-table-edit .ds-table-edit .ds-combobox {
  min-width: 0;
  width: 100%;
}
/* Hide combobox chevron chrome in subtle mode unless focused */
body.portfolio-table-edit .ds-table-edit .ds-combobox:not(:focus-within) .ds-combobox-input {
  background-image: none;
}
body.portfolio-table-edit .ds-table-edit td {
  vertical-align: middle;
}
/* Dedicated remove column — never overlaps amounts */
#portfolio-panel .ds-holdings-table col.ds-holdings-col-action {
  width: 2.25rem;
  min-width: 2.25rem;
}
body.portfolio-table-edit .ds-table-edit .ds-col-action,
body.portfolio-table-edit .ds-table-edit .ds-td-action {
  width: 2.25rem;
  min-width: 2.25rem;
  max-width: 2.5rem;
  padding-left: 0.15rem !important;
  padding-right: 0.5rem !important;
  text-align: center;
  vertical-align: middle;
}
body.portfolio-table-edit .ds-table-edit .ds-btn-remove--subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--ds-text-muted);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}
body.portfolio-table-edit .ds-table-edit tr:hover .ds-btn-remove--subtle,
body.portfolio-table-edit .ds-table-edit tr:focus-within .ds-btn-remove--subtle {
  opacity: 1;
}
body.portfolio-table-edit .ds-table-edit .ds-btn-remove--subtle:hover {
  background: rgb(15 23 42 / 0.08);
  color: var(--ds-text);
}
body.portfolio-table-edit .ds-table-edit .ds-btn-remove--subtle:focus-visible {
  opacity: 1;
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}
body.portfolio-table-edit .ds-table-edit-add {
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
}
body.portfolio-table-edit .ds-table-edit-add-btn.ds-btn {
  font-weight: var(--ds-weight-medium);
}
/* Hide panel overlay styles from older inline path when using true table edit */
body.portfolio-table-edit #new-snapshot-modal {
  display: none !important;
}

