:root {
  --color-brand-green: #10b981;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #059669;
  --green-bg: #d1fae5;
  --yellow: #b45309;
  --yellow-bg: #fef3c7;
  --orange: #c2410c;
  --orange-bg: #ffedd5;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.dark {
  --color-brand-green: #34d399;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-soft: #334155;
  --text: #f8fafc;
  --text-secondary: #e2e8f0;
  --muted: #94a3b8;
  --border: #475569;
  --green: #34d399;
  --green-bg: #064e3b;
  --yellow: #fbbf24;
  --yellow-bg: #78350f;
  --orange: #fb923c;
  --orange-bg: #7c2d12;
  --red: #f87171;
  --red-bg: #7f1d1d;
  --blue: #60a5fa;
  --blue-bg: #1e3a8a;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Unbounded", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
  content: none;
}

a {
  color: inherit;
}

.topbar,
.footer,
main {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 7px 10px;
  background: #ffffff;
  border-radius: 10px;
}

.brand-mark img {
  display: block;
  width: 132px;
  height: auto;
}

.brand-context {
  color: var(--color-brand-green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

nav a {
  text-decoration: none;
}

nav a:hover {
  color: var(--green);
}

.subscribe-menu {
  position: relative;
}

.subscribe-menu summary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #ffffff;
  background: var(--color-brand-green);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  list-style: none;
  transition: background-color 0.2s ease;
}

.subscribe-menu summary:hover {
  background: #059669;
}

.dark .subscribe-menu summary:hover {
  background: #10b981;
}

.subscribe-menu summary::-webkit-details-marker {
  display: none;
}

.subscribe-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10;
  width: min(340px, calc(100vw - 32px));
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.subscribe-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--border);
}

.subscribe-tab {
  display: grid;
  min-height: 42px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border: none;
  border-right: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.subscribe-tab:hover {
  color: var(--text);
  background: var(--surface);
}

.subscribe-tab:last-child {
  border-right: 0;
}

.subscribe-tab.is-active {
  color: #ffffff;
  background: var(--color-brand-green);
}

.subscribe-tab.is-active:hover {
  background: #059669;
}

.dark .subscribe-tab.is-active:hover {
  background: #10b981;
}

.subscribe-content {
  padding: 18px;
}

.subscribe-content p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.rss-link {
  display: block;
  padding: 12px;
  background: var(--color-brand-green);
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: background-color 0.2s ease;
}

.rss-link:hover {
  background: #059669;
}

.dark .rss-link:hover {
  background: #10b981;
}

.rss-url {
  display: block;
  padding: 10px;
  background: var(--surface-soft);
  border-radius: 4px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
}

.subscribe-form {
  display: grid;
  gap: 12px;
}

.subscribe-form p {
  margin: 0;
}

.subscribe-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.subscribe-form button {
  width: 100%;
  justify-content: center;
  text-transform: uppercase;
}

.subscribe-form small {
  color: var(--muted);
  font-size: 10px;
}

.trap-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.flash {
  margin: 0 0 18px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--color-brand-green);
  border-radius: 10px;
  font-size: 13px;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-soft);
  border-color: var(--muted);
}

.theme-toggle__icon {
  display: none;
  width: 20px;
  height: 20px;
}

.theme-toggle__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.dark .theme-toggle__icon--light {
  display: block;
}

html:not(.dark) .theme-toggle__icon--dark {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 32px;
  margin: 12px 0 24px;
  padding: 56px 44px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero h1,
.page-title h1,
.history-hero h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 82px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero h1 {
  color: var(--green);
}

.hero.status-degraded-performance h1 {
  color: var(--yellow);
}

.hero.status-partial-outage h1 {
  color: var(--orange);
}

.hero.status-major-outage h1 {
  color: var(--red);
}

.hero.status-maintenance h1 {
  color: var(--blue);
}

.hero p {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.hero__top,
.history-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.hero__top .eyebrow {
  margin-bottom: 0;
}

.hero-history-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.hero-history-link:hover {
  border-color: var(--muted);
}

.text-link {
  color: inherit;
  text-decoration: none;
}

.text-link:hover {
  color: var(--green);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 999px;
  vertical-align: 1px;
}

.legend-dot--degraded {
  background: var(--yellow);
}

.legend-dot--partial {
  background: var(--orange);
}

.legend-dot--major {
  background: var(--red);
}

.legend-dot--maintenance {
  background: var(--blue);
}

.hero-summary {
  display: grid;
  gap: 18px;
  min-width: 0;
  width: 100%;
  padding: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.hero-summary__head,
.hero-summary__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.hero-summary__head > div {
  min-width: 0;
}

.hero-summary__head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.hero-summary__meta {
  flex-wrap: wrap;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.hero-summary__meta span {
  white-space: nowrap;
}

.hero-summary__bars {
  min-height: 42px;
  width: 100%;
  overflow: hidden;
  grid-template-columns: repeat(60, minmax(3px, 1fr));
}

.hero-summary__bars .uptime-segment {
  min-height: 42px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section,
.panel,
.page-title,
.history-hero {
  margin: 24px 0;
}

.section,
.panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 4px;
}

.page-title p {
  max-width: 700px;
  color: var(--muted);
  margin: 12px 0 0;
}

.history-hero {
  padding: 34px 0 10px;
}

.history-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
}

.history-controls {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 18px;
}

.history-controls > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
}

.history-controls strong {
  color: var(--text);
}

h2 {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin: 0;
}

.section-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.uptime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.uptime-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
}

.uptime-card__head,
.uptime-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.uptime-card__head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.uptime-card__meta {
  color: var(--muted);
  font-size: 12px;
}

.uptime-bars {
  display: grid;
  grid-template-columns: repeat(60, minmax(2px, 1fr));
  gap: 3px;
  min-height: 34px;
  align-items: stretch;
}

.uptime-segment {
  display: block;
  min-height: 34px;
  border-radius: 2px;
  background: var(--surface-soft);
}

.uptime-segment--operational {
  background: var(--green);
}

.uptime-segment--degraded {
  background: var(--yellow);
}

.uptime-segment--partial {
  background: var(--orange);
}

.uptime-segment--outage {
  background: var(--red);
}

.uptime-segment--maintenance {
  background: var(--blue);
}

.uptime-segment--empty {
  background: var(--surface-soft);
  opacity: 0.55;
}

.component-list,
.incident-list,
.timeline,
.history-list {
  display: grid;
  gap: 12px;
}

.history-archive {
  display: grid;
  gap: 32px;
}

.history-month h2 {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.history-entry {
  padding: 4px 0 18px;
}

.history-entry__body {
  min-width: 0;
}

.history-entry__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.history-entry__title {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.history-entry__title:hover {
  color: var(--green);
}

.history-entry__head p {
  max-width: 900px;
  margin: 6px 0 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.history-entry__body > small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.history-updates {
  display: grid;
  gap: 12px;
}

.history-update {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.history-update > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  background: var(--color-brand-green);
  border-radius: 999px;
}

.history-update small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.history-update p {
  margin: 6px 0 0;
  color: var(--text-secondary);
}

.incident-report {
  max-width: 780px;
  margin: 24px auto 42px;
}

.incident-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.incident-summary p {
  margin: 0;
  color: var(--text-secondary);
}

.incident-report__timeline {
  display: grid;
  gap: 28px;
  margin-top: 28px;
}

.incident-report__update {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 28px;
}

.incident-report__update h2 {
  margin: 0;
  font-size: 18px;
}

.incident-report__copy p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
}

.incident-report__copy small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 24px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

.component,
.incident,
.component-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.component:first-child,
.incident:first-child,
.component-form:first-of-type {
  border-top: 0;
}

.component strong,
.incident strong {
  font-weight: 700;
}

.component small,
.incident small,
.update small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
}

.component-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.component-metrics > span:not(.pill) {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.incident {
  display: block;
}

.incident > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.incident p,
.empty {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-bg);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-degraded-performance {
  color: var(--yellow);
  background: var(--yellow-bg);
}

.status-partial-outage {
  color: var(--orange);
  background: var(--orange-bg);
}

.status-major-outage {
  color: var(--red);
  background: var(--red-bg);
}

.status-maintenance {
  color: var(--blue);
  background: var(--blue-bg);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 24px;
}

.component-form {
  align-items: end;
}

.component-form small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.component-form label,
.stack {
  display: grid;
  gap: 8px;
}

.component-form label {
  min-width: 210px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input,
select,
textarea,
button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--text);
  background: var(--surface-soft);
  font: inherit;
}

textarea {
  resize: vertical;
}

button {
  width: auto;
  cursor: pointer;
  color: #ffffff;
  background: var(--color-brand-green);
  border-color: var(--color-brand-green);
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

button:hover {
  background: #059669;
  border-color: #059669;
}

.dark button:hover {
  background: #10b981;
  border-color: #10b981;
}

.secondary-button {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border);
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 220px);
  place-items: center;
  padding: 48px 0;
}

.auth-panel {
  display: grid;
  width: min(460px, 100%);
  gap: 22px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-panel p {
  margin: 10px 0 0;
  color: var(--muted);
}

.auth-panel label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.auth-panel button {
  width: 100%;
}

.form-error {
  margin: 0;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--red);
  border-radius: 10px;
  font-size: 13px;
}

.update {
  margin-top: 16px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.check-list {
  display: grid;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.check-row:first-child {
  border-top: 0;
}

.check-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 44px;
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: inherit;
  text-decoration: none;
}

.footer a:hover {
  color: var(--green);
}

@media (max-width: 760px) {
  .topbar,
  .footer,
  .page-title,
  .history-hero,
  .hero__top,
  .component,
  .component-form,
  .check-row,
  .history-entry__head,
  .incident-summary,
  .incident > div:first-child {
    align-items: stretch;
    flex-direction: column;
  }

  .component-metrics {
    justify-content: flex-start;
  }

  .hero {
    padding: 34px 22px;
  }

  .admin-grid,
  .form-row,
  .uptime-grid {
    grid-template-columns: 1fr;
  }

  .history-controls {
    justify-content: stretch;
  }

  .history-controls > div {
    align-items: flex-start;
  }

  .incident-report__update {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .subscribe-menu,
  .subscribe-menu summary,
  .subscribe-panel {
    width: 100%;
  }

  .subscribe-panel {
    position: static;
    margin-top: 10px;
  }

  .pill {
    width: fit-content;
  }
}
