:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --inchiostro: #14161a;
  --grigio: #6b7079;
  --filo: #e7e8ec;
  --barra: #d9dce2;
  --accento: #1d8f63;
  --accento-chiaro: #e8f5ef;
  --ambra: #d88a12;
  --ambra-chiaro: #fdf3e2;
  --mono: "JetBrains Mono Variable", ui-monospace, monospace;
  --sans: "Mona Sans Variable", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: min(4vw, 4vh);
}

.card {
  position: relative;
  width: min(560px, 94vw);
  background: var(--carta);
  border: 1px solid var(--filo);
  border-radius: 18px;
  padding: clamp(14px, min(4vw, 3.6vh), 26px);
  box-shadow: 0 1px 2px rgb(20 22 26 / 0.04), 0 14px 40px -18px rgb(20 22 26 / 0.18);
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(10px, 2.4vh, 18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 640;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--inchiostro);
  display: grid;
  place-items: center;
}

.brand__mark svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.head__link {
  font-size: 12.5px;
  color: var(--grigio);
}

/* the overall state */
.banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(10px, 2vh, 14px) 14px;
  border-radius: 12px;
  background: var(--accento-chiaro);
  overflow: hidden;
}

.banner__wash {
  position: absolute;
  inset: 0;
  background: var(--ambra-chiaro);
  opacity: 0;
}

.badge {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accento);
}

.badge__icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.badge__icon path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.badge__icon--warn path { stroke-dashoffset: 1; }

.banner__text {
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.banner__swap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.banner__title {
  grid-area: 1 / 1;
  font-size: clamp(15px, min(4.2vw, 3.4vh), 18px);
  font-weight: 650;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.banner__title--warn { opacity: 0; }

.banner__sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--grigio);
}

.legend {
  display: flex;
  justify-content: space-between;
  margin: clamp(10px, 2.2vh, 16px) 0 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--grigio);
}

/* the four components */
.rows { list-style: none; }

.row {
  padding: clamp(7px, 1.5vh, 11px) 0;
  border-top: 1px solid var(--filo);
}

.row__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 13.5px;
}

.row__name { font-weight: 600; }

.row__state {
  font-size: 12px;
  color: var(--accento);
}

.row__uptime {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--grigio);
  min-width: 7ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bars {
  display: flex;
  gap: 2px;
  height: clamp(18px, 3.4vh, 26px);
  align-items: stretch;
}

.bar {
  position: relative;
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--accento);
  transform-origin: 50% 100%;
}

.bar--ambra { background: var(--ambra); }
.bar--piano { background: #8fcdb3; }

/* the incident, opening inside the Webhooks row */
.incident {
  height: 0;
  overflow: hidden;
}

.incident__inner { padding-top: 12px; }

.incident__title {
  font-size: 13px;
  font-weight: 620;
  margin-bottom: 8px;
}

.steps {
  position: relative;
  padding-left: 18px;
}

.steps__rail {
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 1px;
  background: var(--filo);
}

.steps__fill {
  position: absolute;
  inset: 0;
  border-radius: 1px;
  background: var(--ambra);
  transform-origin: 50% 0;
  transform: scaleY(0);
}

.steps__list { list-style: none; display: grid; gap: 5px; }

.step {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  opacity: 0;
}

.step b { font-weight: 620; color: var(--ambra); }
.step--done b { color: var(--accento); }

.step time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--grigio);
}

.step__text {
  color: var(--grigio);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* a short dash on the rail, not a dot */
.step__tick {
  position: absolute;
  left: -12px;
  top: 0.62em;
  width: 7px;
  height: 2px;
  border-radius: 1px;
  background: var(--ambra);
}

.step--done .step__tick { background: var(--accento); }

/* the tooltip over a bar */
.tip {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  gap: 1px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--inchiostro);
  color: #fff;
  font-size: 11.5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 10px 24px -10px rgb(20 22 26 / 0.45);
}

.tip__date {
  font-family: var(--mono);
  font-size: 10px;
  color: rgb(255 255 255 / 0.62);
}

@media (max-width: 420px) {
  .head__link { display: none; }
  .step__text { display: none; }
  .row__top { font-size: 12.5px; gap: 8px; }
}

/* low boxes (the phone preview, 341 by 410): same page, tighter */
@media (max-height: 560px) {
  .stage { padding: 8px; }
  .card { padding: 12px 14px; border-radius: 14px; }
  .head { margin-bottom: 8px; }
  .brand { font-size: 13.5px; }
  .brand__mark { width: 20px; height: 20px; border-radius: 6px; }
  .banner { padding: 8px 10px; gap: 10px; }
  .badge { width: 26px; height: 26px; }
  .banner__title { font-size: 14.5px; }
  .banner__sub { font-size: 10px; }
  .legend { margin: 6px 0 3px; font-size: 9.5px; }
  .row { padding: 5px 0; }
  .row__top { margin-bottom: 4px; font-size: 12px; }
  .row__state { font-size: 11px; }
  .row__uptime { font-size: 10.5px; }
  .bars { height: 13px; }
  .incident__inner { padding-top: 6px; }
  .incident__title { font-size: 11.5px; margin-bottom: 4px; }
  .steps__list { grid-template-columns: 1fr 1fr; gap: 2px 10px; }
  .steps { padding-left: 0; }
  .steps__rail, .step__tick { display: none; }
  .step { font-size: 11px; gap: 6px; }
  .step__text { display: none; }
}

@media (hover: hover) {
  .bars { cursor: default; }
}
