/* 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. */
/* /*
 * Account Security Settings (slug security-posture) — pane-specific styles.
 *
 * Inherits chrome (palette, .lp-pane, .lp-pane-head, .lp-pane-badge,
 * .lp-pane-meta, .lp-pane-refresh, .lp-pane-subhead, .lp-pane-section-end)
 * from /embed/sd-embed.css plus the pane-specific shared bits
 * (subhead, section divider) declared with the tag-coverage pane.
 *
 * Per docs/service-discovery-v2/35-pane-style-guide.md — every colour
 * goes through a CSS variable; no hex literals in pane CSS (§3.1).
 *
 * Doc 32 Spec 2 — Security Posture Scorecard (renamed Account Security Settings, 2026-11-19).
 *\/

/* Supplementary tokens — status palette + section divider, declared on
   .lp-pane scope so they cascade alongside the chrome tokens. Same as
   the tag-coverage pane; will graduate into sd-embed.css as the no-op
   override pattern. *\/
.lp-pane {

    container-type: inline-size;
}
 */

.lp-security-posture-body {
    padding: 20px var(--lp-pane-pad-x);
}

/* ---------- Section divider (style guide §6.4) ---------- */

.lp-pane-section-end {
    height: 2px;
    background: var(--lp-pane-amber-900);
    margin: 20px calc(-1 * var(--lp-pane-pad-x)) 0;
}

/* ---------- Section subhead (style guide §2) ---------- */

/* stripped 2026-07-31 (§26) — this legacy per-pane override was the LAST
   survivor of the 2026-05-27 canonical-class cleanup (ami-inventory, app-health
   et al. were stripped then; this one was missed). Its `margin: 0 calc(...)`
   zeroed the subhead's bottom margin, so its section title ran straight into the
   following .lp-xtable-wrap — the §26 spacing bug. The subhead now inherits the
   shared :where(.lp-pane-subhead) rule in embed/sd-embed.css (blue band + 6px/10px
   margins). Restore by un-commenting if a deliberate per-pane override is needed. */
/* .lp-pane-subhead {
    background: var(--lp-pane-amber-100);
    color: var(--lp-pane-amber-900);
    padding: 8px var(--lp-pane-pad-x);
    margin: 0 calc(-1 * 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);
} */

/* ---------- Score ring + counts ---------- */

.lp-security-posture-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4px;
}

.lp-security-posture-score-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(
        var(--lp-pane-amber-700) 0% var(--lp-sp-pct, 0%),
        var(--lp-pane-amber-100) var(--lp-sp-pct, 0%) 100%
    );
    position: relative;
    margin-bottom: 10px;
}

.lp-security-posture-score-ring::before {
    content: "";
    position: absolute;
    inset: 10px;
    background: var(--lp-pane-bg);
    border-radius: 50%;
}

.lp-security-posture-score-ring-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.lp-security-posture-score-pct {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--lp-pane-amber-900);
    font-variant-numeric: tabular-nums;
}

.lp-security-posture-score-label {
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

.lp-security-posture-score-summary {
    font-size: 13px;
    color: var(--lp-pane-ink-dim);
    text-align: center;
    margin-bottom: 4px;
}

.lp-security-posture-score-counts {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--lp-pane-ink-dim);
}

.lp-security-posture-score-counts-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Filter chips ---------- */

.lp-security-posture-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 0;
}

.lp-security-posture-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    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;
    line-height: 1.4;
    transition: background 120ms ease, border-color 120ms ease;
}

.lp-security-posture-chip:hover {
    background: var(--lp-pane-amber-50);
    border-color: var(--lp-pane-amber-300);
}

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

.lp-security-posture-chip-count {
    color: var(--lp-pane-ink-dim);
    font-variant-numeric: tabular-nums;
}

.lp-security-posture-chip[aria-pressed="true"] .lp-security-posture-chip-count {
    color: var(--lp-pane-amber-900);
}

/* ---------- Rule list ---------- */

.lp-security-posture-category {
    margin: 0 calc(-1 * var(--lp-pane-pad-x));
}

.lp-security-posture-rule {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 12px var(--lp-pane-pad-x);
    border-bottom: 1px solid var(--lp-pane-divider);
    cursor: pointer;
    background: var(--lp-pane-bg);
}

.lp-security-posture-rule:hover {
    background: var(--lp-pane-amber-50);
}

.lp-security-posture-rule:last-child {
    border-bottom: 0;
}

/* Severity dot — coloured by status */
.lp-security-posture-rule-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.lp-security-posture-rule-dot--critical { background: var(--lp-pane-status-critical-ink); }
.lp-security-posture-rule-dot--warning  { background: var(--lp-pane-amber-700); }
.lp-security-posture-rule-dot--info     { background: var(--lp-pane-status-neutral-ink); }
.lp-security-posture-rule-dot--ok       { background: var(--lp-pane-status-ok-ink); }

.lp-security-posture-rule-body {
    min-width: 0;
}

.lp-security-posture-rule-severity {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--lp-pane-ink-dim);
    margin-bottom: 2px;
}

.lp-security-posture-rule-severity--critical { color: var(--lp-pane-status-critical-ink); }
.lp-security-posture-rule-severity--warning  { color: var(--lp-pane-amber-700); }
.lp-security-posture-rule-severity--info     { color: var(--lp-pane-status-neutral-ink); }
.lp-security-posture-rule-severity--ok       { color: var(--lp-pane-status-ok-ink); }

.lp-security-posture-rule-title {
    font-size: 13px;
    color: var(--lp-pane-ink);
    margin: 0;
    line-height: 1.35;
    font-weight: 500;
}

.lp-security-posture-rule-detail {
    font-size: 12px;
    color: var(--lp-pane-ink-dim);
    margin: 2px 0 0 0;
    line-height: 1.4;
}

/* Expander chevron container — passing rules render an empty span
   here so the grid columns align across all rows. */
.lp-security-posture-rule-arrow {
    align-self: center;
    width: 18px;
    /* Override sd-embed.css's .lp-pane-expander padding (6px 8px) which
       collapses the chevron content area to zero with box-sizing:
       border-box + width:18px. */
    padding: 0;
    display: inline-flex;
    justify-content: center;
}

/* Chevron base styles — lifted from sd-embed.css's .lp-pane-chevron.
   Points right by default; rotates 90deg clockwise when its enclosing
   row carries aria-expanded="true". Style guide §6.5. */
.lp-pane-chevron {
    display: block;
    color: var(--lp-pane-amber-700);
    transition: transform 150ms ease, color 120ms ease;
    transform-origin: center;
}

.lp-security-posture-rule:hover .lp-pane-chevron {
    color: var(--lp-pane-amber-900);
}

.lp-security-posture-rule[aria-expanded="true"] .lp-pane-chevron {
    transform: rotate(90deg);
}

/* Expanded rule row — keeps the heavier --lp-pane-detail-bg wash so
   it visually anchors as the parent of the lighter detail panel. */
.lp-security-posture-rule[aria-expanded="true"] {
    background: var(--lp-pane-detail-bg);
}

/* ---------- Drill-down detail (inline below an expanded row) ----------
 *
 * Style guide §6.5 — row expansion:
 *   - Detail panel sits on a LIGHTER shade than the expanded row above
 *     (--lp-pane-amber-50 vs the parent's --lp-pane-detail-bg). The
 *     gradient parent→child reinforces the parent/child relationship.
 *   - Inner content indents to align with the parent row's title
 *     column — past the dot column, past the dot-to-body gap, so the
 *     bullets in the detail list line up under the rule title.
 *
 * Indent maths:  pad-x (body left)  +  dot col 24px  +  grid gap 10px
 *             =  --lp-pane-pad-x  +  34px  for left padding. */
.lp-security-posture-detail {
    background: var(--lp-pane-amber-50);
    border-top: 1px solid var(--lp-pane-divider);
    border-bottom: 1px solid var(--lp-pane-divider);
    padding: 12px var(--lp-pane-pad-x) 14px
             calc(var(--lp-pane-pad-x) + 34px);
    margin: 0 calc(-1 * var(--lp-pane-pad-x));
    font-size: 13px;
    color: var(--lp-pane-ink);
}

.lp-security-posture-detail-list {
    margin: 6px 0 0 0;
    padding-left: 22px;
    color: var(--lp-pane-ink);
}

.lp-security-posture-detail-list li {
    padding: 2px 0;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.lp-security-posture-detail-remediation {
    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;
}

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

/* Filtered-out rows hide via [hidden] (JS toggles) — also drop the
   border-bottom of the previous rule so dividers don't ghost. */
.lp-security-posture-rule[hidden] { display: none; }

/* ---------- Footer ---------- */

.lp-security-posture-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--lp-pane-divider);
    font-size: 13px;
    color: var(--lp-pane-ink-dim);
}

/* ---------- Narrow breakpoint (<520px) ---------- */

@container (max-width: 520px) {
    .lp-security-posture-body { padding: 16px 12px; }

    /* Score ring shrinks; descriptive label drops (style guide §8.1). */
    .lp-security-posture-score-ring { width: 88px; height: 88px; }
    .lp-security-posture-score-pct  { font-size: 22px; }
    .lp-security-posture-score-label { display: none; }

/* 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 { margin-left: -12px; margin-right: -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     { margin-left: -12px; margin-right: -12px; padding: 8px 12px; }
 */

    .lp-security-posture-rule         { padding: 10px 12px; grid-template-columns: 18px 1fr auto; gap: 8px; }
    /* Narrow-width detail indent: 12px body + 18px dot col + 8px gap = 38px. */
    .lp-security-posture-detail       { padding: 10px 12px 12px 38px; margin: 0 -12px; }
    .lp-security-posture-category     { margin-left: -12px; margin-right: -12px; }

    .lp-security-posture-score-counts { gap: 12px; font-size: 11px; }
}

@media (max-width: 520px) {
    .lp-security-posture-body { padding: 16px 12px; }

    .lp-security-posture-score-ring { width: 88px; height: 88px; }
    .lp-security-posture-score-pct  { font-size: 22px; }
    .lp-security-posture-score-label { display: none; }

/* 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 { margin-left: -12px; margin-right: -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     { margin-left: -12px; margin-right: -12px; padding: 8px 12px; }
 */

    .lp-security-posture-rule         { padding: 10px 12px; grid-template-columns: 18px 1fr auto; gap: 8px; }
    /* Narrow-width detail indent: 12px body + 18px dot col + 8px gap = 38px. */
    .lp-security-posture-detail       { padding: 10px 12px 12px 38px; margin: 0 -12px; }
    .lp-security-posture-category     { margin-left: -12px; margin-right: -12px; }

    .lp-security-posture-score-counts { gap: 12px; font-size: 11px; }
}
