/* ==========================================================================
   19 · NETWORK STATUS — templates/pages/status.php (/status/)
   Live state, services with a 90-day history, incidents and maintenance, history. Script: assets/scripts/status.js
   ========================================================================== */
.nsx { --ok: #16a34a; --beta: #7c3aed; --degraded: #d97706; --partial: #ea580c; --major: #dc2626; --maintenance: #2563eb; --none: color-mix(in srgb, var(--ink) 10%, transparent);
  position: relative; min-width: 0; }
.nsx .eyebrow a { text-decoration: none; }
.nsx-h1 { margin: 0; font-size: 44px; line-height: 1.1; font-weight: 500; letter-spacing: -.03em; color: var(--ink); }
.nsx-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.nsx-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); cursor: pointer; list-style: none; white-space: nowrap; }
.nsx-btn::-webkit-details-marker { display: none; }
.nsx-btn svg { width: 16px; height: 16px; }
.nsx-btn:hover { border-color: var(--rule-strong); }
.nsx-btn.is-solid { color: var(--panel); background: var(--ink); border-color: var(--ink); }
.nsx-sub { position: relative; }
.nsx-sub[open] > summary { border-color: var(--rule-strong); }
.nsx-sub-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 360px; max-width: calc(100vw - 32px); padding: 18px; background: var(--panel); border: 1px solid var(--rule); box-shadow: 0 24px 48px -16px rgba(10, 35, 65, .28); }
.nsx-sub-pop label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--ink); }
.nsx-sub-row { display: flex; gap: 8px; }
.nsx-sub-row input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--ink); background: var(--field-bg); border: 1px solid var(--field); }
.nsx-sub-pop small { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.nsx-sub-links { margin: 14px 0 0; padding: 14px 0 0; list-style: none; border-top: 1px solid var(--rule); display: grid; gap: 6px; font-size: 13px; }
.nsx-flash { margin: 20px 0 0; padding: 12px 16px; font-size: 14px; color: var(--ink); background: var(--info-bg); border-left: 3px solid var(--accent); }

/* The big state card */
.nsx-hero { --c: var(--ok); position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: center; margin: 28px 0 0; padding: 28px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--rule)); background: linear-gradient(110deg, color-mix(in srgb, var(--c) 11%, var(--panel)) 0%, var(--panel) 70%); }
.nsx-hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.nsx-hero.is-degraded { --c: var(--degraded); } .nsx-hero.is-partial { --c: var(--partial); } .nsx-hero.is-major { --c: var(--major); } .nsx-hero.is-maintenance { --c: var(--maintenance); }
.nsx-hero-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.nsx-hero-ic { position: relative; flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: #fff; background: var(--c); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--c) 70%, transparent); }
.nsx-hero-ic::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--c) 45%, transparent); animation: nsx-ring 2.6s ease-out infinite; }
.nsx-hero-ic svg { width: 26px; height: 26px; }
.nsx-hero h2 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
.nsx-hero p { display: block; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.nsx-live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: nsx-live 2s infinite; }
.nsx-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--c) 22%, var(--rule)); }
.nsx-kpis div { padding: 2px 22px; border-left: 1px solid var(--rule); }
.nsx-kpis div:first-child { padding-left: 0; border-left: 0; }
.nsx-kpis dt { font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.nsx-kpis dd { margin: 6px 0 0; font-size: 26px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nsx-kpis dd small { font-size: 14px; color: var(--muted); }
@keyframes nsx-ring { 0% { transform: scale(.85); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes nsx-live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Sections */
.nsx-sec { margin: 44px 0 0; }
.nsx-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 14px; }
.nsx-sec-h h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
.nsx-sec-h a { font-size: 14px; }
.nsx-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 12px; color: var(--muted); }
.nsx-legend span { display: inline-block; width: 10px; height: 10px; margin-right: -8px; border-radius: 2px; background: var(--ok); }
.nsx-legend .is-degraded { background: var(--degraded); } .nsx-legend .is-partial { background: var(--partial); } .nsx-legend .is-major { background: var(--major); } .nsx-legend .is-maintenance { background: var(--maintenance); }

/* State words */
.nsx-pill { --c: var(--ok); display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; font-size: 12.5px; font-weight: 500; color: color-mix(in srgb, var(--c) 82%, var(--ink)); background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 999px; white-space: nowrap; }
.nsx-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.is-degraded.nsx-pill { --c: var(--degraded); } .is-partial.nsx-pill { --c: var(--partial); } .is-major.nsx-pill { --c: var(--major); } .is-maintenance.nsx-pill { --c: var(--maintenance); } .is-beta.nsx-pill { --c: var(--beta); }

/* Groups and services */
.nsx-group { border: 1px solid var(--rule); background: var(--panel); }
.nsx-group + .nsx-group { margin-top: 16px; }
.nsx-group-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--tile); border-bottom: 1px solid var(--rule); }
.nsx-group-h h3 { margin: 0; font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.nsx-comp { border-top: 1px solid var(--rule); }
.nsx-group-h + .nsx-comp { border-top: 0; }
.nsx-comp-h { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 18px 20px 10px; }
.nsx-comp-name { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; min-width: 0; }
.nsx-comp-name i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.nsx-comp-name i.is-degraded { background: var(--degraded); } .nsx-comp-name i.is-partial { background: var(--partial); } .nsx-comp-name i.is-major { background: var(--major); } .nsx-comp-name i.is-maintenance { background: var(--maintenance); } .nsx-comp-name i.is-beta { background: var(--beta); }
.nsx-comp-name b { font-size: 16px; font-weight: 500; color: var(--ink); transition: color .15s; }
.nsx-comp-name small { grid-column: 2; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsx-comp-up { font-size: 15px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.nsx-comp-up small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.nsx-bars { display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px; height: 34px; padding: 0 20px; }
.nsx-bars span { border-radius: 2px; background: var(--ok); transition: transform .12s, filter .12s; }
.nsx-bars span:hover { transform: scaleY(1.12); filter: brightness(1.08); }
.nsx-bars .is-none { background: var(--none); }
.nsx-bars .is-degraded { background: var(--degraded); } .nsx-bars .is-partial { background: var(--partial); } .nsx-bars .is-major { background: var(--major); } .nsx-bars .is-maintenance { background: var(--maintenance); }
.nsx-axis { display: flex; justify-content: space-between; padding: 6px 20px 4px; font-size: 12px; color: var(--muted); }
.nsx-d30 { display: none; }
.nsx-comp-more { padding: 6px 20px 14px; }
.nsx-comp-more > summary { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent); cursor: pointer; list-style: none; }
.nsx-comp-more > summary::-webkit-details-marker { display: none; }
.nsx-comp-more > summary::before { content: "+"; font-family: "JetBrains Mono", monospace; }
.nsx-comp-more[open] > summary::before { content: "−"; }
.nsx-comp-more[open] { padding-bottom: 20px; }
.nsx-comp-more[open] > summary { margin-bottom: 10px; }
.nsx-spark { margin: 4px 0 0; padding: 14px 14px 10px; background: var(--tile); border: 1px solid var(--rule); }
.nsx-spark svg { display: block; width: 100%; height: 64px; }
.nsx-spark-line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.nsx-spark-fill { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: none; }
.nsx-spark-down { fill: color-mix(in srgb, var(--major) 55%, transparent); }
.nsx-spark figcaption { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); }
.nsx-comp-last { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* Incidents and maintenance */
.nsx-inc { --c: var(--degraded); position: relative; padding: 22px 24px; border: 1px solid var(--rule); border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 5%, var(--panel)); }
.nsx-inc + .nsx-inc { margin-top: 14px; }
.nsx-inc.is-partial { --c: var(--partial); } .nsx-inc.is-major { --c: var(--major); } .nsx-inc.is-maintenance { --c: var(--maintenance); }
.nsx-inc-kind { margin: 0; font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 85%, var(--ink)); }
.nsx-inc h3 { margin: 6px 0 0; font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.nsx-inc h3 a { color: var(--ink); text-decoration: none; }
.nsx-inc h3 a:hover { text-decoration: underline; }
.nsx-inc-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.nsx-count { padding: 2px 8px; font-size: 12px; font-weight: 500; color: var(--maintenance); background: color-mix(in srgb, var(--maintenance) 12%, transparent); border-radius: 999px; }
.nsx-ics { font-size: 13px; }
.nsx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.nsx-chip { --c: var(--degraded); display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12.5px; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 999px; }
.nsx-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.nsx-chip.is-partial { --c: var(--partial); } .nsx-chip.is-major { --c: var(--major); } .nsx-chip.is-maintenance { --c: var(--maintenance); }
.nsx-inc-text { margin: 14px 0 0; font-size: 15px; line-height: 1.6; color: var(--body); }
.nsx-tl { position: relative; margin: 18px 0 0; padding: 0 0 0 22px; list-style: none; }
.nsx-tl::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--rule); }
.nsx-tl li { position: relative; }
.nsx-tl li + li { margin-top: 16px; }
.nsx-tl li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2px solid var(--c); }
.nsx-tl li:first-child::before { background: var(--c); }
.nsx-tl li.is-resolved::before, .nsx-tl li.is-completed::before { border-color: var(--ok); }
.nsx-tl li.is-resolved:first-child::before, .nsx-tl li.is-completed:first-child::before { background: var(--ok); }
.nsx-tl-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; }
.nsx-tl-h b { font-weight: 600; color: var(--ink); }
.nsx-tl-h span { font-size: 12.5px; color: var(--muted); }
.nsx-auto { padding: 1px 7px; font-family: "JetBrains Mono", monospace; font-size: 10px !important; letter-spacing: .08em; text-transform: uppercase; color: var(--accent) !important; background: var(--info-bg); border-radius: 4px; }
.nsx-tl p { margin: 4px 0 0; font-size: 15px; line-height: 1.6; color: var(--body); }

/* Last 14 days and history */
.nsx-days { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.nsx-days li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 6px 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.nsx-days h3 { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.nsx-days li > a, .nsx-days li > p { grid-column: 2; }
.nsx-none { margin: 0; font-size: 14px; color: var(--muted); }
.nsx-hrow { --c: var(--degraded); display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 2px 0; text-decoration: none; }
.nsx-hrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.nsx-hrow.is-partial { --c: var(--partial); } .nsx-hrow.is-major { --c: var(--major); } .nsx-hrow.is-maintenance { --c: var(--maintenance); }
.nsx-hrow b { font-size: 15px; font-weight: 500; color: var(--ink); }
.nsx-hrow:hover b { color: var(--accent); text-decoration: underline; }
.nsx-hrow span { grid-column: 2; font-size: 13px; color: var(--muted); }
.nsx-month { margin: 36px 0 0; }
.nsx-month h2 { margin: 0 0 12px; padding-bottom: 10px; font-size: 20px; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--rule); }
.nsx-month .nsx-hrow { padding: 10px 0; border-bottom: 1px solid var(--panel-line); }
.nsx-pager { display: flex; justify-content: space-between; margin: 28px 0 0; }
.nsx > .nsx-inc { margin-top: 24px; }
.nsx-foot { margin: 44px 0 0; font-size: 14px; color: var(--muted); }
.nsx-tz { display: block; margin-top: 6px; font-size: 12px; }

/* The day tooltip */
.nsx-tip { position: absolute; z-index: 30; width: 240px; padding: 12px 14px; font-size: 13px; line-height: 1.45; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); box-shadow: 0 18px 40px -14px rgba(10, 35, 65, .35); pointer-events: none; }
.nsx-tip b { display: block; margin-bottom: 4px; font-weight: 600; }
.nsx-tip em { display: flex; align-items: center; gap: 6px; font-style: normal; }
.nsx-tip em::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--ok)); }
.nsx-tip small { display: block; margin-top: 4px; color: var(--muted); }

@media (max-width: 900px) {
  .nsx-hero { grid-template-columns: minmax(0, 1fr); }
  .nsx-kpis div:first-child { padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
  .nsx-h1 { font-size: 34px; }
  .nsx-hero { padding: 22px 18px; }
  .nsx-hero h2 { font-size: 21px; }
  .nsx-hero-ic { width: 44px; height: 44px; } .nsx-hero-ic svg { width: 22px; height: 22px; }
  .nsx-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nsx-kpis div { padding: 0 10px; } .nsx-kpis dd { font-size: 19px; } .nsx-kpis dt { font-size: 9px; letter-spacing: .08em; white-space: normal; }
  .nsx-comp-h { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 16px 14px 10px; }
  .nsx-comp-up { display: none; }
  .nsx-bars { grid-template-columns: repeat(30, minmax(0, 1fr)); padding: 0 14px; height: 30px; }
  .nsx-bars span:nth-child(-n+60) { display: none; }
  .nsx-axis, .nsx-comp-more { padding-left: 14px; padding-right: 14px; }
  .nsx-d90 { display: none; } .nsx-d30 { display: inline; }
  .nsx-group-h { padding: 12px 14px; }
  .nsx-inc { padding: 18px 16px; }
  .nsx-days li { grid-template-columns: minmax(0, 1fr); }
  .nsx-days li > a, .nsx-days li > p { grid-column: 1; }
  .nsx-sub-pop { right: auto; left: 0; }
}
@media (prefers-reduced-motion: reduce) { .nsx-hero-ic::after, .nsx-live { animation: none; } }

.nsx-hero p .nsx-live { display: inline-block; margin-right: 8px; vertical-align: 1px; }
