:root {
  /* Western brand */
  --crimson: #a71930;
  --crimson-shade: #911930;
  --crimson-dark: #801426;
  --bright-red: #e00034;
  --accent-yellow: #ffc72c;
  --western-slate: #565a5c;
  --header-bg: #2b3438;
  --white: #ffffff;
  --page-bg: #f1f2f2;
  --shadowed-white: #d1d3d4;

  /* AAA-safe text / UI (7:1+ on page surfaces) */
  --text: #2b3438;
  --muted: #3f4446;
  --border: #6f737a;
  --focus-ring: #2b3438;
  --focus-halo: #ffffff;

  /* Status colors — pill text AAA; operational card border uses lighter mint */
  --status-operational: #0d4a24;
  --status-operational-border: #98d8c0;
  --status-operational-bg: #e8f8ef;
  --status-degraded: #6b4700;
  --status-degraded-bg: #fff1c2;
  --status-outage: #8f1428;
  --status-outage-bg: #fde5e8;
  --status-maintenance: #6b4700;
  --status-maintenance-bg: #fff1c2;
  /* Light yellow border — matches maintenance message surface (like operational mint) */
  --status-maintenance-border: #e8d48a;
  --status-unknown: #2b3438;
  --status-unknown-bg: #e5e7e8;

  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--page-bg);
  font-size: 16px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; }
.wrap { max-width: 1120px; margin: auto; padding-inline: 24px; }

.top {
  background: var(--header-bg);
  color: var(--white);
  border-bottom: 4px solid var(--crimson);
}

.head {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-block: 18px;
  min-height: 76px;
}

.brand-link {
  display: inline-flex;
  line-height: 0;
  text-decoration: none;
  min-height: 44px;
  align-items: center;
}

.brand-logo {
  display: block;
  width: min(201px, 72vw);
  height: auto;
}

.skip {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--white);
  color: var(--text);
  padding: 12px 16px;
  z-index: 10;
  font-weight: 700;
  text-decoration: underline;
  min-height: 44px;
}
.skip:focus { top: 8px; }

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 42px 0 24px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--crimson-dark);
  margin: 0 0 6px;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 8px;
  letter-spacing: -.03em;
  color: var(--header-bg);
  line-height: 1.2;
}

.lead {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.button {
  background: var(--crimson);
  color: var(--white);
  border: 2px solid var(--crimson);
  border-radius: 8px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}
.button:hover,
.button:active {
  background: var(--crimson-shade);
  border-color: var(--crimson-shade);
}
.button:disabled { opacity: .65; cursor: wait; }

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--focus-halo);
}

.top :focus-visible {
  outline-color: var(--accent-yellow);
  box-shadow: 0 0 0 6px var(--header-bg);
}

.summary {
  background: var(--white);
  border: 2px solid var(--border);
  border-left: 4px solid var(--crimson);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  font-weight: 650;
  color: var(--text);
}

.tools {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 22px 0;
  flex-wrap: wrap;
}
.tools > label:first-child { font-weight: 650; color: var(--text); }
.tools input[type=search] {
  width: min(350px, 100%);
  border: 2px solid var(--border);
  border-radius: 8px;
  min-height: 44px;
  padding: 9px 12px;
  font: inherit;
  color: var(--text);
  background: var(--white);
}
.inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: var(--text);
  min-height: 44px;
}
.inline input {
  width: 24px;
  height: 24px;
  min-width: 24px;
  accent-color: var(--crimson);
}

.view-toggle {
  display: inline-flex;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}
.view-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  font-size: 14px;
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
}
.view-btn + .view-btn {
  border-left: 2px solid var(--border);
}
.view-btn.is-active {
  background: var(--header-bg);
  color: var(--white);
}
.view-btn:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
  z-index: 1;
}

.group { margin: 30px 0; }
.group h2 {
  font-size: 19px;
  margin: 0 0 12px;
  color: var(--text);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}

.card {
  background: var(--white);
  border: 4px solid var(--border);
  border-radius: 12px;
  padding: 19px;
  box-shadow: 0 2px 8px rgb(43 52 56 / 6%);
}
.card-operational { border-color: var(--status-operational-border); }
.card-degraded { border-color: var(--status-degraded); }
.card-outage { border-color: var(--status-outage); }
.card-maintenance { border-color: var(--status-maintenance-border); }
.card-unknown { border-color: var(--status-unknown); }

.card-head {
  display: flex;
  align-items: start;
  gap: 14px;
  justify-content: space-between;
}
.card h3 {
  font-size: 18px;
  margin: 0 0 5px;
  color: var(--text);
  line-height: 1.3;
}
.card h3 .service-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.card h3 .service-link:hover { color: var(--crimson); }
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 4px;
}
.card .desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.45;
}

.pill {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  border: 2px solid transparent;
  line-height: 1.3;
}
.pill.operational {
  background: var(--status-operational-bg);
  color: var(--status-operational);
  border-color: var(--status-operational-border);
}
.pill.degraded {
  background: var(--status-degraded-bg);
  color: var(--status-degraded);
  border-color: var(--status-degraded);
}
.pill.outage {
  background: var(--status-outage-bg);
  color: var(--status-outage);
  border-color: var(--status-outage);
}
.pill.maintenance {
  background: var(--status-maintenance-bg);
  color: var(--status-maintenance);
  border-color: var(--status-maintenance-border);
}
.pill.unknown {
  background: var(--status-unknown-bg);
  color: var(--status-unknown);
  border-color: var(--status-unknown);
}

.note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}
.card a,
.row a,
.about a {
  font-weight: 650;
  color: var(--crimson-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.card a:hover,
.row a:hover,
.about a:hover { color: var(--crimson); }

.rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 30px;
}
.row {
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.row-operational { border-color: var(--status-operational-border); }
.row-degraded { border-color: var(--status-degraded); }
.row-outage { border-color: var(--status-outage); }
.row-maintenance { border-color: var(--status-maintenance-border); }
.row-unknown { border-color: var(--status-unknown); }

.row-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  min-height: 56px;
}
.row-summary::-webkit-details-marker { display: none; }
.row-summary::marker { content: ''; }
.row-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.row-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.row-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.row-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--border);
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.row[open] .row-chevron { transform: rotate(180deg); }
.row-panel {
  padding: 0 16px 16px;
  border-top: 1px solid var(--shadowed-white);
}
.row-panel .note { margin-top: 14px; }
.row-maintenance .incident {
  background: var(--status-maintenance-bg);
  border-left-color: var(--status-maintenance);
}

.incident {
  background: var(--status-degraded-bg);
  border-left: 4px solid var(--status-degraded);
  padding: 10px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text);
}
.card-maintenance .incident {
  background: var(--status-maintenance-bg);
  border-left-color: var(--status-maintenance);
}
.incident strong { display: block; }
.incident p { margin: 4px 0 0; color: var(--muted); }

.about {
  background: var(--white);
  border-radius: 12px;
  padding: 22px 25px;
  margin-top: 42px;
  line-height: 1.65;
  color: var(--text);
  border: 2px solid var(--border);
}
.about h2 { margin-top: 0; font-size: 20px; }
.small { font-size: 13px; color: var(--muted); }
.foot {
  font-size: 13px;
  color: var(--muted);
  padding-block: 24px;
}
.error {
  border-color: var(--status-outage);
  color: var(--status-outage);
}
.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 650px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 28px;
  }
  .inline { margin-left: 0; }
  .card-head { flex-wrap: wrap; }
  .wrap { padding-inline: 16px; }
  .head { padding-block: 14px; min-height: 64px; }
  .row-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .row-meta { margin-left: auto; }
  .view-toggle { width: 100%; }
  .view-btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
