.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}

.portfolio-summary article {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(15, 23, 42, .96), rgba(11, 18, 32, .82));
}

.portfolio-summary span,
.portfolio-summary small {
  display: block;
  color: #94a3b8;
}

.portfolio-summary span { font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.portfolio-summary strong { display: block; margin: 8px 0 4px; color: #f8fafc; font-size: clamp(1.15rem, 2vw, 1.7rem); overflow-wrap: anywhere; }
.portfolio-summary small { font-size: .78rem; }
.portfolio-summary article[data-tone="profit"] strong,
.portfolio-summary article[data-tone="profit"] small,
.is-profit { color: #34d399 !important; }
.portfolio-summary article[data-tone="loss"] strong,
.portfolio-summary article[data-tone="loss"] small,
.is-loss { color: #fb7185 !important; }

.portfolio-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 0 12px; }
.portfolio-table-card { overflow: hidden; }
.portfolio-table-wrap { margin-top: 12px; }
.portfolio-table { min-width: 1370px; }
.portfolio-table th:first-child,
.portfolio-table td:first-child { width: 52px; text-align: center; }
.portfolio-table th:nth-child(2),
.portfolio-table td:nth-child(2) { position: sticky; left: 0; z-index: 2; background: #101a2e; }
.portfolio-table thead th:nth-child(2) { z-index: 3; }
.portfolio-duration { min-width: 96px; white-space: nowrap; }
.portfolio-empty { padding: 46px 20px; text-align: center; color: #94a3b8; }
.portfolio-empty span { display: block; margin-bottom: 10px; font-size: 2rem; }
.portfolio-empty strong { display: block; color: #e2e8f0; }
.portfolio-empty p { margin: 6px 0 0; }

@media (max-width: 900px) {
  .portfolio-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .portfolio-summary { gap: 10px; }
  .portfolio-summary article { padding: 14px; border-radius: 14px; }
  .portfolio-summary strong { font-size: 1.05rem; }
  .portfolio-actions .living-button { flex: 1 1 calc(50% - 10px); }
  .portfolio-table-toolbar { align-items: flex-start; }
}

@media print {
  .portfolio-summary { grid-template-columns: repeat(4, 1fr); }
  .portfolio-summary article { border: 1px solid #cbd5e1; background: #fff; }
  .portfolio-summary strong { color: #111827; }
  .portfolio-table { min-width: 100%; font-size: 9px; }
  .portfolio-table input { border: 0; padding: 2px; }
  .portfolio-table th:nth-child(2),
  .portfolio-table td:nth-child(2) { position: static; background: transparent; }
  .portfolio-table th:last-child,
  .portfolio-table td:last-child { display: none; }
}
