/*
 * Right-Sizing Recommendations — pane styles.
 * Doc 32 batch-3 §10. Compute Optimizer recommendations across EC2,
 * EBS, Lambda, ECS. Filter chips by resource type + sortable table
 * with utilisation sparklines in drill-down. No hex.
 */

.lp-pane {

    container-type: inline-size;
}

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

/* Hero */
.lp-rightsize-hero {
    text-align: center;
    margin-bottom: 12px;
}

.lp-rightsize-hero-num {
    font-size: 30px;
    font-weight: 700;
    color: var(--lp-pane-status-ok-ink);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.lp-rightsize-hero-label {
    font-size: 12px;
    color: var(--lp-pane-ink-dim);
    margin-top: 4px;
}

/* Filter chips */
.lp-rightsize-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 0;
}

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

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

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

/* Embedded table — body provides horizontal padding. */

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

.lp-rightsize-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-rightsize-table thead th.num,
.lp-rightsize-table tbody td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

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

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

.lp-rightsize-table tbody td {
    padding: 9px 10px;
    color: var(--lp-pane-ink);
    vertical-align: middle;
}

.lp-rightsize-resource {
    font-family: inherit;   /* §15: match row font, heavier weight (like EC2 inventory) */
    font-size: 12.5px;
    font-weight: 600;
}

.lp-rightsize-kind {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--lp-pane-amber-100);
    color: var(--lp-pane-amber-900);
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 6px;
}

.lp-rightsize-savings {
    color: var(--lp-pane-status-ok-ink);
    font-weight: 600;
}

.lp-rightsize-confidence {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lp-rightsize-confidence--high { color: var(--lp-pane-status-ok-ink); font-weight: 600; }
.lp-rightsize-confidence--medium { color: var(--lp-pane-amber-700); font-weight: 600; }
.lp-rightsize-confidence--low { color: var(--lp-pane-ink-dim); }

/* Keep the chevron clear of the embedded-table-frame's right border:
   override the table's default cell padding so the SVG sits inside the
   column with breathing room rather than flush against the border. */
.lp-rightsize-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-rightsize-table tbody tr:hover .lp-pane-chevron { color: var(--lp-pane-amber-900); }
.lp-rightsize-table tbody tr[aria-expanded="true"] .lp-pane-chevron { transform: rotate(90deg); }

.lp-rightsize-detail-row td {
    padding: 0 !important;
    background: var(--lp-pane-amber-50);
}

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

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

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

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

.lp-rightsize-detail-grid dd { margin: 0; color: var(--lp-pane-ink); }

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

.lp-rightsize-spark-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.lp-rightsize-spark-svg {
    width: 100%;
    height: 36px;
    display: block;
}

.lp-rightsize-rationale {
    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-rightsize-body { padding: 14px 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-rightsize-table thead th,
    .lp-rightsize-table tbody td { padding: 8px 6px; font-size: 12px; }
    .lp-rightsize-table thead th { font-size: 10px; }
    .lp-rightsize-hero-num { font-size: 24px; }
    /* Drop "Current" + "Confidence" columns — savings + recommended
       SKU are the priority signals; current SKU and confidence are
       in the drill-down. Drop the chevron column entirely (both th
       and td) so the header bg covers the row uniformly — leaving
       only the th visible would create a transparent gap above each
       chevron in the header row. */
    .lp-rightsize-table thead th:nth-child(2),
    .lp-rightsize-table tbody td:nth-child(2),
    .lp-rightsize-table thead th:nth-child(5),
    .lp-rightsize-table tbody td:nth-child(5) { display: none; }
    .lp-rightsize-table thead th:last-child,
    .lp-rightsize-table tbody td:last-child { display: none; }
}

/* ------- Empty / preconditions message ----------------------------
   Mirrors the compute-optimizer pane's not-enrolled empty state so
   panes that share the "feature must be enabled in the AWS console"
   pattern look consistent. */
.lp-rightsize-empty {
    margin: 16px;
    padding: 18px 16px;
    background: var(--lp-pane-amber-50);
    border: 1px dashed var(--lp-pane-amber-300);
    border-radius: 6px;
    color: var(--lp-pane-ink);
    font-size: 13px;
    line-height: 1.55;
}

.lp-rightsize-empty strong { color: var(--lp-pane-amber-900); }

.lp-rightsize-empty a {
    color: var(--lp-pane-amber-900);
    text-decoration: none;
    border-bottom: 1px dotted var(--lp-pane-amber-700);
}

.lp-rightsize-empty a:hover {
    background: var(--lp-pane-amber-100);
    border-bottom-style: solid;
}

@media (max-width: 520px) {
    .lp-rightsize-body { padding: 14px 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-rightsize-table thead th,
    .lp-rightsize-table tbody td { padding: 8px 6px; font-size: 12px; }
    .lp-rightsize-table thead th { font-size: 10px; }
    .lp-rightsize-hero-num { font-size: 24px; }
    .lp-rightsize-table thead th:nth-child(2),
    .lp-rightsize-table tbody td:nth-child(2),
    .lp-rightsize-table thead th:nth-child(5),
    .lp-rightsize-table tbody td:nth-child(5) { display: none; }
    .lp-rightsize-table thead th:last-child { display: none; }
}
