@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
  --bg: #f9fafb;
  --bg-alt: #f3f4f6;
  --surface: #ffffff;
  --surface-hover: #f9fafb;
  --surface-muted: #f3f4f6;
  --border: rgba(15, 23, 42, 0.08);
  --brand: #6ea8ff;
  --brand-alt: #4f63ff;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --text: #111827;
  --text-muted: #6b7280;
  --shadow: 0 25px 60px rgba(15, 23, 42, 0.08);
  --pill-bg: rgba(79, 99, 255, 0.12);
  --metric-bg: rgba(79, 99, 255, 0.06);
  --graph-shell: rgba(79, 99, 255, 0.08);
  --error-bg: #fff5f5;
  --error-border: rgba(248, 113, 113, 0.35);
  --scrollbar-thumb: rgba(156, 163, 175, 0.25);
  --scrollbar-thumb-hover: rgba(156, 163, 175, 0.55);
  --scrollbar-track: transparent;
}

body[data-theme='dark'] {
  --bg: #111827;
  --bg-alt: #1f2937;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --surface-muted: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f5;
  --text-muted: #9ca3af;
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  --pill-bg: rgba(2, 4, 10, 0.5);
  --metric-bg: rgba(255, 255, 255, 0.02);
  --graph-shell: rgba(0, 0, 0, 0.2);
  --error-bg: rgba(239, 68, 68, 0.08);
  --error-border: rgba(239, 68, 68, 0.25);
  --scrollbar-thumb: rgba(156, 163, 175, 0.35);
  --scrollbar-thumb-hover: rgba(156, 163, 175, 0.65);
}

* {
  box-sizing: border-box;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-gutter: stable both-edges;
}

body[data-theme='dark'] {
  /* Dark mode gradient background matching web-interface */
  background: linear-gradient(to bottom right, #111827 0%, #111827 50%, #312e81 100%);
}

img {
  max-width: 100%;
}

.container {
  width: min(1040px, 94vw);
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.header-brand:hover {
  opacity: 0.8;
}

.logo-mark {
  width: 28px;
  height: 28px;
}

.logo-text {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.theme-toggle:hover {
  opacity: 1;
}

.pill {
  background: var(--pill-bg);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.btn-text {
  background: none;
  border: none;
  color: var(--brand);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.375rem 0.5rem;
  transition: opacity 0.2s;
}

.btn-text:hover {
  opacity: 0.75;
}

.services-section {
  padding: 2rem 0;
}

.services-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  color: var(--text);
}

.window-controls {
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem;
}

.window-controls button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.2s;
}

.window-controls button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.window-controls button.active {
  background: var(--text);
  color: var(--bg);
}

.status-hero {
  text-align: center;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.status-hero h1 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.status-hero p {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.live-data-section {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.live-data-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.section-subtitle {
  color: var(--text-muted);
  margin: 0 0 2rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.telemetry-matrix {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.matrix-header,
.matrix-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-bottom: 1px solid var(--border);
}

.matrix-header:last-child,
.matrix-row:last-child {
  border-bottom: none;
}

.matrix-label {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.matrix-cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.col-header {
  padding: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  border-right: 1px solid var(--border);
}

.col-header:last-child {
  border-right: none;
}

.matrix-cell {
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.2s;
}

.matrix-cell:last-child {
  border-right: none;
}

.matrix-cell:hover {
  background: var(--surface-hover);
}

.status-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.service-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.search-field {
  flex: 1;
  background: transparent;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.25rem 0;
}

.search-field input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  padding: 0.4rem 0.2rem;
}

.search-field input:focus {
  outline: none;
}

.filter-chips {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}

.chip.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
}

.service-card:hover {
  border-color: var(--brand);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.service-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.service-card h4 {
  font-size: 0.9375rem;
  font-weight: 500;
  margin: 0;
  color: var(--text);
  flex: 1;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-chip.up {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-chip.down {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.status-chip.attention {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.service-card.is-hidden {
  display: none;
}

.metric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.metric {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  min-height: auto;
}

.metric span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.graph-shell {
  background: transparent;
  border-radius: 0;
  border: none;
  padding: 0.25rem 0 0;
}

.graph-shell img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  filter: none;
}

.service-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.service-footer .muted {
  margin: 0;
  flex: 1;
  word-break: break-word;
}

.services-empty {
  text-align: center;
  margin: 1.5rem 0 0;
}

.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
}

.error button {
  margin-top: 1rem;
  border: none;
  background: var(--brand-alt);
  color: #ffffff;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
}

.subscribe-panel {
  margin: 2.25rem 0;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 1.25rem;
  align-items: center;
  box-shadow: none;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  border: none;
  background: var(--brand);
  color: #ffffff;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.ghost:hover {
  background: var(--surface-hover);
  border-color: rgba(110, 168, 255, 0.3);
}

.incidents {
  margin: 3rem 0;
  padding: 1.75rem;
  border-radius: 1.1rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.incidents-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.incident-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.incident-actions .btn {
  white-space: nowrap;
}

.auth-hint {
  margin-top: 0.35rem;
}

.incident-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.incident-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1.25rem;
}

.incident-group h4 {
  margin-top: 0;
}

.incident-card {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.incident-card:first-of-type {
  border-top: none;
  padding-top: 0;
}

.incident-card h5 {
  margin: 0 0 0.35rem;
}

.incident-card p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.9rem;
}

.incident-meta a {
  color: var(--brand);
  text-decoration: none;
  margin-left: auto;
}

.tag {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.tag.warn {
  background: rgba(248, 113, 113, 0.15);
  color: #b91c1c;
}

.tag.info {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.tag.muted {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.fade-in {
  animation: fadeInUp 0.4s ease both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }

}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-copyright {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}

.modal[aria-hidden='false'] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 10, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.modal__panel {
  position: relative;
  width: min(720px, 95vw);
  max-height: 90vh;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.service-status-banner {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.status-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  flex-shrink: 0;
}

.status-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.status-icon.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.service-status-banner h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.service-status-banner p {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.modal__content {
  padding: 2rem;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

.service-status-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.service-status-banner.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.service-status-banner.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.status-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.service-status-banner h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.service-status-banner p {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.uptime-section {
  margin-bottom: 2rem;
}

.uptime-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.uptime-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.uptime-label strong {
  color: var(--text);
  margin-left: 0.25rem;
}

.uptime-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8125rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-dot.disruption {
  background: #fbbf24;
}

.legend-dot.info {
  background: #60a5fa;
}

.legend-dot.outage {
  background: #ef4444;
}

.uptime-graph {
  display: flex;
  gap: 2px;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 80px;
  align-items: flex-end;
}

.uptime-bar {
  flex: 1;
  min-width: 8px;
  height: 60px;
  background: #10b981;
  border-radius: 2px;
  transition: all 0.2s;
  position: relative;
  cursor: pointer;
}

.uptime-bar.down {
  background: #ef4444;
}

.uptime-bar.degraded {
  background: #fbbf24;
}

.uptime-bar:hover {
  opacity: 0.8;
  transform: scaleY(1.05);
}

.uptime-bar-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.uptime-bar:hover .uptime-bar-tooltip {
  opacity: 1;
}

.uptime-bar-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text);
}

.past-issues-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}

.issues-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.issue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s;
}

.issue-card:hover {
  border-color: var(--brand);
}

.issue-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.issue-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 0.5rem;
  flex-shrink: 0;
}

.issue-indicator.resolved {
  background: #10b981;
}

.issue-indicator.ongoing {
  background: #ef4444;
}

.issue-indicator.info {
  background: #60a5fa;
}

.issue-content {
  flex: 1;
}

.issue-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.25rem;
}

.issue-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.issue-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.issue-status.resolved {
  color: #10b981;
}

.issue-status.ongoing {
  color: #ef4444;
}

.modal__panel label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.modal__panel input,
.modal__panel select,
.modal__panel textarea {
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 0.7rem 0.9rem;
  font: inherit;
  background: var(--surface-muted);
  color: var(--text);
}

.modal__panel textarea {
  resize: vertical;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.icon-button {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text);
}

.small {
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .status-hero {
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 0 1.5rem;
  }

  .status-hero h1 {
    font-size: 1.75rem;
  }

  .status-meta {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .header-nav {
    gap: 1rem;
  }

  /* Make telemetry matrix horizontally scrollable */
  .telemetry-matrix {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .matrix-header,
  .matrix-row {
    min-width: 600px;
  }

  /* Service cards adjust */
  .services-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  /* Modal adjustments */
  .modal__panel {
    width: 96vw;
  }

  .modal__header,
  .modal__content {
    padding: 1.5rem;
  }

  /* Incident filters stack on mobile */
  .incidents-header {
    flex-direction: column;
    align-items: stretch;
  }

  .incident-filters {
    width: 100%;
  }

  .filter-select {
    flex: 1;
    min-width: 0;
  }

  /* Incident items */
  .incident-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .incident-status-badge {
    align-self: flex-start;
  }
}

@media (max-width: 720px) {
  .header-minimal {
    flex-wrap: wrap;
  }

  .window-controls button {
    padding: 0.35rem 0.75rem;
  }

  .subscribe-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .live-data-section h2,
  .services-section h2,
  .incidents-header h2 {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .container {
    width: 96vw;
  }

  .status-hero h1 {
    font-size: 1.5rem;
  }

  .status-hero p {
    font-size: 0.9375rem;
  }

  /* Single column service cards */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Better touch targets */
  .btn,
  .chip,
  .window-controls button {
    min-height: 44px;
    padding: 0.625rem 1rem;
  }

  /* Compact matrix */
  .matrix-label {
    font-size: 0.8125rem;
    padding: 0.875rem 1rem;
  }

  .col-header {
    font-size: 0.6875rem;
    padding: 0.875rem 0.5rem;
  }

  .matrix-cell {
    font-size: 0.875rem;
    padding: 1rem 0.5rem;
  }

  /* Modal full screen on mobile */
  .modal__panel {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal__header {
    padding: 1.25rem;
  }

  .modal__content {
    padding: 1.25rem;
    max-height: calc(100vh - 100px);
  }

  /* Incident cards compact */
  .incident-item {
    padding: 1.25rem;
  }

  .incident-title {
    font-size: 1rem;
  }

  .incident-meta-row {
    font-size: 0.8125rem;
  }

  /* Service cards compact */
  .service-card {
    padding: 1rem 1.25rem;
  }

  .service-card h4 {
    font-size: 0.875rem;
  }

  .metric span {
    font-size: 0.6875rem;
  }

  .metric strong {
    font-size: 0.875rem;
  }
}

/* Uptime Bar Chart Styles */
.uptime-bar-container {
  margin: 1rem 0;
  padding: 0.75rem 0;
}

.uptime-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.uptime-bar-label span {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.uptime-bar-label strong {
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
}

.uptime-bar-track {
  height: 8px;
  background: var(--surface-muted);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.uptime-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, var(--fill-start), var(--fill-end));
  box-shadow: 0 0 8px var(--fill-glow);
}

.uptime-bar-fill.up {
  --fill-start: #10b981;
  --fill-end: #34d399;
  --fill-glow: rgba(16, 185, 129, 0.4);
}

.uptime-bar-fill.down {
  --fill-start: #ef4444;
  --fill-end: #f87171;
  --fill-glow: rgba(239, 68, 68, 0.4);
}

.uptime-bar-fill.attention {
  --fill-start: #f59e0b;
  --fill-end: #fbbf24;
  --fill-glow: rgba(245, 158, 11, 0.4);
}

/* Incidents Timeline */
.incidents-timeline {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.incidents-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.incidents-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.incident-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  transition: all 0.2s;
}

.filter-select:hover {
  border-color: var(--brand);
  background-color: var(--surface-hover);
}

.filter-select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.incidents-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.incident-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--incident-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.incident-item:hover {
  border-left-width: 4px;
  box-shadow: var(--shadow);
}

.incident-item.resolved {
  --incident-color: #10b981;
}

.incident-item.ongoing {
  --incident-color: #ef4444;
}

.incident-item.maintenance {
  --incident-color: #f59e0b;
}

.incident-item.scheduled {
  --incident-color: #60a5fa;
}

.incident-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.incident-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.incident-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.incident-status-badge.resolved {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.incident-status-badge.ongoing {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.incident-status-badge.maintenance {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.incident-status-badge.scheduled {
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
}

.incident-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.incident-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.incident-description {
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

.incident-services {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.incident-service-tag {
  padding: 0.25rem 0.75rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
