/*
 * Auto Scaling Group Activity — pane styles.
 * Doc 32 batch-5 §30. Per-ASG card with capacity counters + 24h
 * sparkline + recent-activity timeline. No hex.
 */

.lp-pane {

    container-type: inline-size;
}

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

/* 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);
}
 */

/* Body wraps cards + footnotes so the pane has consistent
   padding and pane content aligns horizontally. */
.lp-asg-body { padding: 14px var(--lp-pane-pad-x); }

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

.lp-asg-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;
}

/* Per-ASG card. Subhead bleeds edge-to-edge via the canonical
   .lp-pane-subhead rule; the rest of the card sits inside the body
   pad-x boundary. */
.lp-asg-card {
    background: var(--lp-pane-bg);
    border-bottom: 1px solid var(--lp-pane-divider);
    margin: 0 calc(-1 * var(--lp-pane-pad-x));
    padding: 0 var(--lp-pane-pad-x) 14px;
}

.lp-asg-card:last-of-type { border-bottom: 0; }

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

/* Boxes on the left, sparkline on the right. Boxes use the canonical
   .lp-pane-header-boxes which is a grid — it sits inside its own flex
   item so it doesn't stretch over the spark column. */
.lp-asg-card-capacity {
    display: flex;
    align-items: stretch;
    gap: 14px;
    margin: 10px 0 0;
}

.lp-asg-card-boxes {
    flex: 0 1 auto;
    min-width: 0;
}

/* Override the canonical header-boxes grid so the four boxes hug the
   left rather than stretching to fill the row. Each box is a compact
   intrinsic-sized cell; the spark gets the remaining width. */
.lp-asg-card-boxes .lp-pane-header-boxes {
    grid-template-columns: repeat(4, minmax(72px, max-content));
    margin: 0;
    width: auto;
}

.lp-asg-card-spark-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.lp-asg-card-spark {
    height: 40px;
    width: 100%;
}

.lp-asg-card-spark svg {
    width: 100%;
    height: 100%;
    display: block;
}

.lp-asg-card-spark-label {
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

/* Triggers & scaling rules — collapsible row between capacity and
   the activity timeline. Trigger row matches the activity-row visual
   weight (border-top, chevron, hover); detail drawer matches the
   canonical detail style (amber-50 fill, amber-500 side rails). */
.lp-asg-rules-trigger {
    display: grid;
    grid-template-columns: auto 1fr 14px;
    gap: 10px;
    align-items: center;
    padding: 10px var(--lp-pane-pad-x);
    margin: 12px calc(-1 * var(--lp-pane-pad-x)) 0;
    border-top: 1px solid var(--lp-pane-divider);
    cursor: pointer;
    background: var(--lp-pane-bg);
    font-size: 12px;
}
.lp-asg-rules-trigger:hover { background: var(--lp-pane-amber-50); }
.lp-asg-rules-trigger[aria-expanded="true"] { background: var(--lp-pane-detail-bg); }
.lp-asg-rules-trigger[aria-expanded="true"] .lp-pane-chevron { transform: rotate(90deg); }

.lp-asg-rules-label {
    font-weight: 600;
    color: var(--lp-pane-amber-900);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.06em;
}
.lp-asg-rules-summary {
    color: var(--lp-pane-ink-dim);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-asg-rules-detail {
    background: var(--lp-pane-amber-50);
    border-top: 1px solid var(--lp-pane-divider);
    border-bottom: 1px solid var(--lp-pane-divider);
    border-left: 1px solid var(--lp-pane-amber-500);
    border-right: 1px solid var(--lp-pane-amber-500);
    margin: 0 calc(-1 * var(--lp-pane-pad-x));
    padding: 12px var(--lp-pane-pad-x) 14px;
    font-size: 12px;
    color: var(--lp-pane-ink);
}
.lp-asg-rules-detail[hidden] { display: none; }

.lp-asg-rules-live-note {
    margin: 0 0 10px;
    padding: 6px 10px;
    background: var(--lp-pane-bg);
    border-left: 3px solid var(--lp-pane-amber-700);
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
    line-height: 1.5;
}
.lp-asg-rules-live-note code {
    background: var(--lp-pane-bg);
    padding: 0 3px;
    font-size: 10.5px;
}

.lp-asg-rules-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 4px 14px;
    margin: 0 0 12px;
    font-size: 12px;
}
.lp-asg-rules-grid dt {
    color: var(--lp-pane-ink-dim);
    font-weight: 500;
}
.lp-asg-rules-grid dd {
    margin: 0;
    color: var(--lp-pane-ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-word;
}

.lp-asg-policies-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lp-pane-ink-dim);
    margin: 8px 0 6px;
    font-weight: 600;
}
.lp-asg-policies {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lp-asg-policies-empty {
    font-style: italic;
    color: var(--lp-pane-ink-faint);
    font-size: 12px;
}
.lp-asg-policy {
    padding: 8px 10px;
    background: var(--lp-pane-bg);
    border: 1px solid var(--lp-pane-divider);
    border-radius: 4px;
    line-height: 1.45;
}
.lp-asg-policy strong { color: var(--lp-pane-amber-900); }
.lp-asg-policy-type {
    font-size: 10px;
    color: var(--lp-pane-ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 6px;
}
.lp-asg-policy-metric {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
    margin-top: 4px;
}
.lp-asg-policy-detail {
    font-size: 12px;
    color: var(--lp-pane-ink);
    margin-top: 4px;
}

/* Activity timeline */
.lp-asg-activities {
    margin: 0 calc(-1 * var(--lp-pane-pad-x));
    border-top: 1px solid var(--lp-pane-divider);
}

/* Live-mode "deferred" note for the activity timeline. Quiet inline
   label rather than a full-width region with a top border, so it
   doesn't read as an empty box below the capacity counters. */
.lp-asg-deferred-note {
    margin-top: 6px;
    padding-left: 4px;
    font-size: 11px;
    font-style: italic;
    color: var(--lp-pane-ink-faint);
}

.lp-asg-activity {
    display: grid;
    grid-template-columns: 64px 10px 1fr 14px;
    gap: 10px;
    align-items: center;
    padding: 10px var(--lp-pane-pad-x);
    border-bottom: 1px solid var(--lp-pane-divider);
    cursor: pointer;
    background: var(--lp-pane-bg);
}

.lp-asg-activity:hover { background: var(--lp-pane-amber-50); }
.lp-asg-activity:last-child { border-bottom: 0; }
/* Expanded parent row: lift slightly with a soft drop shadow below
   so the eye reads the parent → drawer hierarchy clearly. */
.lp-asg-activity[aria-expanded="true"] {
    background: var(--lp-pane-amber-50);
    box-shadow: 0 2px 4px -2px rgba(61, 33, 0, 0.18);
    position: relative;
    z-index: 1;
}

.lp-asg-activity-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--lp-pane-ink);
    align-self: center;
    font-variant-numeric: tabular-nums;
}

.lp-asg-activity-time-rel {
    font-size: 10px;
    color: var(--lp-pane-ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
    font-weight: 400;
}

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

.lp-asg-activity-dot--scale-out { background: var(--lp-pane-amber-700); }
.lp-asg-activity-dot--scale-in  { background: var(--lp-pane-status-neutral-ink); }
.lp-asg-activity-dot--terminate { background: var(--lp-pane-status-critical-ink); }
.lp-asg-activity-dot--launch    { background: var(--lp-pane-status-ok-ink); }

.lp-asg-activity-body { min-width: 0; }

.lp-asg-activity-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--lp-pane-ink);
    line-height: 1.35;
}

.lp-asg-activity-meta {
    font-size: 12px;
    color: var(--lp-pane-ink-dim);
    margin-top: 2px;
    line-height: 1.4;
}

.lp-asg-activity-arrow {
    align-self: center;
    width: 14px;
    display: inline-flex;
    justify-content: center;
}

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

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

.lp-asg-activity-detail {
    background: var(--lp-pane-bg);
    border-top: 1px solid var(--lp-pane-divider);
    /* 2px dark bottom rule closes off the scaling-event list and
       returns the eye to the next row in the timeline. */
    border-bottom: 2px solid var(--lp-pane-ink);
    /* Inset shadow at top mimics the parent row casting onto the
       drawer — same recipe as the sd-embed detail rows. */
    box-shadow: inset 0 4px 6px -4px rgba(61, 33, 0, 0.22);
    padding: 12px var(--lp-pane-pad-x) 14px
             calc(var(--lp-pane-pad-x) + 84px);
    font-size: 13px;
    color: var(--lp-pane-ink);
}

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

.lp-asg-detail-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 4px 14px;
    margin: 6px 0 0 0;
    font-size: 12px;
}

.lp-asg-detail-grid dt {
    color: var(--lp-pane-ink-dim);
    font-weight: 500;
}

.lp-asg-detail-grid dd { margin: 0; color: var(--lp-pane-ink); overflow-wrap: anywhere; }

.lp-asg-detail-instances {
    margin-top: 6px;
    padding-left: 22px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
}

@container (max-width: 520px) {
    .lp-asg-activity-body, .lp-asg-activity-body { padding: 14px 12px; }
    .lp-asg-card { padding: 0 12px 12px; }
    .lp-asg-card-capacity { flex-direction: column; align-items: stretch; gap: 8px; }
    .lp-asg-card-boxes .lp-pane-header-boxes { grid-template-columns: repeat(4, 1fr); }
    .lp-asg-card-spark-label { text-align: left; }
    .lp-asg-rules-trigger { margin: 12px -12px 0; padding: 10px 12px; }
    .lp-asg-rules-detail { margin: 0 -12px; padding: 12px 12px 14px; }
    .lp-asg-rules-grid { grid-template-columns: 110px 1fr; gap: 3px 10px; }
    .lp-asg-activities { margin: 0 -12px; }
    .lp-asg-activity { grid-template-columns: 48px 10px 1fr 14px; padding: 10px 12px; gap: 8px; }
    .lp-asg-activity-detail { padding: 12px 12px 14px 70px; }
    .lp-asg-detail-grid { grid-template-columns: 100px 1fr; }
}

@media (max-width: 520px) {
    .lp-asg-card { padding: 0 12px 12px; }
    .lp-asg-card-capacity { flex-direction: column; align-items: stretch; gap: 8px; }
    .lp-asg-card-boxes .lp-pane-header-boxes { grid-template-columns: repeat(4, 1fr); }
    .lp-asg-card-spark-label { text-align: left; }
    .lp-asg-rules-trigger { margin: 12px -12px 0; padding: 10px 12px; }
    .lp-asg-rules-detail { margin: 0 -12px; padding: 12px 12px 14px; }
    .lp-asg-rules-grid { grid-template-columns: 110px 1fr; gap: 3px 10px; }
    .lp-asg-activities { margin: 0 -12px; }
    .lp-asg-activity { grid-template-columns: 48px 10px 1fr 14px; padding: 10px 12px; gap: 8px; }
    .lp-asg-activity-detail { padding: 12px 12px 14px 70px; }
    .lp-asg-detail-grid { grid-template-columns: 100px 1fr; }
}
