/* The status page. The header, title, cards, pills, callouts and pill links come from styles.css. */
html { scroll-behavior: smooth; }

:where(.status .page-main) p { margin: 0; }
.status button, .status summary { cursor: pointer; }

.title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.25rem 0 1.5rem; }
.title-row .page-title { margin: 0; }

.refresh { flex: none; padding: 0.3rem 1.1rem; box-shadow: 4px 4px 0 var(--ink); }
.refresh:hover { transform: none; }
.refresh svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.refresh.is-loading { cursor: progress; }
.refresh.is-loading svg { animation: refresh-spin 0.8s linear infinite; }

/* A drawn dot between label parts, a little heavier than the · character. */
.sep { display: inline-block; width: 0.32em; height: 0.32em; margin: 0 0.45em; border-radius: 50%; background: currentColor; vertical-align: 0.18em; }
.empty { padding: 0.75rem; font-weight: 700; opacity: 0.75; }

/* Overall status: a symbol, a title and Howie, over a bar with freshness and the moderation mode. */
.overview { position: relative; padding: 0; overflow: hidden; background: var(--green); animation: enter 0.4s ease-out both; transition: background 0.2s; }
.overview-main { min-height: 8rem; display: flex; align-items: center; gap: 1rem; padding: 1.5rem 10rem 1.5rem 1.5rem; }
/* The symbol is a large .mark (styles.css); only the outage and paused looks are particular to this page. */
/* The overall heading is plain ink, not the pink card heading. */
.overview h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.15; color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; }
.overview-copy p { font-size: 1.05rem; margin-top: 0.25rem; }
.overview-copy p:empty { display: none; }
.status-mascot {
  position: absolute;
  top: 0.75rem;
  right: 1.5rem;
  width: 120px;
  height: 120px;
  filter: drop-shadow(5px 5px 0 var(--ink));
  animation: wobble 2.6s ease-in-out infinite;
}
.overview-meta { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 1.5rem; font-size: 0.9rem; font-weight: 700; background: rgba(255, 255, 255, 0.55); border-top: 3px solid var(--ink); }
.freshness { display: inline-flex; align-items: center; gap: 0.5rem; }
.dot { flex: none; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); }
.overview:not([data-state="operational"]) .dot { background: var(--ink); }
.overview[data-state="degraded"] { background: var(--yellow); }
.overview[data-state="outage"] { background: var(--pink-soft); }
.overview[data-state="outage"] .status-symbol { color: #fff; background: var(--red); }
.overview[data-state="paused"],
.overview[data-state="maintenance"] { background: var(--cyan); }
.overview[data-state="paused"] .status-symbol { font-size: 1.1rem; letter-spacing: -0.1em; }
.overview[data-state="unknown"],
.overview[data-state="loading"] { background: var(--grey); }
.overview[data-state="unknown"] .dot,
.overview[data-state="loading"] .dot { background: #999; }

/* Open incidents and maintenance: callouts (styles.css) under the overview, with a link to the update. */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -0.5rem 0 1.75rem;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-0.5deg);
}
.banner + .banner { margin-top: -0.75rem; }
.banner p { margin-top: 0.2rem; }
.banner .pill-link { flex: none; white-space: nowrap; }
.banner.info .pill-link:hover { background: var(--yellow); }

/* At a glance: the brand guide's swatch cards. */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0; }
.metrics > div { background: var(--soft); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); padding: 0.6rem 0.9rem 0.5rem; }
.metrics > div:nth-child(1) { background: #e8f8ff; }
.metrics > div:nth-child(2) { background: #ffe6f6; }
.metrics > div:nth-child(3) { background: #e2ffee; }
.metrics dt { font-size: 0.95rem; font-weight: 700; }
.metrics dt .pill { margin-left: 0.25rem; vertical-align: 1px; }
.metrics dd { margin: 0.2rem 0 0; font-size: 2.4rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metrics small { font-size: 1rem; }
.activity > .quiet { margin-top: 1rem; }

/* Service health: a black header bar over expandable rows. */
.service-columns,
.service summary { display: grid; grid-template-columns: 1.2fr 1.8fr 0.55fr 0.95fr 1rem; gap: 1.25rem; align-items: center; }
.service-columns { margin-bottom: 0.25rem; padding: 0.35rem 0.75rem; font-size: 0.85rem; font-weight: 700; color: var(--yellow); background: var(--ink); border-radius: 10px; }
.service-columns span:nth-child(3),
.service-columns span:nth-child(4) { text-align: right; }
.service,
.incident { border-bottom: 2px solid #eee; }
.service:last-child,
.incident:last-child { border-bottom: 0; }
.status summary { list-style: none; }
.status summary::-webkit-details-marker { display: none; }
.service summary { padding: 0.8rem 0.75rem; border-radius: 10px; }
.service summary:hover,
.incident summary:hover { background: var(--soft); }
.service-name { font-weight: 700; }
.history { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; min-width: 0; padding: 2px; background: #fff; border: 2px solid var(--ink); border-radius: 8px; }
.history span { height: 1.5rem; background: var(--green); border-radius: 3px; transition: transform 0.1s; }
.history span:hover { transform: scaleY(1.2); }
.history .degraded, .key.degraded { background: var(--yellow); }
.history .outage, .key.outage { background: var(--red); }
.history .maintenance, .key.maintenance { background: var(--cyan); }
.history .unknown, .key.unknown { background: var(--grey); }
.service-uptime { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Status pills (styles.css .pill), coloured by status.js. */
.service-state,
.incident-tag { justify-self: end; }

.chevron { justify-self: end; font-size: 1.4rem; font-weight: 700; line-height: 1; transition: transform 0.2s; }
details[open] > summary .chevron { transform: rotate(90deg); }
.service-description { max-width: 50rem; padding: 0 0.75rem 0.9rem; animation: enter 0.18s ease-out; }

.history-key { display: flex; justify-content: space-between; gap: 0.75rem; padding-top: 0.75rem; font-size: 0.9rem; font-weight: 700; }
/* The range keeps its line; the five-item legend wraps instead. */
.history-range { flex: none; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem 1rem; }
.legend > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.key { display: inline-block; width: 0.9rem; height: 0.9rem; background: var(--green); border: 1.5px solid var(--ink); border-radius: 3px; }

/* Detection speed */
.speed .card-head { align-items: flex-start; }
.speed .card-head .quiet { max-width: 36rem; margin-top: 0.35rem; }
.range-switch { display: flex; flex: none; gap: 0.4rem; }
/* The range buttons are shared pill links (styles.css); the chosen one is yellow. */
.speed-body { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 2rem; align-items: center; padding-top: 0.25rem; }
.speed-values { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.speed-values > div { display: flex; flex-direction: column; align-items: flex-start; }
.speed-values strong { margin: 0.35rem 0 0.25rem; font-size: 2.2rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.speed-values small { font-size: 1rem; }
.speed-values > div > span:last-child { font-size: 0.85rem; opacity: 0.75; }
.chart { margin: 0; min-width: 0; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart-grid path { fill: none; stroke: #ddd; stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart text { font-family: var(--font); font-size: 11px; font-weight: 700; fill: var(--ink); }
.chart-area { fill: rgba(79, 211, 255, 0.25); }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-p95 { fill: none; stroke: var(--pink); stroke-width: 2.5; stroke-dasharray: 6 5; stroke-linejoin: round; stroke-linecap: round; }
.chart-dots circle { fill: var(--blue); stroke: #fff; stroke-width: 1.5; }
.chart-dots .p95 { fill: var(--pink); }
.chart.changed .chart-line { animation: chart-reveal 0.35s ease-out; }
.chart figcaption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; font-size: 0.85rem; font-weight: 700; }
.chart-legend { display: flex; align-items: center; gap: 0.4rem; }
.chart-legend i { display: inline-block; width: 1.1rem; height: 4px; border-radius: 2px; background: var(--blue); }
.chart-legend .p95-key { margin-left: 0.6rem; background: var(--pink); }
.real-scams { margin-top: 0.75rem; }

/* Incidents: each one opens to its timeline of updates. */
.incidents { scroll-margin-top: 1rem; }
.incident summary { display: flex; align-items: center; gap: 1rem; padding: 0.75rem; border-radius: 10px; }
.incident time { flex: none; width: 5.5rem; font-size: 0.9rem; font-weight: 700; opacity: 0.75; }
.incident-title { flex: 1; font-weight: 700; }
.incident-body { margin: 0; padding: 0 0.75rem 0.9rem 7.25rem; list-style: none; animation: enter 0.2s ease-out; }
.incident-body li + li { margin-top: 0.4rem; }

/* The incidents card keeps its range pill and its link to /status/history together. */
.head-pills { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }

/* /status/history: an intro, then one incidents card per month. */
.back-link { flex: none; }
.back-link .arrow { margin-right: 0.5em; }
.history-intro { max-width: 46rem; margin: -0.75rem 0 1.75rem; }

/* Troubleshooting: a blue callout (styles.css) with the site's tilted .blue-btn. */
.help { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 0.9rem 1.25rem; }
.help strong { font-size: 1.15rem; }
.help p { margin-top: 0.15rem; }
.help .blue-btn { flex: none; margin: 0; }

/* Definitions: an expandable section (styles.css .toggle) holding a bulleted list. */
.definitions { padding: 0.75rem 1rem; }
.definitions summary { font-size: 1.05rem; }
.definitions ul { max-width: 50rem; margin: 0.75rem 0 0.25rem; padding-left: 2.2rem; }
.definitions li + li { margin-top: 0.5rem; }

.noscript { max-width: 72rem; margin: 0 auto 1rem; padding: 0 1rem; font-weight: 700; text-align: center; }

@keyframes refresh-spin { to { transform: rotate(360deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes chart-reveal { from { opacity: 0.25; } to { opacity: 1; } }

@media (max-width: 900px) {
  .service-columns,
  .service summary { grid-template-columns: 1.2fr 1.5fr 0.6fr 0.95fr 1rem; gap: 0.75rem; }
  .speed-body { grid-template-columns: 15rem minmax(0, 1fr); gap: 1.25rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .overview { padding: 0; }
  .overview-main { align-items: flex-start; gap: 0.75rem; padding: 1.1rem 5.5rem 1.1rem 1rem; }
  .overview-copy p { font-size: 0.95rem; }
  .status-mascot { top: 1rem; right: 0.9rem; width: 70px; height: 70px; }
  .overview-meta { flex-wrap: wrap; padding: 0.5rem 1rem; font-size: 0.85rem; }
  .banner { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .card-head { gap: 0.5rem; }
  .metrics { gap: 0.75rem; }
  .metrics > div { padding: 0.5rem 0.7rem; }
  .metrics dt { font-size: 0.85rem; }
  .metrics dd { font-size: 1.9rem; }
  .service-columns { display: none; }
  .service summary { grid-template-columns: minmax(0, 1fr) auto 1rem; gap: 0.5rem; padding: 0.75rem 0.25rem; }
  .service-name { grid-column: 1; grid-row: 1; }
  .service-state { grid-column: 2; grid-row: 1; }
  .service .chevron { grid-column: 3; grid-row: 1; }
  .service .history { grid-column: 1 / 4; grid-row: 2; }
  .history span { height: 1.3rem; }
  .service-uptime { grid-column: 1 / 4; grid-row: 3; justify-self: start; font-size: 0.85rem; }
  .service-uptime .visually-hidden { position: static; width: auto; height: auto; clip-path: none; font-weight: 400; }
  .service-description { padding: 0 0.25rem 0.8rem; }
  .history-key { flex-direction: column; }
  .legend { justify-content: flex-start; }
  .speed-body { grid-template-columns: 1fr; gap: 1rem; }
  .speed-values strong { font-size: 1.9rem; }
  .incident summary { flex-wrap: wrap; gap: 0.35rem 0.6rem; padding: 0.7rem 0.25rem; }
  .incident time { width: auto; }
  .incident-title { order: 3; flex-basis: calc(100% - 2rem); }
  .incident .chevron { order: 4; }
  .incident-body { padding: 0 0.25rem 0.8rem; }
  .help { flex-direction: column; align-items: flex-start; gap: 0.9rem; }
}

@media (max-width: 360px) {
  .overview-main { padding-right: 4.5rem; }
  .status-mascot { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status-mascot { animation: wobble-gentle 6s ease-in-out infinite; }
  .overview, .service-description, .incident-body, .chart.changed .chart-line, .refresh.is-loading svg { animation: none; }
  /* Without the spin, a dimmed icon shows the reload is running. */
  .refresh.is-loading svg { opacity: 0.35; }
  .overview, .history span, .chevron { transition: none; }
  .history span:hover { transform: none; }
}

/* The backup status page (status.js renderBackup), framed while our own status data can't be reached. */
.backup iframe { display: block; width: 100%; height: 42rem; margin-top: 0.75rem; border: 3px solid var(--ink); border-radius: 12px; background: #fff; }
.status-failed :is(#banners, .activity, .services, .speed, #incidents) { display: none; }
