.pst-tool {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.pst-panel {
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-width: 0;
}

.pst-panel-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.pst-panel-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--fg-muted);
}

.pst-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pst-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pst-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pst-stat {
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-canvas);
  min-width: 0;
}

.pst-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-subtle);
}

.pst-stat-value {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--fg-default);
}

.pst-stat-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--fg-muted);
}

.pst-stat.is-strong .pst-stat-value,
.pst-stat.is-solid .pst-stat-value { color: #3fb950; }
.pst-stat.is-fragile .pst-stat-value { color: #d29922; }
.pst-stat.is-weak .pst-stat-value { color: #db6d28; }
.pst-stat.is-brittle .pst-stat-value { color: #f85149; }
.pst-stat.is-loss .pst-stat-value { color: #f85149; }

.pst-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 12px;
  align-items: start;
}

.pst-scenarios {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.pst-sc-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.pst-sc-row:hover,
.pst-sc-row.is-active {
  border-color: var(--accent-emphasis, #58a6ff);
}

.pst-sc-name {
  font-size: 13px;
  font-weight: 600;
}

.pst-sc-meta {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 2px;
}

.pst-sc-pnl {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #f85149;
  text-align: right;
}

.pst-sc-val {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--fg-muted);
  text-align: right;
}

.pst-custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.pst-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--fg-muted);
}

.pst-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--fg-default);
  font-variant-numeric: tabular-nums;
}

.pst-custom .peps-btn {
  grid-column: 1 / -1;
}

.pst-coin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pst-coin-table th,
.pst-coin-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-muted);
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.pst-coin-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-subtle);
  font-weight: 600;
}

.pst-coin-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pst-coin-icon-wrap {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.pst-coin-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.pst-neg { color: #f85149; }

.pst-empty {
  padding: 18px 8px;
  color: var(--fg-muted);
  font-size: 13px;
}

.pst-replay-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.pst-chart {
  width: 100%;
  height: 140px;
  display: block;
}

.pst-chart-empty {
  font-size: 13px;
  color: var(--fg-muted);
  padding: 12px 0;
}

@media (max-width: 900px) {
  .pst-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pst-layout {
    grid-template-columns: 1fr;
  }
  .pst-sc-row {
    grid-template-columns: 1fr auto;
  }
  .pst-sc-val { display: none; }
}
