/* EA performance card follows the same data-card grid and palette as the portfolio. */
.portfolio .eap-context { font-size: 11px; margin: -2px 0 8px; }
.eap-table { table-layout: fixed; width: 100%; border-collapse: collapse; }
.eap-table thead th { padding: 3px 6px; background: var(--gs-surface); color: var(--p-muted); }
.eap-table thead th:first-child { width: 35%; }
.eap-table thead th:not(:first-child) { text-align: right; }
.eap-table thead th:last-child { width: 22%; }
.portfolio .eap-table [data-port="performance-sort"] {
  border-color: transparent; background: none; color: var(--p-muted);
  min-height: 31px; padding: 3px 5px; white-space: nowrap; font-size: 11px;
}
.portfolio .eap-table [aria-sort] button, .portfolio .eap-table [data-port="performance-sort"]:hover {
  color: var(--p-accent); background: var(--gs-selected-bg);
}
.eap-arrow { min-width: 9px; }
.eap-table tbody :is(td, th) { padding: 7px 6px; border-bottom: 1px solid var(--p-border); }
.eap-table tbody tr { cursor: pointer; }
.eap-table tbody tr:hover, .eap-table tbody tr:focus-within { background: var(--gs-action-bg); }
.eap-table tbody td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eap-table tbody tr:last-child :is(td, th) { border-bottom: 0; }
.portfolio .eap-link {
  display: flex; align-items: center; gap: 8px; text-align: left; color: inherit; font-weight: 400;
}
.eap-link:hover b, .eap-link:focus-visible b { color: var(--p-accent); }
.eap-link > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.eap-link b { font-size: 13px; }
.eap-link small { display: block; color: var(--p-muted); font-size: 10px; }
.eap-icon {
  display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  width: 32px; height: 32px; flex: 0 0 32px; font: 700 18px/1 system-ui, sans-serif;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.eap-cyan { color: var(--gs-accent); }.eap-indigo { color: var(--gs-average); }.eap-mint { color: var(--gs-positive); }
.eap-lavender { color: var(--gs-average); }.eap-amber { color: var(--gs-warm); }.eap-blue { color: var(--gs-average); }
.eap-rose { color: var(--gs-negative); }.eap-grey { color: var(--gs-text); }
.eap-trend { display: grid; align-items: center; grid-template-columns: minmax(44px, 1fr) auto; gap: 6px; color: var(--p-muted); }
.eap-line { width: 100%; height: 27px; overflow: visible; }
.eap-line polygon { fill: currentColor; opacity: .12; }
.eap-line polyline { fill: none; stroke: currentColor; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.eap-trend strong { font-size: 11px; }
.eap-empty { color: var(--p-muted); }
.eap-footer { display: flex; justify-content: flex-end; margin-top: 7px; }
.eap-footer:empty { display: none; }

@container (max-width: 610px) {
  .eap-table, .eap-table thead, .eap-table tbody { display: block; width: 100%; }
  .eap-table thead tr { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
  .eap-table thead th, .eap-table thead th:first-child, .eap-table thead th:last-child {
    padding: 0; width: auto; border: 0; background: none;
  }
  .portfolio .eap-table [data-port="performance-sort"] { border-color: var(--p-border); min-height: 33px; padding-inline: 6px; }
  .eap-table tbody { display: grid; gap: 6px; }
  .eap-table tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; align-items: start;
    padding: 7px; background: var(--gs-surface); border: 1px solid var(--p-border); border-radius: 7px;
  }
  .eap-table tbody :is(td, th) { border: 0; padding: 0; min-width: 0; text-align: left; }
  .eap-table tbody .eap-identity, .eap-table tbody .eap-graph { grid-column: 1 / -1; }
  .eap-table tbody td::before {
    content: attr(data-label); display: block; color: var(--p-muted); font-size: 10px; white-space: normal;
  }
  .eap-table tbody .eap-graph { padding-top: 4px; border-top: 1px solid var(--p-border); }
  .eap-trend { grid-template-columns: minmax(0, 1fr) 55px; text-align: right; }
  .eap-line { height: 24px; }
}

@media (max-width: 420px) {
  .port-filter-label span, .port-selects label { font-size: 12px; }
  .portfolio .eap-table [data-port="performance-sort"] { font-size: 12px; min-height: 36px; }
}

.port-next-actions, .port-job-counts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px;
}
.port-next-actions { margin: 4px 0; }
.port-job-counts { padding-bottom: 8px; }
.port-jobs { width: min(720px, calc(100% - 14px)); max-height: calc(100dvh - 18px); box-sizing: border-box; }
.port-jobs header { align-items: flex-start; }
.port-jobs header button { flex: 0 0 auto; }
.port-jobs header h2 { margin: 0; font-size: 15px; }
.port-jobs button, .port-jobs a { white-space: normal; }
.port-job-state { color: var(--text-2); border: 1px solid var(--p-border); border-radius: 5px; padding: 2px 6px; width: fit-content; }
.port-job-state[data-state="running"] { color: var(--accent); }
.port-job-state[data-state="paused"], .port-job-state[data-state="waiting"] { color: var(--p-warn); }
.port-job-state[data-state="stopped"] { color: var(--down); }
.port-job-filter { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.port-job-results ul { list-style: none; padding: 0; margin: 0; }
.port-job-results li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px 9px;
  align-items: center; padding: 8px 0; border-top: 1px solid var(--p-border); }
.port-job-info, .port-job-progress { display: grid; gap: 3px; min-width: 0; }
.port-job-info small { color: var(--p-muted); }
.port-job-info :is(strong, small) { overflow-wrap: anywhere; }
.port-job-progress label { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px; color: var(--p-muted); }
.port-job-progress progress { width: 60px; height: 6px; accent-color: var(--accent); }
.port-job-empty { color: var(--p-muted); }
@media (max-width: 520px) {
  .port-job-results li { grid-template-columns: minmax(0, 1fr) auto; }
  .port-job-info { grid-column: 1 / -1; }
  .port-jobs :is(button, a, select), .port-next-actions a { min-height: 40px; }
}
