:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f5f7fb;
  font-size: 14px;
  line-height: 1.5;
  font-synthesis: none
}

* {
  box-sizing: border-box
}

body {
  margin: 0
}

button,
input,
select,
textarea {
  font: inherit
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #334155;
  padding: 9px 15px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 40px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap
}

button:hover,
.button:hover {
  background: #f1f5f9;
  border-color: #94a3b8
}

button:disabled {
  opacity: .5;
  cursor: not-allowed
}

button.primary,
.button.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff
}

button.primary:hover,
.button.primary:hover {
  background: #1d4ed8
}

button.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff
}

button.danger:hover {
  background: #fff1f2
}

a {
  color: #1d4ed8;
  text-decoration: none
}

a:hover {
  text-decoration: underline
}

:focus-visible {
  outline: 3px solid #a855f7;
  outline-offset: 3px
}

input,
select,
textarea {
  border: 1px solid #64748b;
  border-radius: 8px;
  background: #fff;
  padding: 9px 12px;
  max-width: 100%;
  color: #111827;
  min-height: 40px
}

input:not([type=checkbox]),
textarea {
  width: 100%
}

input[type=checkbox] {
  width: 18px;
  min-height: 18px;
  vertical-align: middle;
  accent-color: #2563eb
}

textarea {
  min-height: 110px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px
}

label {
  display: block;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px
}

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

h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 1px
}

h2 {
  font-size: 24px;
  font-weight: 650;
  margin: 0
}

h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px
}

small {
  font-size: 12px
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 28px;
  margin-left: 240px;
  min-height: 80px
}

header small {
  color: #475569
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px
}

.shell>nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: #f3f6fb;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  z-index: 30
}

.brand {
  padding: 22px 24px 20px;
  border-bottom: 1px solid #e5e7eb;
  min-height: 118px
}

.brand img {
  display: block;
  width: 128px;
  height: auto
}

.brand span {
  display: block;
  font-size: 10px;
  color: #475569;
  margin-top: 13px;
  letter-spacing: .03em
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 12px;
  overflow: auto
}

.nav-links button {
  justify-content: flex-start;
  white-space: normal;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4b5563;
  padding: 11px 16px;
  font-size: 14px
}

.nav-links button:hover {
  background: #e5edfb
}

.nav-links button.active {
  background: #2563eb;
  color: white
}

.nav-footer {
  margin-top: auto;
  border-top: 1px solid #e5e7eb;
  padding: 18px 25px;
  overflow-wrap: anywhere
}

.nav-footer span,
.nav-footer small {
  display: block
}

.nav-footer small {
  color: #475569;
  margin-top: 5px
}

.shell>main {
  margin-left: 240px;
  padding: 26px 28px 40px;
  min-height: calc(100vh - 80px);
  max-width: calc(100% - 240px)
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 22px;
  margin: 0 0 20px;
  box-shadow: 0 1px 3px #0f172a05
}

.card>div:not(.actions):not(.segmented) {
  margin-bottom: 14px
}

.card p:last-child {
  margin-bottom: 0
}

.card>button {
  margin-top: 12px
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px
}

.stat-card {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.stat-card>span {
  color: #6b7280;
  font-size: 13px
}

.stat-card strong {
  font-size: 28px;
  font-weight: 650
}

.stat-card .small-value {
  font-size: 15px;
  margin-top: 9px
}

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  padding: 18px
}

.filter-bar>div:first-child {
  flex: 1;
  min-width: 180px
}

.filter-bar .field {
  min-width: 110px
}

.table-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: auto;
  margin-bottom: 18px
}

.filter-bar+.table-wrap {
  border-radius: 0 0 12px 12px
}

table {
  border-collapse: collapse;
  width: 100%;
  text-align: left
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  padding: 13px 18px;
  font-size: 12px;
  border-bottom: 1px solid #e5e7eb
}

td {
  padding: 15px 18px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
  font-size: 13px;
  overflow-wrap: anywhere
}

tr:last-child td {
  border-bottom: 0
}

tbody tr:hover {
  background: #fafbff
}

.row-id {
  display: block;
  color: #475569;
  font-size: 11px;
  margin-top: 4px;
  overflow-wrap: anywhere
}

.identity-cell {
  max-width: 300px
}

.table-wrap>.muted {
  padding: 25px;
  text-align: center
}

.pill {
  display: inline-flex;
  border-radius: 20px;
  padding: 4px 9px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap
}

.pagination {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 8px 0 22px;
  flex-wrap: wrap
}

.pagination>span {
  margin-right: auto;
  color: #475569
}

.pagination select {
  min-width: 74px
}

.pagination label {
  font-size: 11px
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #eaf0f7;
  gap: 4px
}

.segmented button {
  border: 0;
  background: transparent;
  color: #475569;
  padding: 7px 14px;
  min-height: 34px
}

.segmented .selected {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 4px #0f172a12
}

.banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  color: #1e40af;
  overflow-wrap: anywhere
}

.banner p:last-child {
  margin-bottom: 0
}

.banner.error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239
}

.banner.error p {
  margin: 8px 0
}

.muted {
  color: #475569
}

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

.grid .card {
  overflow-wrap: anywhere
}

.provider-grid .card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px
}

.provider-grid .card .actions {
  margin-top: auto
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  font-size: 12px;
  max-height: 400px;
  overflow: auto
}

fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin: 15px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px
}

fieldset label {
  font-weight: 400;
  font-size: 13px
}

legend {
  padding: 0 8px;
  color: #475569
}

summary {
  cursor: pointer;
  font-weight: 600
}

details[open]>summary {
  margin-bottom: 16px
}

.overlay {
  position: fixed;
  inset: 0;
  background: #0f172a88;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100
}

.dialog {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 1020px;
  max-height: 94vh;
  overflow: auto;
  padding: 26px;
  box-shadow: 0 20px 70px #0f172a44
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px
}

.dialog-head h2 {
  overflow-wrap: anywhere
}

.dialog .actions {
  margin-bottom: 20px
}

.dialog .grid .card {
  padding: 16px
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 18px 0;
  color: #475569;
  font-size: 12px
}

.verification-evidence {
  padding: 16px;
  border: 1px solid #dbeafe;
  border-radius: 8px
}

.graph-scroll {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff
}

.graph-scroll svg {
  width: 100%;
  min-width: 640px;
  max-height: 800px
}

.identity-links {
  list-style: none;
  padding: 0;
  font-size: 12px;
  overflow-wrap: anywhere
}

.identity-links li {
  padding: 4px 0
}

.welcome {
  max-width: 440px;
  margin: 9vh auto;
  padding: 36px;
  text-align: center
}

.welcome p {
  color: #475569
}

.welcome form {
  display: grid;
  gap: 16px
}

.login-logo {
  width: 155px;
  height: auto;
  display: block;
  margin: 0 auto 32px
}

.welcome h2 {
  margin-bottom: 22px
}

.menu-button {
  display: none
}

.welcome+header {
  margin-left: 0
}

@media(min-width:1800px) {
  .shell>main {
    padding-left: 42px;
    padding-right: 42px
  }
}

@media(max-width:1100px) {
  .provider-grid {
    grid-template-columns: 1fr
  }

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

  .stats {
    gap: 10px
  }

  .stat-card {
    padding: 15px
  }

  .shell>main {
    padding: 22px 20px
  }
}

@media(max-width:760px) {
  header {
    margin-left: 0;
    padding: 14px 18px
  }

  .menu-button {
    display: inline-flex
  }

  .shell>nav {
    display: none;
    top: 80px;
    width: 240px;
    box-shadow: 10px 0 30px #0f172a15
  }

  .shell.nav-open>nav {
    display: flex
  }

  .shell>main {
    margin-left: 0;
    max-width: 100%;
    padding: 20px 14px
  }

  .stats {
    grid-template-columns: 1fr
  }

  .stat-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: center
  }

  .stat-card strong {
    font-size: 24px
  }

  h2 {
    font-size: 22px
  }

  .overlay {
    padding: 10px
  }

  .dialog {
    padding: 18px;
    max-height: 97vh
  }

  header .actions {
    gap: 6px
  }

  header .actions button {
    padding: 8px 10px
  }

  .filter-bar .field {
    flex: 1;
    min-width: 125px
  }

  .card {
    padding: 18px
  }

  th,
  td {
    padding: 12px
  }

  .welcome {
    margin: 30px 16px
  }

  .nav-footer {
    display: none
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important
  }
}

header.signed-out {
  margin-left: 0
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr))
}

.verification-valid {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534
}

.verification-invalid {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239
}

.verification-indeterminate,
.verification-unsupported {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e
}

/* Administration editors share the UI spacing and palette. */
.editor-card {
  margin-block: 1.2rem;
  border-top: 3px solid var(--accent, #087f8c);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-block: 1rem;
}

.permission-grid fieldset {
  border: 1px solid #d8e2eb;
  border-radius: 8px;
  padding: 1rem;
  min-width: 0;
}

.permission-option {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin-block: .65rem;
  font-weight: 400;
}

.permission-option input[type=checkbox] {
  width: auto;
  margin-top: .25rem;
  flex: 0 0 auto;
}

.editor-card .actions {
  margin-top: 1rem;
}

.claim-field {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  align-items: end;
  gap: .75rem;
  margin-block: .75rem;
}

.brand img,
.login-logo {
  height: auto;
  object-fit: contain;
}

@media(max-width:640px) {
  header {
    flex-wrap: wrap;
    gap: 12px;
  }

  header .actions,
  .header-title {
    min-width: 0;
    max-width: 100%;
  }

  header .actions button {
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  .claim-field {
    grid-template-columns: 1fr;
  }

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

.skip-link { position: absolute; left: 12px; top: -100px; z-index: 100; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
