:root {
  --lime: #0ee071;
  --lime-deep: #00ad55;
  --graphite: #000;
  --ink: #000;
  --muted: #5c666c;
  --line: #eee;
  --soft: #f6f6f6;
  --white: #fff;
  --critical: #d94343;
  --warning: #dc8a1f;
  --ok: #5e7f2f;
  --unknown: #72808a;
  --shadow: 0 20px 55px rgba(45, 49, 52, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: #f6f6f6; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #f6f6f6;
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  min-height: 98px;
  padding: 18px max(24px, calc((100vw - 1340px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 22px; color: inherit; text-decoration: none; }
.brand-logo { display: block; width: 190px; height: auto; }
.product-name { padding: 8px 0 8px 22px; border-left: 1px solid var(--line); font-size: 16px; font-weight: 700 !important; letter-spacing: .08em; text-transform: uppercase; }

.topbar-actions { display: flex; align-items: center; gap: 18px; }
.live-indicator { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.live-indicator i { width: 8px; height: 8px; display: inline-block; margin-right: 7px; border-radius: 50%; background: var(--lime-deep); box-shadow: 0 0 0 5px rgba(190, 214, 47, .18); }

.button { border: 0; padding: 13px 17px; border-radius: 3px; font-size: 13px; font-weight: 800; transition: transform .2s, background .2s; }
.button:hover { transform: translateY(-1px); }
.button--dark { background: var(--lime); color: #000; }
.button--dark:hover { background: #000; color: #fff; }
.button:disabled { cursor: default; opacity: .6; transform: none; }
.button--notifications.is-enabled,
.button--notifications.is-enabled:hover { border: 1px solid var(--lime-deep); background: #fff; color: #00753a; opacity: 1; }
.button--notifications.is-blocked,
.button--notifications.is-blocked:hover,
.button--notifications.is-unsupported,
.button--notifications.is-unsupported:hover { border: 1px solid var(--line); background: var(--soft); color: var(--muted); opacity: 1; }
.button--auth { display: inline-block; margin-top: 28px; padding: 15px 22px; background: var(--lime); color: #000; text-decoration: none; }
.button--auth:hover { background: #000; color: #fff; }
.user-chip { max-width: 190px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sign-out-link, .text-link { color: var(--ink); font-size: 12px; font-weight: 700; text-underline-offset: 4px; }

.auth-screen { min-height: calc(100vh - 99px); display: grid; place-items: center; padding: 40px 24px; background: linear-gradient(135deg, #f6f6f6 0 65%, var(--lime) 65% 100%); }
.auth-card { width: min(620px, 100%); padding: clamp(35px, 7vw, 72px); background: #fff; border-top: 8px solid var(--lime); box-shadow: var(--shadow); }
.auth-card h1 { max-width: 520px; font-size: clamp(38px, 6vw, 62px); }
.auth-card p:not(.eyebrow) { max-width: 470px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.auth-card .text-link { display: block; width: fit-content; margin-top: 22px; }

.page-shell { width: min(1340px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0 58px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 38px; }
.eyebrow { margin: 0 0 10px; color: var(--graphite); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
h1 { max-width: 700px; margin: 0; font-size: clamp(38px, 6vw, 76px); line-height: .98; letter-spacing: -.05em; }
.hero h1::after { content: ''; display: inline-block; width: .18em; height: .18em; margin-left: .08em; background: var(--lime); }
.hero-copy { max-width: 620px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.last-updated { min-width: 170px; padding: 15px 0 15px 18px; border-left: 4px solid var(--lime); }
.last-updated span, .last-updated strong { display: block; }
.last-updated span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .13em; }
.last-updated strong { margin-top: 6px; font-size: 14px; }

.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.status-card { position: relative; min-height: 170px; padding: 22px; overflow: hidden; background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(45, 49, 52, .04); }
.status-card::after { content: ''; position: absolute; right: -35px; bottom: -55px; width: 120px; height: 120px; border-radius: 50%; background: currentColor; opacity: .06; }
.status-card__top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.status-card__top i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.status-card > strong { display: block; margin: 24px 0 5px; font-size: 46px; line-height: 1; }
.status-card p { margin: 0; color: var(--muted); font-size: 12px; }
.status-card--critical { color: var(--critical); }
.status-card--warning { color: var(--warning); }
.status-card--ok { color: var(--ok); }
.status-card--unknown { color: var(--unknown); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(360px, .85fr); gap: 14px; }
.panel { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel-heading { min-height: 104px; padding: 25px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.panel-heading .eyebrow { margin-bottom: 7px; }
.search-field input { width: 220px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 2px; color: var(--ink); background: var(--soft); outline: none; }
.search-field input:focus { border-color: var(--lime-deep); box-shadow: 0 0 0 3px rgba(190, 214, 47, .2); }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--graphite); font-size: 22px; }
.icon-button:hover { background: var(--soft); }

.service-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 165px; gap: 18px; align-items: center; padding: 19px 28px; border-bottom: 1px solid var(--line); }
.service-row:last-child { border-bottom: 0; }
.service-row:hover { background: #fbfcf7; }
.service-main strong, .service-main span { display: block; }
.service-main strong { font-size: 15px; }
.service-main span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.state-badge { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 30px; background: var(--soft); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.state-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-critical { color: var(--critical); background: #fff0ef; }
.state-warning { color: var(--warning); background: #fff6e8; }
.state-ok { color: var(--ok); background: #f1f7e5; }
.state-unknown { color: var(--unknown); background: #edf1f3; }
.service-time { color: var(--muted); font-size: 12px; text-align: right; }

.timeline { list-style: none; margin: 0; padding: 12px 28px 28px; }
.timeline li:not(.timeline-empty) { position: relative; padding: 17px 0 17px 27px; border-bottom: 1px solid var(--line); }
.timeline li:not(.timeline-empty)::before { content: ''; position: absolute; left: 0; top: 22px; width: 9px; height: 9px; border-radius: 50%; background: var(--state-color, var(--unknown)); box-shadow: 0 0 0 5px color-mix(in srgb, var(--state-color, var(--unknown)) 12%, transparent); }
.timeline li:last-child { border-bottom: 0; }
.timeline-title { display: flex; justify-content: space-between; gap: 12px; }
.timeline-title strong { font-size: 13px; }
.timeline-title time { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.timeline p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.timeline-empty, .empty-state { color: var(--muted); text-align: center; }
.timeline-empty { padding: 55px 12px; }
.empty-state { padding: 72px 24px; }
.empty-state strong, .empty-state p { display: block; }
.empty-state strong { margin-top: 17px; color: var(--ink); }
.empty-state p { margin: 7px 0 0; font-size: 13px; }
.empty-state__pulse { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 12px rgba(190, 214, 47, .15); }

.connection-message { min-height: 20px; margin: 16px 0 0; color: var(--critical); font-size: 12px; }
footer { width: min(1340px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 35px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .timeline-panel { order: -1; }
}

@media (max-width: 660px) {
  .topbar { min-height: 80px; padding: 13px 18px; }
  .product-name, .live-indicator { display: none; }
  .brand-logo { width: 142px; }
  .button { padding: 11px 12px; font-size: 11px; }
  .user-chip { display: none; }
  .page-shell { width: min(100% - 28px, 1340px); padding-top: 38px; }
  .hero { display: block; }
  h1 { font-size: 45px; }
  .last-updated { margin-top: 28px; }
  .status-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .status-card { min-height: 145px; padding: 17px; }
  .status-card > strong { font-size: 38px; }
  .status-card p { line-height: 1.35; }
  .panel-heading { min-height: 92px; padding: 20px; align-items: flex-end; }
  .search-field input { width: 145px; }
  .service-row { grid-template-columns: 1fr auto; padding: 17px 20px; }
  .service-time { grid-column: 1 / -1; text-align: left; }
  .timeline { padding-left: 20px; padding-right: 20px; }
  footer { width: calc(100% - 28px); display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
