:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --border: #e7e5e4;
  --accent: #4f46e5;
  --accent-text: #ffffff;
  --ok: #15803d;
  --danger: #b91c1c;
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --surface: #1c1917;
    --text: #f5f5f4;
    --muted: #a8a29e;
    --border: #292524;
    --accent: #818cf8;
    --accent-text: #0c0a09;
    --ok: #4ade80;
    --danger: #f87171;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a.active,
.nav a:hover {
  color: var(--text);
}

.brand {
  font-weight: 600;
}

/* The Pickford app links (same in Identity, Creator and the Orchestrator), then the signed-in user. */
.nav .apps {
  display: flex;
  gap: 16px;
}

.nav .apps a.active {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 6px;
}

.nav .user {
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subnav {
  display: flex;
  gap: 16px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.subnav a {
  color: var(--muted);
  text-decoration: none;
}

.subnav a.active,
.subnav a:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .nav,
  .subnav {
    gap: 8px 12px;
    padding: 8px 16px;
  }

  .nav .apps {
    gap: 12px;
  }

  .nav .user {
    max-width: 20ch;
  }
}

.spacer {
  flex: 1;
}

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px;
}

.page.narrow {
  max-width: 380px;
  padding-top: 15vh;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
}

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

.error {
  color: var(--danger);
}

.ok {
  color: var(--ok);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.row input {
  flex: 1;
  min-width: 200px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

input,
select {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
}

.button {
  font: inherit;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.button.danger {
  color: var(--danger);
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

.button.block {
  width: 100%;
}

.link {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
}

.link.danger {
  color: var(--danger);
}

.divider {
  text-align: center;
  color: var(--muted);
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.table-wrap {
  overflow-x: auto;
}

th,
td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85rem;
}

.actions {
  display: flex;
  gap: 12px;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0 0 12px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

/* Text for the accessibility tree that the layout already shows another way. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
