:root {
  --body-background-color: #f5f6f8;
  --body-text-color: #134e4a;
  --card-background-color: #ffffff;
  --nav-background-color: #f5f6f8;
  --nav-border-bottom-color: #e5e7eb;
  --nav-current-border-bottom-color: #0f766e;
  --card-border-color: #e5e7eb;
  --down-border-left-color: #ef4444;
  --down-background-color: #fef2f2;
  --degraded-border-left-color: #f59e0b;
  --up-border-left-color: #22c55e;
  --tag-color: #166534;
  --tag-up-background-color: #dcfce7;
  --tag-down-background-color: #ef4444;
  --tag-degraded-background-color: #f59e0b;
  --change-background-color: #ecfeff;
  --error-button-border-color: #0f766e;
  --error-button-background-color: #0f766e;
  --error-button-color: #ffffff;
  --submit-button-border-color: #0f766e;
  --submit-button-background-color: #0f766e;
  --submit-button-color: #ffffff;
  --graph-opacity: 0;
  --graph-filter: none;
  --muted-text-color: #6b7280;
  --brand-teal: #0f766e;
  --brand-cyan: #0f766e;
  --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
}

html,
body {
  background: var(--body-background-color);
  color: var(--body-text-color);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body a {
  color: inherit;
}

body .container {
  max-width: 800px;
}

/* Header */

body nav {
  font-weight: 400;
  padding: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--nav-border-bottom-color);
  background: var(--nav-background-color);
}

body nav .container {
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body nav .logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0;
  margin-right: 0;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--body-text-color);
  text-decoration: none;
}

body nav .logo img {
  height: 2rem;
  width: auto;
  max-width: 9.5rem;
  object-fit: contain;
  object-position: left center;
  margin-right: 0;
  border-radius: 0;
  filter: invert(1) hue-rotate(180deg);
  mix-blend-mode: multiply;
}

body nav .logo > div {
  display: block;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--body-text-color);
}

body nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

body nav ul li {
  list-style: none;
}

body nav ul a {
  padding: 0.5rem 0 0.5rem 1.25rem;
  color: var(--brand-teal);
  font-weight: 500;
}

body nav ul a[href^="http"]::after {
  content: " \2197";
  font-size: 0.85em;
}

body nav [aria-current] {
  border-bottom: none;
}

/* Intro copy sits under the page, matching the mockup footer */

body main.container {
  display: flex;
  flex-direction: column;
}

body main.container > header {
  order: 20;
  margin: 2.5rem 0 0;
  text-align: center;
}

body main.container > header h1 {
  display: none;
}

body main.container > header .lead {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted-text-color);
  line-height: 1.5;
}

/* Operational hero */

body article {
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
}

body article.up:not(.link):not(.graph),
body article.down:not(.link):not(.graph),
body article.degraded:not(.link):not(.graph) {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  padding: 1.75rem 1rem 0.35rem;
  margin-bottom: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--body-text-color);
}

body article.up:not(.link):not(.graph)::before,
body article.down:not(.link):not(.graph)::before,
body article.degraded:not(.link):not(.graph)::before {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background-color: #4ade80;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.45rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}

body article.down:not(.link):not(.graph)::before {
  background-color: #ef4444;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
}

body article.degraded:not(.link):not(.graph)::before {
  background-color: #f59e0b;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'><line x1='12' y1='8' x2='12' y2='13'/><circle cx='12' cy='17' r='0.8' fill='white' stroke='none'/></svg>");
}

.diwa-hero-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
}

.diwa-hero-meta .diwa-checked {
  margin: 0;
  color: var(--muted-text-color);
  font-size: 0.92rem;
  font-weight: 400;
}

.diwa-hero-meta .diwa-overall {
  display: inline-block;
  margin: 0.85rem 0 0;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0e7490;
  font-size: 0.85rem;
  font-weight: 500;
}

.diwa-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

body article + h3 {
  margin-top: 1.25rem;
}

body h2,
body h3 {
  opacity: 1;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--body-text-color);
}

body h3 {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted-text-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Duration pills and Live Status heading — mockup uses a recorded-days bar */

body .live-status form,
body .live-status > h3,
body form.f,
body form.r,
body h3:has(form) {
  display: none !important;
}

body.diwa-ready .loading,
body main > .loading,
body article.up:not(.link):not(.graph) ~ .loading {
  display: none !important;
}

/* Service rows */

body .live-status {
  margin-top: 1.75rem;
}

.diwa-service-list {
  background: var(--card-background-color);
  border: 1px solid var(--card-border-color);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.diwa-service-list article,
body .live-status article {
  margin: 0;
  padding: 1.25rem 1.5rem 1.15rem;
  overflow: hidden;
  border: none;
  border-bottom: 1px solid var(--card-border-color);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.diwa-service-list article:last-child {
  border-bottom: none;
}

body .live-status article.up,
body .live-status article.down,
body .live-status article.degraded {
  border-left-width: 0;
}

body article + article {
  margin-top: 0;
}

body .live-status article h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.2rem;
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--body-text-color);
}

body .live-status article h4 .icon {
  display: none;
}

body .live-status article h4::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

body .live-status article.down h4::before {
  background: #ef4444;
}

body .live-status article.degraded h4::before {
  background: #f59e0b;
}

.diwa-service-uptime {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted-text-color);
  white-space: nowrap;
  letter-spacing: 0;
}

body .live-status article.up h4::after,
body .live-status article.down h4::after,
body .live-status article.degraded h4::after {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  color: #166534;
}

body .live-status article.up h4::after {
  content: "Operational";
  background: var(--tag-up-background-color);
}

body .live-status article.down h4::after {
  content: "Down";
  background: #fee2e2;
  color: #991b1b;
}

body .live-status article.degraded h4::after {
  content: "Degraded";
  background: #fef3c7;
  color: #92400e;
}

body .live-status article > div:not(.uptime-bar-wrap):not(.diwa-timeline) {
  display: none;
}

.diwa-service-host {
  margin: 0 0 0 1.05rem;
  font-size: 0.86rem;
  color: var(--muted-text-color);
}

body article.graph {
  background-image: none !important;
}

.uptime-bar-wrap {
  margin-top: 0.85rem;
}

.uptime-bar {
  display: flex;
  gap: 2px;
  height: 28px;
}

.uptime-tick {
  flex: 1;
  min-width: 0;
  border-radius: 1px;
}

.uptime-tick.nodata {
  background: #d1d5db;
}

.uptime-tick.up {
  background: #22c55e;
}

.uptime-tick.degraded {
  background: #f59e0b;
}

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

.uptime-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted-text-color);
}

/* Incidents */

body section > h2 {
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
  font-size: 1.2rem;
  font-weight: 650;
}

body article.down.link:not(.down-active),
body article.degraded.link:not(.down-active) {
  background: var(--card-background-color);
  border: 1px solid var(--card-border-color);
  border-left-width: 1px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  color: var(--body-text-color);
  margin-top: 0.75rem;
}

body article.down.link .f,
body article.degraded.link .f {
  align-items: flex-start;
  gap: 0.75rem;
}

body article.down.link h4,
body article.degraded.link h4 {
  margin-bottom: 0.2rem;
  font-weight: 650;
}

body article.down.link:not(.down-active) h4::after {
  content: "Resolved";
  display: inline-block;
  margin-left: 0.6rem;
  font-size: 0.68rem;
  font-weight: 650;
  vertical-align: middle;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--tag-up-background-color);
  color: #166534;
}

body article.down-active h4::after {
  content: none;
}

body article.down.link .f.r a,
body article.degraded.link .f.r a {
  font-size: 0.8rem;
  color: var(--muted-text-color);
}

body article.down-active {
  border-left-width: 1px;
}

body .tag {
  font-weight: 650;
  letter-spacing: 0.01em;
  border-radius: 999px;
}

body .tag.down,
body .tag.open {
  color: #fff;
}

.diwa-timeline {
  position: relative;
  margin-top: 0.95rem;
  padding: 0.15rem 0 0.1rem 1.15rem;
  border-left: 2px solid var(--card-border-color);
}

.diwa-timeline-item {
  position: relative;
  margin: 0 0 0.85rem;
}

.diwa-timeline-item:last-child {
  margin-bottom: 0;
}

.diwa-timeline-item::before {
  content: "";
  position: absolute;
  left: -1.15rem;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  margin-left: -5px;
  border-radius: 50%;
  background: #94a3b8;
}

.diwa-timeline-item:last-child::before {
  background: #22c55e;
}

.diwa-timeline-when {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-text-color);
}

.diwa-timeline-body {
  font-size: 0.86rem;
  color: #4b5563;
  line-height: 1.45;
}

.diwa-timeline-body code {
  font-size: 0.82em;
}

/* History / incident detail */

body dl dt {
  color: var(--muted-text-color);
  font-weight: 500;
  font-size: 0.85rem;
}

body footer {
  text-align: center;
  margin-top: 1.5rem;
  opacity: 1;
  color: var(--muted-text-color);
  font-size: 0.95rem;
}

body footer a {
  color: var(--brand-teal);
}

.rss-subscribe {
  margin: 0;
}

.rss-subscribe a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: var(--body-text-color);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.rss-subscribe a::before {
  content: "";
  width: 0.9rem;
  height: 0.9rem;
  background: currentColor;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='6.2' cy='17.8' r='2.2' fill='black'/><path d='M4 10.5a9.5 9.5 0 0 1 9.5 9.5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/><path d='M4 4.5A15.5 15.5 0 0 1 19.5 20' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='6.2' cy='17.8' r='2.2' fill='black'/><path d='M4 10.5a9.5 9.5 0 0 1 9.5 9.5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/><path d='M4 4.5A15.5 15.5 0 0 1 19.5 20' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center / contain no-repeat;
}

.rss-subscribe a:hover {
  border-color: var(--brand-teal);
  color: var(--brand-teal);
}

body > .rss-subscribe {
  display: none;
}

@media (max-width: 640px) {
  body nav .container {
    padding: 0.75rem 1rem;
  }

  body nav .logo img {
    max-width: 6.5rem;
  }

  body article.up:not(.link):not(.graph),
  body article.down:not(.link):not(.graph),
  body article.degraded:not(.link):not(.graph) {
    font-size: 1.35rem;
    padding-top: 1.25rem;
  }

  body article.up:not(.link):not(.graph)::before,
  body article.down:not(.link):not(.graph)::before,
  body article.degraded:not(.link):not(.graph)::before {
    width: 2.85rem;
    height: 2.85rem;
    background-size: 1.15rem;
  }

  body .live-status article,
  .diwa-service-list article {
    padding: 1.05rem 1.1rem 1rem;
  }

  body .live-status article h4 {
    flex-wrap: wrap;
  }

  .diwa-service-uptime {
    width: 100%;
    margin-left: 1.05rem;
    order: 5;
  }

  .diwa-service-host {
    margin-left: 1.05rem;
  }

  .uptime-bar {
    height: 22px;
    gap: 1px;
  }
}
