/*
 * Step Functions Execution Health — pane styles.
 * Doc 32 batch-5 §31. Per-state-machine card with success/fail donut
 * + execution table; drill-down has a vertical state-graph (small
 * NEW primitive). No hex.
 */

.lp-pane {

    container-type: inline-size;
}

.lp-stepfn-body { padding: 14px var(--lp-pane-pad-x); }

.lp-stepfn-tag-footnote { margin: 0 0 8px; }

.lp-stepfn-metrics-err {
    margin: 0 0 8px;
    padding: 6px 10px;
    background: var(--lp-pane-amber-50);
    border-left: 3px solid var(--lp-pane-status-critical-ink);
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
    line-height: 1.5;
}

/* stripped 2026-05-27 — canonical lp-pane-* class now
   owned by embed/sd-embed.css. Restore by un-commenting
   if you need a deliberate per-pane override. */
/* .lp-pane-section-end {
    height: 2px;
    background: var(--lp-pane-amber-900);
    margin: 16px 0 0;
}
 */

/* stripped 2026-05-27 — canonical lp-pane-* class now
   owned by embed/sd-embed.css. Restore by un-commenting
   if you need a deliberate per-pane override. */
/* .lp-pane-subhead {
    background: var(--lp-pane-amber-100);
    color: var(--lp-pane-amber-900);
    padding: 8px var(--lp-pane-pad-x);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--lp-pane-divider);
}
 */

/* Window chips */
.lp-stepfn-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0 0 12px;
}

.lp-stepfn-chip {
    background: var(--lp-pane-bg);
    color: var(--lp-pane-ink);
    border: 1px solid var(--lp-pane-border);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.lp-stepfn-chip[aria-pressed="true"] {
    background: var(--lp-pane-amber-300);
    border-color: var(--lp-pane-amber-700);
    color: var(--lp-pane-amber-900);
    font-weight: 600;
}

/* State-machine card */
.lp-stepfn-card {
    margin: 0 calc(-1 * var(--lp-pane-pad-x));
    border-top: 1px solid var(--lp-pane-divider);
    padding: 14px var(--lp-pane-pad-x);
}

.lp-stepfn-card:first-of-type { border-top: 0; }

.lp-stepfn-card-head {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 8px;
}

.lp-stepfn-card-summary {
    min-width: 0;
}

/* Live-mode "deferred" note (replaces bordered table frame when there
   are no execution rows to render). Quiet inline label, not a full-
   width box, so it doesn't visually compete with the card-head. */
.lp-stepfn-deferred-note {
    margin-top: 8px;
    padding-left: 70px; /* clear the 56px donut + 14px grid gap */
    font-size: 11px;
    font-style: italic;
    color: var(--lp-pane-ink-faint);
}

/* Donut — small CSS-only conic-gradient */
.lp-stepfn-donut {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: conic-gradient(
        var(--lp-pane-status-ok-ink) 0% var(--lp-success, 100%),
        var(--lp-pane-status-critical-ink) var(--lp-success, 100%) 100%
    );
    position: relative;
    flex-shrink: 0;
}

.lp-stepfn-donut::before {
    content: "";
    position: absolute;
    inset: 8px;
    background: var(--lp-pane-bg);
    border-radius: 50%;
}

.lp-stepfn-donut-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--lp-pane-amber-900);
    font-variant-numeric: tabular-nums;
    z-index: 1;
}

.lp-stepfn-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--lp-pane-amber-900);
    overflow-wrap: anywhere;
}

.lp-stepfn-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
    margin-top: 4px;
}

.lp-stepfn-stats strong {
    color: var(--lp-pane-ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Execution rows — wrapped in .lp-pane-embedded-table-frame for visual
   consistency with right-sizing / lambda-radar / dynamodb. */
.lp-stepfn-card .lp-pane-embedded-table-frame {
    border: 1px solid var(--lp-pane-amber-700);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 10px;
}

.lp-stepfn-exec {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto auto 14px;
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid var(--lp-pane-divider);
    cursor: pointer;
    background: var(--lp-pane-bg);
}

.lp-stepfn-exec:hover { background: var(--lp-pane-amber-50); }
.lp-stepfn-exec:last-child { border-bottom: 0; }
.lp-stepfn-exec[aria-expanded="true"] { background: var(--lp-pane-detail-bg); }

.lp-stepfn-exec-dot {
    width: 10px; height: 10px; border-radius: 50%;
}

.lp-stepfn-exec-dot--succeeded { background: var(--lp-pane-status-ok-ink); }
.lp-stepfn-exec-dot--failed    { background: var(--lp-pane-status-critical-ink); }
.lp-stepfn-exec-dot--timed-out { background: var(--lp-pane-amber-700); }
.lp-stepfn-exec-dot--aborted   { background: var(--lp-pane-status-neutral-ink); }
.lp-stepfn-exec-dot--running   { background: var(--lp-pane-amber-300); }

.lp-stepfn-exec-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--lp-pane-ink);
    overflow-wrap: anywhere;
}

.lp-stepfn-exec-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.lp-stepfn-exec-status--succeeded { background: var(--lp-pane-status-ok-bg);       color: var(--lp-pane-status-ok-ink); }
.lp-stepfn-exec-status--failed    { background: var(--lp-pane-status-critical-bg); color: var(--lp-pane-status-critical-ink); }
.lp-stepfn-exec-status--timed-out { background: var(--lp-pane-amber-200);          color: var(--lp-pane-amber-900); }
.lp-stepfn-exec-status--aborted   { background: var(--lp-pane-status-neutral-bg);  color: var(--lp-pane-status-neutral-ink); }
.lp-stepfn-exec-status--running   { background: var(--lp-pane-amber-200);          color: var(--lp-pane-amber-900); }

.lp-stepfn-exec-duration {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--lp-pane-ink);
    text-align: right;
    white-space: nowrap;
}

.lp-stepfn-exec-arrow { width: 14px; text-align: center; }

.lp-pane-chevron {
    display: block;
    color: var(--lp-pane-amber-700);
    transition: transform 150ms ease, color 120ms ease;
    transform-origin: center;
}

.lp-stepfn-exec:hover .lp-pane-chevron { color: var(--lp-pane-amber-900); }
.lp-stepfn-exec[aria-expanded="true"] .lp-pane-chevron { transform: rotate(90deg); }

/* Drill-down: state-graph + history */
.lp-stepfn-detail {
    background: var(--lp-pane-amber-50);
    border-bottom: 1px solid var(--lp-pane-divider);
    padding: 12px 12px 14px 32px;
    font-size: 13px;
    color: var(--lp-pane-ink);
}

.lp-stepfn-detail strong { color: var(--lp-pane-amber-900); font-weight: 600; }

/* State-graph (NEW small primitive) — vertical list of states with
   pill status; not a force-directed graph. */
.lp-stepfn-state-graph {
    margin-top: 8px;
    padding: 0;
    list-style: none;
    background: var(--lp-pane-bg);
    border: 1px solid var(--lp-pane-divider);
    border-radius: 4px;
}

.lp-stepfn-state {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 7px 10px;
    border-bottom: 1px solid var(--lp-pane-divider);
    font-size: 12px;
}

.lp-stepfn-state:last-child { border-bottom: 0; }

.lp-stepfn-state-num {
    font-size: 10px;
    font-weight: 700;
    color: var(--lp-pane-ink-faint);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.lp-stepfn-state-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--lp-pane-ink);
    overflow-wrap: anywhere;
}

.lp-stepfn-state-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.lp-stepfn-state-pill--succeeded { background: var(--lp-pane-status-ok-bg);       color: var(--lp-pane-status-ok-ink); }
.lp-stepfn-state-pill--failed    { background: var(--lp-pane-status-critical-bg); color: var(--lp-pane-status-critical-ink); }
.lp-stepfn-state-pill--skipped   { background: var(--lp-pane-status-neutral-bg);  color: var(--lp-pane-status-neutral-ink); }
.lp-stepfn-state-pill--timed-out { background: var(--lp-pane-amber-200);          color: var(--lp-pane-amber-900); }

@container (max-width: 520px) {
    .lp-stepfn-body { padding: 12px 12px; }
/* stripped 2026-05-27 — canonical lp-pane-* class now
   owned by embed/sd-embed.css. Restore by un-commenting
   if you need a deliberate per-pane override. */
/*     .lp-pane-subhead { padding: 8px 12px; } */

    .lp-stepfn-card { margin: 0 -12px; padding: 12px 12px; }
    .lp-stepfn-exec { padding: 9px 10px; grid-template-columns: 10px minmax(0, 1fr) auto 14px; gap: 8px; }
    .lp-stepfn-exec-duration { display: none; }
    .lp-stepfn-detail { padding: 10px 10px 12px 28px; }
}

@media (max-width: 520px) {
    .lp-stepfn-body { padding: 12px 12px; }
/* stripped 2026-05-27 — canonical lp-pane-* class now
   owned by embed/sd-embed.css. Restore by un-commenting
   if you need a deliberate per-pane override. */
/*     .lp-pane-subhead { padding: 8px 12px; } */

    .lp-stepfn-card { margin: 0 -12px; padding: 12px 12px; }
    .lp-stepfn-exec { padding: 9px 10px; grid-template-columns: 10px minmax(0, 1fr) auto 14px; gap: 8px; }
    .lp-stepfn-exec-duration { display: none; }
    .lp-stepfn-detail { padding: 10px 10px 12px 28px; }
}
