* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Set a readable default link color for dark backgrounds. */
a {
  color: var(--link);
}

[hidden] {
  display: none !important;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  /* Use the visible viewport height so mobile browser controls do not hide the footer. */
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-header);
  flex-shrink: 0;
  position: relative;
}

header h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* Match the logo's 42:47 aspect ratio to avoid padding from a square box. */
.header-logo {
  width: 24px;
  height: 27px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Each text box ends at the cap height and the baseline, so centering the
   boxes centers the letters, whatever the font size. */
header h1,
.header-links a,
.header-submenu-toggle,
header .btn,
.header-menu-toggle {
  text-box: trim-both cap alphabetic;
}

.header-left .header-logo + h1 {
  margin-left: -18px;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

header .btn {
  height: 34px;
  padding: 0 14px;
}

.header-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 17px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  height: 34px;
  padding: 0 14px;
  cursor: pointer;
}

.header-links a {
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
}

.header-links a:hover {
  color: var(--text);
}

.header-submenu-group {
  position: relative;
  display: flex;
  flex-direction: column;
}

.header-submenu-toggle {
  font: inherit;
  white-space: nowrap;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.header-submenu-toggle::after {
  content: " ▾";
  font-size: 9px;
}

.header-submenu-toggle:hover,
.header-submenu-toggle[aria-expanded="true"] {
  color: var(--text);
}

.header-submenu {
  position: absolute;
  top: calc(100% + 10px);
  left: -12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
  padding: 6px;
  background: var(--bg-dialog);
  border: 1px solid var(--border-dialog);
  border-radius: 14px;
  box-shadow: var(--shadow-dialog);
  z-index: 60;
}

.header-submenu[hidden] {
  display: none;
}

.header-submenu a {
  padding: 7px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.header-submenu a:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

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

.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--bg-btn);
  color: var(--text);
  cursor: pointer;
}

.btn:hover {
  background: var(--bg-btn-hover);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Dialog panels are lighter than the page, so their buttons need a lighter fill to stand out. */
:where(.consent-dialog) .btn {
  background: var(--bg-btn-dialog);
}

:where(.consent-dialog) .btn:hover {
  background: var(--bg-btn-hover);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--accent);
  opacity: 0.9;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
  font-weight: 600;
}

.btn-danger:hover {
  background: var(--danger-bg);
}

#theme-toggle {
  background: transparent;
  border-color: var(--border);
}

#theme-toggle:hover {
  background: var(--bg-btn);
}

.main {
  flex: 1;
  overflow-y: auto;
  /* Reserve scrollbar space so content does not move sideways when scrolling becomes
     necessary. */
  scrollbar-gutter: stable;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.credentials {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Container queries read the parent width. Using the list as the container makes all cards
   switch layouts together. The name keeps these queries out of the consent dialog, which is a
   container as well. */
.credentials {
  display: flex;
  flex-direction: column;
  gap: 8px;
  container: credentials / inline-size;
}

.credential-card {
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-surface);
  overflow: hidden;
}

.card-face {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #fff;
  cursor: pointer;
}
.card-face.plain {
  background: var(--bg-hover);
  color: var(--text);
}

/* Show batches as a stack on desktop and in consent. A count would be misleading because
   copies are reused. Phone cards have no space for the offset. */
.credential-card.batch .card-face {
  box-shadow:
    3px 4px 0 -1px var(--bg-surface),
    4px 5px 0 -1px color-mix(in srgb, var(--text-dim) 60%, transparent),
    6px 8px 0 -2px var(--bg-surface),
    7px 9px 0 -2px color-mix(in srgb, var(--text-dim) 42%, transparent),
    var(--shadow-card);
}

.credential-logo {
  position: absolute;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
}
.face-init,
.face-generic {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-dim);
}
.face-name {
  position: absolute;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.format-badge {
  font-family: var(--font-mono, monospace);
  font-weight: 500;
  white-space: nowrap;
}
.format-badge-row {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.format-badge-face {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 5px;
  backdrop-filter: blur(3px);
  /* White text stays above 4.5:1 even on white card art. */
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
}

.credential-info { min-width: 0; }
/* List cards open the decoder. Consent cards select a credential and use a separate
   decoder link. */
.credential-card .credential-info { cursor: pointer; }
.credential-card .credential-info:hover .credential-name { color: var(--link); }

.cred-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.credential-name {
  font-size: 15px;
  font-weight: 700;
}
.cred-issuer {
  font-size: 12.5px;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.face-issuer { display: none; }
.cred-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.cred-meta {
  display: flex;
  gap: 2px 16px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}
.cred-meta-item { overflow-wrap: anywhere; }
.cred-meta-k {
  text-transform: uppercase;
  margin-right: 3px;
}
.mono { font-family: var(--font-mono, monospace); font-size: 12px; color: var(--text); }

/* Place shared description rules before container queries that choose the phone and
   desktop controls. */
.about-btn { display: inline-flex; align-items: center; gap: 5px; }
.about-btn .ic { display: block; width: 13px; height: 13px; }
.about-btn[aria-expanded="true"] { background: var(--info-bg); color: var(--info-fg); }
.about-btn .ic-chev { transition: transform 0.2s ease; }

.cred-desc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cred-desc-label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
/* The padding keeps focus rings of links inside the scrolling area. */
.cred-desc-body { font-size: 13px; line-height: 1.55; color: var(--text); overscroll-behavior: contain; padding-inline: 3px; margin-inline: -3px; }
.cred-desc-back {
  display: inline-flex;
  font: inherit; font-size: 12px; font-weight: 500; color: var(--text);
  border: 0; background: var(--bg-btn); border-radius: 999px;
  padding: 4px 12px; cursor: pointer; align-items: center; gap: 5px;
}
.cred-desc-back:hover { color: var(--text); }
.cred-desc-back .ic { width: 13px; height: 13px; display: block; }

@container credentials (min-width: 601px) {
  .cred-front {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px 10px 10px;
  }
  .card-face {
    width: 104px;
    height: 66px;
    border-radius: 9px;
    flex: 0 0 auto;
    box-shadow: var(--shadow-card);
  }
  .credential-logo { top: 5px; left: 5px; width: 20px; height: 20px; padding: 2px; }
  .face-init, .face-generic { font-size: 22px; }
  .face-name, .format-badge-face { display: none; }
  .credential-info { flex: 1; }
  .credential-actions { flex: 0 0 auto; margin-left: 6px; }

  .cred-desc { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.26s ease, opacity 0.2s ease; }
  .credential-card.desc-open .cred-desc { max-height: 180px; opacity: 1; }
  .cred-desc-in { margin: 0 14px 0 130px; padding: 11px 0 13px; border-top: 1px solid var(--border-subtle); }
  .cred-desc-body { max-height: 120px; max-width: 76ch; overflow-y: auto; }
  /* The About button closes the desktop description, so it needs no separate Back button. */
  .cred-desc-back { display: none; }

  .about-btn .ic-info { display: none; }
  .about-btn .ic-chev { display: block; }
  .about-btn[aria-expanded="true"] .ic-chev { transform: rotate(180deg); }
}

@container credentials (max-width: 600px) {
  .card-face {
    width: 100%;
    aspect-ratio: 2.4;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
  }
  .credential-card.batch .card-face {
    box-shadow: none;
  }
  .credential-logo { top: 10px; left: 10px; width: 28px; height: 28px; padding: 4px; }
  .face-init, .face-generic { font-size: 26px; }
  .face-name { left: 15px; bottom: 10px; right: 15px; font-size: 18px; }
  .card-face:has(.face-issuer) .face-name { bottom: 28px; }
  .face-issuer {
    display: block;
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: 9px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cred-hdr { display: none; }
  .credential-info { padding: 10px 15px 4px; }
  .credential-actions { padding: 8px 15px 11px; gap: 8px; }
  .credential-actions .btn {
    flex: 1;
    font-size: 13px;
    padding: 8px 12px;
  }

  .credential-card {
    background: transparent;
    border: 0;
    overflow: visible;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    /* Keep perspective in both states. Adding it only during the flip exposes the mirrored
       front until the animation ends. */
    transform: perspective(1000px) rotateY(0deg);
    -webkit-transform: perspective(1000px) rotateY(0deg);
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .credential-card.desc-open {
    transform: perspective(1000px) rotateY(180deg);
    -webkit-transform: perspective(1000px) rotateY(180deg);
  }
  /* iOS WebKit can ignore backface-visibility when these faces also clip overflow. Clip
     the artwork and scroll the description separately. */
  .cred-front {
    position: relative;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: var(--bg-surface);
    /* iOS WebKit needs a 3D transform on the front face to hide its reverse. The identity
       rotation supplies it without moving the card. */
    transform: rotateY(0deg);
    -webkit-transform: rotateY(0deg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
  .cred-desc {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
  }
  .cred-desc-in { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 12px 14px; }
  .cred-desc-body { flex: 1; min-height: 0; overflow-y: auto; }

  .credential-actions { flex-wrap: wrap; }
  .credential-actions .about-btn { flex: 0 0 auto; }
  .about-btn .ic-chev { display: none; }
}

.credential-actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.pager[hidden] {
  display: none;
}

.pager button[disabled] {
  opacity: 0.4;
  cursor: default;
}

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

.actions-bar input[type="text"] {
  font-family: var(--font-mono);
  font-size: 13px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--bg-input);
  color: var(--text);
  flex: 1;
  min-width: 200px;
}

.actions-bar input[type="text"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.actions-bar .btn {
  font-size: 14px;
  height: 42px;
  padding: 0 18px;
}

.actions-bar .btn-primary {
  padding: 0 22px;
}

.actions-bar input[type="text"]::placeholder {
  color: var(--text-dim);
}

.actions-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.actions-hint a {
  color: var(--link);
}

.actions-hint a:hover {
  text-decoration: underline;
}

.cert-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 4px 0;
  font-size: 13px;
}

.cert-links a {
  color: var(--link);
  text-decoration: none;
}

.cert-links a:hover {
  text-decoration: underline;
}
#trust-list-links {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.cert-links .trust-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.cert-links .trust-list-name {
  color: var(--text-dim);
}
.cert-links .trust-list-desc {
  flex-basis: 100%;
  color: var(--text-dim);
  opacity: 0.75;
}
.cert-links .copy-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
}
.cert-links .copy-btn:hover {
  color: var(--link);
}

.app-footer {
  flex-shrink: 0;
  padding: 10px 16px 12px;
}

#demo-note {
  color: var(--text-dim);
}

#pending-banner {
  display: flex;
  align-items: center;
  gap: 12px 24px;
  margin: 16px 24px 0;
  padding: 10px 12px 10px 16px;
  font-size: 13px;
  color: var(--info-fg);
  background: var(--info-bg);
  border-radius: 14px;
  flex-shrink: 0;
}

#pending-banner .btn {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

#pending-banner[hidden] {
  display: none;
}

#pending-banner button {
  flex-shrink: 0;
  margin-left: auto;
}

#demo-banner {
  display: flex;
  align-items: center;
  gap: 12px 24px;
  margin: 16px 24px 0;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--warn-fg);
  background: var(--warn-bg);
  border-radius: 14px;
  flex-shrink: 0;
}

#demo-banner[hidden] {
  display: none;
}

#demo-banner a {
  color: var(--warn-fg);
}

#demo-banner button {
  flex-shrink: 0;
  margin-left: auto;
  background: var(--warn-fg);
  color: var(--warn-bg);
  font-weight: 600;
  padding: 7px 16px;
}

.howto-store {
  margin: 12px 0;
}
.howto-store .btn {
  display: inline-block;
  margin-bottom: 8px;
  text-decoration: none;
}
.howto-manual summary {
  cursor: pointer;
}

.cli-install-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 12px;
}
.cli-install pre {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-dialog);
  border-radius: 12px;
  padding: 8px 12px;
  margin: 4px 0;
  overflow-x: auto;
  user-select: all;
}

.dialog-hint {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

label.dialog-hint {
  display: block;
}

.import-textarea {
  height: 120px;
  padding: 10px 14px;
}

.conf-hint {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-dim);
}

.conf-hint:empty {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
}

.catalog-fields {
  grid-column: 1 / -1;
  padding: 8px 0 4px 12px;
  border-left: 2px solid var(--border);
}

.catalog-fields[hidden] {
  display: none;
}

#issue-form.template-mode .issue-only {
  display: none;
}

.template-editor-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.template-editor-json {
  width: 100%;
  min-height: 320px;
}

.form-label {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

.form-input {
  font: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text);
  width: 100%;
}

.form-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

textarea.form-input {
  border-radius: 14px;
}

/* The arrow is drawn with gradients so it takes the theme colour, like the
   demo pages. */
select.form-input,
select.conf-input {
  appearance: none;
  -webkit-appearance: none;
  min-height: 32px;
  padding: 6px 34px 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  background:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%) calc(100% - 19px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%) calc(100% - 14px) 50% / 5px 5px no-repeat,
    var(--bg-input);
}

select.form-input:disabled,
select.conf-input:disabled {
  cursor: default;
  background: var(--bg-input);
  padding-right: 14px;
}

select.form-input option,
select.conf-input option {
  background: var(--bg-surface);
  color: var(--text);
}

textarea.form-input {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 14px;
}

.form-input::placeholder {
  color: var(--text-dim);
}

/* A placeholder that doesn't fit ends in an ellipsis. */
.form-input,
#offer-input {
  text-overflow: ellipsis;
}

.form-textarea {
  height: 72px;
  resize: vertical;
  align-self: start;
}

.form-checkbox {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
}

.form-label-top {
  align-self: start;
  margin-top: 6px;
}

.form-section-label {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-dialog);
}

/* Span the grid so notes do not shift the label and input columns. */
.form-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-dim);
}

.form-color-row,
.form-image-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.form-color-row .form-input,
.form-image-row .form-input {
  flex: 1;
  min-width: 0;
}
.form-color-swatch {
  flex: 0 0 auto;
  width: 38px;
  height: 32px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-input);
  cursor: pointer;
}
.form-image-preview-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
}
.form-image-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-input);
  color: inherit;
  font-size: 12px;
  line-height: 14px;
  cursor: pointer;
}
.form-image-preview {
  flex: 0 0 auto;
  width: 38px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-input);
  object-fit: contain;
}
#issue-bg-image-preview {
  object-fit: cover;
}
.form-image-preview[hidden] + .form-image-remove {
  position: static;
  align-self: center;
}
/* The chosen file ends up in the URL field next to it, so the picker shows
   only its button. */
.form-file {
  flex: 0 0 auto;
  font-size: 0;
  width: auto;
}

.form-file::file-selector-button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  height: 32px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-btn);
  color: var(--text);
  cursor: pointer;
}

.form-file::file-selector-button:hover {
  background: var(--bg-btn-hover);
}

.form-file:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 999px;
}

.claims-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: start;
  min-width: 0;
}

.claims-mode,
.registrar-filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border-radius: 20px;
  background: var(--bg-track);
}

.claims-mode label,
.registrar-filter label {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
}

.claims-mode label:hover,
.registrar-filter label:hover {
  color: var(--text);
}

/* The radio stays in place, invisible, so clicks and arrow keys still reach it. */
.claims-mode input[type="radio"],
.registrar-filter input[type="radio"] {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.claims-mode label:has(input:checked),
.registrar-filter label:has(input:checked) {
  background: var(--bg-segment);
  color: var(--text-segment);
  font-weight: 600;
  box-shadow: var(--shadow-segment);
}

.claims-mode label:has(input:focus-visible),
.registrar-filter label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#issue-claim-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
  /* Room for the focus ring of the inputs, which the scrolling area clips. */
  padding: 3px;
  margin: -3px;
}

.claim-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.claim-row input[id^="issue-claim-key-"] {
  flex: 1;
}

.claim-row input[id^="issue-claim-value-"] {
  flex: 2;
}

.claim-row .claim-ns {
  display: none;
  flex: 1;
}

#issue-claim-rows.show-ns .claim-ns {
  display: block;
}

.claim-row .claim-sd {
  display: none;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  cursor: pointer;
}

#issue-claim-rows.show-sd .claim-sd {
  display: flex;
}

.status-list-editor {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-protected {
  background: var(--info-bg);
  color: var(--info-fg);
}

.status-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 9px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  vertical-align: middle;
  /* Keep badges whole when wrapping. */
  white-space: nowrap;
}

.status-badge[title],
.who-chip[title] {
  cursor: help;
}

/* The text sets the baseline of a badge, and an icon centers on the text. */
.cred-pills .status-badge {
  margin-left: 0;
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
}

.cred-pills .status-badge svg {
  align-self: center;
}

.catalog-badge {
  background: var(--neutral-bg);
  color: var(--neutral-fg);
}

.catalog-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 4px;
}

.catalog-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.catalog-filter-label {
  min-width: 120px;
  font-size: 13px;
  color: var(--text-dim);
}

.filter-chip {
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.catalog-filter-clear {
  align-self: flex-start;
}

.status-none {
  background: var(--neutral-bg);
  color: var(--neutral-fg);
}

/* Pseudo-elements keep icons out of badge text used by browser tests. */
.pill-ico { flex: 0 0 auto; }
.ico-dot::before { content: "● "; }
.ico-block::before { content: "⊘ "; }
.ico-half::before { content: "◐ "; }
.ico-circle::before { content: "○ "; }
.ico-clock::before { content: "◷ "; }
.ico-check::before { content: "✓ "; }
.ico-x::before { content: "✗ "; }
.ico-warn::before { content: "⚠ "; }
.ico-pause::before { content: "⏸ "; }

.status-active {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.status-revoked,
.status-expired {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-external,
.status-valid {
  background: var(--neutral-bg);
  color: var(--neutral-fg);
}

.status-unheld-key,
.status-suspended,
.status-expiring,
.status-not-yet-valid {
  background: var(--warn-bg);
  color: var(--yellow);
}

.templates-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.template-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px 6px 12px;
  border-radius: 12px;
  background: var(--bg-raised);
}

.template-row-name {
  font-family: var(--font-mono);
  font-size: 12px;
}

.template-row-meta {
  flex: 1;
  font-size: 12px;
  color: var(--text-dim);
}

#issue-add-claim {
  align-self: flex-start;
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 8px;
  white-space: pre-wrap;
  word-break: break-all;
}

.form-error:empty {
  display: none;
}

.consent-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.consent-overlay.active {
  display: flex;
}

.consent-dialog {
  position: relative;
  background: var(--bg-dialog);
  border: 1px solid var(--border-dialog);
  border-radius: 22px;
  box-shadow: var(--shadow-dialog);
  padding: 22px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.consent-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

/* A title takes focus only so screen readers start reading the dialog there. */
.consent-title:focus,
.dialog-title:focus {
  outline: none;
}

/* Names and identifiers of a registration can be long unbroken words. */
#registrar-cert-party,
.registrar-cert-body {
  overflow-wrap: anywhere;
}

.who {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-raised);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.who-text { flex: 1; min-width: 0; }
.who-logo {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--bg-dialog);
  padding: 3px;
}
.who-nm {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.who-name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.who-cid { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); margin-top: 2px; overflow-wrap: anywhere; }
.who-chip {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 9px;
  border-radius: 10px;
  white-space: nowrap;
}
.who-ok { background: var(--ok-bg); color: var(--ok-fg); }
.who-bad { background: var(--danger-bg); color: var(--danger); }

.consent-purpose {
  font-size: 15px;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg-raised);
}

.consent-multiple-note {
  font-size: 13px;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg-raised);
}

.consent-mismatch {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--yellow);
  background: var(--warn-bg);
  border-radius: 12px;
}

.consent-mismatch ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.consent-unanswered {
  font-size: 13px;
  line-height: 1.6;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  color: var(--warn-fg);
  background: var(--warn-bg);
}

.mismatch-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--yellow);
  background: var(--warn-bg);
  white-space: nowrap;
}

.consent-nonmatching-toggle {
  display: block;
  margin: 8px 0 4px;
}

.consent-nonmatching-label {
  margin: 8px 0 4px;
  font-size: 13px;
  color: var(--text-dim);
}

.candidate.nonmatching:not(.selected) {
  opacity: 0.85;
}

.consent-claim-set-toggle {
  margin-left: 4px;
}

.consent-claim-set-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.consent-claim-set-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
}

.consent-claim-set-option input {
  margin: 0;
}

/* A long claim set wraps under its name, between claims. */
.consent-claim-set-name {
  margin-right: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.consent-claim-set-keys {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.consent-claim-set-key {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.consent-purpose-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.consent-purpose-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.consent-privacy-policies {
  display: inline-flex;
  gap: 10px;
  font-weight: 500;
}

.consent-credential {
  border: 1px solid var(--border-dialog);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}

/* The dialog switches at the breakpoint of the credential list. On a narrow
   screen each credential folds to a summary that opens on tap. */
.consent-overlay {
  container: consent / inline-size;
}

.consent-fold-summary {
  display: none;
}

@container consent (max-width: 600px) {
  .consent-fold-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 3px;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .consent-fold-summary > :not(.consent-fold-chevron, .consent-fold-face) {
    grid-column: 2;
    min-width: 0;
  }
  .consent-fold-summary > .consent-fold-face {
    display: block;
    grid-column: 1;
    grid-row: 1 / span 4;
    align-self: center;
    width: 56px;
    height: 35px;
    border-radius: 6px;
    box-shadow: var(--shadow-card);
  }
  .consent-fold-face .credential-logo {
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    padding: 1px;
  }
  .consent-fold-face .face-init,
  .consent-fold-face .face-generic { font-size: 13px; }
  .consent-fold-open .consent-fold-face {
    display: none;
  }
  .consent-fold-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
  }
  .consent-fold-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .consent-fold-count {
    font-size: 12.5px;
    font-weight: 600;
  }
  .consent-fold-names {
    font-size: 12px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .consent-fold-warn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--yellow);
  }
  .consent-fold-chevron {
    grid-column: 3;
    grid-row: 1 / span 4;
    align-self: center;
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-right: 2px solid var(--text-dim);
    border-bottom: 2px solid var(--text-dim);
    transform: rotate(-45deg);
    transition: transform 0.15s;
  }
  .consent-fold-open .consent-fold-chevron {
    transform: rotate(45deg);
  }
  .consent-fold-open .consent-fold-names,
  .consent-fold-open .consent-fold-warn {
    display: none;
  }
  .consent-fold:not(.consent-fold-open) > .consent-fold-body {
    display: none;
  }
  .consent-fold-open > .consent-fold-body {
    margin-top: 12px;
  }
  .who-cid,
  .who-name.mono {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .who-open .who-cid,
  .who-open .who-name.mono {
    white-space: normal;
  }
}

.consent-credential .credential-card,
.candidate .credential-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 0;
  overflow: visible;
}
/* On narrow screens the text wraps and grows taller than the card art. Top
   alignment keeps the format badge level with the art. */
@media (max-width: 600px) {
  .consent-credential .credential-card,
  .candidate .credential-card {
    align-items: flex-start;
  }
}
.consent-credential .card-face,
.candidate .card-face {
  width: 84px;
  height: 53px;
  border-radius: 8px;
  flex: 0 0 auto;
  box-shadow: var(--shadow-card);
}
.consent-credential .credential-info,
.candidate .credential-info { flex: 1; min-width: 0; }
.consent-credential .face-name,
.candidate .face-name,
.consent-credential .format-badge-face,
.candidate .format-badge-face { display: none; }
/* List container queries do not apply inside consent, so set the logo size here. */
.consent-credential .credential-logo,
.candidate .credential-logo {
  top: 5px;
  left: 5px;
  width: 16px;
  height: 16px;
  padding: 2px;
}
.consent-credential .face-init,
.candidate .face-init,
.consent-credential .face-generic,
.candidate .face-generic { font-size: 18px; }
/* Keep compact consent cards to ID, issuance time and type. Long issuer names would make
   them too tall. */
.consent-credential .cred-m-iss,
.candidate .cred-m-iss { display: none; }

.cl-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  margin: 12px 0 6px;
}
.cl-count {
  color: var(--text-dim);
}

.consent-claims {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border-radius: 12px;
  overflow: hidden;
}
.consent-claim {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-raised);
  cursor: pointer;
}
.consent-claim:last-child { border-bottom: none; }
.consent-claim-fixed { cursor: default; }
.consent-claim-fixed-tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
}
.consent-untrusted {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--yellow);
  background: var(--warn-bg);
  border-radius: 12px;
}
.consent-claim input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.consent-claim-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  flex: 0 0 42%;
  overflow-wrap: anywhere;
}
.consent-claim-value {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.consent-claim-warn { color: var(--yellow); margin-right: 6px; }

.consent-findings {
  margin: 8px 0;
  border-radius: 12px;
  background: var(--warn-bg);
  font-size: 12px;
}

.consent-findings summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--yellow);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.consent-findings summary::-webkit-details-marker { display: none; }
.consent-findings summary::after { content: "Show"; margin-left: auto; font-weight: 500; color: var(--text-dim); }
.consent-findings[open] summary::after { content: "Hide"; }

.consent-findings ul {
  margin: 0;
  padding: 2px 14px 12px 32px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.consent-findings li + li {
  margin-top: 6px;
}

/* Show warnings without hover so they remain accessible on touch screens. */
.consent-claim-hint {
  flex-basis: 100%;
  font-size: 12px;
  line-height: 1.45;
  color: var(--yellow);
}
.consent-claim-missing .consent-claim-name,
.consent-claim-missing .consent-claim-value {
  color: var(--text-dim);
}
.offer-claims .consent-claim { cursor: default; }
.offer-claims .consent-claim-name { flex: 1 1 auto; color: var(--text); }
.offer-claim-label { flex: 1 1 auto; min-width: 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.offer-claims .offer-claim-labeled .consent-claim-name { flex: 0 1 auto; max-width: 55%; font-size: 12px; color: var(--text-dim); text-align: right; }
.offer-description {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

.consent-selection-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.consent-selection-row .btn {
  margin-left: auto;
}

.link-btn {
  font: inherit;
  font-size: 13px;
  border: none;
  background: none;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.consent-sets {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg-raised);
}

.consent-section-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.consent-set-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 3px 0;
}

.consent-set-option input[type="radio"] {
  accent-color: var(--accent);
}

.query-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--neutral-bg);
  color: var(--neutral-fg);
}

.auto-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--info-bg);
  color: var(--info-fg);
}

.consent-credential-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.query-id-label {
  font-size: 13px;
  font-weight: 700;
}

.candidate-count {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: auto;
}

.candidate {
  border: 1px solid var(--border-dialog);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  background: var(--bg-dialog);
}

.candidate:hover {
  background: var(--bg-raised);
}

.candidate.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-dialog));
  cursor: default;
}

.candidate.fixed {
  cursor: default;
}

.candidate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  flex-wrap: wrap;
}

.candidate-row input[type="radio"] {
  accent-color: var(--accent);
  flex-shrink: 0;
}

.candidate-actions {
  flex-shrink: 0;
  /* Room for the absolute chip above the Show button. */
  min-width: 72px;
  align-self: stretch;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}

.candidate-actions .auto-chip,
.candidate-actions .mismatch-chip {
  position: absolute;
  top: 0;
  right: 0;
}

.consent-buttons .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.consent-claims-empty {
  font-size: 13px;
  color: var(--text-dim);
  padding: 6px 0 2px;
}

.candidate-decode {
  white-space: nowrap;
  text-decoration: none;
}

.consent-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}

.consent-buttons .btn {
  font-size: 14px;
  padding: 10px 22px;
}

.consent-buttons .btn-primary {
  padding: 10px 26px;
}

.error-findings {
  margin: 0 0 12px;
  padding: 10px 14px 10px 32px;
  border-radius: 12px;
  background: var(--bg-raised);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.finding-spec {
  display: inline-block;
  margin-right: 6px;
  padding: 0 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: baseline;
  background: var(--neutral-bg);
  color: var(--neutral-fg);
}
.log-specs {
  flex-shrink: 0;
  white-space: nowrap;
}
.log-specs .finding-spec { margin: 0 0 0 4px; }

.findings-grouped ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.findings-grouped li.finding { padding: 7px 0; }
.findings-grouped li.finding + li.finding { border-top: 1px solid var(--border-subtle); }
.finding-text { display: block; }
.finding-text::first-letter { text-transform: uppercase; }
.findings-group + .findings-group { margin-top: 16px; }
.findings-group-title {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.finding-ref {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-dim);
}
.finding-ref a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.finding-ref a:hover { text-decoration-thickness: 2px; }
.consent-findings[open] { padding-bottom: 8px; }
.consent-findings .findings-grouped {
  margin: 0 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-dialog);
  color: var(--text);
  overflow-wrap: anywhere;
}
.error-findings.findings-grouped { padding: 10px 14px; }
.error-findings .findings-group-title { border-bottom-color: var(--border-raised); }
.log-findings { margin-bottom: 10px; overflow-wrap: anywhere; }

.error-more > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
}

.error-detail {
  background: var(--bg-input);
  border: 1px solid var(--border-dialog);
  border-radius: 12px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 12px;
}

.activity-drawer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0 calc(24px + var(--main-gutter, 0px)) 0 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-surface);
  overflow: hidden;
}
.drawer-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
}
.drawer-head:hover {
  background: var(--bg-hover);
}
/* The drawer clips its corners, so the ring sits inside the head. */
.drawer-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 15px 15px 0 0;
}
.activity-drawer.collapsed .drawer-head:focus-visible {
  border-radius: 15px;
}
.drawer-head .section-title {
  margin: 0;
}
.drawer-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.drawer-chev {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
  transition: transform 0.15s;
}
.activity-drawer.collapsed .drawer-chev {
  transform: rotate(-90deg);
}
.drawer-body {
  overflow-y: auto;
  scrollbar-gutter: stable;
  max-height: 32vh;
  padding: 4px 16px 12px;
}
.activity-drawer.collapsed .drawer-body {
  display: none;
}

.log-entries {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  font-size: 13px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  overflow: hidden;
  /* Prevent flex shrinking so full logs scroll instead of compressing their rows. */
  flex-shrink: 0;
}

.log-header {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 12px;
}

.log-entry.has-details .log-header {
  cursor: pointer;
  user-select: none;
}

.log-detail { user-select: text; }

.log-entry.has-details .log-header:hover {
  background: var(--bg-hover);
}

.log-chevron {
  color: var(--text-dim);
  width: 10px;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.log-entry.expanded .log-chevron {
  transform: rotate(90deg);
}

.log-details {
  display: none;
  border-top: 1px solid var(--border);
  padding: 10px 12px;
}

.log-entry.expanded .log-details {
  display: block;
}

.log-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
}

.log-key {
  color: var(--yellow);
  font-weight: 600;
}

.log-value {
  color: var(--text);
  word-break: break-all;
  min-width: 0;
}

.log-value pre {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

.log-payload {
  min-width: 0;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}
.log-payload-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.log-payload-label {
  color: var(--yellow);
  font-weight: 600;
}
.log-payload pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0.4rem 0;
  padding: 0.6rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.log-payload-view {
  color: var(--text-dim);
  font-size: 0.75rem;
}
.log-payload-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.log-payload-controls .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 28px;
  max-width: 100%;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.log-decoder-group {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
}
.log-decoder-group .log-decoder-link {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
/* The picker continues the pill of its button. */
.log-decoder-pick {
  appearance: none;
  min-height: 28px;
  padding: 0 22px 0 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  border: 1px solid transparent;
  border-left: 1px solid var(--border);
  border-radius: 0 999px 999px 0;
  background-color: var(--bg-btn);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.log-decoder-pick:hover {
  background-color: var(--bg-btn-hover);
}
.log-decoder-pick:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.log-time {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 65px;
}

.log-action {
  font-weight: 600;
  min-width: 90px;
}

.log-action.presentation { color: var(--accent); }
.log-action.issuance { color: var(--green); }

.log-detail {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* An expanded entry shows its whole detail, also past the clamp on narrow screens. */
.log-entry.expanded .log-detail {
  white-space: normal;
  overflow-wrap: anywhere;
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.log-status {
  font-weight: 600;
}

.log-status.success { color: var(--green); }
.log-status.failure { color: var(--danger); }
.log-status.warning { color: var(--yellow); white-space: nowrap; }

/* Narrow screens put the detail on its own line below time, kind and status. */
@media (max-width: 600px) {
  .log-header {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .log-status {
    margin-left: auto;
  }
  .log-specs {
    order: 2;
    flex-basis: 100%;
    padding-left: 20px;
    white-space: normal;
  }
  .log-specs .finding-spec { margin: 0 4px 0 0; }
  .log-detail {
    order: 1;
    flex-basis: 100%;
    padding-left: 20px;
    white-space: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 13px;
}

.loading-state,
.load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
  color: var(--text-dim);
  font-size: 13px;
}

#log .loading-state,
#log .load-error {
  min-height: 110px;
}

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

/* The header switches to the menu button before its links would wrap. */
@media (max-width: 1180px) {
  header {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Position the mobile dropdown outside normal flow so opening it does not move the
     header. */
  .header-menu-toggle {
    display: inline-block;
  }

  .header-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 24px;
    font-size: 14px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 50;
  }

  .header-links.open {
    display: flex;
  }

  /* Mobile: the entries nest below the submenu entry inside the menu. */
  .header-submenu-toggle {
    text-align: left;
  }

  .header-submenu {
    position: static;
    margin-top: 10px;
    padding: 0 0 0 14px;
    gap: 12px;
    border: none;
    border-left: 2px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    background: none;
    min-width: 0;
  }

  .header-submenu a {
    padding: 0;
  }
}

@media (max-width: 768px) {
  body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }

  .main {
    overflow: visible;
    flex: none;
    padding: 16px;
  }

  #demo-banner,
  #pending-banner {
    margin: 12px 16px 0;
  }

  #demo-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .activity-drawer {
    margin: 0 calc(16px + var(--main-gutter, 0px)) 0 16px;
  }

  header {
    padding: 10px 16px;
  }
}

.conformance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 12px 0;
}
.conformance-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-dialog);
}
.conformance-table tr:last-child td {
  border-bottom: none;
}
.conformance-table td:first-child {
  color: var(--text-dim);
  width: 55%;
}
.conformance-table td:last-child {
  color: var(--text);
}
.conformance-table td.conf-on {
  font-weight: 600;
  color: var(--green);
}
.conformance-table td.conf-off {
  color: var(--text-dim);
}

.conf-input {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 10px;
  font-size: 13px;
  font-family: inherit;
}
.conf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
/* Keep disabled demo controls readable instead of using the browser's dimmed default. */
.conf-toggle input,
.conf-input {
  accent-color: var(--accent);
}
.conf-toggle input {
  cursor: pointer;
}
.conf-toggle:has(input:disabled),
.conf-input:disabled {
  cursor: default;
  color: var(--text);
  opacity: 1;
}

.offer-facts {
  font-size: 13px;
  margin: 8px 0 4px;
}
.offer-facts > div {
  display: flex;
  gap: 8px;
  padding: 2px 0;
}
.offer-fact-name {
  color: var(--text-dim);
  min-width: 120px;
}
.dialog-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.dialog-message {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
}

.trust-section {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--bg-raised);
}
.registrar-filter {
  margin: 12px 0;
}

/* The search text starts at the same edge as the text in the entries. The
   field's border counts toward the inset. */
.registrar-search {
  width: 100%;
  margin-bottom: 12px;
  padding-inline: calc(var(--registrar-inset) - 1px);
}

/* Chrome adds an arrow to fields with suggestions. Clicking it lists all of them. */
.registrar-search::-webkit-calendar-picker-indicator {
  display: none !important;
}

.registrar-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.registrar-pager[hidden] {
  display: none;
}

.registrar-page-info {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

.registrar-filter-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.registrar-party-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* Only the list scrolls, so title, search and buttons stay in view. */
.registrar-dialog:has(> .registrar-party-list) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* On small screens the filters leave the list too little room, so the whole
   dialog scrolls instead. */
@media (max-width: 600px), (max-height: 700px) {
  .registrar-dialog:has(> .registrar-party-list) {
    overflow-y: auto;
  }

  .registrar-party-list {
    flex: none;
    overflow-y: visible;
  }
}

.registrar-party {
  border-radius: 14px;
  padding: 12px var(--registrar-inset);
  background: var(--bg-raised);
  min-width: 0;
}

.registrar-party-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.registrar-party-name {
  font-size: 15px;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.registrar-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
}

.status-role-verifier {
  background: var(--info-bg);
  color: var(--info-fg);
}

.status-role-issuer {
  background: color-mix(in srgb, var(--purple) 16%, var(--bg-raised));
  color: var(--purple);
}

.registrar-party-identifier {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
}

.registrar-use {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-raised);
}

.registrar-use-kind {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

/* The title, the badge and the buttons share the baseline of their text. */
.registrar-cert-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 2px 10px;
  align-items: baseline;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-raised);
}

.registrar-cert-line .registrar-use-kind {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.registrar-cert-line .status-badge {
  margin-left: 0;
}

.registrar-cert-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.registrar-cert-title {
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* The dialog title shows the certificate type. */
.registrar-cert-body .registrar-use {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.registrar-cert-body .registrar-use-kind {
  display: none;
}

.registrar-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-raised);
}

/* A service label can be one long identifier. */
.registrar-add-row .btn {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
}

.registrar-use-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.registrar-use-purpose {
  min-width: 0;
  overflow-wrap: anywhere;
}

.registrar-party-head .btn,
.registrar-use-head .btn {
  white-space: nowrap;
}

.registrar-party-actions,
.registrar-use-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.registrar-use-credentials {
  margin: 4px 0 0;
  padding-left: 16px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  word-break: break-all;
}

.registrar-catalog-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.registrar-catalog-links a,
.registrar-use-credentials li {
  margin: 2px 0;
}

.registrar-use-credentials summary {
  cursor: pointer;
}

.registrar-credential-type {
  color: var(--text);
}

.registrar-credential-meta {
  margin-left: 8px;
  color: var(--text-dim);
  font-size: 11px;
}

.registrar-credential-claims {
  margin: 2px 0 6px 14px;
  line-height: 1.5;
}

.registrar-use-credentials a {
  color: var(--link);
  text-decoration: none;
  white-space: nowrap;
  word-break: normal;
}

.registrar-catalog-links a:hover,
.registrar-use-credentials a:hover {
  text-decoration: underline;
}

.registrar-catalog-version {
  white-space: nowrap;
}

.registrar-use-result textarea {
  height: 64px;
  word-break: break-all;
}

.registrar-help {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-dim);
}

.registrar-help summary {
  cursor: pointer;
  color: var(--link);
}

.registrar-command {
  position: relative;
  margin-top: 6px;
}

.registrar-command .btn {
  position: absolute;
  top: 6px;
  right: 6px;
}

.registrar-help pre {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-dialog);
  border-radius: 12px;
  padding: 8px 72px 8px 12px;
  margin: 4px 0;
  overflow-x: auto;
  user-select: all;
  color: var(--text);
}

/* A section keeps its fields in the dialog's grid. */
.registrar-section {
  display: contents;
}

.registrar-section[hidden] {
  display: none;
}

.registrar-dialog {
  --registrar-inset: 14px;
  max-width: 720px;
}

.registrar-credentials {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* Format, type and Remove share the first line. The claims get the second. */
.registrar-credential {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: var(--bg-raised);
}

.registrar-credential [data-field="format"] { grid-area: 1 / 1; }
.registrar-credential [data-field="type"] { grid-area: 1 / 2; }
.registrar-credential [data-field="remove"] { grid-area: 1 / 3; }
.registrar-credential [data-field="claims"] { grid-area: 2 / 1 / 3 / -1; }

.registrar-dialog .form-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.registrar-credentials-label {
  grid-column: 1 / -1;
}

.registrar-add {
  grid-column: 1 / -1;
  justify-self: start;
}

.registrar-notice {
  grid-column: 1 / -1;
  margin: 0;
}

.registrar-client-ids {
  margin: 4px 0 0;
  padding-left: 16px;
  font-size: 12px;
}

.registrar-client-ids code {
  word-break: break-all;
}

@media (max-width: 560px) {
  .registrar-credential {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .registrar-credential [data-field="remove"] { grid-area: 1 / 2; }
  .registrar-credential [data-field="type"] { grid-area: 2 / 1 / 3 / -1; }
  .registrar-credential [data-field="claims"] { grid-area: 3 / 1 / 4 / -1; }
}

.btn.registrar-registered:disabled {
  background: var(--ok-bg);
  color: var(--ok-fg);
  border-color: transparent;
  opacity: 1;
  cursor: default;
}

.registrar-result {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-dialog);
}

.registrar-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 4px;
}

.registrar-result textarea {
  height: 64px;
  word-break: break-all;
}

.trust-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.trust-section-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.5;
}
.trust-items {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  align-items: baseline;
  margin: 0;
}
.trust-items dt {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.trust-items dd {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.trust-items dd .trust-links + .trust-item-hint {
  margin-bottom: 4px;
}
.trust-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}
.trust-list-menu {
  position: relative;
  margin-left: auto;
}
.trust-list-menu summary {
  list-style: none;
  white-space: nowrap;
}
.trust-list-menu summary::-webkit-details-marker {
  display: none;
}
.trust-list-menu summary::after {
  content: " ▾";
  color: var(--text-dim);
}
.trust-list-menu-items {
  position: absolute;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  margin-top: 4px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.trust-list-menu-items button {
  min-height: 36px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.trust-list-menu-items button:hover {
  background: var(--bg-raised);
}
.trust-links a {
  color: var(--link);
  text-decoration: none;
  overflow-wrap: anywhere;
}
/* A long name wraps inside its own box, so the copy button stays on the row. */
.trust-links .trust-list-name {
  flex: 1 1 0;
  min-width: 0;
}
.trust-links a:hover {
  text-decoration: underline;
}
.trust-item-hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.45;
}
@media (max-width: 480px) {
  /* The title takes its own row. The status and actions share the next. */
  .registrar-cert-line {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 6px;
  }
  .registrar-cert-line .registrar-cert-title {
    grid-column: 1 / -1;
  }
  .registrar-cert-actions {
    justify-self: end;
  }
  /* Labels go above their inputs, so the inputs keep the full width. */
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 4px;
  }
  .form-grid .form-label {
    white-space: normal;
    margin-top: 6px;
  }
  .trust-items {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .trust-items dt {
    margin-top: 6px;
  }
  /* Each filter label takes its own row above the chips. */
  .catalog-filter-label {
    flex-basis: 100%;
  }
  /* Candidate rows share the width with the actions column, so the status pills
     need the room the thumbnail takes. */
  .candidate .card-face {
    display: none;
  }
  /* The ID, issuance time and type stay one tap away behind Show. */
  .candidate .cred-meta {
    display: none;
  }
  /* A fixed layout makes long setting labels and select values wrap inside the
     dialog. */
  .conformance-table {
    table-layout: fixed;
  }
  .conformance-table td:first-child {
    width: 38%;
  }
  .conf-input {
    max-width: 100%;
  }
  .conf-toggle {
    align-items: flex-start;
  }
}

.deferred-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.deferred-item {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 10px 14px 10px 10px;
  background: var(--bg-surface);
}
.deferred-item .card-face {
  width: 84px;
  height: 53px;
  border-radius: 8px;
  flex: 0 0 auto;
  box-shadow: var(--shadow-card);
  opacity: 0.6;
  filter: saturate(0.85);
}
.deferred-item .card-face .face-name,
.deferred-item .card-face .format-badge-face {
  display: none;
}
.deferred-item .credential-logo {
  top: 5px;
  left: 5px;
  width: 18px;
  height: 18px;
  padding: 2px;
}
.deferred-item .face-init,
.deferred-item .face-generic {
  font-size: 18px;
}
.deferred-body {
  flex: 1;
  min-width: 0;
}
.deferred-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.deferred-awaiting {
  margin-left: 0;
  background: var(--warn-bg);
  color: var(--yellow);
}
.deferred-status {
  display: flex;
  align-items: center;
  gap: 6px;
}
.deferred-spinner,
.loading-spinner {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--text-dim) 45%, transparent);
  border-top-color: var(--accent);
  animation: deferred-spin 0.9s linear infinite;
}
.loading-spinner {
  width: 24px;
  height: 24px;
}
@keyframes deferred-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .deferred-spinner,
  .loading-spinner { animation: none; }
}
.deferred-name {
  font-size: 15px;
  font-weight: 700;
}
.deferred-meta {
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
}
.deferred-error {
  color: var(--danger);
}
.deferred-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.btn-sm {
  font-size: 12px;
  padding: 3px 11px;
}

.offer-tx-code {
  margin: 10px 0 4px;
}
.offer-tx-code label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.offer-tx-code input[type="text"] {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--bg-input);
  color: var(--text);
  width: 100%;
}
.offer-tx-code input[type="text"]::placeholder {
  letter-spacing: normal;
  color: var(--text-dim);
}
.offer-tx-code input.input-error {
  border-color: var(--danger);
}
.offer-description {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.offer-description.offer-description-open {
  display: block;
}

.offer-description-toggle {
  font-size: 12px;
}

.trust-added {
  margin: 6px 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.trust-added li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  overflow-wrap: anywhere;
}

.trust-added .trust-remove {
  flex-shrink: 0;
  padding: 1px 9px;
  line-height: 1.4;
}

.trust-list-error {
  display: block;
  color: var(--danger);
}

.trust-items dd .trust-added {
  margin: 0 0 4px;
  padding-left: 10px;
  border-left: 2px solid var(--border);
  font-size: 12px;
}

.howto-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0 10px;
  padding: 4px;
  border-radius: 20px;
  background: var(--bg-track);
}

.howto-tab {
  padding: 6px 16px;
  border: none;
  border-radius: 17px;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.howto-tab:hover {
  color: var(--text);
}

.howto-tab.active {
  background: var(--bg-segment);
  color: var(--text-segment);
  font-weight: 600;
  box-shadow: var(--shadow-segment);
}

.howto-panel pre {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.howto-panel pre.howto-commands {
  white-space: pre;
  overflow-x: auto;
}

.news-content h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.news-content p,
.news-content ul {
  margin: 0 0 12px;
  line-height: 1.5;
}

.news-content ul {
  padding-left: 20px;
}

.news-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 16px;
  border-radius: 10px;
}

.news-content .chrome-web-store .btn {
  display: inline-block;
  text-decoration: none;
}

.news-dialog {
  max-width: 760px;
}

/* The news can be longer than the dialog, so Close stays in view. */
.news-dialog .consent-buttons {
  position: sticky;
  bottom: -22px;
  margin: 0 -22px -22px;
  padding: 12px 22px 22px;
  background: var(--bg-dialog);
  border-top: 1px solid var(--border-dialog);
}

/* A bare monospace family gets the browser's smaller monospace size. */
.news-content code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--link);
}

.news-content .news-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}

.news-content .news-features > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-surface);
}

.news-content .news-features span {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 600px) {
  .news-content .news-features {
    grid-template-columns: 1fr;
  }
}

.news-content .lead {
  font-size: 15px;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--bg-raised);
}

/* The guided tour. The spot's shadow dims everything around the target. */
.tour {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.tour-spot {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 200vmax var(--scrim);
  outline: 2px solid var(--accent);
  outline-offset: 0;
  pointer-events: none;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.tour-card {
  position: fixed;
  width: min(360px, calc(100vw - 32px));
  background: var(--bg-dialog);
  border: 1px solid var(--border-dialog);
  border-radius: 18px;
  box-shadow: var(--shadow-dialog);
  padding: 14px 18px 16px;
  transition: top 0.2s ease, left 0.2s ease;
}

.tour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tour-step {
  font-size: 12px;
  color: var(--text-dim);
}

.tour-close {
  width: 30px;
  height: 30px;
  margin-right: -8px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.tour-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.tour-close:focus-visible {
  outline: 2px solid var(--accent);
}

.tour-title {
  font-size: 16px;
  font-weight: 700;
  margin: 2px 0 6px;
}

.tour-text {
  color: var(--text-dim);
}

.tour-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.tour-card .btn:not(.btn-primary) {
  background: var(--bg-btn-dialog);
}

.howto-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0 12px;
}

.howto-head .btn {
  flex: 0 0 auto;
}

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

/* A button that reads like a link inside running text. */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
}

.link-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

#trust-external-lists .trust-item-hint {
  display: block;
  margin-top: 0;
}

#trust-external-lists .trust-links > span,
#trust-external-lists .trust-list-error {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dialog-actions ~ .howto-head {
  padding-right: 108px;
}

/* The news starts with an image, so its actions take a row of their own. */
.news-dialog > .dialog-actions {
  position: static;
  justify-content: flex-end;
  margin: -6px -6px 8px 0;
}

/* A maximized dialog gives its lists and text fields the extra height. The
   templates list fills the dialog, so its buttons stay at the bottom. */
.consent-dialog.dialog-maximized:has(> .templates-list) {
  display: flex;
  flex-direction: column;
}

.consent-dialog.dialog-maximized > .templates-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.consent-dialog.dialog-maximized #issue-claim-rows {
  max-height: none;
}

.consent-dialog.dialog-maximized .form-textarea {
  height: 25vh;
}

.consent-dialog.dialog-maximized .template-editor-json,
.consent-dialog.dialog-maximized #issue-claims,
.consent-dialog.dialog-maximized .import-textarea {
  height: 60vh;
}

.certificate-list {
  margin-bottom: 16px;
}

.certificate-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-left: calc(var(--chain-depth, 0) * 20px);
  padding: 10px 12px;
  background: var(--bg-raised);
  border-radius: 12px;
}

.certificate-row + .certificate-row {
  margin-top: 12px;
}

/* An elbow from the row above shows which certificate issued this one. */
.certificate-row + .certificate-row::before {
  content: "";
  position: absolute;
  top: -12px;
  left: -10px;
  width: 10px;
  height: 30px;
  border-left: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  border-bottom-left-radius: 6px;
}

.certificate-row-credential {
  background: none;
  border: 1px solid var(--border);
}

.certificate-info {
  min-width: 0;
  overflow-wrap: anywhere;
}

.certificate-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

.certificate-name {
  font-size: 13px;
  font-weight: 600;
}

.certificate-state {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
}

.certificate-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

@media (max-width: 480px) {
  .certificate-row {
    flex-direction: column;
    margin-left: calc(var(--chain-depth, 0) * 12px);
  }

  .certificate-actions {
    justify-content: flex-start;
  }
}

#request-credential-overlay {
  z-index: 110;
}

/* These rows are alternatives, so they have no issuer elbow. */
#request-credential-list .certificate-row::before {
  content: none;
}

.consent-obtain {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
