:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #5c6575;
  --line: #d9e0eb;
  --primary: #1f5eff;
  --danger: #b42318;
  --success: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--primary);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.container {
  max-width: 1180px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgb(23 32 51 / 0.06);
}

.narrow {
  max-width: 460px;
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 1rem;
}

.stack {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 650;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

button,
.button {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
}

button.danger {
  background: var(--danger);
}

.link-button {
  background: none;
  color: var(--primary);
  padding: 0;
}

.inline-form {
  display: inline;
}

.inline-role-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.inline-role-form select {
  width: auto;
  min-width: 10rem;
}

.muted {
  color: var(--muted);
}

.alert {
  border-radius: 10px;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
}

.alert.error {
  background: #fff0f0;
  border: 1px solid #ffb4ab;
  color: var(--danger);
}

.alert.success {
  background: #edfff5;
  border: 1px solid #a8f0c6;
  color: var(--success);
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem;
  text-align: left;
  vertical-align: top;
}

.metadata {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 0.4rem 1rem;
}

.metadata dt {
  color: var(--muted);
}

.metadata dd {
  margin: 0;
}

.mono,
pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.secret-value,
.secret-reveal {
  border: 1px dashed var(--line);
  border-radius: 10px;
  margin: 1rem 0;
  padding: 1rem;
}

.secret-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

pre {
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.danger-zone {
  border-top: 1px solid var(--line);
  margin-top: 1.5rem;
  padding-top: 1rem;
}

.temp-password-wrap {
  margin: 0.5rem 0 0;
}

code.temp-password {
  display: inline-block;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  border-radius: 6px;
  word-break: break-all;
}

.add-user-form {
  max-width: 28rem;
  margin-bottom: 1.5rem;
}

.tests-shared {
  margin-bottom: 1rem;
}

.block-label {
  display: block;
}

.input-wide,
.graph-test-form input[type="email"],
.graph-test-form input[type="text"],
.graph-test-form textarea {
  width: 100%;
  max-width: 36rem;
}

.inline-test-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin: 0.75rem 0;
}

.section-rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

.test-result-target {
  margin-top: 0.75rem;
  min-height: 0.5rem;
}

.test-result {
  font-size: 0.85rem;
  max-height: 20rem;
  overflow: auto;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.test-details {
  margin-top: 0.75rem;
}

.break-all {
  word-break: break-all;
}

p.small {
  font-size: 0.9rem;
}

.warn {
  color: var(--danger);
}

.button.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.alert.success {
  border-color: var(--success);
  background: #ecfdf3;
}

  .grid.two {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
