/* ==========================================================================
   EC2
   The EC2 page (aws_manager/ec2.html and its partials): header, summary
   strip, call path topology, tables, workflow cards and diagrams, and the
   reference. Accents are written from the -rgb triplets as text and hairlines,
   and from the -fill-rgb rung as tinted surfaces (docs/frontend/architecture.md).
   ========================================================================== */

.ec2 {
    --ec2-mono: ui-monospace, "SF Mono", Consolas, monospace;
    --ec2-radius: 10px;
}

.ec2-mono {
    font-family: var(--ec2-mono);
    font-size: 0.86em;
}

.ec2-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    color: var(--text-tertiary);
}

/* No link on the page or in its modals is underlined, hovered or not;
   a text link changes color on hover, as across the app (layout.css). */
.ec2 a,
.ec2 a:hover,
.modal[id^="ec2-"] a,
.modal[id^="ec2-"] a:hover {
    text-decoration: none;
}

/* ---- Header ------------------------------------------------------------- */

.ec2-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ec2-head-id {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

/* The header's pills: the env (blue, red for prod) and the active AZ
   (green, orange when unset), each tinted in its own hue. */
.ec2-pill {
    --ec2-pill-rgb: var(--color-blue-rgb);
    --ec2-pill-fill-rgb: var(--color-blue-fill-rgb);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.65rem;
    border: 1px solid rgba(var(--ec2-pill-rgb), 0.35);
    border-radius: 999px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: rgb(var(--ec2-pill-rgb));
    background: rgba(var(--ec2-pill-fill-rgb), 0.1);
    text-decoration: none;
    transition: border-color 0.15s ease;
}

a.ec2-pill:hover {
    border-color: rgba(var(--ec2-pill-rgb), 0.7);
    color: rgb(var(--ec2-pill-rgb));
    text-decoration: none;
}

.ec2-pill-label {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.ec2-pill-value {
    font-family: var(--ec2-mono);
    font-weight: var(--font-weight-strong);
    color: var(--text-primary);
}

.ec2-env {
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ec2-env::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
}

.ec2-env-prod {
    --ec2-pill-rgb: var(--color-red-rgb);
    --ec2-pill-fill-rgb: var(--color-red-fill-rgb);
}

.ec2-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
    font-size: 0.82rem;
    color: var(--text-tertiary);
}

.ec2-az-pill {
    --ec2-pill-rgb: var(--color-green-rgb);
    --ec2-pill-fill-rgb: var(--color-green-fill-rgb);
}

.ec2-az-pill.is-unset {
    --ec2-pill-rgb: var(--color-orange-rgb);
    --ec2-pill-fill-rgb: var(--color-orange-fill-rgb);
}

/* The Refresh button while a read runs (its own click, or the page's
   reload of an older read): blue, its icon turning. */
.ec2-refresh.is-reading,
.ec2-refresh.htmx-request {
    border-color: rgba(var(--color-blue-rgb), 0.6);
    color: rgb(var(--color-blue-rgb));
    background: rgba(var(--color-blue-fill-rgb), 0.12);
    opacity: 1;
}

.ec2-refresh.is-reading i,
.ec2-refresh.is-reading svg,
.ec2-refresh.htmx-request i,
.ec2-refresh.htmx-request svg {
    animation: fa-spin 1s linear infinite;
}

.ec2-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ec2-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ec2-pulse {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.35rem;
    border-radius: 50%;
    background: rgb(var(--color-blue-fill-rgb));
    animation: ec2-pulse 1.6s ease-out infinite;
}

@keyframes ec2-pulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--color-blue-fill-rgb), 0.6); }
    100% { box-shadow: 0 0 0 0.45rem rgba(var(--color-blue-fill-rgb), 0); }
}

@media (prefers-reduced-motion: reduce) {
    .ec2-pulse { animation: none; }
}

/* ---- Summary strip ------------------------------------------------------ */

.ec2-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
    margin-bottom: 1.25rem;
    background: var(--surface-2);
    border: 1px solid var(--border-normal);
    border-radius: var(--ec2-radius);
}

.ec2-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem 1.2rem;
    border-left: 1px solid var(--border-normal);
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.ec2-stat:first-child {
    border-left: 0;
}

a.ec2-stat:hover {
    background: var(--surface-2);
    color: inherit;
    text-decoration: none;
}

.ec2-stat-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.ec2-stat-value {
    font-size: 1.5rem;
    font-weight: var(--font-weight-strong);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    color: var(--text-primary);
}

.ec2-stat-value small {
    margin-left: 0.35rem;
    font-size: 0.8rem;
    font-weight: var(--font-weight-body);
    color: var(--text-tertiary);
}

.ec2-stat.is-bad .ec2-stat-value { color: rgb(var(--color-red-rgb)); }
.ec2-stat.is-warn .ec2-stat-value { color: rgb(var(--color-orange-rgb)); }

@media (max-width: 991px) {
    .ec2-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* An odd last stat takes the whole row, so no empty cell is left. */
    .ec2-stat:last-child:nth-child(odd) { grid-column: 1 / -1; border-left: 0; }
    .ec2-stat { border-left: 0; border-top: 1px solid var(--border-normal); }
    .ec2-stat:nth-child(-n + 2) { border-top: 0; }
    .ec2-stat:nth-child(2n) { border-left: 1px solid var(--border-normal); }
}

/* ---- Counts in tabs and titles ----------------------------------------- */

.ec2-count {
    margin-left: 0.35rem;
    font-weight: var(--font-weight-strong);
    font-variant-numeric: tabular-nums;
    color: inherit;
    opacity: 0.7;
}

.ec2-count.is-bad {
    opacity: 1;
    color: rgb(var(--color-red-rgb));
}

/* On the filled active tab an accent number would sit on the accent fill;
   it takes the tab's own label color instead. */
.nav-link.active .ec2-count {
    color: inherit;
}

/* Tabs collapsed to icons (nav-tabs.js) hide the count: its label is
   hidden, and its margin would leave a gap after the icon. */
.nav-tabs-icons .ec2-count {
    display: none;
}

/* ---- Cards -------------------------------------------------------------- */

.ec2-card {
    margin-bottom: 1.25rem;
}

.ec2-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.ec2-card-sub {
    max-width: 72ch;
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: var(--text-tertiary);
}

.ec2-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 2.5rem 1rem;
    color: var(--text-tertiary);
    text-align: center;
}

.ec2-empty > i {
    font-size: 1.6rem;
    color: var(--text-muted);
}

/* ---- Dots, health, state pills, chips ---------------------------------- */

/* The hue comes from a .ec2-health-* class on the dot or on an ancestor
   (a topology node, a health cell); gray when neither sets it. */
.ec2-dot {
    display: inline-block;
    flex: none;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: rgb(var(--ec2-dot-rgb, var(--color-gray-fill-rgb)));
    box-shadow: 0 0 0 3px rgba(var(--ec2-dot-rgb, var(--color-gray-fill-rgb)), 0.18);
}

.ec2-health-ok { --ec2-dot-rgb: var(--color-green-fill-rgb); }
.ec2-health-changing { --ec2-dot-rgb: var(--color-blue-fill-rgb); }
.ec2-health-warning { --ec2-dot-rgb: var(--color-orange-fill-rgb); }
.ec2-health-critical { --ec2-dot-rgb: var(--color-red-fill-rgb); }

.ec2-health {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.ec2-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.ec2-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.ec2-state {
    --ec2-state-rgb: var(--color-gray-rgb);
    --ec2-state-fill-rgb: var(--color-gray-fill-rgb);
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-strong);
    white-space: nowrap;
    color: rgb(var(--ec2-state-rgb));
    background: rgba(var(--ec2-state-fill-rgb), 0.14);
}

.ec2-instance-in_service,
.ec2-instance-standalone,
.ec2-run-succeeded,
.ec2-activity-ok,
.ec2-alarm-ok {
    --ec2-state-rgb: var(--color-green-rgb);
    --ec2-state-fill-rgb: var(--color-green-fill-rgb);
}

.ec2-instance-launching,
.ec2-instance-draining,
.ec2-activity-live,
.ec2-run-running {
    --ec2-state-rgb: var(--color-blue-rgb);
    --ec2-state-fill-rgb: var(--color-blue-fill-rgb);
}

.ec2-instance-dead,
.ec2-run-failed,
.ec2-run-timed_out,
.ec2-run-aborted,
.ec2-activity-bad,
.ec2-alarm-alarm {
    --ec2-state-rgb: var(--color-red-rgb);
    --ec2-state-fill-rgb: var(--color-red-fill-rgb);
}

.ec2-instance-unknown,
.ec2-activity-warn {
    --ec2-state-rgb: var(--color-orange-rgb);
    --ec2-state-fill-rgb: var(--color-orange-fill-rgb);
}

.ec2-instance-stopped,
.ec2-run-pending_redrive,
.ec2-alarm-insufficient_data {
    --ec2-state-rgb: var(--color-gray-rgb);
    --ec2-state-fill-rgb: var(--color-gray-fill-rgb);
}

.ec2-chip {
    display: inline-flex;
    align-items: center;
    margin: 0.1rem 0.25rem 0.1rem 0;
    padding: 0.05rem 0.45rem;
    border: 1px solid var(--border-normal);
    border-radius: 6px;
    font-size: 0.72rem;
    white-space: nowrap;
    color: var(--text-secondary);
    background: var(--surface-1);
}

a.ec2-chip:hover {
    text-decoration: none;
    border-color: var(--border-emphasis);
}

.ec2-chip-warn {
    border-color: rgba(var(--color-orange-rgb), 0.45);
    color: rgb(var(--color-orange-rgb));
    background: rgba(var(--color-orange-fill-rgb), 0.1);
}

.ec2-chip-accent {
    border-color: rgba(var(--color-purple-rgb), 0.4);
    color: rgb(var(--color-purple-rgb));
    background: rgba(var(--color-purple-fill-rgb), 0.12);
}

/* ---- Load meter --------------------------------------------------------- */

.ec2-meter {
    display: block;
    overflow: hidden;
    height: 0.3rem;
    border-radius: 999px;
    background: var(--surface-3);
}

.ec2-meter > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: rgb(var(--color-blue-fill-rgb));
}

/* ---- Topology diagram --------------------------------------------------- */

.ec2-diagram-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.ec2-legend-line {
    display: inline-block;
    width: 1.4rem;
    border-top: 2px solid rgba(var(--color-blue-rgb), 0.7);
}

.ec2-legend-line.is-control {
    border-top: 2px dashed var(--text-muted);
}

/* On a screen narrower than the diagram, the diagram keeps its layout
   and scrolls sideways; the connectors are drawn in its own coordinates. */
.ec2-diagram-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* The canvas: the internet above the VPC frame, the regional services
   under it, and the connectors' SVG laid over them all. */
.ec2-diagram {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    padding: 1.75rem;
    border: 1px solid var(--card-border);
    min-width: 1180px;
    border-radius: 14px;
    background:
        radial-gradient(circle, var(--border-normal) 1px, transparent 1.5px) 0 0 / 18px 18px,
        var(--bg-surface);
}

/* Above the frames, whose fills would hide it; its paths run through the
   gaps between nodes, so it never covers one. */
.ec2-edges {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.ec2-edge {
    fill: none;
    stroke: rgba(var(--color-blue-rgb), 0.55);
    stroke-width: 1.75;
}

.ec2-edge-flow {
    fill: none;
    stroke: rgb(var(--color-blue-fill-rgb));
    stroke-width: 1.75;
    stroke-dasharray: 3 14;
    stroke-linecap: round;
    animation: ec2-edge-flow 1.1s linear infinite;
}

.ec2-edge.is-control {
    stroke: var(--text-muted);
    stroke-dasharray: 5 5;
}

.ec2-edge-head {
    fill: rgba(var(--color-blue-rgb), 0.8);
}

.ec2-edge-head.is-control {
    fill: var(--text-muted);
}

@keyframes ec2-edge-flow {
    to { stroke-dashoffset: -17; }
}

@media (prefers-reduced-motion: reduce) {
    .ec2-edge-flow { display: none; }
}

.ec2-edge-label {
    position: absolute;
    z-index: 3;
    padding: 0.05rem 0.45rem;
    border: 1px solid var(--border-normal);
    border-radius: 999px;
    font-family: var(--ec2-mono);
    font-size: 0.66rem;
    white-space: nowrap;
    color: var(--text-secondary);
    background: var(--bg-surface);
    transform: translate(-50%, -50%);
    pointer-events: none;
}



/* ---- Internet ---------------------------------------------------------- */

/* The internet: a pill of its clients behind a globe, set in from the
   left. Its line (an ec2.js "drop" edge) leaves its left side, carries
   its label along the run, and drops through the VPC's left padding. */
.ec2-internet {
    display: flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.85rem;
    margin-left: 12rem;
    padding: 0.35rem 1rem 0.35rem 0.35rem;
    border: 1px solid rgba(var(--color-blue-rgb), 0.4);
    border-radius: 999px;
    background: var(--bg-surface);
    box-shadow: 0 4px 14px rgba(var(--color-blue-fill-rgb), 0.1);
}

.ec2-internet-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    font-size: 0.95rem;
    color: rgb(var(--color-blue-rgb));
    background: rgba(var(--color-blue-fill-rgb), 0.14);
}

.ec2-internet-list {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.ec2-internet-list li + li {
    margin-left: 0.8rem;
    padding-left: 0.8rem;
    border-left: 1px solid var(--border-normal);
}

.ec2-internet-list i {
    margin-right: 0.4rem;
    color: var(--text-tertiary);
}

/* ---- Frames: region, VPC, AZ ------------------------------------------- */

.ec2-frame {
    position: relative;
    padding: 2.4rem 1.6rem 1.6rem;
    border: 1px solid var(--border-emphasis);
    border-radius: 12px;
}

/* A tag on the frame's top edge. It stacks above the connectors, so a line
   crossing it passes behind. */
.ec2-frame-label {
    position: absolute;
    top: -0.7rem;
    left: 0.9rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border-normal);
    border-radius: 999px;
    background: var(--bg-surface);
    font-size: 0.7rem;
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* An AZ frame's tag says whether the ASGs and ECS services run there. */
.ec2-az-badge {
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    background: var(--surface-2);
}

.ec2-az-badge.is-active {
    color: rgb(var(--color-green-rgb));
    background: rgba(var(--color-green-fill-rgb), 0.16);
}

/* The other env's VPC switch, in the diagram's top right corner, clear
   of the internet node and its lines. */
.ec2-switch {
    position: absolute;
    top: 0.7rem;
    right: 0.9rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    cursor: pointer;
    user-select: none;
}

.ec2-switch:hover {
    color: var(--text-secondary);
}

.ec2-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ec2-switch-track {
    position: relative;
    width: 2rem;
    height: 1.1rem;
    border: 1px solid var(--border-emphasis);
    border-radius: 999px;
    background: var(--surface-2);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ec2-switch-track::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0.15rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--text-tertiary);
    transform: translateY(-50%);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.ec2-switch input:checked + .ec2-switch-track {
    border-color: rgba(var(--color-blue-rgb), 0.6);
    background: rgba(var(--color-blue-fill-rgb), 0.35);
}

.ec2-switch input:checked + .ec2-switch-track::after {
    background: rgb(var(--color-blue-rgb));
    transform: translate(0.85rem, -50%);
}

.ec2-switch input:focus-visible + .ec2-switch-track {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
}

.ec2-switch input:checked ~ span:first-child,
.ec2-switch:has(input:checked) {
    color: var(--text-primary);
}

/* Its tag starts right of the internet's line, which drops through the
   left padding. */
.ec2-frame-vpc > .ec2-frame-label {
    left: 2rem;
}

.ec2-frame-vpc {
    display: flex;
    flex-direction: column;
    gap: 2.75rem;
    border-style: dashed;
    background: var(--surface-1);
}

/* An AZ other than the active one: a grey frame, its subnets' groups in
   a row. */
/* Groups sit in equal columns: every group has the same width however
   many there are, and its instances stack. */
.ec2-off-az-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-items: start;
    gap: 1.5rem;
}

.ec2-frame-az {
    display: flex;
    flex-direction: column;
    gap: 2.75rem;
    border-style: dashed;
    border-color: rgba(var(--color-blue-rgb), 0.35);
}

/* An AZ frame's tag takes the frame's blue, as the subnets' tags take
   theirs. */
.ec2-frame-az > .ec2-frame-label {
    border-color: rgba(var(--color-blue-rgb), 0.35);
}

/* Subnets: public in green (the instances, with public IPs), private in blue
   (the ECS services), as AWS's own diagrams color them. */
.ec2-frame-subnet.is-public {
    border-color: rgba(var(--color-green-rgb), 0.4);
    background: rgba(var(--color-green-fill-rgb), 0.03);
}

.ec2-frame-subnet.is-private {
    border-color: rgba(var(--color-blue-rgb), 0.4);
    background: rgba(var(--color-blue-fill-rgb), 0.04);
}

.ec2-frame-subnet.is-absent {
    border-style: dashed;
    border-color: var(--border-normal);
    background: transparent;
}

.ec2-frame-label.is-public {
    border-color: rgba(var(--color-green-rgb), 0.45);
    color: rgb(var(--color-green-rgb));
}

.ec2-frame-label.is-private {
    border-color: rgba(var(--color-blue-rgb), 0.45);
    color: rgb(var(--color-blue-rgb));
}

.ec2-frame-subnet.is-absent .ec2-frame-label {
    border-color: var(--border-normal);
    color: var(--text-tertiary);
}

/* A fact after a frame tag's name (a CIDR, an id), set off by a rule. */
.ec2-frame-detail {
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-normal);
    font-weight: var(--font-weight-body);
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--text-secondary);
}

.ec2-frame-detail.is-mono {
    font-family: var(--ec2-mono);
    font-size: 0.68rem;
}

.ec2-az-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    /* The gap is the horizontal connectors' length. */
    gap: 4rem;
    align-items: start;
}

.ec2-cell-signal,
.ec2-cell-calls,
.ec2-cell-ai {
    display: flex;
    flex-direction: column;
    /* The gap is the vertical connectors' length. */
    gap: 4rem;
    min-width: 0;
}

/* ---- Endpoint ---------------------------------------------------------- */

.ec2-endpoint {
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(var(--color-purple-rgb), 0.45);
    border-radius: 10px;
    background: var(--bg-surface);
    box-shadow: 0 0 0 4px rgba(var(--color-purple-fill-rgb), 0.07);
}


.ec2-endpoint.is-orphaned {
    border-color: rgba(var(--color-red-rgb), 0.5);
    box-shadow: 0 0 0 4px rgba(var(--color-red-fill-rgb), 0.08);
}

.ec2-endpoint.is-off-ec2 {
    border-style: dashed;
    border-color: var(--border-normal);
    box-shadow: none;
}

.ec2-endpoint-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.ec2-endpoint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    color: rgb(var(--color-purple-rgb));
    background: rgba(var(--color-purple-fill-rgb), 0.14);
}

.ec2-endpoint-name {
    font-size: 0.72rem;
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgb(var(--color-purple-rgb));
}

.ec2-endpoint-eip {
    margin-bottom: 0.4rem;
    font-family: var(--ec2-mono);
    font-size: 1rem;
    font-weight: var(--font-weight-strong);
    color: var(--text-primary);
}


.ec2-endpoint-row {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.74rem;
    color: var(--text-tertiary);
}

.ec2-endpoint-row > :last-child {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
    color: var(--text-secondary);
}

/* ---- App groups ---------------------------------------------------------- */

.ec2-group {
    border: 1px solid var(--border-normal);
    border-radius: 12px;
    background: var(--bg-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* It wraps: a title too long to share the line with the tools pushes them
   onto a line of their own, at the right. */
.ec2-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 0.9rem 0.35rem;
}

.ec2-group-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: rgb(var(--color-blue-rgb));
    background: rgba(var(--color-blue-fill-rgb), 0.13);
}

/* Its basis is 0 and its minimum its longest word, so the tools wrap only
   when they would otherwise overlap a word of the title. */
.ec2-group-title {
    flex: 1 1 0;
}

.ec2-group-title h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: var(--font-weight-heading);
    color: var(--text-primary);
}

.ec2-group-title span {
    font-size: 0.74rem;
    color: var(--text-tertiary);
}

.ec2-group-health {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: var(--font-weight-strong);
    font-variant-numeric: tabular-nums;
    color: rgb(var(--color-green-rgb));
    background: rgba(var(--color-green-fill-rgb), 0.12);
}

/* The health badge and the add button, centered on each other and kept in
   the top right corner instead of centered on the two-line title. */
.ec2-group-tools {
    display: flex;
    flex: none;
    align-self: flex-start;
    margin-left: auto;
    align-items: center;
    gap: 0.5rem;
}

.ec2-group-health.is-warn {
    color: rgb(var(--color-orange-rgb));
    background: rgba(var(--color-orange-fill-rgb), 0.12);
}

.ec2-group-asg {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.2rem 0.75rem;
    padding: 0 0.9rem 0.7rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.ec2-group-asg a {
    font-family: var(--ec2-mono);
}

.ec2-group-instances {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem;
}

.ec2-cell-calls .ec2-group-instances {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.ec2-group-empty {
    padding: 1.1rem;
    border: 1px dashed var(--border-normal);
    border-radius: 8px;
    font-size: 0.78rem;
    text-align: center;
    color: var(--text-muted);
}

/* ---- Server nodes ------------------------------------------------------- */

/* The outline carries the health: neutral while healthy, in the
   health's hue otherwise (the same hue as the dot). */
.ec2-srv {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem 0.55rem;
    border: 1px solid var(--border-emphasis);
    border-radius: 9px;
    background: var(--surface-1);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.3s ease;
}

.ec2-srv:not(.ec2-health-ok) {
    border-color: rgba(var(--ec2-dot-rgb), 0.55);
}

.ec2-srv.ec2-health-critical {
    background: rgba(var(--color-red-fill-rgb), 0.05);
}

.ec2-srv:hover {
    border-color: var(--text-muted);
}

.ec2-srv:not(.ec2-health-ok):hover {
    border-color: rgb(var(--ec2-dot-rgb));
}

.ec2-srv.is-flash {
    box-shadow: 0 0 0 2px rgba(var(--color-blue-fill-rgb), 0.75);
}

.ec2-srv-head {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.ec2-srv-head > .ec2-dot {
    margin-top: 0.32rem;
}

.ec2-srv-head > .ec2-state {
    flex: none;
    margin: -0.05rem 0 -0.1rem;
}

.ec2-srv-foot .ec2-srv-actions {
    margin: -0.15rem -0.35rem -0.15rem auto;
}

/* Shown only in the phone layout's compact instance. */
.ec2-srv-ip {
    display: none;
}

.ec2-srv-name {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: var(--font-weight-strong);
    line-height: 1.3;
    overflow-wrap: anywhere;
    color: var(--text-primary);
}

/* Addresses and instance type: a label column and a value column,
   both on one line height so each label sits level with its value. */
.ec2-srv-facts {
    display: grid;
    grid-template-columns: 3.6rem 1fr;
    align-items: baseline;
    gap: 0.1rem 0.5rem;
    margin: 0;
    line-height: 1.55;
}

.ec2-srv-facts dt {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.ec2-srv-facts dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-family: var(--ec2-mono);
    font-size: 0.74rem;
    color: var(--text-secondary);
}

/* A value that is a word, not an address: the instance type. */
.ec2-srv-facts dd.is-plain {
    font-family: inherit;
}

/* Uptime (or time stopped), at the footer's left. */
.ec2-srv-uptime {
    flex: none;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--text-tertiary);
}

/* What is wrong beyond the alarms: launching, not ready, unhealthy. */
.ec2-srv-note {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.74rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.ec2-srv-note > i {
    color: var(--text-muted);
}

.ec2-srv-note.is-warn,
.ec2-srv-note.is-warn > i {
    color: rgb(var(--color-orange-rgb));
}

.ec2-srv-note.is-warn {
    cursor: help;
}

/* The outdated image warning's tooltip (_outdated_image_tip.html): a title,
   a line of text, then each image's id over its version and age. */
#tip.ec2-image-tip .tip-body {
    max-width: 20rem;
    font-size: 0.78rem;
    line-height: 1.4;
}

#tip.ec2-image-tip .ec2-tip-title {
    margin-bottom: 0.15rem;
    font-weight: var(--font-weight-strong);
    color: rgb(var(--color-orange-rgb));
}

#tip.ec2-image-tip .ec2-tip-text {
    white-space: normal;
    opacity: 0.85;
}

#tip.ec2-image-tip .ec2-tip-images {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 0.75rem;
    margin: 0.5rem 0 0;
    padding-top: 0.45rem;
    border-top: 1px solid var(--tooltip-edge);
}

#tip.ec2-image-tip .ec2-tip-images dt {
    font-weight: normal;
    opacity: 0.7;
}

#tip.ec2-image-tip .ec2-tip-images dd {
    display: flex;
    flex-direction: column;
    margin: 0;
}

#tip.ec2-image-tip .ec2-tip-images code {
    padding: 0;
    font-size: 0.76rem;
    color: inherit;
    background: none;
}

#tip.ec2-image-tip .ec2-tip-images small {
    font-size: 0.72rem;
    opacity: 0.7;
}

.ec2-srv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.ec2-srv-tags .ec2-chip {
    margin: 0;
}

.ec2-srv-load {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ec2-srv-load .ec2-meter {
    flex: 1;
    height: 0.35rem;
}

.ec2-srv-load-label {
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--text-tertiary);
}

.ec2-srv-load-label strong {
    color: var(--text-primary);
}

/* Uptime at the left and the actions at the right, under a rule. */
.ec2-srv-foot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-subtle);
}

/* An instance's alarms: a row counting each state, each led by a dot in its
   hue, and under it the firing alarms by name. */
.ec2-alarms {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.ec2-alarms-counts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.6rem;
}

.ec2-alarms-counts > i {
    color: var(--text-muted);
}

.ec2-alarms-counts > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.ec2-alarms-counts > span::before {
    content: "";
    flex: none;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: rgb(var(--color-gray-fill-rgb));
}

.ec2-alarms-counts > .is-firing {
    font-weight: var(--font-weight-strong);
    color: rgb(var(--color-red-rgb));
}

.ec2-alarms-counts > .is-firing::before {
    background: rgb(var(--color-red-fill-rgb));
}

.ec2-alarms-counts > .is-ok {
    color: rgb(var(--color-green-rgb));
}

.ec2-alarms-counts > .is-ok::before {
    background: rgb(var(--color-green-fill-rgb));
}

/* The firing alarms' names, under the counts. */
.ec2-alarms-firing {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.6rem;
    color: rgb(var(--color-red-rgb));
}

.ec2-alarms-firing > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    overflow-wrap: anywhere;
}

.ec2-alarms-firing > span:not(.is-more)::before {
    content: "";
    flex: none;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: rgb(var(--color-red-fill-rgb));
}

.ec2-alarms-firing > .is-more {
    color: var(--text-tertiary);
}

.ec2-alarms.is-none {
    color: var(--text-muted);
}

.ec2-alarms.is-none .ec2-alarms-counts {
    gap: 0.4rem;
}

.ec2-srv-actions {
    display: flex;
    flex: none;
    gap: 0.15rem;
}

.ec2-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    background: transparent;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ec2-act:hover {
    color: var(--text-primary);
    text-decoration: none;
    background: var(--surface-3);
}

.ec2-act.is-copied {
    color: rgb(var(--color-green-rgb));
}

/* ---- Services ----------------------------------------------------------- */

.ec2-service {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-normal);
    border-radius: 10px;
    color: inherit;
    background: var(--bg-surface);
    transition: border-color 0.15s ease;
}

a.ec2-service:hover {
    border-color: var(--border-emphasis);
    color: inherit;
    text-decoration: none;
}

.ec2-service-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--surface-3);
}

.ec2-service-title {
    font-size: 0.8rem;
    font-weight: var(--font-weight-strong);
    color: var(--text-primary);
}

.ec2-service-sub {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.ec2-service-dashboard {
    align-self: center;
}

.ec2-frame-regional {
    border-style: dashed;
    background: var(--surface-1);
}

/* ---- Other VPCs ---------------------------------------------------------

   A lighter frame than the PBX topology's; their groups and instances look
   the same. */
.ec2-other-vpcs {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}


.ec2-diagram:not(.show-other-env) .ec2-frame-vpc.is-other-env {
    display: none;
}

.ec2-frame-vpc.is-other {
    border-color: var(--border-normal);
    background: transparent;
}

.ec2-frame-vpc.is-other > .ec2-frame-label {
    color: var(--text-tertiary);
}


.ec2-regional {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}


/* ---- Tables ------------------------------------------------------------- */

.ec2-table td,
.ec2-table th {
    vertical-align: middle;
}

.ec2-table th {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ec2-table tr.is-firing td {
    background: rgba(var(--color-red-fill-rgb), 0.05);
}

.ec2-cell-sub {
    margin-top: 0.1rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* One line, cut with an ellipsis; the full text is in its tooltip. */
.ec2-clamp {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The alarm list: a row an alarm, its details open on a click. */
.ec2-alarm + .ec2-alarm {
    border-top: 1px solid var(--border-subtle);
}

/* The list's header row: what the columns hold. */
.ec2-alarm-row.ec2-alarm-head {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-normal);
    font-size: 0.68rem;
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    cursor: default;
}

.ec2-alarm-head > :last-child {
    text-align: right;
}

.ec2-alarm.is-firing {
    background: rgba(var(--color-red-fill-rgb), 0.05);
}

.ec2-alarm-row {
    display: grid;
    grid-template-columns: 0.7rem 4.2rem minmax(0, 1fr) auto;
    /* The caret, state and time sit in the row's middle; the name and
       description, the tallest, set the row's height, so opening an alarm
       does not move them. */
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    list-style: none;
}

.ec2-alarm-row::-webkit-details-marker {
    display: none;
}

/* The whole alarm, open or not, answers the pointer: a click anywhere
   on it opens or closes it. */
.ec2-alarm:hover {
    background: var(--surface-2);
}

.ec2-alarm-caret {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    transition: transform 0.15s ease;
}

.ec2-alarm[open] .ec2-alarm-caret {
    transform: rotate(90deg);
}

.ec2-alarm-console {
    flex: none;
    white-space: nowrap;
}

.ec2-alarm-what {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.ec2-alarm-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ec2-alarm-name .ec2-chip {
    margin: 0;
}

/* Cut to the line while closed; whole, in the same place, once open. */
.ec2-alarm-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-tertiary);
}

.ec2-alarm[open] .ec2-alarm-desc {
    overflow: visible;
    white-space: normal;
}

/* Kept clear of the description cut to the line before it. */
.ec2-alarm-since {
    padding-left: 2rem;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
    color: var(--text-secondary);
}

/* Under the name. A click on it closes the alarm (ec2.js). */
.ec2-alarm-body {
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0 1.25rem 0.85rem calc(1.25rem + 0.7rem + 4.2rem + 1.5rem);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* The reason is CloudWatch's own words: set apart from the description
   as a mono note on a tinted panel, under its label. */
.ec2-alarm-why {
    flex: 1 1 16rem;
    min-width: 0;
    margin-bottom: 0;
    padding: 0.45rem 0.65rem;
    border-left: 2px solid var(--border-emphasis);
    border-radius: 4px;
    font-family: var(--ec2-mono);
    font-size: 0.72rem;
    line-height: 1.55;
    color: var(--text-tertiary);
    background: var(--surface-1);
}

.ec2-alarm-why > span {
    display: block;
    margin-bottom: 0.15rem;
    font-family: var(--font-family-base, inherit);
    font-size: 0.64rem;
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ec2-alarm.is-firing .ec2-alarm-why {
    border-left-color: rgba(var(--color-red-rgb), 0.7);
    color: var(--color-red);
    background: rgba(var(--color-red-fill-rgb), 0.06);
}

/* ---- Workflows ---------------------------------------------------------- */

/* Cards start at the top of their row, so a long card grows only itself. */
/* An even grid: four columns on a wide screen, fewer as it narrows; the
   cards of a row share its height, their steps link at the bottom. */
.ec2-workflows {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 1400px) {
    .ec2-workflows {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .ec2-workflows {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ec2-workflows {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ec2-workflow {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--card-border);
    border-radius: var(--ec2-radius);
    background: var(--bg-surface);
    transition: border-color 0.15s ease;
}

/* The card before the workflows spans the columns their last row would
   leave empty, so the grid ends on a full row (views.build_workflow_fill
   sets each width's span). */
.ec2-workflow-fill {
    grid-column: span var(--span-4);
    background:
        linear-gradient(135deg, rgba(var(--color-blue-fill-rgb), 0.08), transparent 60%),
        var(--bg-surface);
}

@media (max-width: 1400px) {
    .ec2-workflow-fill { grid-column: span var(--span-3); }
}

@media (max-width: 1000px) {
    .ec2-workflow-fill { grid-column: span var(--span-2); }
}

@media (max-width: 640px) {
    .ec2-workflow-fill { grid-column: auto; }
}

.ec2-fill-stats {
    display: flex;
    gap: 0.6rem;
    margin: 0.35rem 0 0.2rem;
}

.ec2-fill-stat {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    background: var(--surface-2);
}

.ec2-fill-value {
    font-size: 1.5rem;
    font-weight: var(--font-weight-strong);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    color: var(--text-primary);
}

.ec2-fill-label {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.ec2-fill-stat.is-ok .ec2-fill-value { color: rgb(var(--color-green-rgb)); }
.ec2-fill-stat.is-bad .ec2-fill-value { color: rgb(var(--color-red-rgb)); }
.ec2-fill-stat.is-live .ec2-fill-value { color: rgb(var(--color-blue-rgb)); }

/* A one-column card lists its stats, a value and label a line. */
.ec2-workflow-fill {
    container-type: inline-size;
}

@container (max-width: 22rem) {
    .ec2-fill-stats {
        flex-direction: column;
        gap: 0.35rem;
    }

    .ec2-fill-stat {
        flex-direction: row-reverse;
        align-items: baseline;
        justify-content: space-between;
        padding: 0.35rem 0.7rem;
    }
}

.ec2-fill-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    margin-top: auto;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.ec2-workflow.is-flash,
.ec2-workflow:target {
    border-color: rgb(var(--color-blue-rgb));
}

.ec2-workflow-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ec2-workflow-name {
    font-weight: var(--font-weight-strong);
    color: var(--text-primary);
}

/* A title that links turns the app's link hover blue. */
a.ec2-workflow-name:hover,
.ec2-instance-alarm-title a:hover {
    color: var(--color-blue-hover);
}

.ec2-workflow-starters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.9rem;
    font-size: 0.75rem;
    color: rgb(var(--color-blue-rgb));
}

.ec2-workflow-summary {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* The definition's own top-level Comment. */
.ec2-workflow-detail {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-tertiary);
}

.ec2-workflow-steps {
    align-self: flex-start;
    margin-top: auto;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.78rem;
    color: rgb(var(--color-blue-rgb));
    cursor: pointer;
}

/* A button that reads as a link: the app's link hover color, no
   underline. */
.ec2-workflow-steps {
    transition: color 0.2s ease;
}

.ec2-workflow-steps:hover {
    color: var(--color-blue-hover);
}

/* The steps modal: the markers' ring matches the modal's surface. */
.ec2-steps-modal {
    --step-surface: var(--modal-bg);
}

.ec2-steps-modal .ec2-workflow-detail {
    margin-bottom: 1rem;
}

.ec2-step-type {
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.68rem;
    font-weight: var(--font-weight-body);
    color: var(--text-tertiary);
    background: var(--surface-2);
}

.ec2-step-type-choice {
    color: rgb(var(--color-purple-rgb));
}

.ec2-step-type-fail {
    color: rgb(var(--color-red-rgb));
}

.ec2-step-type-succeed {
    color: rgb(var(--color-green-rgb));
}

.ec2-step-transitions {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.ec2-step-transitions > li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.1rem 0.4rem;
    min-width: 0;
}

.ec2-step-kind {
    min-width: 3.6rem;
    font-size: 0.66rem;
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ec2-step-kind-catch {
    color: rgb(var(--color-orange-rgb));
}

.ec2-step-condition {
    overflow-wrap: anywhere;
    font-size: 0.7rem;
}

.ec2-step-arrow {
    color: var(--text-muted);
}

/* A Parallel or Map step's branch, nested in the step: its own surface
   for the markers' ring. */
.ec2-step-branch {
    --step-surface: var(--bg-inset);
}

/* A catalog or definition the page could not read. */
.ec2-unavailable {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(var(--color-orange-rgb), 0.35);
    border-radius: 0.4rem;
    background: rgba(var(--color-orange-fill-rgb), 0.1);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ec2-unavailable > i {
    margin-top: 0.15rem;
    color: rgb(var(--color-orange-rgb));
}

.card-body > .ec2-unavailable {
    margin: 0.9rem;
}

/* ---- Reference ---------------------------------------------------------- */

/* Three cards: three to a row, two on a laptop, one on a phone. */
.ec2-ref-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 1.25rem;
}

@media (max-width: 1599px) {
    .ec2-ref-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .ec2-ref-grid { grid-template-columns: minmax(0, 1fr); }
}

.ec2-ref-card dd {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.ec2-ref-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
    font-size: 1rem;
    font-weight: var(--font-weight-heading);
    color: var(--text-primary);
}

.ec2-ref-title > i {
    color: rgb(var(--color-blue-rgb));
}

.ec2-ref-dl {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.6rem 0.9rem;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.ec2-ref-dl dt {
    font-weight: var(--font-weight-body);
    color: var(--text-primary);
}

.ec2-ref-dl dd {
    margin: 0;
}

/* ---- Instance modal ---------------------------------------------------------- */

.ec2-instance-detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
    margin-bottom: 1rem;
}

.ec2-instance-detail-head .ec2-chip {
    margin: 0;
}

.ec2-instance-detail-head .ec2-srv-actions {
    margin-left: auto;
}

.ec2-instance-detail-note {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-normal);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--surface-2);
}

.ec2-instance-detail-note > i {
    color: var(--text-muted);
}

/* Instance, Network, Role and Image: two columns, so the four panels fill
   two even rows; one column on a narrow screen. */
.ec2-instance-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .ec2-instance-panels {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ec2-instance-panel {
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border-normal);
    border-radius: 8px;
    background: var(--surface-1);
}

.ec2-instance-panel h6,
.ec2-instance-alarms-head h6 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.6rem;
    font-size: 0.66rem;
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.ec2-instance-panel h6 > i {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.ec2-instance-panel dl {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    align-items: baseline;
    gap: 0.3rem 0.5rem;
    margin: 0;
    font-size: 0.8rem;
}

.ec2-instance-panel dt {
    font-weight: var(--font-weight-body);
    color: var(--text-muted);
}

.ec2-instance-panel dt {
    white-space: nowrap;
}

/* IDs, IPs and kernels stay whole; free text (a version, a note) wraps. */
.ec2-instance-panel dd {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.ec2-instance-panel dd.is-wrap {
    overflow-wrap: anywhere;
    white-space: normal;
    text-wrap: pretty;
}

.ec2-instance-alarms-empty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border: 1px dashed var(--border-normal);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-tertiary);
}

.ec2-instance-alarms-empty > i {
    color: var(--text-muted);
}

/* The instance modal's header: the name, then its state and actions on
   the same line. */
.ec2-instance-modal .modal-header {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

/* Narrower, the state and actions take their own line under the name. */
@media (max-width: 991px) {
    .ec2-instance-modal .ec2-instance-modal-head {
        flex: 1 1 100%;
        order: 3;
    }

    .ec2-instance-modal .modal-header .close {
        order: 2;
        margin-left: auto;
    }
}

.ec2-instance-modal-head {
    flex: 1;
    min-width: 0;
}

.ec2-instance-modal-head .ec2-instance-detail-head {
    margin: 0;
}

.ec2-instance-modal .modal-header .close {
    margin: -1rem -1rem -1rem 0;
}

/* The instance modal's facts: one card, its four sections side by side
   between dividers, each as wide as its content needs, every value on one
   line: the modal is wide enough for them. */
.ec2-instance-modal .modal-dialog {
    max-width: min(1400px, calc(100vw - 2rem));
    margin-right: auto;
    margin-left: auto;
}

.ec2-instance-modal .ec2-instance-panels {
    grid-template-columns: repeat(4, auto);
    gap: 0;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-normal);
    border-radius: 8px;
    background: var(--surface-1);
}

.ec2-instance-modal .ec2-instance-panel {
    padding: 0.75rem 0.8rem;
    border: 0;
    border-radius: 0;
    background: none;
}

.ec2-instance-modal .ec2-instance-panel + .ec2-instance-panel {
    border-left: 1px solid var(--border-subtle);
}

.ec2-instance-modal .ec2-instance-panel dl {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.3rem 0.6rem;
    font-size: 0.76rem;
}

.ec2-instance-modal .ec2-instance-panel dd {
    overflow: visible;
    white-space: nowrap;
}

@media (max-width: 1199px) {
    .ec2-instance-modal .ec2-instance-panels {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ec2-instance-modal .ec2-instance-panel + .ec2-instance-panel {
        border-left: 0;
    }
}

/* A phone: one section a row, values free to wrap, two metric tiles a row. */
@media (max-width: 575px) {
    .ec2-instance-modal .modal-dialog {
        max-width: calc(100vw - 1rem);
        margin: 0.5rem auto;
    }

    .ec2-instance-modal .ec2-instance-panels {
        grid-template-columns: minmax(0, 1fr);
    }

    .ec2-instance-modal .ec2-instance-panel + .ec2-instance-panel {
        border-top: 1px solid var(--border-subtle);
    }

    .ec2-instance-modal .ec2-instance-panel dd {
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .ec2-metric-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* The OK alarms: chips, or cards with their descriptions when the modal
   has .show-alarm-descriptions (ec2.js). */
.ec2-ok-alarm-list,
.ec2-instance-modal.show-alarm-descriptions .ec2-alarm-chips {
    display: none;
}

.ec2-instance-modal.show-alarm-descriptions .ec2-ok-alarm-list {
    display: block;
}

.ec2-alarms-view {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    cursor: pointer;
}

.ec2-alarms-view:hover {
    color: var(--text-primary);
}

.ec2-alarms-view .is-hide,
.ec2-instance-modal.show-alarm-descriptions .ec2-alarms-view .is-show {
    display: none;
}

.ec2-instance-modal.show-alarm-descriptions .ec2-alarms-view .is-hide {
    display: inline;
}

/* The OK alarms: a chip each, its name by a green dot. */
.ec2-alarm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ec2-alarm-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border-normal);
    border-radius: 999px;
    background: var(--surface-1);
    font-family: var(--ec2-mono);
    font-size: 0.74rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.ec2-alarm-chip:hover {
    border-color: rgb(var(--color-green-fill-rgb));
    color: var(--text-primary);
    text-decoration: none;
}

.ec2-alarm-chip-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: rgb(var(--color-green-fill-rgb));
}

/* The instance's metrics (_instance_metrics.html), under its alarms: a
   tile per metric (name, latest value, sparkline), by namespace. */
.ec2-instance-metrics {
    margin-top: 1.25rem;
}

.ec2-metrics-window {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.ec2-metric-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

/* Name over value, the sparkline under them; the whole tile opens the
   metric's CloudWatch graph. */
.ec2-metric-tile {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0.65rem 0.4rem;
    border: 1px solid var(--border-normal);
    border-radius: 8px;
    background: var(--surface-1);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.ec2-metric-tile:hover {
    border-color: var(--chart-series-1);
    color: inherit;
    text-decoration: none;
}

.ec2-metric-name {
    display: -webkit-box;
    min-height: 2.2em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.72rem;
    line-height: 1.1;
    color: var(--text-tertiary);
}

.ec2-metric-value {
    font-size: 1.15rem;
    font-weight: var(--font-weight-strong);
    line-height: 1.2;
    color: var(--text-primary);
}

.ec2-metric-spark {
    width: 100%;
    height: 26px;
    margin-top: 0.15rem;
}

.ec2-metric-spark polyline {
    fill: none;
    stroke: var(--chart-series-1);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.ec2-metric-spark polygon {
    fill: var(--chart-series-1);
    opacity: 0.15;
}

/* A value that never moved: dimmed, so the moving ones stand out. */
.ec2-metric-tile.is-flat .ec2-metric-value {
    color: var(--text-tertiary);
}

.ec2-metric-tile.is-flat .ec2-metric-spark polyline {
    stroke: var(--text-muted);
}

.ec2-metric-tile.is-flat .ec2-metric-spark polygon {
    display: none;
}

.ec2-metrics-namespace {
    margin: 0.5rem 0 0.35rem;
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.ec2-instance-alarms-head {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    margin-bottom: 0.4rem;
}

.ec2-instance-alarms-head h6 {
    margin: 0;
}

.ec2-instance-alarms-head .ec2-alarms-counts {
    font-size: 0.75rem;
}

/* One alarm per row: a dot in its state's hue, its name, state and age on
   one line, then its description and, when it is not OK, AWS's reason. */
.ec2-instance-alarms {
    border: 1px solid var(--border-normal);
    border-radius: 8px;
    overflow: hidden;
}

.ec2-instance-alarm {
    --ec2-pip-rgb: var(--color-green-fill-rgb);
    display: flex;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-top: 1px solid var(--border-subtle);
}

.ec2-instance-alarm:first-child {
    border-top: 0;
}

.ec2-instance-alarm.ec2-alarm-alarm {
    --ec2-pip-rgb: var(--color-red-fill-rgb);
    background: rgba(var(--color-red-fill-rgb), 0.07);
}

.ec2-instance-alarm.ec2-alarm-insufficient_data {
    --ec2-pip-rgb: var(--color-gray-fill-rgb);
}

.ec2-instance-alarm-dot {
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.4rem;
    border-radius: 50%;
    background: rgb(var(--ec2-pip-rgb));
}

.ec2-instance-alarm-body {
    flex: 1;
    min-width: 0;
}

.ec2-instance-alarm-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.5rem;
}

.ec2-instance-alarm-title a {
    font-size: 0.85rem;
    font-weight: var(--font-weight-strong);
    color: var(--text-primary);
}

.ec2-instance-alarm.ec2-alarm-alarm .ec2-instance-alarm-title a {
    color: rgb(var(--color-red-rgb));
}

.ec2-instance-alarm-title .ec2-state {
    padding: 0 0.45rem;
    font-size: 0.66rem;
}

.ec2-instance-alarm-since {
    margin-left: auto;
    font-size: 0.72rem;
    white-space: nowrap;
    color: var(--text-muted);
}

.ec2-instance-alarm-about {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.ec2-instance-alarm-reason {
    margin-top: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    font-family: var(--ec2-mono);
    font-size: 0.7rem;
    line-height: 1.45;
    color: var(--text-tertiary);
    background: var(--surface-2);
}

/* ---- History modal ------------------------------------------------------ */

.ec2-history-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 0.6rem;
    margin-bottom: 0.75rem;
    font-weight: var(--font-weight-heading);
    color: var(--text-primary);
}


/* Names and IDs break at their hyphens otherwise; the table scrolls
   sideways instead when the modal is too narrow. */
.ec2-history .ec2-mono {
    white-space: nowrap;
}

/* One line per row: the cells never wrap, and a failed activity's cause
   takes the row under it (.ec2-activity-cause) at the table's width. */
.ec2-history-table td {
    white-space: nowrap;
}

.ec2-history-table tr.has-cause td {
    border-bottom: 0;
}

.ec2-history-table .ec2-activity-cause td {
    padding-top: 0;
    border-top: 0;
    font-size: 0.72rem;
    white-space: normal;
    color: var(--text-tertiary);
}

/* ---- Images tab --------------------------------------------------------- */

.ec2-image-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ec2-env-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.45rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgb(var(--color-blue-rgb));
    background: rgba(var(--color-blue-fill-rgb), 0.14);
}

.ec2-env-pill-prod {
    color: rgb(var(--color-red-rgb));
    background: rgba(var(--color-red-fill-rgb), 0.12);
}

.ec2-image-notes {
    margin: 0;
    padding: 0.6rem 1rem;
    list-style: none;
    border-top: 1px solid var(--border-normal);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.ec2-image-notes li {
    display: flex;
    gap: 0.5rem;
    padding: 0.15rem 0;
}

.ec2-image-notes li > i {
    width: 1rem;
    margin-top: 0.2rem;
    text-align: center;
    color: var(--text-muted);
}

.ec2-image-notes li.is-warn > i { color: rgb(var(--color-orange-rgb)); }
.ec2-image-notes li.is-accent > i { color: rgb(var(--color-purple-rgb)); }

/* An app card's title row: the title as the Reference tab's cards have it,
   its actions at the far end. */
.ec2-image-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
}

.ec2-image-head .ec2-ref-title {
    margin-bottom: 0;
}

.ec2-image-notes li.is-bad > i { color: rgb(var(--color-red-rgb)); }

/* An app version can be long (FreeSWITCH's names its exact build): it wraps. */
.ec2-image-version {
    max-width: 18rem;
    overflow-wrap: anywhere;
}

.ec2-image-note {
    margin-top: 0;
    color: var(--text-secondary);
}

/* The note row continues the image's row: no rule between them (tables.css
   draws a cell's top and bottom edges), and the image's cells give up most
   of their bottom padding. The paddings are !important to beat tables.css's
   `.table tr td` padding, which is. */
.ec2-table tr:has(+ .ec2-image-note-row) td {
    padding-bottom: 0.15rem !important;
    border-bottom: 0;
}

.ec2-table .ec2-image-note-row td {
    padding-top: 0 !important;
    border-top: 0;
}

/* ---- Actions ------------------------------------------------------------ */

.ec2-op {
    white-space: nowrap;
}

/* An action in a card's header: an .ec2-act outlined in the accent, so it
   stands out from the card's links. */
.ec2-op-icon {
    flex: none;
    border-color: rgba(var(--color-blue-rgb), 0.45);
    color: rgb(var(--color-blue-rgb));
}

.ec2-op-icon:hover {
    color: rgb(var(--color-blue-rgb));
    background: rgba(var(--color-blue-fill-rgb), 0.16);
}

.ec2-endpoint-head .ec2-op-icon {
    margin-left: auto;
}

/* A group's history button: the history modal, filtered to the group's
   app. With dead instances the topology leaves out, it widens to their
   count. */
.ec2-group-history {
    flex: none;
    gap: 0.3rem;
    border-color: var(--border-emphasis);
    color: var(--text-secondary);
    background: var(--surface-2);
}

.ec2-group-history:hover {
    color: var(--text-primary);
    background: var(--surface-3);
}

.ec2-group-history.has-dead {
    width: auto;
    padding: 0 0.45rem;
}

.ec2-group-history-count {
    font-size: 0.68rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* In the top right corner, not centered on the two-line title. */
.ec2-endpoint-head .ec2-op-icon {
    align-self: flex-start;
}

.ec2-table .ec2-op {
    padding: 0.05rem 0.45rem;
    font-size: 0.72rem;
}

.ec2-card-ops {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* The instance modal's actions: ghost buttons at the right of its header
   row, set off from the links after them by a short rule. */
.ec2-instance-ops {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
}

.ec2-instance-ops::after {
    content: "";
    width: 1px;
    height: 1.1rem;
    margin: 0 0.35rem;
    background: var(--border-normal);
}

.ec2-instance-detail-head .ec2-instance-ops:has(.ec2-op) + .ec2-srv-actions {
    margin-left: 0;
}

/* The action modal's back button, before its title; the title then keeps
   to the left instead of sitting between it and the close button. */
.ec2-action-back {
    margin: -0.25rem 0.4rem -0.25rem -0.5rem;
}

.ec2-action-back ~ .modal-title {
    margin-right: auto;
}

.ec2-action-heading {
    margin-bottom: 0.6rem;
    font-weight: var(--font-weight-heading);
}

.ec2-action-title {
    margin: 0.9rem 0 0.4rem;
    font-size: 0.8rem;
    font-weight: var(--font-weight-strong);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ec2-action-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.2rem 1rem;
    margin: 0;
    font-size: 0.85rem;
}

.ec2-action-facts dt {
    font-weight: normal;
    color: var(--text-tertiary);
}

.ec2-action-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.ec2-action-list {
    margin: 0 0 0.75rem;
    padding-left: 1.3rem;
    font-size: 0.85rem;
}

.ec2-action-list li + li {
    margin-top: 0.3rem;
}

.ec2-action-confirm {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-normal);
    font-size: 0.85rem;
}

.ec2-action-word {
    font-weight: var(--font-weight-strong);
}

.ec2-action-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.ec2-action-row .form-control {
    max-width: 22rem;
}

.ec2-action-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ec2-action-hint {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* An instance whose state allows no action shows no actions. */
.ec2-instance-ops:not(:has(.ec2-op)) {
    display: none;
}

/* Apply's spinner shows only while the apply runs: htmx puts
   .htmx-request on the form for the request. The form in the selector
   outranks Bootstrap's .spinner-border, which also sets display. */
.ec2-action-confirm .ec2-action-spinner {
    display: none;
}

.ec2-action-confirm.htmx-request .ec2-action-spinner {
    display: inline-block;
}

/* ---- Phones ------------------------------------------------------------- */

@media (max-width: 767px) {
    /* The header's buttons: icons only, on one row. Each label is a bare
       text node, hidden by font-size 0 and still read by screen readers. */
    .ec2-head-actions,
    .ec2-links {
        flex-wrap: nowrap;
        gap: 0.35rem;
    }

    .ec2-head-actions .btn {
        font-size: 0;
        letter-spacing: 0;
        word-spacing: 0;
        padding: 0.35rem 0.55rem;
    }

    .ec2-head-actions .btn > i,
    .ec2-head-actions .btn > svg {
        font-size: 0.85rem;
        margin: 0 !important;
    }

    /* History's count sits on the button's corner, so the button is the
       same size as the others. */
    .ec2-head-actions .btn {
        position: relative;
    }

    .ec2-head-actions .btn .ec2-count {
        position: absolute;
        top: -0.45rem;
        right: -0.4rem;
        margin: 0;
        padding: 0 0.3rem;
        border-radius: 999px;
        font-size: 0.62rem;
        line-height: 1.4;
        opacity: 1;
        color: var(--text-primary);
        background: var(--surface-2);
        border: 1px solid var(--border-normal);
    }

    /* The topology on a phone: the same layout, every node shrunk to a
       label. An instance is a badge of its health dot, name and private IP; a
       tap opens its modal, which holds the details, links and actions. */
    .ec2-diagram {
        min-width: 600px;
        gap: 2rem;
        padding: 1rem 0.75rem;
    }

    /* The top padding keeps a frame's tag clear of the tag inside it. */
    .ec2-frame {
        padding: 2rem 0.6rem 0.6rem;
        border-radius: 8px;
    }

    .ec2-frame-vpc,
    .ec2-frame-az {
        gap: 1.6rem;
    }

    .ec2-frame-vpc > .ec2-frame-label {
        left: 1.25rem;
    }

    .ec2-frame-label {
        top: -0.55rem;
        left: 0.5rem;
        gap: 0.3rem;
        padding: 0.1rem 0.4rem;
        font-size: 0.56rem;
    }

    .ec2-frame-detail {
        padding-left: 0.3rem;
    }

    .ec2-frame-detail.is-mono,
    .ec2-az-badge {
        font-size: 0.54rem;
    }

    .ec2-internet-icon {
        width: 1.3rem;
        height: 1.3rem;
        font-size: 0.7rem;
    }

    /* The internet is its globe; its line's label names the traffic. */
    .ec2-internet {
        margin-left: 9rem;
        padding: 0.2rem;
    }

    .ec2-internet-list {
        display: none;
    }

    .ec2-az-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.75rem;
    }

    .ec2-cell-signal,
    .ec2-cell-calls,
    .ec2-cell-ai {
        gap: 1.75rem;
    }

    .ec2-edge-label {
        padding: 0 0.3rem;
        font-size: 0.52rem;
    }

    /* Groups: a title line and the instances. */
    .ec2-group {
        border-radius: 7px;
    }

    .ec2-group-head {
        gap: 0.35rem;
        padding: 0.35rem 0.4rem 0.2rem;
    }

    .ec2-group-icon {
        width: 1.2rem;
        height: 1.2rem;
        border-radius: 4px;
        font-size: 0.6rem;
    }

    .ec2-group-title h3 {
        font-size: 0.68rem;
    }

    .ec2-group-title span,
    .ec2-group-asg {
        display: none;
    }

    .ec2-group-tools {
        gap: 0.25rem;
    }

    .ec2-group-health {
        padding: 0 0.3rem;
        font-size: 0.56rem;
    }

    .ec2-group-instances,
    .ec2-cell-calls .ec2-group-instances {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem;
        padding: 0.3rem;
    }

    .ec2-group-head .ec2-op-icon,
    .ec2-endpoint-head .ec2-op-icon {
        width: 1.2rem;
        height: 1.2rem;
        border-radius: 4px;
        font-size: 0.55rem;
    }

    .ec2-group-head .ec2-group-history {
        width: 1.2rem;
        height: 1.2rem;
        border-radius: 4px;
        font-size: 0.55rem;
    }

    .ec2-group-head .ec2-group-history.has-dead {
        width: auto;
        padding: 0 0.25rem;
    }

    .ec2-group-empty {
        padding: 0.25rem;
        border-radius: 5px;
        font-size: 0.56rem;
    }

    .ec2-off-az-groups {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.6rem;
    }

    .ec2-srv {
        gap: 0;
        padding: 0.2rem 0.35rem;
        border-radius: 5px;
    }

    .ec2-srv-head {
        flex-wrap: wrap;
        align-items: center;
        gap: 0 0.3rem;
    }

    .ec2-srv-head > .ec2-dot {
        margin-top: 0;
    }

    .ec2-srv-name {
        font-size: 0.6rem;
        line-height: 1.25;
        white-space: nowrap;
    }

    .ec2-srv-ip {
        display: block;
        flex-basis: 100%;
        padding-left: 0.85rem;
        font-family: var(--ec2-mono);
        font-size: 0.56rem;
        color: var(--text-tertiary);
    }

    .ec2-srv-uptime,
    .ec2-srv-head > .ec2-state,
    .ec2-srv-tags,
    .ec2-srv-facts,
    .ec2-srv-note,
    .ec2-srv-load,
    .ec2-srv .ec2-alarms,
    .ec2-srv-foot {
        display: none;
    }

    /* Endpoints: the name and its EIP. */
    .ec2-endpoint {
        padding: 0.35rem 0.45rem;
        border-radius: 7px;
    }

    .ec2-endpoint-head {
        gap: 0.3rem;
    }

    .ec2-endpoint-icon {
        width: 1.2rem;
        height: 1.2rem;
        font-size: 0.6rem;
    }

    .ec2-endpoint-name {
        font-size: 0.6rem;
    }

    .ec2-endpoint-eip {
        margin-top: 0.15rem;
        font-size: 0.7rem;
    }

    .ec2-endpoint-row {
        display: none;
    }

    /* Services: icon and title. */
    .ec2-service {
        gap: 0.35rem;
        padding: 0.3rem 0.4rem;
        border-radius: 7px;
    }

    .ec2-service-icon {
        width: 1.2rem;
        height: 1.2rem;
        border-radius: 4px;
        font-size: 0.6rem;
    }

    .ec2-service-title {
        font-size: 0.62rem;
    }

    .ec2-service-sub {
        display: none;
    }

    .ec2-regional {
        gap: 0.4rem;
    }

    .ec2-switch {
        top: 0.3rem;
        right: 0.4rem;
        font-size: 0.6rem;
    }

    /* An alarm on a phone: its state, caret and age on the first line,
       then its name and description across the width. The list's header
       row names no columns here. */
    .ec2-alarm-row {
        grid-template-columns: 0.7rem auto minmax(0, 1fr);
        grid-template-areas:
            "caret state since"
            "what what what";
        gap: 0.4rem 0.6rem;
        padding: 0.65rem 1rem;
    }

    .ec2-alarm-row.ec2-alarm-head {
        display: none;
    }

    .ec2-alarm-caret { grid-area: caret; }
    .ec2-alarm-state { grid-area: state; }
    .ec2-alarm-what { grid-area: what; }

    .ec2-alarm-since {
        grid-area: since;
        padding-left: 0;
    }

    .ec2-alarm-name {
        flex-wrap: wrap;
        overflow-wrap: anywhere;
    }

    /* The console link drops under the reason. */
    .ec2-alarm-body {
        flex-wrap: wrap;
        padding: 0 1rem 0.75rem;
    }
}
