.investment-card {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(10, 22, 18, .98), rgba(6, 13, 11, .98));
  box-shadow: inset 0 1px rgba(255, 255, 255, .02), 0 14px 34px rgba(0, 0, 0, .16);
}

.investment-head,
.investment-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.investment-head > div {
  display: grid;
  gap: 3px;
}

.investment-head span,
.investment-head strong,
.investment-metrics small,
.investment-chart-head > small,
.investment-coverage,
.investment-details summary {
  letter-spacing: .065em;
  text-transform: uppercase;
}

.investment-head span {
  color: var(--muted);
  font-size: 8px;
}

.investment-head strong {
  color: #eafff7;
  font-size: 12px;
}

.investment-head > button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(53, 240, 162, .38);
  border-radius: 6px;
  color: var(--green);
  background: rgba(53, 240, 162, .06);
  font-size: 7px;
  font-weight: 800;
}

.investment-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.investment-metrics article {
  min-width: 0;
  padding: 10px;
  background: rgba(4, 11, 9, .92);
}

.investment-metrics small,
.investment-metrics strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.investment-metrics small {
  color: var(--muted);
  font-size: 7px;
}

.investment-metrics strong {
  margin-top: 5px;
  color: #eafff7;
  font-size: 13px;
  font-variant-numeric: tabular-nums slashed-zero;
  letter-spacing: -.035em;
}

.investment-chart-head {
  margin-top: 13px;
}

.investment-chart-head > small {
  color: var(--muted);
  font-size: 7px;
  line-height: 1.35;
}

.investment-period {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid #1b352d;
  border-radius: 6px;
  background: #050c0a;
}

.investment-period button {
  min-width: 31px;
  min-height: 24px;
  padding: 0 5px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 7px;
  font-weight: 800;
}

.investment-period button.is-selected {
  color: #04110c;
  background: var(--green);
}

.investment-chart-stage {
  position: relative;
  min-height: 180px;
  margin-top: 9px;
  overflow: hidden;
  border: 1px solid #142a23;
  border-radius: 7px;
  background: #030806;
}

#investment-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
}

#investment-chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
  text-transform: uppercase;
}

#investment-chart-empty[hidden] {
  display: none;
}

.investment-grid {
  stroke: #142921;
  stroke-width: 1;
}

.investment-axis {
  fill: #638077;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 8px;
}

.investment-line-value,
.investment-line-cost {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.investment-line-value {
  stroke: var(--green);
  stroke-width: 2.4;
  filter: drop-shadow(0 0 5px rgba(53, 240, 162, .2));
}

.investment-line-cost {
  stroke: var(--amber);
  stroke-width: 1.3;
  stroke-dasharray: 5 4;
}

.investment-dot-value {
  fill: #030806;
  stroke: var(--green);
  stroke-width: 2;
}

.investment-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 7px;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.investment-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.investment-legend i {
  width: 13px;
  height: 2px;
  background: var(--green);
}

.investment-legend .legend-investment-cost {
  height: 1px;
  background: var(--amber);
}

.investment-coverage {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.45;
}

.investment-details {
  margin-top: 11px;
  border-top: 1px solid var(--line);
}

.investment-details summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 12px;
  gap: 8px;
  align-items: center;
  min-height: 41px;
  cursor: pointer;
  list-style: none;
  color: #dff8ef;
  font-size: 8px;
}

.investment-details summary::-webkit-details-marker {
  display: none;
}

.investment-details summary::after {
  color: var(--green);
  content: "+";
  font-size: 14px;
  font-weight: 800;
}

.investment-details[open] summary::after {
  content: "−";
}

.investment-details summary b {
  color: var(--muted);
  font-size: 7px;
  font-weight: 600;
}

.investment-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.investment-position,
.investment-movement {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 53px;
  border-bottom: 1px solid var(--line);
}

.investment-position:last-child,
.investment-movement:last-child {
  border-bottom: 0;
}

.investment-asset-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #28483e;
  border-radius: 7px;
  color: var(--green);
  background: #07130f;
  font-size: 9px;
  font-weight: 900;
}

.investment-row-main,
.investment-row-value {
  min-width: 0;
}

.investment-row-main b,
.investment-row-main small,
.investment-row-value b,
.investment-row-value small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.investment-row-main b,
.investment-row-value b {
  color: #eafff7;
  font-size: 9px;
}

.investment-row-main small,
.investment-row-value small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 7px;
}

.investment-row-value {
  text-align: right;
}

.investment-movement {
  grid-template-columns: 30px minmax(0, 1fr) auto 23px;
}

.investment-movement .investment-asset-icon.is-sell {
  color: var(--red);
  border-color: rgba(255, 95, 109, .28);
}

.remove-movement {
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid rgba(255, 95, 109, .24);
  border-radius: 5px;
  color: var(--red);
  background: rgba(255, 95, 109, .045);
  font-size: 10px;
}

.investment-empty {
  padding: 14px 0 3px;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}

.movement-sheet {
  text-align: left;
}

.movement-sheet > small,
.movement-sheet h2 {
  display: block;
  text-align: center;
}

.movement-sheet h2 {
  margin: 6px 0 14px;
}

.movement-sheet form {
  display: grid;
  gap: 10px;
}

.movement-sheet form > label {
  display: grid;
  gap: 6px;
}

.movement-sheet form > label > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.movement-sheet select,
.movement-sheet input,
.movement-money {
  width: 100%;
  min-height: 45px;
  border: 1px solid #203b33;
  border-radius: 7px;
  color: var(--ink);
  background: var(--panel);
  outline: 0;
}

.movement-sheet select,
.movement-sheet input {
  padding: 0 11px;
}

.movement-sheet select {
  color-scheme: dark;
}

.movement-money {
  display: flex;
  align-items: center;
  padding-left: 11px;
}

.movement-money b {
  color: var(--green);
}

.movement-money input {
  min-width: 0;
  border: 0;
  background: transparent;
}

.movement-type {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid #1b352d;
  border-radius: 7px;
  background: #050c0a;
}

.movement-type button {
  min-height: 38px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 8px;
  font-weight: 800;
}

.movement-type button.is-selected {
  color: #04110c;
  background: var(--green);
}

.movement-check {
  grid-template-columns: 18px minmax(0, 1fr) !important;
  align-items: center;
}

.movement-check input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--green);
}

.movement-help {
  color: var(--muted);
  font-size: 7px;
  line-height: 1.45;
}

.movement-sheet #save-movement {
  min-height: 48px;
  border: 1px solid var(--green);
  border-radius: 7px;
  color: #02110b;
  background: var(--green);
  font-weight: 800;
}

.movement-sheet .back-button {
  min-height: 38px;
}

@media (max-width: 370px) {
  .investment-card {
    padding: 14px;
  }

  .investment-head > button {
    padding-inline: 8px;
  }
}

.investment-overview {
  margin-top: 13px;
  border-top: 1px solid var(--line);
}

.investment-overview > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 12px;
  gap: 9px;
  align-items: center;
  min-height: 47px;
  cursor: pointer;
  list-style: none;
}

.investment-overview > summary::-webkit-details-marker { display: none; }

.investment-overview > summary > span {
  display: grid;
  gap: 3px;
}

.investment-overview > summary small,
.investment-overview > summary b {
  color: var(--muted);
  font-size: 7px;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.investment-overview > summary strong {
  color: #eafff7;
  font-size: 13px;
}

.investment-overview > summary b { font-weight: 600; }

.investment-overview > summary::after {
  color: var(--green);
  content: "+";
  font-size: 14px;
  font-weight: 800;
}

.investment-overview[open] > summary::after { content: "−"; }

.investment-expanded {
  border-top: 1px solid var(--line);
  padding-top: 1px;
}
