/* Status page styles — self-contained tokens. */

:root {
    --s-bg:        #0c0b12;
    --s-surface:   #14121d;
    --s-surface-2: #1c1a27;
    --s-text:      #f4f2fb;
    --s-text-2:    #a6a2b4;
    --s-text-3:    #6f6b7e;
    --s-border:    #221f2e;
    --s-border-2:  #2e2b3b;
    --s-accent:    #a675ff;
}

/* Public wrap. Dashboard uses .dashboard-main which supplies its own width. */
.s-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
    color: var(--s-text);
}
.s-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
    color: var(--s-text);
}
.s-sub {
    color: var(--s-text-2);
    font-size: 0.98rem;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

/* ── Platform toggle ─────────────────────────────────────────── */
.s-toggle {
    display: inline-flex;
    padding: 4px;
    background: var(--s-surface);
    border: 1px solid var(--s-border);
    border-radius: 10px;
    margin-bottom: 1.25rem;
}
.s-tog {
    background: transparent;
    border: none;
    color: var(--s-text-2);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.5rem 0.95rem;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: color 0.15s, background 0.15s;
    font-family: inherit;
}
.s-tog:hover { color: var(--s-text); }
.s-tog.active {
    background: var(--s-surface-2);
    color: var(--s-text);
}
.s-tog svg { opacity: 0.75; }
.s-tog.active svg { opacity: 1; }

/* ── Summary banner (only rendered when SOMETHING is off) ─────── */
.s-summary {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.s-summary::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: currentColor;
}
.s-summary.bad { background: rgba(239,68,68,0.06);  border-color: rgba(239,68,68,0.22);  color: #fca5a5; }

/* ── Section (stacked vertically) ─────────────────────────────── */
.s-section {
    background: var(--s-surface);
    border: 1px solid var(--s-border);
    border-radius: 12px;
    padding: 1.15rem 1.25rem 1.1rem;
    margin-bottom: 1rem;
}
.s-section:last-child { margin-bottom: 0; }

.s-s-hdr {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.15rem;
}
.s-s-label {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--s-text);
    margin: 0;
    letter-spacing: -0.005em;
    line-height: 1.3;
}
.s-s-req {
    /* kept as class in case a section adds a requires note again */
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--s-accent);
    padding: 0.15rem 0.5rem;
    background: color-mix(in srgb, var(--s-accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--s-accent) 28%, transparent);
    border-radius: 999px;
    white-space: nowrap;
}
.s-s-note {
    font-size: 0.83rem;
    color: var(--s-text-2);
    margin: 0 0 0.75rem;
    line-height: 1.4;
    font-style: italic;
}

/* Items flow as a responsive grid: as many columns as fit at min-tile-width.
   Wide screens: 3-4 across. Narrower: 2. Under ~500px: 1. Cards use a
   min-height so every tile in the grid ends up visually the same size
   regardless of which row it lands in. */
.s-i-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.6rem;
    margin-top: 0.9rem;   /* padding between section header and the tiles */
}

/* ── Item card ───────────────────────────────────────────────── */
/* Card stacks CENTERED: name / version / pill / (optional note).
   Every card is same height (grid-auto-rows: 1fr + align-self: stretch).
   Padding tuned to feel elegant with three lines of centered content. */
.s-item {
    background: var(--s-surface-2);
    border: 1px solid var(--s-border);
    border-radius: 10px;
    /* Extra top padding pushes the centered name+version down so the
       corner status dot has breathing room above the title. */
    padding: 1.6rem 1rem 1rem;
    transition: border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.25rem;
    min-height: 100px;
    position: relative;  /* anchor for the top-right status dot */
}
.s-item:hover { border-color: var(--s-border-2); }

.s-i-name {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--s-text);
    line-height: 1.3;
    /* NO ellipsis / truncation -- full text wraps to next line as needed. */
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}
.s-i-ver {
    color: var(--s-text-3);
    font-weight: 400;
    font-size: 0.78rem;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    line-height: 1.3;
    word-break: break-word;
    max-width: 100%;
}

/* ── Status indicator: absolute top-right corner of the card.
      A colored dot + short label (hidden visually on 'Operational' since
      the dot alone reads clearly; broken/degraded/etc. keep the label so
      an anomaly is immediately readable). */
.s-i-pill {
    position: absolute;
    top: 0.55rem;
    right: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--s-text-2);
    white-space: nowrap;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    text-transform: uppercase;
}
.s-i-pill::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tone);
    box-shadow: 0 0 8px 0 color-mix(in srgb, var(--tone) 55%, transparent);
    flex-shrink: 0;
}

/* Solution Coming Soon: bigger orange glow that pulses so it draws the eye. */
.s-i-pill.s-op-solution_coming_soon::before {
    box-shadow: 0 0 12px 2px color-mix(in srgb, var(--tone) 70%, transparent),
                0 0 24px 4px color-mix(in srgb, var(--tone) 30%, transparent);
    animation: s-pulse 1.8s ease-in-out infinite;
}
@keyframes s-pulse {
    0%, 100% { box-shadow: 0 0 12px 2px color-mix(in srgb, var(--tone) 70%, transparent),
                            0 0 24px 4px color-mix(in srgb, var(--tone) 30%, transparent); }
    50%      { box-shadow: 0 0 16px 3px color-mix(in srgb, var(--tone) 90%, transparent),
                            0 0 32px 6px color-mix(in srgb, var(--tone) 45%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
    .s-i-pill.s-op-solution_coming_soon::before { animation: none; }
}

/* ── Cards with an update note: clickable → modal ─────────────── */
.s-item.has-note {
    cursor: pointer;
    /* Padding matches non-has-note tiles so the centered name+version sit at
       the exact same y-coord as neighbouring cards. Cue floats absolutely in
       the bottom padding area below the version. */
}
.s-item.has-note:hover {
    background: color-mix(in srgb, var(--s-surface-2) 92%, var(--s-accent));
    border-color: color-mix(in srgb, var(--s-border) 60%, var(--s-accent));
    transform: translateY(-1px);
}
.s-item.has-note:focus-visible {
    outline: 2px solid var(--s-accent);
    outline-offset: 2px;
}
/* Cue absolute-positioned near the bottom edge -- lives in the natural
   bottom-padding of the tile, doesn't push the centered content up.  */
.s-i-cue {
    position: absolute;
    bottom: 0.55rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--s-accent);
    letter-spacing: 0.02em;
    opacity: 0.85;
    margin: 0;
    line-height: 1.2;
}
.s-item { transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease; }

/* ── Modal (opened by clicking a has-note card) ────────────────── */
.s-modal {
    position: fixed; inset: 0;
    background: rgba(6, 5, 12, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    animation: s-fade 0.15s ease-out;
}
.s-modal.open { display: flex; }
@keyframes s-fade { from { opacity: 0; } to { opacity: 1; } }
.s-modal-card {
    background: var(--s-surface);
    border: 1px solid var(--s-border-2);
    border-radius: 14px;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.75rem 1.75rem 1.5rem;
    box-shadow: 0 24px 60px -20px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.02);
    animation: s-rise 0.2s ease-out;
}
@keyframes s-rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.s-modal-hdr { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.35rem; }
.s-modal-title { font-size: 1.15rem; font-weight: 700; color: var(--s-text); margin: 0; letter-spacing: -0.01em; line-height: 1.3; }
.s-modal-close {
    background: transparent; border: none; color: var(--s-text-3); cursor: pointer;
    padding: 0.25rem 0.5rem; font-size: 1.25rem; line-height: 1; border-radius: 6px;
    margin: -0.25rem -0.5rem 0 0; font-family: inherit;
    transition: color 0.15s, background 0.15s;
}
.s-modal-close:hover { color: var(--s-text); background: var(--s-surface-2); }
.s-modal-meta {
    display: flex; align-items: center; gap: 0.7rem;
    margin: 0.15rem 0 1.1rem;
    color: var(--s-text-2);
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.s-modal-meta .s-i-pill { position: static; font-size: 0.72rem; }
.s-modal-ver { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.8rem; color: var(--s-text-3); }
.s-modal-body {
    color: var(--s-text); font-size: 0.93rem; line-height: 1.6;
    border-top: 1px solid var(--s-border);
    padding-top: 1.1rem;
}
.s-modal-body p { margin: 0 0 0.75rem; }
.s-modal-body p:last-child { margin-bottom: 0; }
.s-modal-body ul { margin: 0 0 0.75rem; padding-left: 1.25rem; }
.s-modal-body li { margin-bottom: 0.35rem; }
.s-modal-body strong { color: var(--s-text); font-weight: 700; }
.s-modal-body em { color: var(--s-text); font-style: italic; }


.s-i-note {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: var(--s-text-2);
    padding: 0.4rem 0.55rem;
    background: var(--s-surface);
    border-left: 3px solid var(--s-border-2);
    border-radius: 4px;
    line-height: 1.4;
}

.s-loading, .s-error, .s-empty, .s-empty-big {
    padding: 1.75rem 1rem;
    text-align: center;
    color: var(--s-text-3);
    background: var(--s-surface);
    border: 1px solid var(--s-border);
    border-radius: 10px;
    font-size: 0.9rem;
}
.s-empty { padding: 0.85rem; font-size: 0.85rem; }
.s-error { color: #fca5a5; }
