:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f5f5f7;
  background: #0d0e11;
  --text: #f5f5f7;
  --muted: #a8a9b2;
  --quiet: #8c8e99;
  --accent: #9cc7ff;
  --surface: #1b1c22;
  --line: #30313a;
  --motion: cubic-bezier(.2,.75,.25,1);
}
*, *::before, *::after { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; min-width: 280px; min-height: 100vh; min-height: 100dvh }
button, input, select, textarea { font: inherit }
button { cursor: pointer; -webkit-tap-highlight-color: transparent }
button:disabled { cursor: default; opacity: .5 }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px }
button, a, input, select { touch-action: manipulation }
h1, h2, p { margin: 0 }
.icon-library { position: absolute; pointer-events: none }
.icon { flex: none; inline-size: 20px; block-size: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle }
.wallet { width: min(100%, 680px); min-height: 100vh; min-height: 100dvh; padding: max(44px, env(safe-area-inset-top)) 32px max(28px, env(safe-area-inset-bottom)); margin: 0 auto; display: flex; flex-direction: column }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 44px }
.wordmark { display: flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 550; color: #d4d5da }
.wordmark-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #e3ebfb; border-radius: 11px; background: #22242c; border: 1px solid #353743 }
.wordmark-icon .icon { width: 19px; height: 19px }
.header-actions { display: flex; gap: 8px }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none; padding: 0; border: 1px solid #353640; border-radius: 50%; color: var(--text); background: #22232a; transition: background-color .16s var(--motion), transform .16s var(--motion) }
.icon-button:hover { background-color: #343640 }
.icon-button:active, .button:active { transform: scale(.97) }
.icon-button--add { background: #e8effa; color: #111826; border-color: transparent }
.icon-button--add:hover { background-color: #c9dfff }
.icon-button--add .icon { width: 22px; height: 22px }
h1 { font-size: clamp(2.125rem, 6vw, 3.25rem); font-weight: 680; letter-spacing: -.06em; line-height: 1.06 }
.wallet-subtitle { color: var(--muted); font-size: .9375rem; margin-top: 8px; font-variant-numeric: tabular-nums }
.collection { margin: 28px 0 24px }
.empty { display: grid; justify-items: center; text-align: center; padding: 30px 20px 36px; border: 1px solid #262832; border-radius: 28px; background: #14151a }
.empty h2 { margin: 4px 0 8px; font-size: 1.375rem; font-weight: 630; letter-spacing: -.025em }
.empty p { color: var(--muted); max-width: 34ch; line-height: 1.55; font-size: .9375rem }
.empty .button { margin-top: 20px }
.empty-art { width: min(100%, 352px); height: 200px; position: relative; margin-bottom: 12px; display: grid; place-items: center; isolation: isolate }
.sample-pass { position: absolute; width: 66%; aspect-ratio: 1.77; border: 1px solid #ffffff35; border-radius: 17px; overflow: hidden; box-shadow: 0 14px 23px #05060760 }
.sample-pass--back { transform: translate(-15%, -12%) rotate(-13deg); background: #986c50 }
.sample-pass--middle { transform: translate(15%, -9%) rotate(14deg); background: #6c4e5f }
.sample-pass--front { transform: translateY(13%); background: linear-gradient(155deg,#466c9d,#2f4e79 72%); text-align: left }
.sample-lines { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #b5d8ff4f; stroke-width: 1 }
.sample-mark { position: absolute; top: 14px; left: 14px; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; color: #eff5ff; background: #dce9ff27; border: 1px solid #cfe5ff3b }
.sample-tail { display: flex; position: absolute; bottom: 15px; left: 15px; align-items: center; gap: 4px }
.sample-tail i { width: 3px; height: 13px; background: #d1e2f8a0; border-radius: 1px }
.sample-tail i:nth-child(even) { width: 5px }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 13px; border: 1px solid transparent; font-size: .9375rem; font-weight: 600; line-height: 1.22; transition: background-color .16s var(--motion), transform .16s var(--motion) }
.button--primary { background: #e8effa; color: #151b27 }
.button--primary:hover { background-color: #cfe2ff }
.button--secondary { background: #292b33; border-color: #363843; color: var(--text) }
.button--secondary:hover { background-color: #373943 }
.button--wide { width: 100% }
.button--destructive { color: #fff; background: #a82d3c }
.button--destructive:hover { background-color: #bd3545 }
.button--danger-quiet { color: #ffacb3 }
.wallet-footer { display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--quiet); font-size: .8125rem; text-align: center; margin-top: auto; padding-top: 16px }
.wallet-footer .icon { inline-size: 16px; block-size: 16px }
.stack { display: flex; flex-direction: column; isolation: isolate }
.stack > * + * { margin-top: -100px }
.card { --card-bg: #34477d; --card-ink: #fff; position: relative; overflow: hidden; border-radius: 22px; border: 1px solid #ffffff38; color: var(--card-ink); background: var(--card-bg); background-image: linear-gradient(151deg,#ffffff17,transparent 55%,#070b142a); isolation: isolate }
.card::after { content: ""; position: absolute; z-index: -1; pointer-events: none; width: 300px; height: 300px; top: -130px; right: -55px; background: radial-gradient(circle, transparent 89px, #ffffff36 90px 91px, transparent 92px 108px, #ffffff2b 109px 110px, transparent 111px 127px, #ffffff20 128px 129px, transparent 130px) }
.card--stack { display: block; width: 100%; height: 176px; padding: 0; text-align: left; box-shadow: 0 -3px 13px #06060943, 0 5px 12px #06060933; transition: filter .16s var(--motion), transform .16s var(--motion) }
.card--stack .card-top, .card--stack .card-bottom { position: absolute; inset-inline: 16px; width: auto }
.card--stack .card-top { top: 14px }
.card--stack .card-bottom { bottom: 14px }
.card--stack:hover { filter: brightness(1.09) }
.card--stack:active { transform: translateY(2px) }
.card--stack:focus-visible { outline: 2px solid #fff; outline-offset: -4px }
.card-top { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0 }
.card-mark { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 1px solid #ffffff4a; border-radius: 12px; background: #00000025; color: inherit; font-weight: 650; font-size: .875rem }
.card-name { font-size: 1.1875rem; font-weight: 640; line-height: 1.18; min-width: 0; overflow-wrap: anywhere }
.card--stack .card-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.card-chevron { opacity: .82; margin-left: auto; flex: none; font-size: 1.4rem; line-height: 1 }
.card-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .8125rem; color: #ffffffe0; font-variant-numeric: tabular-nums }
.stack-hint { text-align: center; color: var(--muted); font-size: .875rem; margin-top: 20px }
.sheet { color: var(--text); background: var(--surface); width: min(calc(100% - 32px), 480px); max-height: calc(100% - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid #343540; border-radius: 24px; box-shadow: 0 20px 70px #0008; overscroll-behavior: contain }
.sheet[open] { animation: sheet-in .21s var(--motion) both }
.sheet::backdrop { background: #050609a6 }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: translateY(0) } }
.sheet-inner { padding: 20px 24px 24px }
.sheet-header { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 16px }
.sheet-header h2 { font-size: 1.375rem; font-weight: 650; letter-spacing: -.03em; line-height: 1.15 }
.sheet-header .icon-button { margin-right: -4px }
.sheet-kicker { font-size: .9375rem; color: var(--muted) }
.sheet-copy { color: var(--muted); font-size: .9375rem; line-height: 1.5; margin: 0 0 16px }
.sheet-copy strong { color: var(--text); overflow-wrap: anywhere }
.quick-actions, .detail-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px }
.quick-actions { margin-bottom: 20px }
#card-form { display: grid; gap: 8px }
#card-form label, legend { font-weight: 560; font-size: .875rem }
#card-form label:not(:first-child) { margin-top: 4px }
#card-form input, #card-form select, #card-form textarea { width: 100%; min-height: 44px; margin: 0; padding: 10px 12px; background: #111216; color: var(--text); border: 1px solid var(--line); border-radius: 10px; font-size: 1rem }
#card-form textarea { resize: vertical; min-height: 44px; line-height: 1.375 }
#card-form input::placeholder, #card-form textarea::placeholder { color: #888a97; opacity: 1 }
.optional, .field-help { color: var(--muted); font-weight: 400 }
.field-help { font-size: .8125rem; line-height: 1.45 }
fieldset { border: 0; padding: 0; margin: 4px 0 0; min-width: 0 }
legend { padding: 0; margin-bottom: 8px }
.palette { display: flex; flex-wrap: wrap; gap: 4px }
.swatch { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 2px solid transparent; border-radius: 50%; color: #fff; background: transparent }
.swatch::after { content: ""; display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--swatch); border: 1px solid #ffffff40 }
.swatch[aria-pressed=true] { border-color: #d4e5ff }
.save-button { margin-top: 8px }
.error { padding: 10px 12px; color: #ffb9c0; background: #3a2028; border-radius: 9px; font-size: .875rem; line-height: 1.4; overflow-wrap: anywhere }
.card--detail { display: grid; gap: 20px; padding: 16px; margin-bottom: 16px }
.code-panel { display: grid; justify-items: center; gap: 4px; position: relative; width: 100%; min-width: 0; background: #fff; color: #0d0d10; border: 0; border-radius: 12px; padding: 24px 16px 12px; text-align: center; color-scheme: light }
.code-panel:focus-visible { outline-offset: 3px; outline-color: #fff }
.code-image { width: 100%; display: grid; justify-items: center; overflow: hidden }
.code-image svg { display: block; width: 100%; height: auto; max-height: 220px }
.code-value { max-width: 100%; color: #20212a; font-family: ui-monospace, Consolas, monospace; font-size: .875rem; overflow-wrap: anywhere }
.expand-icon { position: absolute; top: 6px; right: 6px; color: #454854; width: 16px; height: 16px }
.card-note { color: var(--muted); margin: 0 0 16px; font-size: .9375rem; overflow-wrap: anywhere }
.settings-actions { display: grid; gap: 8px; margin-bottom: 12px }
.settings-actions + .error { margin-bottom: 12px }
.settings-shortcut { margin-bottom: 20px }
.settings-heading { font-size: .9375rem; font-weight: 600; margin: 0 0 8px }
.shortcut-sheet { width: min(calc(100% - 32px), 620px) }
.shortcut-options { display: grid; gap: 12px }
.shortcut-choice { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px }
.shortcut-choice h3 { margin: 0; font-size: 1rem; font-weight: 620 }
.shortcut-choice :is(p, ol) { margin: 0 }
.shortcut-choice p, .shortcut-choice ol { color: var(--muted); font-size: .875rem; line-height: 1.55 }
.shortcut-choice strong { color: var(--text); font-weight: 600 }
.shortcut-choice ol { padding-inline-start: 20px }
.shortcut-choice li + li { margin-top: 8px }
.shortcut-native-actions { display: flex; flex-wrap: wrap; gap: 8px }
.shortcut-native-actions .button { text-align: center; text-decoration: none }
.shortcut-fields { display: grid; gap: 8px }
.shortcut-fields label { font-size: .875rem; font-weight: 560 }
.shortcut-fields label:not(:first-child) { margin-top: 4px }
.shortcut-fields select, .shortcut-fields input { width: 100%; min-height: 44px; min-width: 0; padding: 8px 12px; color: var(--text); background: #111216; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem }
.shortcut-fields .button { justify-self: start; margin-top: 4px }
.shortcut-guide { margin-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; line-height: 1.5 }
.shortcut-guide summary { cursor: pointer; min-height: 44px; padding: 12px 0; color: var(--text); font-weight: 560 }
.shortcut-guide p { margin: 0 }
.viewfinder { position: relative; background: #08090b; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; margin-bottom: 12px }
.viewfinder video { display: block; width: 100%; height: 100%; object-fit: cover }
.viewfinder-frame { width: 78%; height: 54%; position: absolute; inset: 0; margin: auto; border: 2px solid #ffffffbb; border-radius: 14px; box-shadow: 0 0 0 200px #0003; pointer-events: none }
.zoom-panel { margin-bottom: 12px; padding: 16px }
.zoom-panel .code-image svg { max-height: 340px }
.toast { position: fixed; z-index: 2; bottom: max(20px, env(safe-area-inset-bottom)); inset-inline: 16px; width: max-content; max-width: calc(100% - 32px); margin-inline: auto; color: var(--text); font-size: .875rem; line-height: 1.35; background: #30323c; border: 1px solid #464955; border-radius: 12px; box-shadow: 0 8px 28px #0006; padding: 10px 14px; pointer-events: none; overflow-wrap: anywhere }
.toast:empty, .toast[hidden] { display: none }
.sheet .toast { position: sticky; bottom: 8px; margin-bottom: 8px }
.noscript { position: fixed; bottom: 16px; left: 16px; right: 16px; padding: 16px; background: #252631; color: var(--text); border-radius: 12px; text-align: center }
@media (max-width: 560px) {
  .wallet { padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 32px }
  .collection { margin-top: 24px }
  .empty { border-radius: 22px; padding: 20px 16px 28px }
  .empty-art { height: clamp(144px, 50vw, 184px); margin-bottom: 8px }
  .sheet { width: 100%; max-width: none; max-height: calc(100dvh - max(12px, env(safe-area-inset-top))); margin: auto 0 0; border-radius: 24px 24px 0 0; border-inline: 0; border-bottom: 0 }
  .sheet-inner { padding: 16px 16px max(20px, env(safe-area-inset-bottom)) }
  .card--stack { height: 164px }
  .card--stack .card-top, .card--stack .card-bottom { inset-inline: 14px }
  .stack > * + * { margin-top: -96px }
}
@media (max-width: 330px) {
  .wallet { padding-inline: 12px }
  .quick-actions .button, .detail-actions .button { padding-inline: 6px; font-size: .875rem }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important }
}
