:root {
  color-scheme: light;
  --canvas: #f4f6f8;
  --surface: #fff;
  --ink: #172636;
  --muted: #536477;
  --line: #d7dfe7;
  --input-line: #7d8fa2;
  --accent: #175b9b;
  --alert: #9b2920;
  font:
    1rem/1.5 system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
.masthead {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.875rem max(1rem, calc((100vw - 74rem) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.masthead span {
  color: var(--muted);
  font-size: 0.875rem;
}
.brand {
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}
main {
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 1rem;
}
.narrow {
  max-width: 34rem;
}
.wide {
  max-width: 76rem;
}
h1,
h2,
h3,
p,
dl {
  margin: 0;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 1.15rem;
  line-height: 1.3;
}
h3 {
  font-size: 1rem;
}
.intro {
  margin: 0.625rem 0 1.5rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.panel {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
}
.fields {
  display: grid;
  gap: 1rem;
}
.panel h2 + form {
  margin-top: 1rem;
}
label {
  display: grid;
  gap: 0.375rem;
  font-weight: 600;
}
input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--input-line);
  border-radius: 0.375rem;
  padding: 0.625rem 0.75rem;
  color: var(--ink);
  background: var(--surface);
}
input,
button {
  font: inherit;
}
button {
  width: fit-content;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 0.375rem;
  background: var(--accent);
  color: var(--surface);
  font-weight: 650;
  cursor: pointer;
}
button:hover {
  background: #124877;
}
button.secondary {
  border-color: var(--input-line);
  background: var(--surface);
  color: var(--ink);
}
button.secondary:hover {
  background: #edf2f8;
}
button:disabled {
  opacity: 0.65;
  cursor: wait;
}
a {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.notice {
  margin: 0.5rem 0;
  padding: 0.75rem;
  border-left: 0.25rem solid var(--alert);
  background: #fcece9;
  color: var(--alert);
}
.success {
  color: #215b36;
}
.help,
.signed-in {
  color: var(--muted);
  font-size: 0.875rem;
}
.signed-in {
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}
.page-title,
.actions,
.pagination,
.user-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.page-title .intro {
  margin-bottom: 0.75rem;
}
.actions {
  justify-content: flex-end;
  margin-top: 1rem;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.users {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}
.user-card {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
  display: grid;
  gap: 0.75rem;
}
.user-heading > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.user-heading > div > span {
  color: var(--muted);
  font-size: 0.875rem;
}
.status {
  font-size: 0.8rem;
  font-weight: 650;
  color: #215b36;
  background: #eaf3ec;
  padding: 0.2rem 0.65rem;
  border-radius: 2rem;
}
.status.inactive {
  color: #7b342e;
  background: #fcece9;
}
.count {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: normal;
  margin-left: 0.25rem;
}
summary {
  cursor: pointer;
  padding: 0.5rem 0;
  font-weight: 600;
}
details form {
  padding-top: 0.75rem;
}
.source-tables {
  display: grid;
  gap: 0.75rem;
}
fieldset {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  max-height: 22rem;
  overflow-y: auto;
}
legend {
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.table-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  cursor: pointer;
}
.table-option input {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.25rem 0;
  accent-color: var(--accent);
}
.table-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.table-option small {
  display: block;
  font-weight: 400;
  color: var(--muted);
}
.pagination {
  justify-content: flex-start;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  font-size: 0.875rem;
}
.details {
  display: grid;
  gap: 1rem;
  overflow-wrap: anywhere;
}
dt {
  font-weight: 650;
}
dd {
  margin: 0;
  color: var(--muted);
}
code {
  overflow-wrap: anywhere;
}
.audit-panel {
  margin-top: 1rem;
}
.table-scroll {
  overflow-x: auto;
  margin-top: 1rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}
th,
td {
  border-top: 1px solid var(--line);
  padding: 0.6rem;
  vertical-align: top;
  overflow-wrap: anywhere;
  max-width: 24rem;
  min-width: 8rem;
}
@media (min-width: 58rem) {
  .columns {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background-color 0.15s;
  }
}
