/*
 * CloudFormation Stack Drift Monitor — pane styles.
 * Doc 32 batch-3 §3. Top counter trio + per-stack rows in
 * embedded-table-frame with property-diff drill-down.
 */

.lp-pane {

    container-type: inline-size;
}

.lp-cfn-drift-body { padding: 18px var(--lp-pane-pad-x) 12px; }

/* Top scorecard */
.lp-cfn-drift-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 4px 0 14px 0;
}

.lp-cfn-drift-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
}

.lp-cfn-drift-counter-num {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.lp-cfn-drift-counter--drifted .lp-cfn-drift-counter-num    { color: var(--lp-pane-status-critical-ink); }
.lp-cfn-drift-counter--in-sync .lp-cfn-drift-counter-num    { color: var(--lp-pane-status-ok-ink); }
.lp-cfn-drift-counter--unchecked .lp-cfn-drift-counter-num  { color: var(--lp-pane-status-neutral-ink); }

.lp-cfn-drift-counter-label {
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Embedded table */

.lp-cfn-drift-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--lp-pane-bg);
}

.lp-cfn-drift-table thead th {
    background: var(--lp-pane-amber-100);
    color: var(--lp-pane-amber-900);
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--lp-pane-divider);
}

.lp-cfn-drift-table thead th.num,
.lp-cfn-drift-table tbody td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lp-cfn-drift-table tbody tr {
    border-bottom: 1px solid var(--lp-pane-divider);
    cursor: pointer;
}

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

.lp-cfn-drift-table tbody td {
    padding: 9px 10px;
    color: var(--lp-pane-ink);
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.lp-cfn-drift-stack-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--lp-pane-ink);
}

.lp-cfn-drift-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.lp-cfn-drift-status--drifted {
    background: var(--lp-pane-status-critical-bg);
    color: var(--lp-pane-status-critical-ink);
}

.lp-cfn-drift-status--in-sync {
    background: var(--lp-pane-status-ok-bg);
    color: var(--lp-pane-status-ok-ink);
}

.lp-cfn-drift-status--unchecked {
    background: var(--lp-pane-status-neutral-bg);
    color: var(--lp-pane-status-neutral-ink);
}

.lp-cfn-drift-arrow {
    width: 22px;
    text-align: center;
    padding-left: 0 !important;
    padding-right: 8px !important;
}

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

.lp-cfn-drift-table tbody tr:hover .lp-pane-chevron { color: var(--lp-pane-amber-900); }
.lp-cfn-drift-table tbody tr[aria-expanded="true"] .lp-pane-chevron { transform: rotate(90deg); }

/* Drill-down: per-resource diff list */
.lp-cfn-drift-detail-row td {
    padding: 0 !important;
    background: var(--lp-pane-amber-50);
}

.lp-cfn-drift-detail {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--lp-pane-ink);
    line-height: 1.5;
}

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

.lp-cfn-drift-resource {
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--lp-pane-bg);
    border: 1px solid var(--lp-pane-divider);
    border-radius: 4px;
}

.lp-cfn-drift-resource:first-of-type { margin-top: 6px; }

.lp-cfn-drift-resource-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.lp-cfn-drift-resource-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--lp-pane-amber-900);
}

.lp-cfn-drift-resource-type {
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
}

.lp-cfn-drift-prop {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    margin-top: 4px;
    line-height: 1.5;
}

.lp-cfn-drift-prop-key {
    color: var(--lp-pane-amber-900);
    font-weight: 600;
}

.lp-cfn-drift-prop-before { color: var(--lp-pane-status-critical-ink); }
.lp-cfn-drift-prop-after  { color: var(--lp-pane-status-ok-ink); }

.lp-cfn-drift-detail-action {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--lp-pane-divider);
    font-size: 12px;
    color: var(--lp-pane-ink-dim);
    line-height: 1.5;
}

@container (max-width: 520px) {
    .lp-cfn-drift-body { padding: 14px 12px 10px; }
/* 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-cfn-drift-counter-num { font-size: 20px; }
    .lp-cfn-drift-table thead th,
    .lp-cfn-drift-table tbody td { padding: 8px 6px; font-size: 12px; }
    .lp-cfn-drift-table thead th { font-size: 10px; }
    /* Drop the "last checked" timestamp at narrow widths — the
       drift status + count carry the priority signal. Drop the
       chevron column entirely (both th and td); leaving the th
       hidden but the td visible creates a gap above the chevron in
       the header row. */
    .lp-cfn-drift-table thead th:nth-child(4),
    .lp-cfn-drift-table tbody td:nth-child(4) { display: none; }
    .lp-cfn-drift-table thead th:last-child,
    .lp-cfn-drift-table tbody tr:not(.lp-cfn-drift-detail-row) td:last-child { display: none; }
}

@media (max-width: 520px) {
    .lp-cfn-drift-body { padding: 14px 12px 10px; }
/* 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-cfn-drift-counter-num { font-size: 20px; }
    .lp-cfn-drift-table thead th,
    .lp-cfn-drift-table tbody td { padding: 8px 6px; font-size: 12px; }
    .lp-cfn-drift-table thead th { font-size: 10px; }
    .lp-cfn-drift-table thead th:nth-child(4),
    .lp-cfn-drift-table tbody td:nth-child(4) { display: none; }
    .lp-cfn-drift-table thead th:last-child { display: none; }
}
