/* =========================================================================
   CREDENTIAL WALLET
   Loaded after style.css. Inherits the site background, header, footer,
   buttons and panel language; everything below is wallet-specific.

   The one new idea here: a credential is a receipt. IDs, counters and
   dates are set in a monospace face so the page reads like something that
   was issued and can be checked, not like a decorated list.
   ========================================================================= */

:root {
  --w-panel: rgba(8, 14, 36, 0.55);
  --w-panel-solid: #0d1330;
  --w-line: rgba(120, 160, 255, 0.18);
  --w-line-strong: rgba(120, 160, 255, 0.34);
  --w-blue: #4fb3ff;
  --w-purple: #7c4dff;
  --w-green: #4ade80;
  --w-amber: #fbbf24;
  --w-text: #e6ebff;
  --w-dim: #8f9dc0;
  --w-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Visually hidden, still announced by screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ============ PAGE HEAD ============ */
.wallet-main { padding-bottom: 20px; }

.wallet-hero {
  padding: 44px 0 8px;
}

.wallet-eyebrow {
  font-family: var(--w-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--w-blue);
  margin: 0 0 14px;
}

.wallet-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 46px;
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  margin: 0 0 16px;
}

.wallet-intro {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #b8c3e0;
  max-width: 720px;
  margin: 0 0 28px;
}

.wallet-intro strong { color: var(--w-text); font-weight: 600; }

/* ---- Ledger strip: the counters ---- */
.wallet-ledger {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--w-line);
  border-radius: 14px;
  background: var(--w-panel);
  overflow: hidden;
}

.ledger-cell {
  padding: 20px 22px;
  border-right: 1px solid var(--w-line);
  min-width: 0;
}

.ledger-cell:last-child { border-right: none; }

.ledger-value {
  font-family: var(--w-mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.02em;
  display: block;
  font-variant-numeric: tabular-nums;
}

.ledger-value .ledger-unit {
  font-size: 15px;
  color: var(--w-blue);
  margin-left: 4px;
  font-weight: 600;
}

.ledger-label {
  display: block;
  margin-top: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--w-dim);
}

.ledger-sub {
  display: block;
  margin-top: 3px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: #6f7da3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ CONTROLS ============ */
.wallet-controls {
  position: sticky;
  top: 78px;
  z-index: 30;
  margin: 26px 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--w-line);
  border-radius: 14px;
  background: rgba(6, 10, 28, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

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

.controls-row + .controls-row { margin-top: 14px; }

/* ---- Search ---- */
.search-wrap {
  position: relative;
  flex: 1 1 320px;
  min-width: 220px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--w-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 84px 11px 42px;
  border-radius: 9px;
  border: 1px solid var(--w-line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14.5px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.search-input::placeholder { color: #6f7da3; }

.search-input:focus {
  outline: none;
  border-color: var(--w-blue);
  background: rgba(255, 255, 255, 0.07);
}

.search-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--w-mono);
  font-size: 11px;
  color: #6f7da3;
  border: 1px solid var(--w-line);
  border-radius: 5px;
  padding: 2px 7px;
  pointer-events: none;
}

.search-wrap:focus-within .search-hint { opacity: 0; }

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--w-text);
  cursor: pointer;
}

.search-clear:hover { background: rgba(255, 255, 255, 0.16); }
.search-wrap.has-value .search-clear { display: inline-flex; }
.search-wrap.has-value .search-hint { display: none; }

/* ---- Select + view toggle ---- */
.select-wrap { position: relative; flex: 0 0 auto; }

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 11px 36px 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--w-line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--w-text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  cursor: pointer;
}

.sort-select:focus { outline: none; border-color: var(--w-blue); }
.sort-select option { background: #10163a; color: #fff; }

.select-chev {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--w-dim);
  pointer-events: none;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--w-line-strong);
  border-radius: 9px;
  overflow: hidden;
  flex: 0 0 auto;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border: none;
  background: rgba(255, 255, 255, 0.03);
  color: var(--w-dim);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.view-btn + .view-btn { border-left: 1px solid var(--w-line); }
.view-btn:hover { color: var(--w-text); background: rgba(255, 255, 255, 0.07); }

.view-btn[aria-pressed="true"] {
  background: rgba(79, 179, 255, 0.16);
  color: #fff;
}

/* ---- Filter chips ---- */
.chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.chip-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6f7da3;
  margin-right: 4px;
  flex: 0 0 auto;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--w-line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--w-text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.chip:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(160, 190, 255, 0.55);
}

.chip[aria-pressed="true"] {
  background: linear-gradient(180deg, #2f7dff 0%, #1e63e6 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(47, 125, 255, 0.36);
}

.chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.chip-count {
  font-family: var(--w-mono);
  font-size: 11.5px;
  color: var(--w-dim);
  font-variant-numeric: tabular-nums;
}

.chip[aria-pressed="true"] .chip-count { color: rgba(255, 255, 255, 0.85); }

/* Status chips carry their own colour so the state reads at a glance */
.chip-status[data-status="lifetime"][aria-pressed="true"],
.chip-status[data-status="active"][aria-pressed="true"] {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.32);
}

.chip-status[data-status="in-progress"][aria-pressed="true"] {
  background: linear-gradient(180deg, #7c4dff 0%, #5b2ee0 100%);
  box-shadow: 0 4px 14px rgba(124, 77, 255, 0.36);
}

/* ---- Filter row: fields and status share one line ---- */
.controls-filters {
  row-gap: 10px;
}

.chip-divider {
  width: 1px;
  align-self: stretch;
  min-height: 24px;
  background: var(--w-line-strong);
  margin: 0 4px;
  flex: 0 0 auto;
}

/* ---- Result count / active filter summary ---- */
.result-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--w-dim);
}

.result-count {
  font-family: var(--w-mono);
  color: var(--w-text);
  font-variant-numeric: tabular-nums;
}

.reset-link {
  background: none;
  border: none;
  color: var(--w-blue);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
}

.reset-link:hover { text-decoration: underline; }

/* ============ CREDENTIAL GRID ============ */
/* Results are grouped: a category header, then one block per issuer
   inside it, then the card grid. */
.cred-groups { display: block; }

.cat-group + .cat-group { margin-top: 46px; }

.cat-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 6px;
}

.cat-title {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  margin: 0;
  flex: 0 0 auto;
}

.cat-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--w-line-strong), transparent);
}

.cat-count {
  font-family: var(--w-mono);
  font-size: 11.5px;
  color: var(--w-dim);
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.cat-blurb {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--w-dim);
  margin: 0 0 20px;
  max-width: 620px;
}

.issuer-block + .issuer-block { margin-top: 26px; }

.issuer-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--w-blue);
  margin: 0 0 14px;
}

.issuer-count {
  font-family: var(--w-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--w-dim);
  border: 1px solid var(--w-line);
  border-radius: 999px;
  padding: 1px 7px;
}

.cred-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cred-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 1px solid var(--w-line);
  border-radius: 16px;
  background: var(--w-panel);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cred-card:hover {
  transform: translateY(-4px);
  border-color: rgba(160, 190, 255, 0.5);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.cred-card:focus-visible {
  outline: 2px solid var(--w-blue);
  outline-offset: 3px;
}

.cred-card.is-progress {
  border-style: dashed;
  border-color: rgba(124, 77, 255, 0.5);
  background: rgba(124, 77, 255, 0.06);
}

/* ---- Card image ---- */
.cred-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #070b1e;
  border-bottom: 1px solid var(--w-line);
  overflow: hidden;
}

.cred-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}

.cred-thumb img.fit-contain {
  object-fit: contain;
  object-position: center;
  padding: 16px;
}

.cred-card:hover .cred-thumb img { transform: scale(1.035); }

.cred-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(124, 77, 255, 0.55);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(124, 77, 255, 0.07) 0 12px,
      transparent 12px 24px
    );
}

/* Status pill sits on the image */
.status-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--w-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill[data-status="lifetime"],
.status-pill[data-status="active"] {
  background: rgba(6, 30, 16, 0.82);
  border: 1px solid rgba(74, 222, 128, 0.55);
  color: var(--w-green);
}

.status-pill[data-status="expiring"] {
  background: rgba(38, 26, 4, 0.82);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: var(--w-amber);
}

.status-pill[data-status="in-progress"] {
  background: rgba(20, 10, 44, 0.82);
  border: 1px solid rgba(167, 139, 250, 0.6);
  color: #c4b5fd;
}

/* Issuer tab on the image */
.issuer-tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 11px;
  border-radius: 7px;
  background: rgba(4, 7, 20, 0.85);
  border: 1px solid var(--w-line-strong);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--w-text);
}

/* ---- Card body ---- */
.cred-body {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cred-name {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  margin: 0 0 8px;
}

.cred-issuer {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: #b8c3e0;
  margin: 0 0 12px;
  line-height: 1.45;
}

.cred-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--w-mono);
  font-size: 11.5px;
  color: var(--w-dim);
  padding-top: 12px;
  border-top: 1px dashed var(--w-line);
  margin-bottom: 12px;
}

.cred-meta .dot-sep { color: #47527a; }

.cred-skills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.skill-tag {
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(79, 179, 255, 0.1);
  border: 1px solid rgba(79, 179, 255, 0.22);
  color: #a9d5ff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.skill-tag:hover {
  background: rgba(79, 179, 255, 0.24);
  color: #fff;
}

.skill-tag.is-more {
  background: transparent;
  border-color: var(--w-line);
  color: var(--w-dim);
  cursor: default;
}

.skill-tag[aria-pressed="true"] {
  background: var(--w-blue);
  border-color: var(--w-blue);
  color: #04122a;
  font-weight: 700;
}

.cred-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.cred-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.cred-action-verify {
  background: linear-gradient(180deg, #2f7dff 0%, #1e63e6 100%);
  color: #fff;
  flex: 1;
}

.cred-action-verify:hover { transform: translateY(-1px); }

.cred-action-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--w-line-strong);
  color: var(--w-text);
}

.cred-action-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(160, 190, 255, 0.55);
}

/* ============ TIMELINE VIEW ============ */
.cred-timeline { display: none; }
body[data-view="timeline"] .cred-groups { display: none; }
body[data-view="timeline"] .cred-timeline { display: block; }

.tl-year {
  margin-bottom: 8px;
}

.tl-year-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 14px;
}

.tl-year-label {
  font-family: var(--w-mono);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.tl-year-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--w-line-strong), transparent);
}

.tl-year-count {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--w-dim);
}

.tl-item {
  display: grid;
  grid-template-columns: 108px 24px 1fr;
  gap: 0;
  align-items: stretch;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.tl-date {
  font-family: var(--w-mono);
  font-size: 12px;
  color: var(--w-dim);
  padding: 18px 12px 18px 0;
  text-align: right;
  white-space: nowrap;
}

.tl-rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.tl-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--w-line-strong);
}

.tl-node {
  position: relative;
  margin-top: 20px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--w-blue);
  box-shadow: 0 0 0 4px rgba(79, 179, 255, 0.16);
  flex: 0 0 auto;
  align-self: flex-start;
  transition: box-shadow 0.2s ease;
}

.tl-item:hover .tl-node { box-shadow: 0 0 0 7px rgba(79, 179, 255, 0.24); }
.tl-item.is-progress .tl-node {
  background: var(--w-purple);
  box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.2);
}

.tl-body {
  padding: 14px 16px;
  margin: 4px 0 4px 16px;
  border: 1px solid var(--w-line);
  border-radius: 12px;
  background: var(--w-panel);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.tl-item:hover .tl-body {
  border-color: rgba(160, 190, 255, 0.5);
  transform: translateX(3px);
}

.tl-item:focus-visible .tl-body {
  outline: 2px solid var(--w-blue);
  outline-offset: 2px;
}

.tl-name {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px;
}

.tl-sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--w-dim);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tl-chip {
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--w-line);
  font-family: var(--w-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============ EMPTY STATE ============ */
.wallet-empty {
  display: none;
  text-align: center;
  padding: 64px 24px;
  border: 1px dashed var(--w-line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.wallet-empty.is-shown { display: block; }

.wallet-empty svg { color: #47527a; margin-bottom: 16px; }

.wallet-empty h3 {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 19px;
  color: #fff;
  margin: 0 0 8px;
}

.wallet-empty p {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14.5px;
  color: var(--w-dim);
  margin: 0 0 20px;
}

/* ============ DETAIL MODAL ============ */
.cred-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cred-modal.is-open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 14, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: none;
  padding: 0;
  cursor: zoom-out;
}

.modal-panel {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--w-line-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, #0c1130 0%, #0a0e26 100%);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  animation: modal-in 0.22s cubic-bezier(0.22, 0.9, 0.3, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--w-line-strong);
  background: rgba(4, 7, 20, 0.85);
  color: var(--w-text);
  cursor: pointer;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.12); }

.modal-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.modal-visual {
  padding: 26px;
  border-right: 1px solid var(--w-line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.modal-img-frame {
  border: 1px solid var(--w-line);
  border-radius: 12px;
  overflow: hidden;
  background: #070b1e;
  cursor: zoom-in;
}

.modal-img-frame img { width: 100%; display: block; }

.modal-visual-note {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: #6f7da3;
  text-align: center;
}

.modal-detail { padding: 30px 28px 26px; min-width: 0; }

.modal-issuer {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--w-blue);
  margin: 0 0 10px;
}

.modal-name {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.28;
  color: #fff;
  margin: 0 0 14px;
}

.modal-summary {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #b8c3e0;
  margin: 0 0 22px;
}

/* Receipt-style key/value table */
.modal-table {
  border-top: 1px solid var(--w-line);
  margin-bottom: 22px;
}

.modal-row {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--w-line);
  align-items: baseline;
}

.modal-key {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6f7da3;
}

.modal-val {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--w-text);
  word-break: break-word;
  min-width: 0;
}

.modal-val.mono {
  font-family: var(--w-mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

.modal-val a { color: var(--w-blue); text-decoration: underline; text-underline-offset: 3px; }
.modal-val a:hover { color: #8fcbff; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--w-line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--w-dim);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
}

.copy-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.copy-btn.is-done { color: var(--w-green); border-color: rgba(74, 222, 128, 0.5); }

.modal-skills { display: flex; gap: 7px; flex-wrap: wrap; }

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--w-line);
}

/* ============ IMAGE LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(2, 4, 14, 0.93);
  cursor: zoom-out;
}

.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

/* ============ TOAST ============ */
.wallet-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 400;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(74, 222, 128, 0.45);
  background: rgba(6, 26, 16, 0.95);
  color: #d7ffe6;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.wallet-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ============ SUB-NAV BACK LINK ============ */
.wallet-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--w-dim);
  transition: color 0.18s ease;
}

.wallet-back:hover { color: var(--w-blue); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .cred-grid { grid-template-columns: repeat(2, 1fr); }
  .wallet-title { font-size: 40px; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-visual { border-right: none; border-bottom: 1px solid var(--w-line); }
}

@media (max-width: 860px) {
  .wallet-ledger { grid-template-columns: repeat(2, 1fr); }
  .ledger-cell:nth-child(2) { border-right: none; }
  .ledger-cell:nth-child(1), .ledger-cell:nth-child(2) { border-bottom: 1px solid var(--w-line); }
}

@media (max-width: 768px) {
  .wallet-hero { padding: 26px 0 4px; }
  .wallet-title { font-size: 29px; }
  .wallet-intro { font-size: 15px; }
  .cred-grid { grid-template-columns: 1fr; }
  .ledger-cell { padding: 15px 16px; }
  .ledger-value { font-size: 27px; }

  .wallet-controls {
    position: static;
    padding: 14px;
  }

  /* Every filter stays visible: the chip rows wrap inside the card instead
     of running off the right edge, so nothing is hidden behind a swipe. */
  .chip-group {
    flex-wrap: wrap;
    overflow: visible;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    gap: 7px;
    padding-bottom: 0;
  }
  .chip {
    flex: 0 1 auto;
    max-width: 100%;
    padding: 6px 11px;
    font-size: 12.5px;
    gap: 5px;
  }
  .chip-count { font-size: 10.5px; }

  .search-hint { display: none; }
  .chip-divider { display: none; }
  .controls-filters { flex-direction: column; align-items: stretch; }
  .controls-filters .chip-label { margin-bottom: -4px; }
  .cat-title { font-size: 17px; }

  .tl-item { grid-template-columns: 66px 20px 1fr; }
  .tl-date { font-size: 11px; padding-right: 8px; }
  .tl-body { margin-left: 10px; padding: 12px 13px; }

  .cred-modal { padding: 0; }
  .modal-panel { max-height: 100vh; border-radius: 0; width: 100%; }
  .modal-detail { padding: 24px 20px; }
  .modal-visual { padding: 20px; }
  .modal-row { grid-template-columns: 1fr; gap: 4px; padding: 10px 0; }
}

/* Narrow phones (iPhone SE / mini class): the chips tighten one more step
   so the full set of fields still fits the card in three short rows. */
@media (max-width: 430px) {
  .chip-group { gap: 6px; }
  .chip {
    padding: 5px 9px;
    font-size: 11.5px;
    gap: 4px;
  }
  .chip-count { font-size: 10px; }
  .controls-filters .chip-label { font-size: 10px; letter-spacing: 0.1em; }
}

/* ============ MOTION PREFERENCES ============ */
@media (prefers-reduced-motion: reduce) {
  .cred-card,
  .cred-thumb img,
  .tl-body,
  .tl-node,
  .modal-panel,
  .wallet-toast {
    transition: none !important;
    animation: none !important;
  }
  .cred-card:hover { transform: none; }
  .cred-card:hover .cred-thumb img { transform: none; }
  .tl-item:hover .tl-body { transform: none; }
}

/* ============ PRINT =======================================================
   Ctrl/Cmd-P turns whatever the recruiter has filtered to into a clean,
   one-column credential dossier with the verification URLs written out in
   full — because a printed link that cannot be clicked is useless.
   ========================================================================= */
@media print {
  body {
    background: #fff !important;
    color: #111 !important;
  }

  .site-header,
  .site-footer,
  .wallet-controls,
  .wallet-back,
  .cred-actions,
  .cred-thumb,
  .modal-backdrop,
  .cred-modal,
  .lightbox,
  .wallet-toast,
  .result-bar .reset-link,
  .cred-timeline { display: none !important; }

  .container { max-width: none; padding: 0 12mm; }
  .wallet-hero { padding: 0 0 8mm; }

  .wallet-eyebrow { color: #555 !important; }
  .wallet-title { color: #000 !important; font-size: 26pt; }
  .wallet-intro { color: #333 !important; font-size: 10pt; }

  .wallet-ledger {
    background: none !important;
    border: 1px solid #bbb !important;
  }
  .ledger-cell { border-right: 1px solid #ddd !important; }
  .ledger-value { color: #000 !important; font-size: 18pt; }
  .ledger-label, .ledger-sub { color: #555 !important; }

  .result-bar { color: #555 !important; font-size: 9pt; }

  .cred-groups,
  .cred-grid { display: block !important; }
  .cat-title { color: #000 !important; font-size: 14pt; }
  .cat-blurb { color: #444 !important; font-size: 9pt; }
  .issuer-head { color: #1a4fa0 !important; font-size: 9pt; }

  .cred-card {
    display: block !important;
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    background: none !important;
    border-radius: 6px;
    margin-bottom: 5mm;
    box-shadow: none !important;
    transform: none !important;
  }

  .cred-body { padding: 4mm 5mm; }
  .cred-name { color: #000 !important; font-size: 12pt; }
  .cred-issuer { color: #333 !important; font-size: 9.5pt; }
  .cred-meta { color: #555 !important; font-size: 8.5pt; border-color: #ddd !important; }

  .skill-tag {
    background: none !important;
    border: 1px solid #ccc !important;
    color: #333 !important;
    font-size: 8pt;
  }

  /* Print the verification URL under each card so the paper copy is checkable */
  .cred-card[data-verify]::after {
    content: "Verify: " attr(data-verify);
    display: block;
    padding: 0 5mm 4mm;
    font-family: var(--w-mono);
    font-size: 7.5pt;
    color: #1a4fa0;
    word-break: break-all;
  }
}
