/* ==========================================================================
   Platform Status (/status)
   The page's own parts on top of the shared Toybox Calm look (assets/css/toybox-calm.css, loaded first by
   _ToyboxCalmHead): the live counts in the header, the overall banner, the affected services, the legend, the group
   panels with their 90-day uptime bars, the "data unavailable" state and the day bars' tooltip. Every class starts
   with pss-. Views/Public/Status.cshtml links it in its FinalHeader section with a ?v= cache buster from
   StaticAssetVersion; Scripts/platform-status/platform-status.js rebuilds the same markup on every refresh.
   The bar, dot and swatch colours are set inline from StatusStyles (Models/StatusPageModel.cs); the pills, banner and
   tiles use the family's soft fills in the same hues.
   ========================================================================== */

/* ---------- The live counts in the header ---------- */
.pss-stat { gap: 7px; }
.pss-stat__n { font-variant-numeric: tabular-nums; }
.pss-stat__dot { flex: none; width: 12px; height: 12px; border: 2px solid var(--tc-ink); border-radius: 50%; background: var(--d, #dee2e6); }
.pss-stat__dot--operational { --d: #28a745; }
.pss-stat__dot--degraded { --d: #ffc107; }
.pss-stat__dot--outage { --d: #dc3545; }
/* Stacked beside the title on wide screens: one width, so they read as a list */
@media (min-width: 1200px) { .tc-root .pss-stats { align-items: stretch; } }

/* ---------- The board ---------- */
.pss-content { min-width: 0; }

/* The overall banner: a status tile, the verdict and its message, and when the monitor last checked */
.pss-banner { --st: #D9E1EE; --st-bg: #fff; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px 16px; padding: 18px 16px; background: var(--st-bg); border: 3px solid var(--tc-ink); border-radius: 24px; box-shadow: var(--tc-drop-lg), 0 30px 60px -24px rgba(33, 28, 90, .4); }
@media (min-width: 768px) { .pss-banner { grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 24px; padding: 24px 28px; border-radius: 28px; } }
.pss-banner--operational { --st: var(--tc-green); --st-bg: var(--tc-mint); }
.pss-banner--degraded { --st: var(--tc-yellow); --st-bg: var(--tc-butter); }
.pss-banner--outage { --st: #FF6B6B; --st-bg: var(--tc-blush); }
.pss-banner--unknown { --st: #D9E1EE; --st-bg: #fff; }
.pss-banner__icon { display: grid; place-items: center; width: 52px; height: 52px; border: 3px solid var(--tc-ink); border-radius: 16px; background-color: var(--st); background-image: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 55%); box-shadow: 0 4px 0 var(--tc-ink); font-size: 1.9rem; color: var(--tc-ink); }
@media (min-width: 768px) { .pss-banner__icon { width: 64px; height: 64px; border-radius: 20px; font-size: 2.3rem; } }
.pss-banner__body { min-width: 0; }
.tc-root .pss-banner__title { margin: 0; font: 700 clamp(1.45rem, 1.15rem + 1.2vw, 2.15rem)/1.12 var(--tc-display); color: var(--tc-ink); text-wrap: balance; }
.pss-banner__message { margin: 4px 0 0; font-weight: 600; color: var(--tc-ink-2); }
.pss-banner__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding-top: 12px; border-top: 2px dashed rgba(47, 42, 79, .3); }
@media (min-width: 768px) { .pss-banner__meta { grid-column: auto; flex-direction: column; align-items: flex-end; gap: 4px; padding: 4px 0 4px 24px; border-top: 0; border-left: 2px dashed rgba(47, 42, 79, .3); text-align: right; } }
.pss-banner__label { font: 700 .75rem/1.2 var(--tc-display); letter-spacing: .08em; text-transform: uppercase; color: var(--tc-muted); }
.pss-banner__time { font: 600 1rem/1.35 var(--tc-display); color: var(--tc-ink); }

/* The services that are degraded or down right now */
.pss-affected { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; padding: 14px 16px; background: #fff; border: 3px solid var(--tc-ink); border-radius: 18px; box-shadow: 0 4px 0 var(--tc-ink); }
.pss-affected__label { margin-right: 4px; font: 700 1.0625rem/1.3 var(--tc-display); color: var(--tc-ink); }
.pss-affected .pss-pill { white-space: normal; }

/* Status pills: soft fills, ink text */
.pss-pill { --p: #EEF0F6; display: inline-flex; align-items: center; padding: 2px 10px 1px; border: 2px solid var(--tc-ink); border-radius: 999px; background: var(--p); font: 700 .8125rem/1.35 var(--tc-display); color: var(--tc-ink); white-space: nowrap; }
.pss-pill--operational { --p: var(--tc-mint); }
.pss-pill--degraded { --p: var(--tc-butter); }
.pss-pill--outage { --p: var(--tc-blush); }
.pss-pill--unknown { --p: #EEF0F6; }

.pss-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 28px 0 16px; }
.pss-legend li { display: inline-flex; align-items: center; gap: 7px; font: 600 .9375rem/1.2 var(--tc-display); color: var(--tc-ink-2); }
.pss-legend__swatch { flex: none; width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(47, 42, 79, .25); }

/* ---------- The group panels ---------- */
.pss-groups { display: grid; gap: 24px; }
@media (min-width: 1200px) { .pss-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pss-group { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 3px solid var(--tc-ink); border-radius: var(--tc-r); box-shadow: var(--tc-drop); }
.pss-group__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 16px 14px 14px; background: var(--tc-sky-0); border-bottom: 3px solid var(--tc-ink); border-radius: 19px 19px 0 0; }
@media (min-width: 768px) { .pss-group__head { padding: 18px 24px 16px; } }
.tc-root .pss-group__title { margin: 0; font: 700 clamp(1.35rem, 1.2rem + .6vw, 1.625rem)/1.2 var(--tc-display); color: var(--tc-ink); }
.pss-group__summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pss-group__count { font-size: .9375rem; font-weight: 600; color: var(--tc-muted); }
.pss-components { padding: 2px 14px 6px; }
@media (min-width: 768px) { .pss-components { padding: 4px 24px 10px; } }
.pss-component { padding: 16px 0 14px; }
.pss-component + .pss-component { border-top: 2px solid var(--tc-line); }
.pss-component__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
/* On phones the pill always sits under the name, whatever the name's length, so the rows line up */
@media (max-width: 575.98px) { .pss-component__head { flex-direction: column; align-items: flex-start; } }
.pss-component__name { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font: 600 1.0625rem/1.3 var(--tc-display); color: var(--tc-ink); }
.pss-dot { flex: none; width: 12px; height: 12px; border: 2px solid var(--tc-ink); border-radius: 50%; }

/* The 90 day bars, oldest first. They shrink to fit (no minimum width), so every day, today's included, stays inside
   the panel down to 320px */
.pss-bars { display: flex; align-items: stretch; gap: 2px; height: 38px; }
.pss-bar { flex: 1 1 0; min-width: 0; border-radius: 2px; opacity: .9; transition: opacity .15s ease, transform .15s ease; }
.pss-bar:hover { opacity: 1; transform: scaleY(1.08); }
@media (max-width: 575.98px) { .pss-bars { gap: 1px; height: 34px; } .pss-bar { border-radius: 1px; } }
.pss-component__foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: .8125rem; font-weight: 600; line-height: 1.4; color: var(--tc-muted); }
.pss-uptime { color: var(--tc-ink); }

/* No snapshot to show */
.pss-empty { display: flex; flex-direction: column; align-items: center; padding: 40px 20px; text-align: center; background: rgba(255, 255, 255, .8); border: 2px dashed rgba(47, 42, 79, .4); border-radius: 24px; }
.pss-empty__icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border: 3px solid var(--tc-ink); border-radius: 18px; background-color: var(--tc-sky-2); box-shadow: 0 4px 0 var(--tc-ink); font-size: 1.8rem; color: var(--tc-ink); }
.tc-root .pss-empty__title { margin: 0 0 6px; font: 700 1.35rem/1.25 var(--tc-display); color: var(--tc-ink); }
.pss-empty__text { margin: 0; color: var(--tc-ink-2); }

/* ---------- Support and related pages ---------- */
.pss-handoff { margin-top: 44px; justify-content: center; text-align: center; }
.tc-root .pss-handoff > p { flex: 0 1 auto; }
.pss-handoff i { margin-right: 8px; font-size: 1.35rem; vertical-align: -4px; color: var(--tc-ink); }
.pss-related { margin-top: 30px; }

/* ---------- The day bars' tooltip ----------
   Appended to <body> by the script, outside .tc-root, so it carries its own colours and fonts */
.pss-tip { position: fixed; top: 0; left: 0; z-index: 1080; transform: translate(-50%, -100%); padding: 8px 12px 9px; background: #2F2A4F; border: 2px solid #0F0C2C; border-radius: 12px; box-shadow: 0 4px 0 #0F0C2C; color: #fff; font: 500 .8125rem/1.45 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; text-align: left; pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity .12s ease; }
.pss-tip--visible { opacity: 1; }
.pss-tip--below { transform: translate(-50%, 0); }
.pss-tip::after { content: ""; position: absolute; left: calc(50% + var(--pss-tip-arrow, 0px)); top: calc(100% + 6px); transform: translateX(-50%); border: 7px solid transparent; border-top-color: #0F0C2C; }
.pss-tip--below::after { top: auto; bottom: calc(100% + 2px); border-top-color: transparent; border-bottom-color: #0F0C2C; }
.pss-tip__date { display: block; font: 700 .875rem/1.3 'Fredoka', 'Fredoka Fallback', 'Segoe UI', system-ui, sans-serif; }
.pss-tip__status { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-weight: 700; }
.pss-tip__dot { flex: none; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; }
.pss-tip__metric { display: block; color: #D7D3F3; }

@media (prefers-reduced-motion: reduce) {
  .pss-bar:hover { transform: none; }
  .pss-tip { transition: none; }
}
@media print {
  .pss-bar, .pss-dot, .pss-stat__dot, .pss-legend__swatch, .pss-pill, .pss-banner, .pss-banner__icon { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .pss-bar:hover { transform: none; }
}
