/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: #1f2328;
  background: #f6f8fa;
}

.site-header {
  background: #24292f;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.site-nav a {
  color: #9ecbff;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.site-nav a {
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.site-nav a[aria-current="page"] {
  color: #fff;
  font-weight: 600;
  border-bottom-color: #9ecbff;
}

.site-title {
  margin: 0;
  font-size: 1.25rem;
}

.site-title a {
  color: #fff;
  text-decoration: none;
}

/* Account navigation: right end of the header; a long e-mail is cut with an ellipsis. */
.account-nav {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
  margin-left: auto;
  white-space: nowrap;
}

.account-nav__email {
  min-width: 0;
  max-width: 20rem;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e6edf3;
}

.account-nav .button_to {
  display: inline;
  margin: 0;
}

.account-nav__link,
.account-nav__sign-out {
  color: #9ecbff;
  text-decoration: none;
}

.account-nav__sign-out {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.account-nav__link:hover,
.account-nav__sign-out:hover {
  text-decoration: underline;
}

.account-nav__link:focus-visible,
.account-nav__sign-out:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.flash {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.flash--notice {
  color: #0f5323;
  background: #dafbe1;
  border-color: #4ac26b;
}

.flash--alert {
  color: #82071e;
  background: #ffebe9;
  border-color: #ff8182;
}

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

.stats__tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats__tab {
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
}

.stats__tab[aria-current="page"] {
  font-weight: 600;
  border-bottom-color: currentColor;
}

.stats__counters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.stats__counter dt {
  font-size: 0.85rem;
  color: #57606a;
}

.stats__counter dd {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
}

.stats__section {
  margin-bottom: 2rem;
}

.stats__table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}

.stats__table th,
.stats__table td {
  border: 1px solid #d0d7de;
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.stats__table th {
  background: #f6f8fa;
}

.stats__failures li {
  margin-bottom: 0.4rem;
}

/* Phones: title and three mode links stay in one row (a wrapped header would push the board down). Sizes leave
   ~10% spare width for wider fonts (Linux CI). Keep these rules after the base .site-* rules. */
@media (max-width: 40rem) {
  .site-header {
    padding-inline: 0.625rem;
    gap: 0.5rem;
  }

  .site-title {
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .site-nav {
    gap: 0.5rem;
    font-size: 0.75rem;
  }
}

/* Up to tablets the account navigation takes its own compact row. Two rows must stay within 57 px at 390 px
   (spec/system/find_blunder_spec.rb), hence the smaller padding and line height. Keep after the 40rem block,
   whose `gap` would otherwise override row-gap. */
@media (max-width: 48rem) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 0.2rem;
    padding-block: 0.35rem;
    line-height: 1.25;
  }

  .account-nav {
    flex-basis: 100%;
    justify-content: flex-end;
    font-size: 0.75rem;
  }
}

/* Narrow phones (360 px and below): the links no longer fit next to the title, so the nav takes a second row. */
@media (max-width: 24rem) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
}
