/* STACKGee system status (status.stackgee.com, or /status/ on the main site).
   Builds on site.css tokens and components. No inline styles anywhere: the
   Content Security Policy forbids them, so every colour and size is a class. */

.status-page { background: #fff; }
.status-container { max-width: 880px; }
.no-js .js-only { display: none !important; }
.icon-flip { transform: scaleX(-1); }

/* ---------- Header ---------- */
.status-top { background: #fff; border-bottom: 1px solid var(--line); }
.status-top-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 20px; min-height: 84px; padding-block: 14px; }
.status-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.status-logo-link { display: inline-flex; flex: none; }
.status-logo { width: auto; height: 42px; }
.status-name { padding-left: 14px; border-left: 1.5px solid var(--line-strong); color: var(--ink); font-weight: 700; font-size: 1.02rem; line-height: 1.3; text-decoration: none; white-space: nowrap; }
.status-name:hover { color: var(--blue-700); }
.status-subscribe-btn .icon { width: 17px; height: 17px; }
.status-top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
@media (max-width: 560px) {
  .status-logo { height: 34px; }
  .status-name { padding-left: 10px; font-size: .94rem; }
  .status-top-actions { width: 100%; }
  .status-top-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Layout and type ---------- */
.status-main { padding-block: clamp(24px, 4vw, 44px) clamp(48px, 7vw, 80px); }
.status-section { margin-top: clamp(32px, 5vw, 48px); }
.status-h1 { font-size: clamp(1.6rem, 1.25rem + 1.3vw, 2.15rem); margin-bottom: 14px; }
.status-h2 { font-size: 1.3rem; margin: 0 0 14px; }
.status-main .breadcrumbs { margin-bottom: 14px; }
.status-card { max-width: 660px; padding: clamp(22px, 3.4vw, 36px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-1); }
.status-card p { color: var(--text); }
.status-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }

/* ---------- Subscribe panel (always visible without JavaScript) ---------- */
.subscribe-panel { margin: 0 0 24px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); scroll-margin-top: 16px; }
.js .subscribe-panel { display: none; }
.js .subscribe-panel.is-open { display: block; }
.sp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sp-title { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 1.08rem; }
.sp-title .icon { color: var(--blue-600); }
.sp-close { display: inline-grid; place-items: center; width: 36px; height: 36px; margin: -6px -8px 0 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.sp-close:hover { background: var(--surface-2); color: var(--ink); }
.sp-close .icon { width: 18px; height: 18px; }
.sp-text { margin: 0 0 14px; font-size: .95rem; color: var(--muted); }
.sp-form .field label { font-size: .9rem; }
.sp-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sp-row input { flex: 1 1 240px; width: auto; min-width: 0; }
.sp-row .btn { flex: none; }
.sp-form .help { margin: 10px 0 0; }
.subscribe-panel .notice { margin-bottom: 14px; }

/* ---------- Banner ---------- */
.status-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 28px; padding: 18px 22px; border-radius: var(--radius-s); background: var(--green-700); color: #fff; box-shadow: var(--shadow-1); }
.sb-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.sb-icon .icon { width: 20px; height: 20px; stroke-width: 2.4; }
.sb-label { flex: 1; margin: 0; font-size: clamp(1.1rem, 1rem + .6vw, 1.38rem); font-weight: 700; line-height: 1.3; }
.sb-time { margin: 0; font-size: .85rem; font-weight: 600; white-space: nowrap; opacity: .92; }
.sb-ok { background: var(--green-700); }
.sb-degraded { background: var(--amber-500); color: var(--ink); }
.sb-degraded .sb-icon { background: rgba(11, 27, 49, .12); }
.sb-partial { background: var(--orange-600); }
.sb-major { background: var(--red-700); }
.sb-maint { background: var(--blue-600); }
.sb-unknown { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.sb-unknown .sb-icon { background: #fff; color: var(--muted); }
@media (max-width: 560px) { .status-banner { flex-wrap: wrap; } .sb-time { width: 100%; padding-left: 50px; } }

/* ---------- Active incidents and maintenance ---------- */
.incident-card { margin: 0 0 20px; overflow: hidden; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-s); background: #fff; box-shadow: var(--shadow-1); }
.ic-head { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ic-title { margin: 0; font-size: 1.1rem; line-height: 1.35; }
.ic-title a { color: inherit; text-decoration: none; }
.ic-title a:hover { text-decoration: underline; }
.ic-meta { margin: 4px 0 0; font-size: .86rem; font-weight: 600; color: var(--muted); }
.ic-minor { border-left-color: var(--amber-500); } .ic-minor .ic-head { background: var(--amber-100); } .ic-minor .ic-title { color: var(--amber-700); }
.ic-major { border-left-color: var(--orange-600); } .ic-major .ic-head { background: var(--orange-100); } .ic-major .ic-title { color: var(--orange-600); }
.ic-critical { border-left-color: var(--red-500); } .ic-critical .ic-head { background: var(--red-100); } .ic-critical .ic-title { color: var(--red-700); }
.ic-maintenance { border-left-color: var(--blue-500); } .ic-maintenance .ic-head { background: var(--blue-50); } .ic-maintenance .ic-title { color: var(--blue-700); }
.ic-none { border-left-color: var(--line-strong); }
.incident-card .updates { padding: 0 18px; }

/* ---------- Updates (cards, entries, incident page) ---------- */
.updates { list-style: none; margin: 0; padding: 0; }
.update { padding: 12px 0; border-top: 1px solid var(--line); }
.update:first-child { border-top: 0; }
.upd-body { margin: 0; color: var(--text); }
.upd-state { color: var(--ink); }
.upd-time { margin: 4px 0 0; font-size: .82rem; font-weight: 600; color: var(--muted); }
.timeline { position: relative; padding-left: 22px; border-left: 2px solid var(--line); }
.timeline .update { position: relative; padding: 0 0 22px; border-top: 0; }
.timeline .update::before { content: ""; position: absolute; left: -30px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--blue-400); }
.timeline .update:first-child::before { border-color: var(--blue-600); background: var(--blue-100); }

/* ---------- Services ---------- */
.uptime-caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.uptime-caption .status-h2 { margin: 0; }
.uptime-caption p { margin: 0; font-size: .9rem; font-weight: 600; color: var(--muted); }
.components { border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; box-shadow: var(--shadow-1); }
.c-group + .c-group, .c-group + .c-ungrouped, .c-ungrouped + .c-group { border-top: 1px solid var(--line); }
.c-group-head { margin: 0; font-size: 1rem; }
.c-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 16px 20px; border: 0; border-radius: 0; background: transparent; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.c-group:first-child .c-toggle { border-radius: var(--radius-s) var(--radius-s) 0 0; }
.c-toggle:hover { background: var(--surface); }
.c-chevron { display: inline-grid; place-items: center; color: var(--muted); }
.c-chevron .icon { width: 18px; height: 18px; transform: rotate(-90deg); transition: transform .2s var(--ease); }
.c-toggle[aria-expanded="true"] .c-chevron .icon { transform: none; }
.no-js .c-chevron { display: none; }
.no-js .c-toggle { cursor: default; }
.c-group-name { flex: 1; min-width: 0; }
.c-count { font-size: .82rem; font-weight: 600; color: var(--muted); }
.c-body { padding: 0 20px; }
.js .c-group:not(.is-open) > .c-body { display: none; }
.c-group .c-body { border-top: 1px solid var(--line); }
.c-row { padding: 16px 0 18px; }
.c-row + .c-row { border-top: 1px solid var(--line); }
.c-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.c-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-size: 1rem; }
.c-link { display: inline-flex; color: var(--muted); border-radius: 4px; }
.c-link:hover { color: var(--blue-600); }
.c-desc { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.st { display: inline-flex; align-items: center; gap: 7px; flex: none; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.st::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.st-ok { color: var(--green-700); }
.st-degraded { color: var(--amber-700); }
.st-partial { color: var(--orange-600); }
.st-major { color: var(--red-700); }
.st-maint { color: var(--blue-700); }
.st-unknown { color: var(--muted); }

/* ---------- Uptime bars (aria-hidden; each row has a text summary) ---------- */
.bars { display: flex; align-items: stretch; gap: 2px; height: 34px; margin: 12px 0 6px; }
.bar { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--green-500); transition: opacity .15s; }
.bar:hover { opacity: .7; }
.b-degraded { background: var(--amber-500); }
.b-partial { background: var(--orange-600); }
.b-major { background: var(--red-500); }
.b-maint { background: var(--blue-500); }
.b-nodata, .b-unknown { background: var(--line-strong); }
.bars-month { height: 28px; margin: 10px 0 0; }
.bars-legend { display: flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.bl-rule { flex: 1; height: 1px; background: var(--line); }
.bl-uptime { color: var(--text); }
.d60, .d30 { display: none; }
@media (max-width: 700px) { .bar.old60 { display: none; } .d90 { display: none; } .d60 { display: inline; } }
@media (max-width: 440px) { .bar.old30 { display: none; } .d60 { display: none; } .d30 { display: inline; } }
.bar-tip { position: absolute; z-index: 70; max-width: 260px; padding: 9px 12px; border-radius: var(--radius-xs); background: var(--navy); color: #dbe6f3; font-size: .82rem; font-weight: 600; line-height: 1.45; box-shadow: var(--shadow-2); pointer-events: none; }
.bar-tip[hidden] { display: none; }
.bar-tip strong { display: block; margin-bottom: 2px; color: #fff; }
.bar-tip span { display: block; }

/* ---------- Past incidents and history ---------- */
.past-day { padding: 16px 0; border-bottom: 1px solid var(--line); }
.past-day:first-of-type { border-top: 1px solid var(--line); }
.past-date { margin: 0 0 8px; font-size: 1rem; color: var(--ink); }
.past-none { margin: 0; font-size: .95rem; color: var(--muted); }
.past-more { margin: 22px 0 0; }
.entry { margin: 0 0 18px; }
.entry:last-child { margin-bottom: 0; }
.entry-title { margin: 0 0 2px; font-size: 1.03rem; }
.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover { text-decoration: underline; }
.entry-minor .entry-title { color: var(--amber-700); }
.entry-major .entry-title { color: var(--orange-600); }
.entry-critical .entry-title { color: var(--red-700); }
.entry-maintenance .entry-title { color: var(--blue-700); }
.entry-meta { margin: 0 0 4px; font-size: .84rem; font-weight: 600; color: var(--muted); }
.entry .update { padding: 8px 0; border-top: 0; }
.status-section > .entry { padding: 16px 0; margin: 0; border-bottom: 1px solid var(--line); }
.status-section > .entry:first-of-type { border-top: 1px solid var(--line); }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 8px; }
.month-current { flex: 1; margin: 0; text-align: center; font-weight: 700; color: var(--ink); }
.month-spacer { min-width: 1px; }
.month-components { padding: 4px 20px 18px; }
.m-group { padding-top: 14px; }
.m-group + .m-group { margin-top: 10px; border-top: 1px solid var(--line); }
.m-group-name { margin: 0 0 4px; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.m-row { padding: 12px 0; }
.m-row + .m-row { border-top: 1px dashed var(--line); }
.m-uptime { font-size: .9rem; font-weight: 700; color: var(--text); white-space: nowrap; }
@media (max-width: 560px) { .month-nav .btn { padding-inline: 12px; } .month-current { display: none; } }

/* ---------- Incident page ---------- */
.ip-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.ip-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin: 0 0 28px; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.ip-facts > div { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.ip-facts dt { margin-bottom: 4px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ip-facts dd { margin: 0; font-weight: 700; color: var(--ink); }
.ip-minor .ip-title { color: var(--amber-700); }
.ip-major .ip-title { color: var(--orange-600); }
.ip-critical .ip-title { color: var(--red-700); }
.ip-maintenance .ip-title { color: var(--blue-700); }

/* ---------- Footer ---------- */
.status-foot { border-top: 1px solid var(--line); background: var(--surface); font-size: .88rem; color: var(--muted); }
.sf-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-block: 24px; }
.sf-copy, .sf-meta { margin: 0; }
.sf-meta { flex-basis: 100%; }
.sf-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.status-foot a { color: var(--muted); font-weight: 600; text-decoration: none; }
.status-foot a:hover { color: var(--blue-700); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .c-chevron .icon, .bar { transition: none; }
}
@media print {
  .status-top .btn, .subscribe-panel, .sp-close { display: none !important; }
  .js .c-group:not(.is-open) > .c-body { display: block; }
  .status-banner { border: 1px solid #000; }
}
