html {
  min-width: 320px;
  background: var(--charcoal);
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

button,
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 9px 18px 7px;
  border: 4px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
  background: var(--cyan);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: var(--font-action);
  font-size: 1.05rem;
  letter-spacing: .035em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

button:hover:not(:disabled),
.button:hover {
  filter: brightness(1.08);
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
}

button:active:not(:disabled),
.button:active {
  transform: translate(5px, 5px);
  box-shadow: none;
}

button:focus-visible,
.button:focus-visible,
input:focus-visible,
.table-link:focus-visible {
  outline: 4px solid var(--pink);
  outline-offset: 4px;
}

button:disabled {
  filter: grayscale(.7);
  opacity: .48;
  cursor: not-allowed;
}

.button-secondary {
  background: var(--yellow);
}

.button-danger {
  color: var(--chalk);
  background: #9c3831;
}

.access-page {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.access-page-auth {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-rows: 1fr;
}

.access-page-auth > .brand-link {
  position: absolute;
  z-index: 1;
  top: 28px;
  left: 0;
}

.access-page-auth > .auth-stage {
  grid-row: 1;
}

.brand-link {
  display: block;
  width: fit-content;
  text-decoration: none;
  transform: rotate(-.35deg);
}

.brand-link:focus-visible {
  outline: 4px solid var(--cyan);
  outline-offset: 6px;
}

.auth-stage {
  display: grid;
  place-items: center;
  padding: 48px 0 80px;
}

.comic-panel {
  position: relative;
  border: 5px solid var(--ink);
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgb(255 216 35 / 9%), transparent 36%),
    var(--panel);
  box-shadow: 11px 11px 0 var(--ink);
}

.auth-card {
  width: min(100%, 740px);
  padding: clamp(28px, 6vw, 54px);
}

.auth-brand-link {
  width: 100%;
  margin: 0 0 30px;
}

.auth-brand-link .brand-banner {
  width: 100%;
  justify-content: center;
  font-size: clamp(28px, 4vw, 36px);
}

.auth-card-admin {
  width: min(100%, 650px);
}

.panel-label,
.eyebrow {
  margin: 0 0 12px;
  color: var(--yellow);
  font-family: var(--font-action);
  font-size: 1.05rem;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--font-comic);
  white-space: normal;
}

.auth-card h1 {
  max-width: 12ch;
  margin-bottom: 24px;
  color: var(--chalk);
  font-size: clamp(2.65rem, 8vw, 5.25rem);
  line-height: .86;
}

.auth-card-admin h1 {
  max-width: none;
  font-size: clamp(1.9rem, 8vw, 2.65rem);
  letter-spacing: -.015em;
}

.intro {
  max-width: 47ch;
  margin-bottom: 26px;
  color: var(--chalk);
  font-size: 1.15rem;
  line-height: 1.45;
}

.small {
  max-width: 54ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.45;
}

.auth-actions {
  display: grid;
  justify-items: start;
  gap: 18px;
}

.membership-link {
  color: var(--chalk);
  font-size: .98rem;
  line-height: 1.3;
  text-decoration-color: var(--cyan);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.membership-link:hover {
  color: var(--yellow);
  text-decoration-color: currentColor;
}

.membership-link:focus-visible {
  outline: 4px solid var(--pink);
  outline-offset: 4px;
}

.notice {
  margin: 0 0 24px;
  padding: 16px 17px 13px;
  border: 4px solid var(--ink);
  border-left: 11px solid var(--pink);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 700;
  line-height: 1.35;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.field-label {
  display: grid;
  gap: 9px;
  color: var(--yellow);
  font-family: var(--font-action);
  font-size: 1rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.field-input {
  width: 100%;
  min-height: 54px;
  padding: 10px 13px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 10%);
  font-family: var(--font-body);
  font-size: 1.1rem;
}

.auth-form button {
  width: fit-content;
}

.dashboard-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 34px 0 30px;
}

.dashboard-heading {
  margin: 0;
  color: var(--chalk);
  font-size: clamp(2.6rem, 6vw, 5.1rem);
  line-height: .88;
}

.header-actions,
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.header-actions form,
.panel-actions form {
  margin: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.summary-card {
  min-height: 176px;
  padding: 22px 24px 20px;
  overflow: hidden;
}

.summary-card::after {
  position: absolute;
  right: -25px;
  bottom: -42px;
  width: 130px;
  height: 130px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--cyan);
  content: "";
  opacity: .16;
}

.summary-card:nth-child(2)::after {
  background: var(--yellow);
}

.summary-card:nth-child(3)::after {
  background: var(--pink);
}

.summary-card h2 {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: var(--yellow);
  font-family: var(--font-action);
  font-size: 1.05rem;
  letter-spacing: .08em;
  line-height: 1.05;
  text-transform: uppercase;
}

.summary-number {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-comic);
  font-size: 4.25rem;
  line-height: .8;
}

.dashboard-panel {
  margin-top: 26px;
  padding: clamp(22px, 4vw, 32px);
}

.dashboard-panel h2 {
  margin-bottom: 16px;
  color: var(--yellow);
  font-family: var(--font-action);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
}

.sync-status,
.cohort-status {
  color: var(--muted);
  line-height: 1.4;
}

.panel-actions {
  margin: 22px 0 18px;
}

.message,
.warning {
  padding: 15px 17px 13px;
  border: 4px solid var(--ink);
  border-left-width: 11px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 700;
  line-height: 1.35;
}

.message {
  border-left-color: var(--green);
}

.warning {
  border-left-color: var(--yellow);
}

.history-wrap {
  overflow-x: auto;
  border: 4px solid var(--ink);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
  scrollbar-color: var(--yellow) var(--ink);
}

.history-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  color: var(--ink);
}

.history-table th,
.history-table td {
  padding: 15px 16px 13px;
  border-bottom: 3px solid var(--ink);
  text-align: left;
  white-space: nowrap;
}

.history-table th {
  color: var(--ink);
  background: var(--yellow);
  font-family: var(--font-action);
  font-size: .92rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

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

.history-table tbody tr:nth-child(even) td {
  background: #efe8d5;
}

.table-link {
  display: inline-flex;
  padding: 7px 10px 5px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  background: var(--cyan);
  font-family: var(--font-action);
  font-size: .88rem;
  letter-spacing: .035em;
  line-height: 1;
  text-decoration: none;
}

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

@media (max-width: 900px) {
  .dashboard-header {
    display: grid;
    align-items: start;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 138px;
  }
}

@media (max-width: 620px) {
  .access-page {
    width: min(100% - 24px, 1480px);
    padding-top: 16px;
  }

  .access-page-auth {
    grid-template-rows: auto 1fr;
  }

  .access-page-auth > .brand-link {
    position: static;
  }

  .access-page-auth > .auth-stage {
    grid-row: 2;
  }

  .brand-link .brand-banner {
    font-size: 22px;
  }

  .auth-brand-link .brand-banner {
    font-size: 24px;
  }

  .auth-stage {
    place-items: start center;
    padding: 38px 0 60px;
  }

  .comic-panel {
    box-shadow: 7px 7px 0 var(--ink);
  }

  .auth-card {
    padding: 28px 23px 30px;
  }

  .auth-actions {
    align-items: stretch;
  }

  .auth-actions .button {
    width: 100%;
  }

  .header-actions,
  .panel-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .header-actions form,
  .header-actions button,
  .header-actions .button,
  .panel-actions form,
  .panel-actions button {
    width: 100%;
  }

  .history-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .history-table {
    min-width: 0;
  }

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

  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table td {
    display: block;
    width: 100%;
  }

  .history-table tr {
    overflow: hidden;
    border: 4px solid var(--ink);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 5px 5px 0 var(--ink);
  }

  .history-table tr + tr {
    margin-top: 17px;
  }

  .history-table td {
    display: grid;
    grid-template-columns: minmax(7.5rem, .8fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px 13px 10px;
    border-bottom: 3px solid var(--ink);
    white-space: normal;
  }

  .history-table td::before {
    color: var(--ink);
    font-family: var(--font-action);
    font-size: .82rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    content: attr(data-label);
  }

  .history-table td:last-child {
    border-bottom: 0;
  }

  .history-table .empty-history {
    display: block;
    padding: 16px;
    border-bottom: 0;
  }

  .history-table .empty-history::before {
    content: none;
  }

  .table-link {
    width: fit-content;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  .button {
    transition: none;
  }
}
