:root {
  --bg: #f3f3f4;
  --surface: #ffffff;
  --line: #d8d8dc;
  --text: #1d1d22;
  --muted: #6a6c75;
  --brand: #d73a2f;
  --brand-dark: #b52b22;
  --ok: #21864f;
  --warn: #a45a00;
  --major: #9a1d1d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Arial", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem;
}

.topbar {
  background: linear-gradient(90deg, var(--brand), #f05a2d);
  color: #fff;
  border-bottom: 1px solid #a32923;
}
.topbar__inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}
.topnav a {
  color: #fff;
  text-decoration: none;
  margin-left: 1rem;
  font-size: .95rem;
  opacity: .95;
}

.page {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  margin: 0 0 1rem;
}
.hero {
  border-top: 4px solid var(--brand);
}

h1, h2, h3 {
  margin: 0 0 .6rem;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }

.check-form {
  display: flex;
  gap: .5rem;
  margin-top: .8rem;
}
input {
  flex: 1;
  border: 1px solid #c3c4cc;
  border-radius: 6px;
  padding: .65rem .75rem;
  font-size: 1rem;
}
button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: .65rem .95rem;
  cursor: pointer;
}
button:hover { background: var(--brand-dark); }
.error { color: #aa1f1f; }

.status-card {
  border-left: 5px solid var(--brand);
}
.status-line {
  font-weight: 700;
}
.status-line--up { color: var(--ok); }
.status-line--down { color: var(--major); }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: .2rem .55rem;
  font-size: .8rem;
  font-weight: 700;
}
.pill--normal { background: #e7f5ec; color: #226a3f; }
.pill--elevated { background: #fff1dd; color: #8a5200; }
.pill--major { background: #fde3e3; color: #9a1d1d; }

.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag {
  border: 1px solid #d5d6de;
  border-radius: 999px;
  padding: .35rem .65rem;
  background: #fafafa;
  color: #2c2d33;
  text-decoration: none;
  font-size: .9rem;
}

.report-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border: 1px solid #dfdfe5;
  text-align: left;
  padding: .5rem;
  font-size: .93rem;
}
th {
  background: #f7f7fa;
}

a { color: #0c5fa8; }

.incident-chart {
  position: relative;
  border: 1px solid #d9d1c5;
  background: #fcfcfd;
  padding: .75rem .5rem 1.5rem;
  overflow-x: auto;
}
.incident-chart__axis--zero {
  position: absolute;
  left: .5rem;
  right: .5rem;
  top: calc(50% - 1px);
  border-top: 2px dashed #9ea0aa;
  pointer-events: none;
}
.incident-chart__plot { position: relative; }
.incident-chart__bars {
  display: flex;
  gap: .2rem;
  align-items: stretch;
  min-height: 170px;
  position: relative;
  z-index: 2;
}
.incident-chart__slot {
  position: relative;
  width: 22px;
  height: 150px;
  flex: 0 0 22px;
}
.incident-chart__slot small {
  position: absolute;
  bottom: -16px;
  left: 0;
  width: 100%;
  font-size: .67rem;
  text-align: center;
  color: #6a6256;
}
.incident-chart__bar {
  position: absolute;
  left: 3px;
  width: 16px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  background: #ddd;
}
.incident-chart__bar.is-positive {
  bottom: 50%;
  background: linear-gradient(180deg, #ff8f75, #d13a2f);
}
.incident-chart__bar.is-negative {
  top: 50%;
  background: linear-gradient(180deg, #57af7f, #2e7b56);
}
.incident-chart__line-svg {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}
.incident-chart__line {
  fill: none;
  stroke: #0b4aa2;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.7));
}
.incident-chart__legend {
  margin: .45rem 0 0;
  color: var(--muted);
  font-size: .88rem;
}
.incident-chart__tooltip {
  position: absolute;
  z-index: 3;
  background: #111;
  color: #fff;
  padding: .45rem .55rem;
  border-radius: 6px;
  font-size: .8rem;
  max-width: 230px;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}

.footer {
  padding-top: .6rem;
  padding-bottom: 1.2rem;
  color: var(--muted);
  font-size: .88rem;
}

@media (max-width: 820px) {
  .check-form { flex-direction: column; }
  .topbar__inner { flex-direction: column; justify-content: center; padding: .5rem 0; }
  .topnav a { margin: 0 .5rem; }
}
