/* Spero Data Status: the Spero Design System look.
   Navy text, one orange accent (the active tab and the primary button), cool grey rules, near-square
   corners, Jost for text, Cormorant Garamond for headings, wide letterspaced caps on labels. */

:root {
  --navy: #233451;
  --orange: #F68B1F;
  --orange-deep: #E27A12;
  --sky: #48C7EF;
  --grey: #CFCFD1;
  --muted: #5A6578;
  --paper: #FFFFFF;
  --mist: #F5F6F8;
  --ok: #84BB4C;
  --late: #F2A86F;
  --bad: #ED6E6E;
  --neutral: #E6E7EA;
  --sky-tint: rgba(72, 199, 239, .09);

  --radius: 3px;
  --gutter: 24px;
  --page: 1120px;
  --text: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --caps: .18em;
  --focus: 0 0 0 3px rgba(72, 199, 239, .45);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; color: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---- Type ---- */

.heading {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -.005em;
}

.heading--section { font-size: 30px; }

.lede { margin: 0 0 20px; font-size: 17px; }

.aside { margin: 0 0 20px; color: var(--muted); font-size: 15px; }

.label,
.section-label {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--caps);
  text-transform: uppercase;
}

.section-label { color: var(--muted); }

.email { font-weight: 500; overflow-wrap: anywhere; }

/* ---- Wordmark ---- */

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  white-space: nowrap;
}

.wordmark {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .34em;
  margin-right: -.34em; /* the tracking after the last letter */
}

.tagline {
  padding-left: 12px;
  border-left: 1px solid var(--grey);
  color: var(--muted);
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 19px;
  line-height: 1;
}

/* ---- Card screens: sign-in, check your inbox, not on the list ---- */

.screen--card {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 12vh 16px 48px;
  background: var(--mist);
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 40px 40px 36px;
  background: var(--paper);
  border: 1px solid var(--grey);
  border-radius: var(--radius);
}

.card .brand { margin-bottom: 40px; }

.card > :last-child { margin-bottom: 0; }

.loading { margin: 0; color: var(--muted); letter-spacing: var(--caps); text-transform: uppercase; font-size: 12px; }

.noscript { margin: 24px; text-align: center; }

/* ---- Form ---- */

.form { margin-top: 28px; }

.field {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0 0 16px;
  padding: 0 14px;
  background: var(--paper);
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  font-size: 16px; /* 16px keeps phones from zooming in */
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field::placeholder { color: #9AA1AD; }

.field:focus { outline: none; border-color: var(--navy); box-shadow: var(--focus); }

.field[aria-invalid="true"] { border-color: var(--bad); }

/* ---- Buttons ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.button--primary { width: 100%; background: var(--orange); color: var(--navy); }

.button--primary:hover { background: var(--orange-deep); }

.button--secondary { background: transparent; border-color: var(--navy); color: var(--navy); }

.button--secondary:hover { background: var(--navy); color: var(--paper); }

.button:disabled { opacity: .7; cursor: progress; }

.link {
  padding: 0;
  background: none;
  border: 0;
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--grey);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

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

/* ---- Messages ---- */

.message {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-left: 3px solid var(--sky);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(72, 199, 239, .09);
  font-size: 15px;
}

.message--error { border-left-color: var(--bad); background: rgba(237, 110, 110, .09); }

/* ---- App: header and tabs ---- */

.masthead { background: var(--paper); border-bottom: 1px solid var(--grey); }

.masthead__inner { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

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

.masthead__top .brand { flex: none; }

.account {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
  font-size: 14px;
}

.account__email {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account__signout { flex: none; }

.tabs { display: flex; gap: 32px; margin-top: 8px; }

.tab {
  margin: 0 0 -1px;
  padding: 12px 0 11px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}

.tab:hover { color: var(--navy); border-bottom-color: var(--grey); }

.tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--orange); }

.content {
  max-width: var(--page);
  margin: 0 auto;
  padding: 36px var(--gutter) 72px;
}

.content:focus { outline: none; }

/* ---- Panels ---- */

.panel {
  padding: 28px 32px;
  border: 1px solid var(--grey);
  border-radius: var(--radius);
}

.panel--placeholder { max-width: 640px; }

.panel--placeholder .lede { margin-bottom: 0; color: var(--muted); }

/* ---- Status tab ---- */

.status-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  margin-bottom: 28px;
}

.status-head .heading { margin: 0; }

.status-updated { margin: 0; color: var(--muted); font-size: 14px; }

.status-problem { margin-bottom: 24px; overflow-wrap: anywhere; }

.board { display: grid; gap: 48px; min-width: 0; }

.board > *, .status-top > *, .status-lower > * { min-width: 0; }

.status-top {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 24px;
  align-items: stretch;
}

.status-lower { display: grid; gap: 48px; }

.section > .section-label {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--grey);
}

.section__hint { margin: -4px 0 12px; font-size: 14px; }

/* Chips: the colour says the tone, the text always says the status. */
.chip {
  display: inline-block;
  padding: 3px 8px 2px;
  border-radius: var(--radius);
  background: var(--neutral);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip--ok { background: var(--ok); }
.chip--late { background: var(--late); }
.chip--bad { background: var(--bad); }
.chip--neutral { background: var(--neutral); color: var(--muted); }

/* Collector banner */
.banner {
  padding: 22px 28px 24px;
  border: 1px solid var(--grey);
  border-left: 4px solid var(--neutral);
  border-radius: var(--radius);
}

.banner--ok { border-left-color: var(--ok); }
.banner--late { border-left-color: var(--late); }
.banner--bad { border-left-color: var(--bad); }

.banner__warning,
.banner__empty {
  margin: 0 0 16px;
  padding: 8px 12px;
  border-left: 3px solid var(--bad);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(237, 110, 110, .12);
  font-weight: 600;
}

.banner__empty:last-child { margin-bottom: 0; }

.hosts { margin: 0; padding: 0; list-style: none; }

.host + .host { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--grey); }

.host__line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }

.host__name {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.meta li + li::before { content: "·"; margin: 0 10px; color: var(--grey); }

/* Summary */
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary__item { display: flex; align-items: center; gap: 10px; }

.summary__count {
  min-width: 1ch;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
}

/* Tables */
.scroller {
  position: relative; /* clips its absolutely placed screen-reader text too */
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.scroller:focus-visible { border-radius: var(--radius); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.table th,
.table td {
  padding: 11px 16px 11px 0;
  border-bottom: 1px solid var(--grey);
  text-align: left;
  vertical-align: top;
}

.table th:last-child,
.table td:last-child { padding-right: 0; }

.table thead th {
  padding-top: 0;
  padding-bottom: 8px;
  border-bottom-color: var(--navy);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody th { font-weight: 500; }

.table .num { white-space: nowrap; }

.nowrap { white-space: nowrap; }

.cell--error {
  min-width: 220px;
  max-width: 360px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.table--sources { min-width: 980px; }

.table--sources tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 150px;
  max-width: 220px;
  padding-left: 10px;
  background: var(--paper);
  box-shadow: inset 3px 0 0 transparent;
}

.table--sources thead th:first-child { padding-left: 10px; }

.table--sources tr.is-clickable { cursor: pointer; }

.table--sources tbody tr:hover td,
.table--sources tbody tr:hover th { background: var(--mist); }

.table--sources tr.is-selected td,
.table--sources tr.is-selected th { background: var(--sky-tint); }

.table--sources tr.is-selected th { box-shadow: inset 3px 0 0 var(--sky); }

.table--sources tr.is-selected:hover td,
.table--sources tr.is-selected:hover th { background: rgba(72, 199, 239, .15); }

.source-button {
  padding: 0;
  background: none;
  border: 0;
  font-weight: 500;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--grey);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.source-button:hover { text-decoration-color: var(--navy); }

.table--schedule { max-width: 720px; }

.table--runs { min-width: 720px; }

/* Runs panel */
.runs { padding: 24px 28px 8px; background: var(--paper); }

.runs__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.runs__title { min-width: 0; }

.runs__title .heading { margin: 0; overflow-wrap: anywhere; }

.runs .table tbody tr:last-child td { border-bottom: 0; }

.button--small { min-height: 36px; padding: 0 16px; font-size: 12px; flex: none; }

/* Last 30 days */
.calendar__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 12px;
}

.calendar__range { margin: 0; font-size: 14px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.legend li { display: flex; align-items: center; gap: 7px; }

.swatch { width: 12px; height: 12px; border-radius: 2px; background: var(--neutral); }
.swatch--ok { background: var(--ok); }
.swatch--bad { background: var(--bad); }

.calendar {
  border-collapse: separate;
  border-spacing: 3px;
  margin-left: -3px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.calendar th { font-weight: 500; }

.calendar__day {
  min-width: 20px;
  padding: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.calendar__day--month { color: var(--navy); font-weight: 600; }

.calendar__source {
  position: sticky;
  left: 0;
  z-index: 1;
  max-width: 180px;
  padding: 0 14px 0 3px;
  background: var(--paper);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar__corner { position: sticky; left: 0; z-index: 1; background: var(--paper); }

.calendar__cell {
  width: 20px;
  min-width: 20px;
  height: 22px;
  padding: 0;
  border-radius: 2px;
  background: var(--neutral);
}

.calendar__cell--ok { background: var(--ok); }
.calendar__cell--late { background: var(--late); }
.calendar__cell--bad { background: var(--bad); }

/* ---- Small screens ---- */

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .card { padding: 32px 22px 28px; }
  .card .brand { margin-bottom: 32px; }
  .heading { font-size: 34px; }
  .heading--section { font-size: 26px; }
  .masthead__top { padding-top: 16px; }
  .tagline { font-size: 17px; }
  .wordmark { font-size: 15px; letter-spacing: .3em; margin-right: -.3em; }
  .tabs { gap: 24px; }
  .content { padding-top: 24px; }
  .panel { padding: 22px 20px; }
  .status-top { grid-template-columns: minmax(0, 1fr); }
  .board, .status-lower { gap: 40px; }
  .banner { padding: 18px 20px 20px; }
  .host__name { font-size: 24px; }
  .meta { flex-direction: column; }
  .meta li + li::before { content: none; }
  .summary { gap: 12px 20px; }
  .summary__count { font-size: 28px; }
  .runs { padding: 20px 20px 4px; }
  .calendar__source { max-width: 120px; }
}

@media (max-width: 860px) and (min-width: 561px) {
  .status-top { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
