/*
 * The availability page. Restrained colours: a month below the promise should
 * stand out, but the page is a record, not an alarm board.
 */

/* ── Page rhythm ─────────────────────────────────────────────────────────
 * One column at the order page's width, every section 20px apart, the head
 * on the same edge as the cards below it.
 */
.st-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1120px;
  margin-inline: auto;
}
.st-page > .page-head {
  /* In a flex column, auto margins would shrink the head to its text and centre it. */
  width: 100%;
  margin-inline: 0;
  padding-bottom: 14px;
}

.st-sample {
  margin: 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--tint);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ── This month, big ─────────────────────────────────────────────────────── */

.st-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: end;
  padding: clamp(24px, 3vw, 36px);
  border-radius: 22px;
  background: var(--bg-card);
  box-shadow:
    0 0 0 1px var(--border-faint),
    var(--shadow-card);
}
.st-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.st-hero-val {
  display: block;
  margin-top: 14px;
  font-size: clamp(44px, 6vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.st-hero-sub {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}
.st-hero[data-tone="bad"] .st-hero-val {
  color: #b42318;
}

.st-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-faint);
}
.st-hero[data-tone="ok"] .st-dot {
  background: #17803d;
  box-shadow: 0 0 0 4px rgba(23, 128, 61, 0.14);
}
.st-hero[data-tone="bad"] .st-dot {
  background: #b42318;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14);
}

/* Twelve months as columns: a glance, the list below has the figures. */
.st-strip {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
  height: 120px;
}
.st-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.st-track {
  flex: 1;
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 26px;
  border-radius: 7px;
  background: var(--bg-tertiary);
}
.st-col i {
  display: block;
  width: 100%;
  border-radius: 7px;
  background: var(--text-faint);
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.st-col[data-tone="ok"] i {
  background: linear-gradient(180deg, #22a35a, #17803d);
}
.st-col[data-tone="bad"] i {
  background: linear-gradient(180deg, #d9534a, #b42318);
}
.st-col[data-tone="idle"] i {
  background: var(--border-primary);
}
.st-col small {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
}
.st-col:last-child small {
  color: var(--text-primary);
}

/* ── Monthly list ────────────────────────────────────────────────────────── */

.st-months {
  display: grid;
  gap: 2px;
}

.st-month {
  display: grid;
  align-items: center;
  gap: 16px;
  /* Capped width: stretched across a wide screen, even an outage looks like a
     green line. */
  grid-template-columns: 160px minmax(120px, 1fr) 84px minmax(170px, 0.7fr);
  padding: 14px 6px;
  border-bottom: 1px solid var(--border-secondary);
}
.st-month:last-child {
  border-bottom: 0;
}

.st-month-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.st-month-val {
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-secondary);
}
.st-month-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: right;
}

.st-month[data-tone="bad"] .st-month-val {
  color: #b42318;
  font-weight: 600;
}
.st-month[data-tone="idle"] .st-month-val {
  color: var(--text-faint);
}

/* The bar spans 98 to 100 percent, where the difference between kept and
   broken lies. */
.st-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border-primary);
  overflow: hidden;
}
.st-bar span {
  display: block;
  height: 100%;
  background: var(--text-faint);
}
.st-month[data-tone="ok"] .st-bar span {
  background: #17803d;
}
.st-month[data-tone="bad"] .st-bar span {
  background: #b42318;
}

/* ── Maintenance windows ─────────────────────────────────────────────────── */

.st-windows {
  display: grid;
  gap: 2px;
}
.st-window {
  display: grid;
  gap: 3px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border-secondary);
}
.st-window:last-child {
  border-bottom: 0;
}
.st-window b {
  font-size: 13.5px;
  color: var(--text-primary);
}
.st-window span {
  font-size: 12.5px;
  color: var(--text-muted);
}
.st-window-told {
  color: var(--text-faint) !important;
  font-size: 11.5px !important;
}

.st-empty {
  margin: 0;
  padding: 16px 4px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── How it is measured ──────────────────────────────────────────────────── */

.st-how {
  margin: 0;
  display: grid;
  gap: 2px;
}
.st-how > div {
  display: grid;
  gap: 16px;
  grid-template-columns: 200px minmax(0, 1fr);
  padding: 15px 4px;
  border-bottom: 1px solid var(--border-secondary);
}
.st-how > div:last-child {
  border-bottom: 0;
}
.st-how dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.st-how dd {
  margin: 0;
  max-width: 68ch;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-muted);
}
.st-how dd a {
  color: var(--text-primary);
}

@media (max-width: 860px) {
  .st-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

@media (max-width: 760px) {
  /* On narrow screens each row stacks instead of squeezing a percentage into a
     40px column. */
  .st-month {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 8px;
  }
  .st-bar {
    grid-column: 1 / -1;
    order: 3;
  }
  .st-month-note {
    grid-column: 1 / -1;
    order: 4;
    text-align: left;
  }
  .st-how > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}
