:root {
  color-scheme: light;
  --ink: #10131a;
  --muted: #626b79;
  --muted-light: #87909d;
  --paper: #ffffff;
  --soft: #f4f7fb;
  --line: #dce3ed;
  --line-strong: #bdc9d9;
  --blue: #0b57d0;
  --blue-dark: #0845a5;
  --blue-soft: #edf4ff;
  --yellow: #ffd400;
  --yellow-dark: #e0b900;
  --yellow-soft: #fff9dc;
  --red: #b3261e;
  --red-soft: #fff1f0;
  --green: #147d43;
  --green-soft: #eaf7ef;
  --shadow: 0 24px 70px rgba(17, 35, 72, 0.13);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, rgba(255, 212, 0, 0.15), transparent 31rem),
    radial-gradient(circle at 94% 15%, rgba(11, 87, 208, 0.11), transparent 30rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
label,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(11, 87, 208, 0.35);
  outline-offset: 2px;
}

a {
  color: var(--blue);
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.boot-card {
  display: grid;
  width: min(430px, 100%);
  justify-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.boot-card strong {
  margin-top: 12px;
  letter-spacing: 0.06em;
}

.boot-card p {
  margin: 18px 0 8px;
  color: var(--muted);
}

.boot-card small {
  color: var(--muted-light);
  line-height: 1.5;
}

.noscript-message {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  text-align: center;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  height: 70px;
  align-items: center;
  padding: 0 max(22px, calc(50vw - 590px));
  border-bottom: 1px solid rgba(220, 227, 237, 0.9);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px rgba(11, 87, 208, 0.03);
  backdrop-filter: blur(20px);
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-build {
  padding: 2px 6px;
  border: 1px solid rgba(11, 87, 208, 0.18);
  border-radius: 999px;
  background: rgba(11, 87, 208, 0.06);
  color: var(--blue);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid var(--blue);
  border-radius: 11px;
  background: var(--blue);
  color: var(--yellow);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.35), 0 7px 18px rgba(11, 87, 208, 0.2);
  font-weight: 800;
}

.desktop-nav {
  display: flex;
  align-self: stretch;
  gap: 32px;
  margin-left: 58px;
}

.nav-button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.nav-button:hover,
.nav-button.active {
  color: var(--ink);
}

.nav-button.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
  content: "";
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.connection-pill > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow-dark);
  box-shadow: 0 0 0 4px rgba(255, 212, 0, 0.18);
}

.connection-pill.online > span {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(20, 125, 67, 0.13);
}

.connection-pill.warning > span {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.12);
}

.page {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scan-home {
  padding: 72px 0 82px;
  text-align: center;
}

.scan-home > h1,
.collection-heading h1,
.account-intro h1,
.section-heading h1 {
  margin: 16px auto 18px;
  color: var(--ink);
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 690;
  letter-spacing: -0.06em;
  line-height: 0.99;
}

.scan-home h1 em {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.hero-copy {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.scanner-panel {
  width: min(700px, 100%);
  margin: 42px auto 0;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 27px;
  background: #fff;
  box-shadow: var(--shadow);
}

.scanner-visual {
  position: relative;
  display: grid;
  height: 310px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d9e3f3;
  border-radius: 18px;
  background:
    linear-gradient(rgba(11, 87, 208, 0.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(11, 87, 208, 0.07) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(circle, rgba(255, 212, 0, 0.2), transparent 48%),
    #f5f9ff;
}

.scanner-card-outline {
  display: grid;
  width: 154px;
  height: 216px;
  place-items: center;
  border: 2px solid rgba(11, 87, 208, 0.35);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(11, 87, 208, 0.08), rgba(255, 212, 0, 0.1));
  box-shadow: 0 22px 45px rgba(17, 35, 72, 0.15);
  transform: rotate(-2deg);
}

.scanner-card-outline::before {
  position: absolute;
  width: 118px;
  height: 180px;
  border: 1px solid rgba(11, 87, 208, 0.16);
  border-radius: 7px;
  content: "";
}

.scanner-card-outline span {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 1px solid rgba(11, 87, 208, 0.28);
  border-radius: 50%;
  color: var(--blue);
  font-size: 26px;
}

.scanner-line,
.processing-line,
.camera-scan-line {
  position: absolute;
  z-index: 3;
  right: 13%;
  left: 13%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--yellow-dark), transparent);
  box-shadow: 0 0 13px rgba(244, 180, 0, 0.55);
  animation: scan 3s ease-in-out infinite;
}

@keyframes scan {
  0%,
  100% { top: 22%; opacity: 0.35; }
  50% { top: 78%; opacity: 1; }
}

.scanner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 14px;
}

.scanner-actions .quiet {
  grid-column: 1 / -1;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 19px;
  border-radius: 13px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.button.primary {
  border: 1px solid var(--yellow-dark);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(244, 180, 0, 0.2);
}

.button.primary:hover:not(:disabled) {
  background: #ffe24b;
}

.button.secondary {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.button.secondary:hover:not(:disabled) {
  border-color: rgba(11, 87, 208, 0.5);
  background: var(--blue-soft);
}

.button.quiet {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--blue);
}

.button.wide {
  width: 100%;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.privacy-note {
  margin: 12px 0 2px;
  color: var(--muted-light);
  font-size: 11px;
}

.feature-grid {
  display: grid;
  width: min(900px, 100%);
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 60px auto 0;
  text-align: left;
}

.feature-grid article {
  padding: 20px;
  border-top: 1px solid var(--line);
}

.feature-grid article > span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.feature-grid h2 {
  margin: 12px 0 7px;
  font-size: 16px;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.system-banner,
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

.system-banner {
  margin-bottom: 28px;
}

.system-banner span {
  flex: 1;
}

.system-banner.warning,
.alert.warning {
  border-color: rgba(224, 185, 0, 0.4);
  background: var(--yellow-soft);
  color: #5f4d00;
}

.alert.error {
  margin-top: 12px;
  border-color: rgba(179, 38, 30, 0.27);
  background: var(--red-soft);
  color: var(--red);
}

.camera-stage {
  position: relative;
  min-height: calc(100dvh - 70px);
  overflow: hidden;
  background: #020306;
}

.camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 20%, rgba(0, 0, 0, 0.72) 75%);
}

.camera-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(58vw, 390px);
  aspect-ratio: 63 / 88;
  transform: translate(-50%, -52%);
}

.guide-corner {
  position: absolute;
  width: 52px;
  height: 52px;
  border-color: var(--yellow);
  border-style: solid;
}

.guide-corner.top-left { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 10px 0 0; }
.guide-corner.top-right { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 10px 0 0; }
.guide-corner.bottom-left { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 10px; }
.guide-corner.bottom-right { right: 0; bottom: 0; border-width: 0 3px 3px 0; border-radius: 0 0 10px; }

.camera-scan-line {
  right: 0;
  left: 0;
}

.camera-top,
.camera-bottom {
  position: absolute;
  z-index: 5;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
}

.camera-top {
  top: 0;
  justify-content: space-between;
  padding: 24px max(22px, calc(50vw - 590px));
  color: #fff;
}

.camera-top strong {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  font-size: 12px;
  backdrop-filter: blur(8px);
}

.glass-button {
  height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(9px);
}

.camera-bottom {
  bottom: 24px;
  flex-direction: column;
  gap: 11px;
}

.camera-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
}

.shutter {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.shutter span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  transition: transform 120ms ease;
}

.shutter:active span {
  transform: scale(0.88);
}

.processing-view {
  display: grid;
  min-height: calc(100vh - 70px);
  grid-template-columns: 270px 1fr;
  align-items: center;
  gap: 64px;
  padding: 58px 0;
}

.processing-preview {
  position: relative;
  aspect-ratio: 63 / 88;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--soft);
  box-shadow: var(--shadow);
}

.processing-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.76;
}

.processing-placeholder {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--blue);
  font-size: 40px;
}

.processing-line {
  right: 0;
  left: 0;
}

.processing-copy h1 {
  margin: 12px 0 10px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.045em;
}

.processing-copy p {
  max-width: 540px;
  margin: 0 0 25px;
  color: var(--muted);
  line-height: 1.6;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e9f2;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #4f8fea);
  transition: width 180ms ease;
}

#progress-value {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 12px;
}

.confirm-view,
.result-view,
.collection-view {
  padding: 44px 0 64px;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 30px;
}

.section-heading h1 {
  margin: 12px 0 12px;
  font-size: clamp(38px, 5vw, 58px);
}

.section-heading p,
.collection-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.recognition-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
}

.recognition-badge strong {
  font-size: 10px;
}

.recognition-badge span {
  color: var(--muted);
  text-transform: capitalize;
}

.recognition-badge.cardsight {
  border-color: rgba(11, 87, 208, 0.25);
  background: var(--blue-soft);
  color: var(--blue);
}

.back-button,
.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.back-button {
  display: block;
  margin-bottom: 22px;
}

.confirm-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 24px;
  align-items: start;
}

.capture-panel,
.match-panel,
.info-card,
.account-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 16px 50px rgba(17, 35, 72, 0.08);
}

.capture-panel {
  padding: 15px;
}

.capture-panel > img,
.card-image-placeholder.large {
  display: grid;
  width: 100%;
  aspect-ratio: 63 / 88;
  place-items: center;
  border-radius: 13px;
  background: var(--soft);
  object-fit: cover;
}

.crop-message {
  margin: 12px 2px 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.capture-panel details {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.capture-panel summary {
  cursor: pointer;
}

.capture-panel pre {
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border-radius: 9px;
  background: var(--soft);
  white-space: pre-wrap;
  font-size: 10px;
}

.match-panel {
  padding: 20px;
}

.manual-form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 100px 100px auto;
  gap: 10px;
  align-items: end;
}

.manual-form label,
.stack-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.manual-form input,
.stack-form input,
.collection-tools input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.candidate-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.candidate {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.candidate:hover {
  border-color: rgba(11, 87, 208, 0.42);
  background: var(--blue-soft);
}

.candidate-image,
.collection-image,
.card-image-placeholder {
  width: 62px;
  aspect-ratio: 63 / 88;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  object-fit: cover;
}

.card-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--blue);
}

.candidate-details {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.candidate-details strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-details small {
  color: var(--muted);
}

.candidate-details em {
  width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.candidate-arrow {
  color: var(--blue);
  font-size: 26px;
}

.empty-state {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.empty-state p {
  margin: 7px 0 0;
}

.result-view > .back-button {
  margin-bottom: 18px;
}

.result-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  align-items: center;
  gap: 30px;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 27px;
  background:
    radial-gradient(circle at 9% 22%, rgba(255, 212, 0, 0.22), transparent 20rem),
    radial-gradient(circle at 92% 10%, rgba(11, 87, 208, 0.12), transparent 19rem),
    #fff;
  box-shadow: var(--shadow);
}

.selected-card {
  position: relative;
}

.result-image {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 24px 45px rgba(17, 35, 72, 0.2);
}

.selected-card > span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.card-identity h1 {
  margin: 8px 0 8px;
  font-size: clamp(34px, 4.5vw, 58px);
  letter-spacing: -0.055em;
  line-height: 1;
}

.card-identity p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 17px 0;
}

.tag-row span,
.collection-info div span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.value-card {
  min-height: 280px;
  padding: 22px;
  border: 1px solid rgba(11, 87, 208, 0.24);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--yellow-soft), var(--blue-soft));
}

.value-ready {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.value-label {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.value-ready > strong {
  margin: 9px 0;
  font-size: 43px;
  letter-spacing: -0.05em;
}

.risk {
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  text-transform: capitalize;
}

.risk.low { background: var(--green-soft); color: var(--green); }
.risk.medium { background: var(--yellow-soft); color: #6c5800; }
.risk.high { background: var(--red-soft); color: var(--red); }

.value-range,
.confidence {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
}

.value-range b {
  margin-left: auto;
  color: var(--ink);
}

.confidence i {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(11, 87, 208, 0.13);
}

.confidence i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.confidence > strong {
  color: var(--ink);
}

.filtered-note {
  margin: 15px 0 0;
  color: var(--red);
  font-size: 10px;
}

.value-pending {
  display: grid;
  height: 235px;
  align-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.value-pending > span {
  color: var(--blue);
  font-size: 30px;
}

.value-pending p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(11, 87, 208, 0.18);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.result-details {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.info-card {
  padding: 23px;
}

.card-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.info-card > span,
.card-title-row span {
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-card h2 {
  margin: 5px 0 10px;
  font-size: 18px;
}

.info-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.signal-grid > div {
  display: grid;
  gap: 6px;
  padding: 17px 12px 0;
  border-left: 1px solid var(--line);
}

.signal-grid > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.signal-grid span {
  color: var(--muted);
  font-size: 9px;
}

.signal-grid strong {
  font-size: 16px;
}

.method-summary ul {
  margin: 18px 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.result-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  margin-top: 22px;
}

.result-action > div {
  display: grid;
  text-align: right;
}

.result-action span {
  color: var(--muted);
  font-size: 9px;
}

.collection-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 30px;
}

.collection-heading > div {
  max-width: 760px;
}

.collection-heading h1,
.account-intro h1 {
  margin: 12px 0 13px;
  font-size: clamp(38px, 5vw, 58px);
}

.portfolio {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(11, 87, 208, 0.22);
  border-radius: 22px;
  background: linear-gradient(130deg, var(--yellow-soft), var(--blue-soft));
}

.portfolio > div {
  display: flex;
  min-height: 135px;
  flex-direction: column;
  justify-content: center;
  padding: 25px 28px;
  border-left: 1px solid var(--line);
}

.portfolio > div:first-child {
  border-left: 0;
}

.portfolio span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.portfolio strong {
  margin: 8px 0 4px;
  font-size: 25px;
  letter-spacing: -0.03em;
}

.portfolio-main strong {
  font-size: 40px;
}

.portfolio small {
  color: var(--muted-light);
}

.collection-tools {
  display: flex;
  gap: 10px;
  margin: 22px 0 12px;
}

.collection-tools label {
  flex: 1;
}

.collection-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.collection-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
}

.collection-row + .collection-row {
  border-top: 1px solid var(--line);
}

.collection-image {
  width: 58px;
}

.collection-info h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.collection-info p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
}

.collection-info div {
  display: flex;
  gap: 5px;
}

.collection-value {
  display: grid;
  min-width: 120px;
  justify-items: end;
  gap: 3px;
}

.collection-value span,
.collection-value small {
  color: var(--muted);
  font-size: 9px;
}

.collection-value strong {
  font-size: 18px;
}

.delete-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-light);
  cursor: pointer;
  font-size: 22px;
}

.delete-button:hover {
  border-color: rgba(179, 38, 30, 0.25);
  background: var(--red-soft);
  color: var(--red);
}

.account-view {
  display: grid;
  min-height: calc(100vh - 70px);
  grid-template-columns: 1.05fr 0.75fr;
  align-items: center;
  gap: 86px;
  padding: 52px 0;
}

.account-intro p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.65;
}

.security-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.security-list div {
  display: grid;
  gap: 3px;
  padding-left: 15px;
  border-left: 3px solid var(--blue);
}

.security-list b {
  font-size: 13px;
}

.security-list span {
  color: var(--muted);
  font-size: 10px;
}

.account-card {
  padding: 26px;
  text-align: center;
}

.account-card > h2 {
  margin: 18px 0 5px;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.account-card > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 11px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 11px;
  background: #edf2fa;
}

.auth-switch button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.auth-switch button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 13px rgba(17, 35, 72, 0.12);
}

.stack-form {
  display: grid;
  gap: 13px;
  margin-top: 18px;
  text-align: left;
}

.stack-form .remember-login {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 1px;
  color: var(--ink);
  cursor: pointer;
}

.stack-form .remember-login input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--blue);
}

.remember-login span,
.remember-login strong,
.remember-login small {
  display: block;
}

.remember-login strong {
  font-size: 11px;
}

.remember-login small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.45;
}

.profile-avatar {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  margin: 2px auto 16px;
  border-radius: 24px;
  background: var(--blue);
  color: var(--yellow);
  font-size: 29px;
  font-weight: 800;
}

.profile-status {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 22px 0 16px;
  padding: 13px;
  border-radius: 11px;
  background: var(--blue-soft);
  text-align: left;
}

.profile-status > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(11, 87, 208, 0.1);
}

.profile-status strong,
.profile-status small {
  display: block;
}

.profile-status strong {
  font-size: 11px;
}

.profile-status small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.password-change {
  margin: 15px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  text-align: left;
}

.password-change summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.import-status {
  display: grid;
  gap: 7px;
  margin: 15px 0;
  text-align: left;
}

.import-status h3 {
  margin: 0 0 3px;
  font-size: 13px;
}

.import-status > div {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 10px;
}

.import-status small {
  color: var(--muted);
}

.recognition-settings {
  margin: 15px 0;
  padding: 15px;
  border: 1px solid rgba(11, 87, 208, 0.2);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--blue-soft), #fff 68%);
  text-align: left;
}

.recognition-settings-heading,
.recognition-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recognition-settings-heading span {
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recognition-settings h3 {
  margin: 3px 0 0;
  font-size: 16px;
}

.recognition-settings > p {
  margin: 11px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.recognition-settings > small {
  display: block;
  margin-top: 11px;
  color: var(--muted-light);
  font-size: 8px;
  line-height: 1.5;
}

.recognition-state {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 8px;
  text-transform: uppercase;
}

.recognition-state.active {
  background: var(--green-soft);
  color: var(--green);
}

.recognition-state.inactive {
  background: var(--soft);
  color: var(--muted);
}

.recognition-usage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.recognition-usage > div {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.recognition-usage span {
  color: var(--muted);
  font-size: 8px;
}

.recognition-usage strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recognition-links {
  margin-top: 12px;
  font-size: 10px;
}

.recognition-links a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.toast {
  position: fixed;
  z-index: 90;
  bottom: 26px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 16px 50px rgba(17, 35, 72, 0.3);
  font-size: 12px;
  transform: translateX(-50%);
  animation: toast-in 220ms ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: rgba(3, 7, 14, 0.72);
  backdrop-filter: blur(9px);
}

.method-dialog {
  position: relative;
  width: min(550px, 100%);
  padding: 29px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 35px 100px rgba(17, 35, 72, 0.35);
}

.method-dialog > h1 {
  margin: 9px 0 10px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.method-dialog > p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.method-dialog ol {
  display: grid;
  gap: 16px;
  margin: 23px 0;
  padding: 0;
  list-style: none;
}

.method-dialog li {
  display: flex;
  gap: 12px;
}

.method-dialog li > span {
  display: grid;
  width: 27px;
  height: 27px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.method-dialog li p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.mobile-nav {
  display: none;
}

.app-footer {
  padding: 18px;
  color: var(--muted-light);
  font-size: 9px;
  text-align: center;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  white-space: nowrap !important;
}

@media (max-width: 960px) {
  .result-hero {
    grid-template-columns: 180px 1fr;
  }

  .value-card {
    grid-column: 1 / -1;
  }

  .manual-form {
    grid-template-columns: 1fr 90px 90px;
  }

  .manual-form .button {
    grid-column: 1 / -1;
  }

  .account-view {
    gap: 44px;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 68px;
  }

  .topbar {
    height: 60px;
    padding: 0 16px;
  }

  .desktop-nav,
  .connection-pill {
    display: none;
  }

  .brand-button {
    font-size: 16px;
  }

  .brand-build {
    font-size: 7px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .page {
    width: calc(100% - 28px);
  }

  .mobile-nav {
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: 68px;
    grid-template-columns: repeat(3, 1fr);
    padding: 5px 10px max(5px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
  }

  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted-light);
  }

  .mobile-nav button.active {
    color: var(--blue);
  }

  .mobile-nav button > span {
    font-size: 20px;
  }

  .mobile-nav small {
    font-size: 9px;
    font-weight: 750;
  }

  .scan-home {
    padding: 42px 0 52px;
  }

  .scan-home > h1 {
    margin-top: 13px;
    font-size: clamp(39px, 12vw, 56px);
  }

  .hero-copy {
    font-size: 14px;
  }

  .scanner-panel {
    margin-top: 30px;
    padding: 10px;
    border-radius: 21px;
  }

  .scanner-visual {
    height: 265px;
    border-radius: 14px;
  }

  .scanner-actions,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    gap: 0;
    margin-top: 42px;
  }

  .system-banner {
    display: grid;
  }

  .camera-stage {
    min-height: calc(100dvh - 128px);
  }

  .camera-guide {
    width: min(73vw, 320px);
  }

  .camera-top {
    padding: 15px;
  }

  .camera-top strong {
    position: absolute;
    top: 66px;
    left: 50%;
    white-space: nowrap;
    transform: translateX(-50%);
  }

  .processing-view {
    min-height: calc(100vh - 128px);
    grid-template-columns: 135px 1fr;
    gap: 24px;
    padding: 34px 0;
  }

  .processing-copy h1 {
    font-size: 25px;
  }

  .processing-copy p {
    font-size: 11px;
  }

  .confirm-view,
  .result-view,
  .collection-view {
    padding: 28px 0 40px;
  }

  .confirm-grid,
  .result-details,
  .account-view {
    grid-template-columns: 1fr;
  }

  .capture-panel {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: 12px;
  }

  .capture-panel details {
    grid-column: 1 / -1;
  }

  .manual-form {
    grid-template-columns: 1fr 78px 78px;
  }

  .manual-form label:first-child,
  .manual-form .button {
    grid-column: 1 / -1;
  }

  .result-hero {
    grid-template-columns: 118px 1fr;
    gap: 18px;
    padding: 17px;
    border-radius: 20px;
  }

  .card-identity h1 {
    font-size: 31px;
  }

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

  .signal-grid > div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .result-action {
    position: sticky;
    z-index: 20;
    bottom: 76px;
    margin: 20px -5px 0;
    padding: 9px;
    border: 1px solid var(--line-strong);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(14px);
  }

  .collection-heading {
    display: block;
  }

  .collection-heading .button {
    width: 100%;
    margin-top: 21px;
  }

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

  .portfolio-main {
    grid-column: 1 / -1;
  }

  .portfolio > div {
    min-height: 105px;
    padding: 18px;
    border-top: 1px solid var(--line);
  }

  .portfolio > div:first-child {
    min-height: 125px;
    border-top: 0;
  }

  .portfolio > div:nth-child(2) {
    border-left: 0;
  }

  .collection-tools {
    flex-wrap: wrap;
  }

  .collection-tools label,
  .collection-tools .button {
    width: 100%;
    flex-basis: 100%;
  }

  .collection-row {
    grid-template-columns: 48px 1fr auto;
    gap: 11px;
    padding: 12px;
  }

  .collection-image {
    width: 48px;
  }

  .collection-value {
    min-width: 90px;
  }

  .delete-button {
    grid-column: 3;
    justify-self: end;
  }

  .account-view {
    min-height: auto;
    gap: 32px;
    padding: 38px 0;
  }

  .modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .method-dialog {
    max-height: calc(100dvh - 20px);
    overflow: auto;
    padding: 23px;
    border-radius: 20px;
  }

  .toast {
    bottom: 80px;
    width: calc(100% - 30px);
    text-align: center;
  }

  .app-footer {
    display: none;
  }
}

@media (max-width: 400px) {
  .processing-view {
    display: block;
    text-align: center;
  }

  .processing-preview {
    width: 115px;
    margin: 0 auto 24px;
  }

  .result-hero {
    grid-template-columns: 100px 1fr;
  }

  .collection-row {
    grid-template-columns: 44px 1fr;
  }

  .collection-value {
    grid-column: 2;
    justify-items: start;
  }

  .delete-button {
    grid-area: 1 / 2;
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
