/* ScanComps · "Black Lime". True black for OLED and dim halls, lime as the
   only light: the one primary action per screen and the live price. Holo
   foil appears only at success moments. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #111311;
  --raised: #1b1e1a;
  --line: #262a24;
  --text: #f2f5ee;
  --muted: #9ba396;
  --faint: #7f877a;
  --accent: #b4f07b;
  --on-accent: #0b1a05;
  --accent-soft: #16240e;
  --accent-strong: #c9f79f;
  --positive: #5be38f;
  --negative: #ff6b6b;
  --negative-soft: #2e1414;
  --warning-soft: #2b2410;
  --warning: #f5c84b;
  --bar: rgb(10 11 10 / 0.86);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.6), 0 12px 32px rgb(0 0 0 / 0.6);
  --glow: 0 10px 30px rgb(180 240 123 / 0.22);
  --foil: conic-gradient(
    from 210deg,
    #7ee3ff,
    #b69cff,
    #ffd27a,
    #8ff0c4,
    #7ee3ff
  );
  --hero:
    radial-gradient(120% 90% at 50% 0%, #24451a 0%, rgb(36 69 26 / 0) 60%),
    linear-gradient(180deg, #0c1709 0%, #000 100%);
  --nm: #5be38f;
  --lp: #4cc9f0;
  --mp: #f5b54a;
  --hp: #ff8a4c;
  --dmg: #ff6b6b;
  --display: "Archivo", -apple-system, BlinkMacSystemFont, sans-serif;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    sans-serif;
  font-synthesis: none;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
a,
label,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button,
.photo-action,
.home-actions label {
  transition:
    transform 0.12s ease,
    opacity 0.12s ease,
    background-color 0.15s ease;
}
button {
  border: 0;
  cursor: pointer;
  background: var(--raised);
  color: var(--text);
  border-radius: var(--r);
  min-height: 50px;
  padding: 12px 16px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
button:active,
.photo-action:active,
.home-actions label:active,
.option:active {
  transform: scale(0.97);
  opacity: 0.8;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}
a {
  color: var(--accent);
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Shell */
.shell {
  max-width: 480px;
  margin: auto;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
  position: relative;
}
main {
  display: flex;
  flex: 1;
  min-height: 0;
}
.screen {
  padding: 6px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-width: 0;
  min-height: 0;
  animation: appear 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.screen > * {
  flex-shrink: 0;
}
.screen .flex-space {
  flex: 1;
  min-height: 0;
}
.screen h1:focus {
  outline: none;
}

/* Brand (login, home, public page) */
.app-header {
  padding: 10px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  flex: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.brand img {
  border-radius: 7px;
}

/* iOS navigation: back + trailing action row, then a large or inline title */
.nav-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 44px;
  margin: 0 -8px;
}
.nav-bar > :last-child {
  justify-self: end;
}
.nav-bar h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}
.back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--accent);
  background: transparent;
  font-size: 17px;
  font-weight: 400;
  min-height: 44px;
  padding: 0 8px 0 2px;
  white-space: nowrap;
}
.back svg,
.chevron svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.large-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.1;
  text-wrap: balance;
}
.screen-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
  margin-top: -6px;
}

/* Type */
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.4px;
}
h1 {
  font-size: 28px;
  font-weight: 700;
}
h2 {
  font-size: 20px;
  font-weight: 650;
}
h3 {
  font-size: 17px;
  font-weight: 600;
}
p {
  line-height: 1.4;
}
.muted,
.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.hint {
  text-wrap: pretty;
}
.accent {
  color: var(--accent);
}
.danger {
  color: var(--negative);
}
.money,
.amount {
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.primary,
.photo-action {
  background: var(--accent);
  color: var(--on-accent);
}
.secondary {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.quiet {
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}
.text-button {
  background: transparent;
  padding: 0 8px;
  min-height: 44px;
  color: var(--accent);
  font-weight: 400;
}
.danger.quiet {
  color: var(--negative);
}

/* Layout helpers */
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Inset grouped surfaces */
.group {
  background: var(--surface);
  border-radius: var(--r);
  padding: 14px 16px;
}
.group h2 {
  font-size: 17px;
  font-weight: 600;
}
.group .row + .row {
  border-top: 0.5px solid var(--line);
  padding-top: 11px;
  margin-top: 11px;
}
.section-label,
legend {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  padding: 0 4px;
  margin-bottom: 6px;
}

/* Forms */
label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
input,
select {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  padding: 11px 14px;
  font-size: 17px;
}
input::placeholder {
  color: var(--faint);
}
select {
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) 52%,
    calc(100% - 14px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input[type="number"] {
  appearance: textfield;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  padding: 0 4px;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* Segmented control (iOS) */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--raised);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}
.segmented button,
.segmented label {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  text-align: center;
}
.segmented button[aria-pressed="true"],
.segmented label:has(:checked) {
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.14);
}
/* The real radio covers its whole row, so any tap lands on it. */
.segmented input,
.option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

/* Printing chips */
.option {
  display: flex;
  align-items: center;
  position: relative;
  color: var(--text);
  cursor: pointer;
}
.option:focus-within {
  outline: none;
}
.option:has(:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips .option {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
}
.chips .option:has(:checked) {
  background: var(--accent);
  color: var(--on-accent);
}

/* Home: camera-first */
.home-screen {
  gap: 12px;
}
.home-screen .large-title {
  margin-top: 4px;
}
.viewfinder {
  flex: 1 !important;
  min-height: 120px;
  max-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(
      ellipse 70% 60% at 50% 45%,
      color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%,
      var(--surface) 70%
    );
  border-radius: var(--r-lg);
  overflow: hidden;
}
.scan-outline {
  height: 74%;
  max-height: 340px;
  aspect-ratio: 63/88;
  position: relative;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.scan-outline:before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--raised), transparent);
}
.scan-outline:after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 3px solid var(--accent);
  border-radius: 22px;
  -webkit-mask:
    linear-gradient(#000 0 0) top left / 26px 26px,
    linear-gradient(#000 0 0) top right / 26px 26px,
    linear-gradient(#000 0 0) bottom left / 26px 26px,
    linear-gradient(#000 0 0) bottom right / 26px 26px;
  mask:
    linear-gradient(#000 0 0) top left / 26px 26px,
    linear-gradient(#000 0 0) top right / 26px 26px,
    linear-gradient(#000 0 0) bottom left / 26px 26px,
    linear-gradient(#000 0 0) bottom right / 26px 26px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.capture-note {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  text-wrap: balance;
}
/* Shutter row: one big, distinct capture control flanked by two quiet ones */
.home-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  padding: 2px 0 4px;
}
.home-actions label,
.home-actions .side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 76px;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.home-actions .side i {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}
.home-actions svg,
.photo-action svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shutter {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  padding: 4px !important;
  display: block !important;
  cursor: pointer;
}
.shutter span:not(.sr-only) {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 -3px 8px rgb(0 0 0 / 0.18);
}
.photo-action {
  min-height: 54px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

/* Loading: show the real work as it completes */
.loading-art {
  flex: 1 !important;
  min-height: 100px;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-frame {
  position: relative;
  height: 100%;
  max-height: min(32vh, 250px);
  aspect-ratio: 63/88;
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.loading-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.loading-frame:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 30%;
  top: 35%;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--accent) 45%, transparent) 50%,
    transparent
  );
  animation: scan 1.8s ease-in-out infinite;
}
.loading-title {
  text-align: center;
}
.loading-title h1 {
  font-size: 26px;
  margin-bottom: 6px;
}
.checklist {
  list-style: none;
  margin: 0;
  padding: 6px 16px;
  background: var(--surface);
  border-radius: var(--r);
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  font-size: 15px;
  color: var(--faint);
}
.checklist li:before {
  content: "";
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  box-sizing: border-box;
}
.checklist li.active {
  color: var(--text);
  font-weight: 500;
}
.checklist li.active:before {
  border: 2px solid var(--accent);
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
.checklist li.done {
  color: var(--muted);
}
.checklist li.done:before {
  border: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.5L14 7.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 20px no-repeat,
    var(--positive);
}

/* Matches */
.candidate-art {
  flex: 1 !important;
  min-height: 80px;
  max-height: 260px;
  width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgb(13 17 23 / 0.22));
}
.candidate-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.candidate-info h2 {
  font-size: 24px;
  font-weight: 700;
}
.candidate-info p {
  color: var(--muted);
  font-size: 15px;
}
.candidate-info strong {
  color: var(--text);
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.pager button {
  background: var(--surface);
  width: 44px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}
.match-reference .money {
  font-size: 22px;
  font-weight: 700;
}

/* Result */
.card-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}
.card-summary img {
  height: 84px;
  width: 60px;
  object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 4px 8px rgb(13 17 23 / 0.2));
}
.card-summary h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.card-summary p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}
.progress {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
}
.progress li {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.progress li:before {
  content: "";
  height: 4px;
  border-radius: 2px;
  background: var(--raised);
}
.progress li.done {
  color: var(--muted);
}
.progress li.done:before {
  background: var(--positive);
}
.progress li.current {
  color: var(--text);
}
.progress li.current:before {
  background: var(--accent);
}
.price-panel {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.price-panel .row {
  align-items: center;
}
.price-caption {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.amount {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -1.6px;
  line-height: 1.1;
}
.selection-button,
.asking-field {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  background: var(--surface);
  border-radius: var(--r);
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px 8px 16px;
  font-size: 16px;
  font-weight: 500;
}
.selection-button .chevron {
  color: var(--faint);
  display: flex;
}
.selection-button .need {
  color: var(--accent);
}
.asking-field label {
  font-size: 16px;
  color: var(--text);
  font-weight: 500;
}
.asking-field input {
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  padding: 4px 12px;
  min-height: 42px;
  width: 150px;
  text-align: right;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.asking-field .currency {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

/* Retake */
.retake-photo {
  width: 100%;
  height: clamp(80px, 22dvh, 190px);
  object-fit: contain;
  min-height: 0;
  border-radius: var(--r);
}
.callout {
  background: var(--warning-soft);
  border-radius: var(--r);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.callout h2 {
  font-size: 17px;
}

/* Label ready: the peak moment */
.success-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.foil-check {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--foil);
  display: grid;
  place-items: center;
  flex: none;
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.foil-check svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #0d1117;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.success-head h1 {
  font-size: 28px;
}
.success-head p {
  color: var(--muted);
  font-size: 14px;
}
.label-preview {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.label-preview:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgb(255 255 255 / 0.7) 45%,
    transparent 60%
  );
  transform: translateX(-100%);
  animation: sheen 1.1s 0.2s ease-out forwards;
  pointer-events: none;
}
.label-preview svg {
  width: 100%;
  height: auto;
  max-height: 150px;
}
.label-info {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.label-info strong {
  color: var(--text);
  font-weight: 600;
}

/* Lists (deal, labels) */
.list {
  background: var(--surface);
  border-radius: var(--r);
  overflow: hidden;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 11px 16px;
  min-height: 62px;
}
.list-item + .list-item {
  box-shadow: inset 16px 0.5px 0 var(--surface), inset 0 0.5px 0 var(--line);
}
.list-item > div:first-child {
  flex: 1;
  min-width: 0;
}
.list-item h3 {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item p {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item .money {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
}
.list-item input {
  width: 52px;
  min-height: 36px;
  text-align: center;
  padding: 4px;
  background: var(--raised);
  font-size: 16px;
  font-weight: 600;
}
.list-item .remove {
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  font-size: 20px;
  font-weight: 400;
}
.list-item .open {
  min-height: 44px;
  padding: 0 4px 0 8px;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
}
.list-item .open svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.list-item .stack-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.deal-totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.deal-totals p {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  color: var(--muted);
}
.deal-totals p strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.deal-totals .margin strong {
  color: var(--positive);
}
.deal-totals .margin.negative strong {
  color: var(--negative);
}

/* Empty states */
.empty {
  flex: 1 !important;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}
.empty-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.empty h2 {
  font-size: 20px;
}

/* Activity */
.usage-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.usage-hero .group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.usage-hero b {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.usage-data .row {
  font-size: 15px;
}
.usage-data .row strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Toast */
.notice {
  position: absolute;
  z-index: 5;
  left: 12px;
  right: 12px;
  /* Below the nav bar: never covers Back or the bottom primary actions. */
  top: calc(52px + env(safe-area-inset-top));
  padding: 13px 48px 13px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  font-size: 15px;
  font-weight: 500;
  animation: toast 0.28s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.notice:has(#error:not(:empty)) {
  background: var(--negative-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--negative) 40%, transparent);
}
#error {
  color: inherit;
}
.notice .icon-button {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: inherit;
  opacity: 0.7;
  font-size: 22px;
  font-weight: 400;
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
}

/* Tab bar */
#tabs {
  display: flex;
  flex: none;
  justify-content: space-around;
  padding: 6px 8px calc(4px + env(safe-area-inset-bottom));
  border-top: 0.5px solid var(--line);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
#tabs button {
  background: transparent;
  color: var(--faint);
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 50px;
  padding: 2px;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.1px;
  border-radius: 10px;
  position: relative;
}
#tabs button[aria-pressed="true"] {
  color: var(--accent);
}
#tabs svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#tabs button[aria-pressed="true"] svg {
  fill: color-mix(in srgb, currentColor 18%, transparent);
  stroke-width: 2;
}
.badge {
  position: absolute;
  top: 0;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--negative);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}
.badge:empty {
  display: none;
}

/* Login */
.login-screen {
  justify-content: space-between;
  padding-bottom: 28px;
}
.intro {
  margin-top: 6vh;
}
.intro h1 {
  font-size: 44px;
  letter-spacing: -1.6px;
  line-height: 1.05;
  margin: 12px 0 14px;
}
.intro h1 em {
  font-style: normal;
  color: var(--accent);
}
.intro > p:last-child {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}
.intro .accent {
  font-weight: 600;
  font-size: 15px;
}

/* Public price page */
.public-shell .screen {
  padding-top: 14px;
}
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.compare .group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.compare .big {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
}
.compare .asking {
  background: var(--accent-soft);
}
.compare .asking .big {
  color: var(--accent-strong);
}
.public-footer {
  padding: 10px 22px calc(18px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

#print-area {
  display: none;
}
/* Opacity only: a translate would briefly push content past the fold. */
@keyframes appear {
  from {
    opacity: 0;
  }
}
@keyframes scan {
  0%,
  100% {
    transform: translateY(-120%);
  }
  50% {
    transform: translateY(120%);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes sheen {
  to {
    transform: translateX(100%);
  }
}
@keyframes toast {
  from {
    transform: translateY(-12px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-height: 720px) {
  .screen {
    gap: 10px;
    padding-bottom: 10px;
  }
  .large-title {
    font-size: 30px;
  }
  .home-screen .large-title {
    font-size: 28px;
  }
  .price-panel {
    padding: 10px 16px;
  }
  .amount {
    font-size: 38px;
  }
  .card-summary img {
    height: 64px;
    width: 46px;
  }
  .card-summary h2 {
    font-size: 20px;
  }
  .candidate-art {
    max-height: 180px;
  }
  .group {
    padding: 12px 14px;
  }
  button {
    min-height: 46px;
  }
  .selection-button,
  .asking-field {
    min-height: 48px;
  }
  .asking-field input {
    min-height: 38px;
  }
  .hint,
  .muted {
    font-size: 12px;
  }
  .checklist li {
    min-height: 32px;
  }
  .shutter {
    width: 70px;
    height: 70px;
  }
  .home-actions .side i {
    width: 46px;
    height: 46px;
  }
  .list-item {
    min-height: 56px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .option {
    min-height: 42px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .intro h1 {
    font-size: 38px;
  }
  .deal-totals .offer strong {
    font-size: 26px;
  }
}
@media (min-width: 600px) {
  .shell {
    border-left: 0.5px solid var(--line);
    border-right: 0.5px solid var(--line);
  }
}
@media (max-height: 540px) {
  .shell {
    height: auto;
    min-height: 100dvh;
  }
  .screen {
    min-height: 300px;
  }
  .viewfinder,
  .flex-space {
    display: none;
  }
  #tabs {
    position: sticky;
    bottom: 0;
  }
  .notice {
    position: fixed;
  }
  .candidate-art {
    max-height: 130px;
  }
  .loading-art {
    flex: none !important;
    height: 100px;
  }
  .loading-frame {
    height: 100px;
  }
}
@media print {
  @page {
    size: 50mm 15mm;
    margin: 0;
  }
  html,
  body {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .shell {
    display: none !important;
  }
  #print-area {
    display: block !important;
    width: 50mm;
    height: 15mm;
    padding: 0;
    margin: 0;
  }
  #print-area svg {
    display: block;
    width: 100%;
    height: 100%;
  }
}
.brand span {
  font-weight: 400;
  margin-left: -8px;
}
.center {
  text-align: center;
}
.secondary-label {
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: var(--r);
  min-height: 50px;
  padding: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.columns:has(.secondary-label) button {
  font-size: 15px;
}

/* Condition sheet: thumb-reach choices, one tap picks and closes */
.sheet {
  position: fixed;
  inset: auto 0 0;
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
  max-height: 94dvh;
  border: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 -8px 40px rgb(0 0 0 / 0.25);
  overflow: auto;
}
.sheet[open] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: sheet-up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet::backdrop {
  background: rgb(0 0 0 / 0.4);
}
.grabber {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  margin: 0 auto;
  flex: none;
}
.sheet-head h2,
.sheet > h2 {
  font-size: 22px;
  font-weight: 700;
}
.sheet .quiet {
  min-height: 44px;
}
.pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px 0 12px;
  background: var(--surface);
  border-radius: var(--r);
  text-align: left;
  font-size: 17px;
  font-weight: 600;
}
.pick .abbr {
  min-width: 46px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.pick .name {
  flex: 1;
}
.pick .money {
  font-variant-numeric: tabular-nums;
}
.pick[aria-current="true"] {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.grade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.grade-grid .pick {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 66px;
  padding: 8px;
  text-align: center;
}
.grade-grid .pick .name {
  flex: none;
  font-size: 20px;
}
.grade-grid .pick .money {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
/* Tertiary end beat under the primary actions */
.next-scan {
  min-height: 44px;
  padding: 0 12px;
  margin-top: -4px;
  background: transparent;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
}
.next-scan svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes sheet-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
@media (max-height: 720px) {
  .pick {
    min-height: 52px;
  }
  .sheet[open] {
    gap: 10px;
  }
}

/* Brand band (Copilot-style): the header sits on cobalt, the key card
   floats over its lower edge. */
.hero {
  margin: -6px -16px 0;
  padding: 0 16px 62px;
  background: var(--hero);
  color: #fff;
  border-radius: 0 0 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero .back,
.hero .text-button,
.hero .nav-bar h1 {
  color: #fff;
}
.hero .card-summary p {
  color: rgb(255 255 255 / 0.75);
}
.hero .card-summary img {
  filter: drop-shadow(0 6px 14px rgb(0 0 0 / 0.35));
}
.hero .progress li {
  color: rgb(255 255 255 / 0.6);
}
.hero .progress li:before {
  background: rgb(255 255 255 / 0.22);
}
.hero .progress li.done {
  color: rgb(255 255 255 / 0.85);
}
.hero .progress li.done:before {
  background: #fff;
}
.hero .progress li.current {
  color: #fff;
  font-weight: 600;
}
.hero .progress li.current:before {
  background: linear-gradient(90deg, #fff 0 40%, rgb(255 255 255 / 0.35) 40%);
}
.lifted {
  margin-top: -66px;
  position: relative;
  box-shadow: var(--shadow);
}
.home-hero {
  padding-top: 10px;
  padding-bottom: 64px;
}
.home-hero .brand {
  color: #fff;
}
.home-hero .beta {
  background: rgb(255 255 255 / 0.16);
  color: #fff;
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.home-hero .large-title {
  margin: 0;
}
.today {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.today span {
  background: rgb(255 255 255 / 0.14);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 13px;
  color: rgb(255 255 255 / 0.85);
}
.today b {
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.home-screen .viewfinder {
  margin-top: -58px;
  box-shadow: var(--shadow);
  position: relative;
}

/* Money: dollars carry the weight; a raised "$" and quieter cents. */
.big-money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.big-money .cur {
  font-size: 0.5em;
  vertical-align: 0.72em;
  margin-right: 0.06em;
  font-weight: 600;
}
.big-money .cents {
  font-size: 0.55em;
  opacity: 0.55;
  letter-spacing: 0;
}
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.spark {
  width: 112px;
  height: 40px;
  flex: none;
  overflow: visible;
}
.spark .line {
  fill: none;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.spark.up .line {
  stroke: var(--positive);
}
.spark.down .line {
  stroke: var(--negative);
}
.spark .area {
  opacity: 0.14;
}
.spark.up .area,
.spark.up circle {
  fill: var(--positive);
}
.spark.down .area,
.spark.down circle {
  fill: var(--negative);
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.pill {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--raised);
  color: var(--muted);
  white-space: nowrap;
}
.pill.up {
  background: color-mix(in srgb, var(--positive) 14%, transparent);
  color: var(--positive);
}
.pill.down {
  background: color-mix(in srgb, var(--negative) 14%, transparent);
  color: var(--negative);
}

/* Grouped rows: condition and price read as one inset list. */
.inset-list {
  background: var(--surface);
  border-radius: var(--r);
  overflow: hidden;
}
.inset-list > * {
  border-radius: 0;
}
.inset-list > * + * {
  box-shadow: inset 16px 0.5px 0 var(--surface), inset 0 0.5px 0 var(--line);
}
.selection-button .tier {
  margin-right: -2px;
}
.selection-button > span:not(.chevron, .tier) {
  flex: 1;
}

/* Condition tiers: same colors in the sheet, comps, deal and labels. */
.tier {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 20px;
  padding: 0 6px;
  margin-right: 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  vertical-align: 1px;
}
.tier,
.abbr {
  --t: var(--accent);
}
.tier-nm {
  --t: var(--nm);
}
.tier-lp {
  --t: var(--lp);
}
.tier-mp {
  --t: var(--mp);
}
.tier-hp {
  --t: var(--hp);
}
.tier-dmg {
  --t: var(--dmg);
}
.tier,
.pick .abbr {
  background: color-mix(in srgb, var(--t) 15%, transparent);
  color: var(--t);
}
.pick .name,
.pick .money {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pick .money {
  align-items: flex-end;
}
.pick small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.pick small .pill {
  padding: 0;
  background: none;
  font-size: 11px;
}
.pick[aria-current="true"] {
  background: var(--accent-soft);
}

/* Deal offer: the number said out loud sits on the brand color. */
.group.deal-totals {
  padding: 12px 16px;
}
.deal-totals .offer {
  background: var(--hero);
  color: rgb(255 255 255 / 0.85);
  margin: -12px -16px 2px;
  padding: 12px 16px;
  border-radius: var(--r) var(--r) 0 0;
  align-items: center;
  font-weight: 500;
}
.deal-totals .offer strong {
  color: #fff;
  font-size: 34px;
}
.trend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.trend .meta {
  margin-top: 4px;
}

/* Black Lime display type: heavy condensed Archivo for the numbers and
   headlines people read from across a table. */
.large-title,
.amount,
.success-head h1,
.loading-title h1,
.candidate-info h2,
.card-summary h2,
.deal-totals .offer strong,
.usage-hero b,
.compare .big,
.intro h1,
.empty h2,
.sheet-head h2,
.sheet > h2 {
  font-family: var(--display);
  font-stretch: 72%;
  font-weight: 850;
  letter-spacing: -0.2px;
}
.large-title,
.intro h1 {
  font-size: 44px;
  line-height: 0.95;
  color: var(--accent);
}
.home-hero .large-title {
  color: var(--accent);
}
.amount {
  font-size: 60px;
  line-height: 1;
  letter-spacing: 0;
}
.price-panel .amount,
.compare .big {
  color: var(--accent);
  text-shadow: 0 0 28px rgb(180 240 123 / 0.25);
}
.big-money .cents {
  opacity: 0.6;
}
.primary,
.photo-action {
  box-shadow: var(--glow);
}
.lifted,
.home-screen .viewfinder {
  box-shadow:
    0 0 0 1px var(--line),
    var(--shadow);
}
.home-hero .beta,
.today span {
  background: rgb(180 240 123 / 0.1);
  color: var(--accent-strong);
}
.today b {
  color: var(--accent);
}
.home-actions .side i {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.shutter {
  border-color: var(--accent);
  box-shadow: var(--glow);
}
.scan-outline {
  background: #050605;
  box-shadow: none;
}
.viewfinder {
  background:
    radial-gradient(
      ellipse 70% 60% at 50% 45%,
      #13240d 0%,
      var(--surface) 70%
    );
}
.deal-totals .offer {
  color: rgb(255 255 255 / 0.8);
}
.deal-totals .offer strong {
  color: var(--accent);
  font-size: 40px;
}
#tabs button[aria-pressed="true"] svg {
  fill: rgb(180 240 123 / 0.16);
}
.label-preview {
  box-shadow: 0 0 0 1px var(--line), var(--glow);
}
@media (max-height: 720px) {
  .large-title,
  .intro h1 {
    font-size: 38px;
  }
  .amount {
    font-size: 50px;
  }
  .deal-totals .offer strong {
    font-size: 34px;
  }
}
.hero .progress li.done:before {
  background: var(--accent);
}
.hero .progress li.current:before {
  background: linear-gradient(
    90deg,
    var(--accent) 0 40%,
    rgb(180 240 123 / 0.25) 40%
  );
}
/* Deals: Current / History switch sits in the nav bar. */
.deals-switch {
  width: 220px;
}
.deal-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border-radius: 0;
  font-weight: inherit;
  color: inherit;
  min-height: 62px;
}
.deal-row h3 {
  font-weight: 600;
}
/* Settings */
.pct {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 700;
}
.pct input {
  width: 88px;
  min-height: 44px;
  text-align: right;
  font-size: 22px;
  font-weight: 700;
  background: var(--raised);
}
.row-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.group label[for="offer-pct"] {
  font-size: 16px;
  color: var(--text);
}
/* A grade taken from the slab label, still one tap to change. */
.auto-tag {
  flex: none !important;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 999px;
}
.sheet .callout {
  font-size: 14px;
  padding: 10px 14px;
}
/* Estimated grades: visibly different from real sold data. */
.pick.est {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.pick.est .name {
  color: var(--muted);
}
/* Public QR page: the card is the hero. */
.public-shell .screen {
  gap: 12px;
}
.showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.card-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 10px 0 14px;
  background: radial-gradient(
    50% 55% at 50% 50%,
    rgb(180 240 123 / 0.22) 0%,
    rgb(180 240 123 / 0) 70%
  );
}
.holo {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  line-height: 0;
  box-shadow:
    0 18px 40px rgb(0 0 0 / 0.7),
    0 0 50px rgb(180 240 123 / 0.18);
}
.holo img {
  height: clamp(170px, 42dvh, 400px);
  width: auto;
  max-width: 82vw;
  object-fit: contain;
}
.holo:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgb(158 231 255 / 0.35) 42%,
    rgb(255 210 122 / 0.35) 50%,
    rgb(199 166 255 / 0.3) 58%,
    transparent 70%
  );
  transform: translateX(-120%);
  animation: sheen 1.6s 0.3s ease-out forwards;
  pointer-events: none;
}
.show-name {
  font-family: var(--display);
  font-stretch: 72%;
  font-weight: 850;
  font-size: 34px;
  line-height: 1;
  color: var(--text);
}
.show-meta {
  color: var(--muted);
  font-size: 14px;
}
.show-pick {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
}
.price-duo {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 10px;
}
.price-duo .tile {
  background: var(--surface);
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.price-duo .tile.ask {
  background: var(--accent-soft);
  box-shadow:
    inset 0 0 0 1px rgb(180 240 123 / 0.35),
    var(--glow);
}
.price-duo .big {
  font-family: var(--display);
  font-stretch: 72%;
  font-weight: 850;
  font-size: 34px;
  line-height: 1.05;
}
.price-duo .ask .big {
  color: var(--accent);
  font-size: 40px;
}
.tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 22px;
}
.tile-foot .spark {
  width: 64px;
  height: 22px;
}
@media (max-height: 720px) {
  .show-name {
    font-size: 28px;
  }
  .price-duo .ask .big {
    font-size: 34px;
  }
  .price-duo .big {
    font-size: 28px;
  }
}
/* Per-label QR price */
.qr-sum {
  flex: 1;
  text-align: right;
  color: var(--accent);
  font-weight: 600;
}
.qr-preview {
  text-align: center;
  color: var(--muted);
}
.qr-preview strong {
  display: block;
  font-family: var(--display);
  font-stretch: 72%;
  font-size: 36px;
  color: var(--accent);
}
.qr-badge,
.sale-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.sheet .chips {
  gap: 6px;
}
.qr-sum {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}
/* Inventory: stock stepper, label filters, rescan banner */
.stock-row > span:first-child {
  font-size: 16px;
  font-weight: 500;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.stepper button {
  width: 44px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 500;
}
.stepper .stock-count {
  min-width: 40px;
  text-align: center;
  font-family: var(--display);
  font-stretch: 72%;
  font-size: 26px;
  font-weight: 850;
  color: var(--accent);
}
.label-kinds label {
  font-size: 13px;
  gap: 4px;
}
.kind-count {
  color: var(--faint);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.owned {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.owned-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  min-height: 46px;
  padding: 8px 12px;
}
.owned-open span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.owned-tag {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 999px;
}
.owned-add {
  flex: none;
  min-height: 46px;
  padding: 0 14px;
  background: var(--accent);
  color: var(--on-accent);
}
/* Public page: comps make it a scrolling page; raw cards stay one screen. */
.public-shell {
  height: auto;
}
.comps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comps h2 {
  font-size: 18px;
}
.comps table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--r);
  overflow: hidden;
  font-size: 14px;
}
.comps th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 12px 6px;
}
.comps td {
  padding: 9px 12px;
  border-top: 0.5px solid var(--line);
  color: var(--muted);
}
.comps td.money {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.comps td a {
  color: var(--accent);
}
/* Table mode */
.scan-mode .segmented {
  max-width: 240px;
  margin: 0 auto;
}
.batch .thumb {
  width: 44px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  flex: none;
  background: var(--raised);
}
.batch .list-item.off {
  opacity: 0.55;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text);
  min-height: 44px;
}
.check input {
  width: 22px;
  min-height: 22px;
  height: 22px;
  accent-color: var(--accent);
}
ul.batch {
  list-style: none;
  margin: 0;
  padding: 0;
}
.batch .list-item > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
/* Version check: your photo beside each catalog version */
.warn {
  color: var(--warning);
}
.versions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.versions figure {
  margin: 0;
}
.versions img {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: 6px;
  background: var(--raised);
}
.versions figcaption {
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
}
.pick.version {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px;
  min-height: 0;
  font-size: 14px;
}
.pick.version small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* Screen transitions: only when the screen changes (see layout()). Sideways
   or opacity-and-scale only, so nothing is pushed past the fold. */
#stage {
  overflow-x: clip;
}
#stage.push > *,
#stage.pop > *,
#stage.fade > * {
  animation: in-right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
#stage.pop > * {
  animation-name: in-left;
}
#stage.fade > * {
  animation-name: in-fade;
  animation-duration: 0.24s;
}
#stage > :nth-child(2) { animation-delay: 25ms; }
#stage > :nth-child(3) { animation-delay: 50ms; }
#stage > :nth-child(4) { animation-delay: 75ms; }
#stage > :nth-child(5) { animation-delay: 100ms; }
#stage > :nth-child(n + 6) { animation-delay: 120ms; }
@keyframes in-right {
  from { opacity: 0; transform: translateX(22px); }
}
@keyframes in-left {
  from { opacity: 0; transform: translateX(-22px); }
}
@keyframes in-fade {
  from { opacity: 0; transform: scale(0.985); }
}
/* Rows arrive in a short cascade. */
#stage:is(.push, .pop, .fade) .list > li {
  animation: in-fade 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
#stage .list > li:nth-child(2) { animation-delay: 60ms; }
#stage .list > li:nth-child(3) { animation-delay: 90ms; }
#stage .list > li:nth-child(n + 4) { animation-delay: 120ms; }
.sheet::backdrop,
.tour::backdrop {
  animation: in-fade 0.2s ease-out;
}
.badge.bump {
  animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}

/* Little cards for the login art and the tour */
.mini {
  display: block;
  width: 64px;
  aspect-ratio: 63 / 88;
  border-radius: 7px;
  border: 3px solid #e9e4cf;
  background: var(--card-art, conic-gradient(from 210deg, #7ee3ff, #b69cff, #ffd27a, #8ff0c4, #7ee3ff));
  box-shadow: 0 8px 22px rgb(0 0 0 / 0.5);
  position: relative;
}
.mini.holo { --card-art: conic-gradient(from 210deg, #7ee3ff, #b69cff, #ffd27a, #8ff0c4, #7ee3ff); }
.mini.fire { --card-art: linear-gradient(160deg, #ffb35c, #e2552c 60%, #7a1d10); }
.mini.leaf { --card-art: linear-gradient(160deg, #c8f59a, #5aa83a 60%, #1f4a16); }
.mini.water { --card-art: linear-gradient(160deg, #9be7ff, #2a8fb8 60%, #123c5a); }
.mini.dusk { --card-art: linear-gradient(160deg, #e3b8ff, #7b4fd0 60%, #2c1a5c); }

@keyframes deal-in {
  from { opacity: 0; transform: translateY(30px) rotate(0deg); }
}
@keyframes float {
  50% { transform: translateX(var(--x)) rotate(var(--tilt)) translateY(-6px); }
}
@keyframes sweep {
  0%, 100% { transform: translateY(-50px); opacity: 0; }
  15%, 85% { opacity: 0.9; }
  50% { transform: translateY(50px); }
}

/* First-run tour */
.tour {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  background: var(--bg);
  color: var(--text);
}
.tour[open] {
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  gap: 16px;
}
.tour-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}
.tour-dots {
  display: flex;
  gap: 6px;
}
.tour-dots i {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  transition: width 0.3s, background 0.3s;
}
.tour-dots i.done { background: var(--accent-soft); }
.tour-dots i.on { width: 22px; background: var(--accent); }
.tour-art {
  flex: 1;
  min-height: 180px;
  display: grid;
  place-items: center;
  animation: in-fade 0.3s ease-out both;
}
.tour-copy {
  animation: in-right 0.32s 0.05s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.tour-copy h2 {
  font: 900 40px/0.95 var(--display);
  font-stretch: 72%;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.tour-copy h2:focus { outline: none; }
.tour-copy p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
  margin: 0;
}
.tour-copy input[type="range"] {
  width: 100%;
  margin-top: 18px;
  accent-color: var(--accent);
  min-height: 44px;
}
.tour-actions {
  display: flex;
  gap: 10px;
}
.tour-actions button { flex: 1; }
/* Tour art: each loops gently and settles on its last frame when motion is off. */
.t-phone {
  position: relative;
  width: 150px;
  height: 210px;
  border-radius: 26px;
  border: 2px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
}
.t-phone .mini { width: 90px; }
.t-drop { animation: deal-in 0.6s 0.1s cubic-bezier(0.2, 1, 0.3, 1) both; }
.t-sweep {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 50%;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
  animation: sweep 2.2s 0.6s ease-in-out infinite;
  opacity: 0;
}
.t-chip {
  position: absolute;
  bottom: -14px;
  background: var(--accent);
  color: var(--on-accent);
  font: 800 18px var(--display);
  padding: 6px 14px;
  border-radius: 999px;
  animation: pop 0.5s 1s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.t-grid {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 12px;
}
.t-grid .mini {
  animation: pop 0.4s calc(var(--i) * 0.12s) cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.t-grid b,
.t-versions i {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  display: grid;
  place-items: center;
  animation: pop 0.35s calc(0.8s + var(--i) * 0.12s) cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.t-versions {
  display: flex;
  gap: 22px;
}
.t-versions .mini { width: 96px; }
.t-versions i {
  --i: 0;
  width: auto;
  padding: 0 8px;
  font-style: normal;
  font-weight: 800;
  background: var(--raised);
  color: var(--text);
}
.t-pick {
  animation: picked 0.5s 0.7s ease-out both;
}
.t-pick i {
  background: var(--accent);
  color: var(--on-accent);
}
@keyframes picked {
  to { box-shadow: 0 0 0 4px var(--accent), 0 10px 26px rgb(180 240 123 / 0.35); transform: scale(1.06); }
}
.t-printer {
  position: relative;
  width: 230px;
  height: 190px;
}
.t-slot {
  position: absolute;
  inset: 0 0 auto;
  height: 76px;
  border-radius: 18px;
  background: var(--raised);
  border: 2px solid var(--line);
  z-index: 1;
}
.t-label {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 74px;
  height: 92px;
  border-radius: 8px;
  background: #f4f4ee;
  color: #0b0b0b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font: 900 30px var(--display);
  animation: print 1.1s 0.3s cubic-bezier(0.3, 0.8, 0.3, 1) both;
}
.t-qr {
  width: 58px;
  height: 58px;
  background:
    repeating-linear-gradient(90deg, #0b0b0b 0 6px, transparent 6px 11px),
    repeating-linear-gradient(0deg, #0b0b0b 0 6px, transparent 6px 11px);
  background-blend-mode: multiply;
}
@keyframes print {
  from { transform: translateY(-84px); }
}
.t-offer {
  text-align: center;
}
.t-offer strong {
  display: block;
  font: 900 96px/1 var(--display);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.t-offer span {
  color: var(--muted);
  font-size: 15px;
}
.t-done {
  position: relative;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
}
.t-done span {
  width: 96px;
  height: 96px;
  border-radius: 48px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 52px;
  font-weight: 900;
  display: grid;
  place-items: center;
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.t-done i {
  position: absolute;
  left: 56px;
  top: 56px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  animation: burst 0.9s calc(0.2s + var(--d)) cubic-bezier(0.1, 0.8, 0.3, 1) both;
}
.t-done i:nth-child(3n) { background: #7ee3ff; }
.t-done i:nth-child(3n + 1) { background: #ffd27a; }
@keyframes burst {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-110px) rotate(200deg); }
}

/* Sign in with Apple / Google: white buttons with each brand's mark. */
.login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  border-radius: var(--r);
  background: #fff;
  color: #000;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.sso:active {
  transform: scale(0.97);
  opacity: 0.85;
}
.sso svg {
  width: 20px;
  height: 20px;
}
.sso.apple svg {
  margin-top: -3px;
}
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.signed-in {
  text-align: center;
}
/* The iPhone app shows no beta badge (window.scancompsApp, see app.js). */
.in-app .beta {
  display: none;
}

/* Settings: Privacy group with iOS-style switches, kept compact so the
   screen still fits a 375 × 667 phone. */
.group.privacy {
  padding-top: 10px;
  padding-bottom: 10px;
}
.privacy .row {
  min-height: 40px;
  font-size: 16px;
  color: var(--text);
}
.group.privacy .row + .row {
  padding-top: 7px;
  margin-top: 7px;
}
.privacy label.row > span {
  display: flex;
  flex-direction: column;
}
.privacy small {
  color: var(--muted);
  font-size: 12px;
}
.privacy .links {
  min-height: 0;
}
.privacy .links a {
  font-size: 15px;
  margin-left: 16px;
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 51px;
  min-height: 31px;
  height: 31px;
  padding: 0;
  border-radius: 999px;
  background: var(--raised);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.4);
  transition: transform 0.2s ease;
}
.switch:checked {
  background: var(--accent);
}
.switch:checked::after {
  transform: translateX(20px);
}
.switch:disabled {
  opacity: 0.5;
}
/* Photo recognition consent, before the first photo is sent. */
.consent strong {
  font-weight: 600;
}

/* Privacy policy */
.policy {
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.5;
  color: var(--text);
}
.policy h2 {
  font-size: 20px;
  margin: 10px 0 0;
}
.policy ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.policy p {
  margin: 0;
}
.policy a,
.legal a {
  color: var(--accent);
}
.legal {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* Login hero: the centre card is scanned top to bottom, its real label pops
   up, then it flips to the next card; the side cards show the ones before and
   after it. Driven by heroLoop() in app.js. */
.login-screen {
  overflow: hidden;
}
.login-art {
  position: relative;
  height: clamp(240px, 43dvh, 390px);
  margin-top: clamp(8px, 3.5dvh, 32px);
  display: grid;
  place-items: center;
}
.hero-glow {
  position: absolute;
  inset: 4% 14%;
  background: radial-gradient(closest-side, rgb(180 240 123 / 0.25), rgb(180 240 123 / 0) 75%);
  filter: blur(10px);
}
.hero-stage {
  position: relative;
  height: 100%;
  width: min(100%, 360px);
  margin: 0 auto;
  perspective: 900px;
}
.hero-side {
  position: absolute;
  top: 17%;
  width: 31%;
  aspect-ratio: 63 / 88;
  border-radius: 6% / 4.3%;
  overflow: hidden;
  background: linear-gradient(160deg, #2a2f28, #121411);
  filter: brightness(0.5) saturate(0.85);
  box-shadow: 0 14px 30px rgb(0 0 0 / 0.6);
  animation: float 6s ease-in-out infinite;
}
.hero-side.left {
  left: 3%;
  --x: 0px;
  --tilt: -9deg;
  transform: rotate(-9deg);
}
.hero-side.right {
  right: 3%;
  --x: 0px;
  --tilt: 9deg;
  transform: rotate(9deg);
  animation-delay: 1.5s;
}
.hero-side img,
.hero-flip .face {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-main {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 3%;
  width: 50%;
  aspect-ratio: 63 / 88;
  translate: -50% 0;
}
.hero-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.hero-flip .face {
  position: absolute;
  inset: 0;
  border-radius: 6% / 4.3%;
  backface-visibility: hidden;
  background: linear-gradient(160deg, #ffb35c, #e2552c 60%, #7a1d10);
  box-shadow: 0 20px 44px rgb(0 0 0 / 0.7), 0 0 0 1px rgb(255 255 255 / 0.1);
}
.hero-flip .face.back {
  transform: rotateY(180deg);
}
/* Viewfinder corners around the card being scanned. */
.hero-main .corner {
  position: absolute;
  width: 18%;
  aspect-ratio: 1;
  border: 3px solid var(--accent);
  opacity: 0.55;
  transition: opacity 0.3s, inset 0.3s;
}
.corner.tl { top: -9px; left: -9px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.corner.tr { top: -9px; right: -9px; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.corner.bl { bottom: -9px; left: -9px; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.corner.br { bottom: -9px; right: -9px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.login-art.scanning .corner,
.login-art.found .corner {
  opacity: 1;
}
/* The scan line runs the full card down and back up, with a glowing trail. */
.hero-scanarea {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 6% / 4.3%;
}
.hero-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 16px 3px var(--accent);
  opacity: 0;
}
.hero-beam::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 46px;
  background: linear-gradient(to top, rgb(180 240 123 / 0.35), rgb(180 240 123 / 0));
}
.login-art.scanning .hero-beam {
  animation: card-scan 2s ease-in-out both;
}
@keyframes card-scan {
  0% { top: 0; opacity: 0; }
  8% { opacity: 1; }
  50% { top: calc(100% - 3px); }
  50.01% { transform: scaleY(-1); }
  92% { opacity: 1; }
  100% { top: 0; opacity: 0; transform: scaleY(-1); }
}
/* The label the app prints for this card. */
.hero-label {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 9%;
  width: 78%;
  max-width: 290px;
  border-radius: 6px;
  box-shadow: 0 14px 30px rgb(0 0 0 / 0.65);
  opacity: 0;
  transform: translate(-50%, 14px) rotate(-2deg) scale(0.9);
  transition:
    opacity 0.25s ease,
    transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.login-art.found .hero-label {
  opacity: 1;
  transform: translate(-50%, 0) rotate(-2deg);
}
@media (prefers-reduced-motion: reduce) {
  .hero-label {
    opacity: 1;
    transform: translate(-50%, 0) rotate(-2deg);
  }
}
/* Header badge */
.beta {
  position: relative;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--on-accent);
  background: linear-gradient(120deg, var(--accent), #7ee3ff);
  padding: 4px 11px;
  border-radius: 999px;
  box-shadow: 0 0 16px rgb(180 240 123 / 0.35);
}
.beta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.6) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: badge-shine 4s 1s ease-in-out infinite;
}
@keyframes badge-shine {
  0%, 70% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

/* One-line headline that lights up word by word with the hero (heroLoop). */
.login-screen .tagline {
  white-space: nowrap;
  font-size: clamp(30px, 10.2vw, 44px);
  line-height: 1;
  letter-spacing: -0.4px;
}
.tagline span {
  display: inline-block;
  transition:
    color 0.35s ease,
    text-shadow 0.35s ease,
    transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.tagline.live span {
  color: rgb(180 240 123 / 0.28);
}
.tagline.live[data-step="scan"] [data-w="scan"],
.tagline.live[data-step="price"] :is([data-w="scan"], [data-w="price"]),
.tagline.live[data-step="tag"] span {
  color: var(--accent);
  text-shadow: 0 0 22px rgb(180 240 123 / 0.45);
}
.tagline.live[data-step="scan"] [data-w="scan"],
.tagline.live[data-step="price"] [data-w="price"],
.tagline.live[data-step="tag"] [data-w="tag"] {
  transform: translateY(-3px);
}
@media (max-height: 700px) {
  .login-art {
    height: 210px;
    margin-top: 2px;
  }
}

/* Inside the iPhone app: no page bounce, text selection or long-press callouts. */
.in-app,
.in-app body {
  overscroll-behavior: none;
}
.in-app body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.in-app input,
.in-app textarea {
  -webkit-user-select: text;
  user-select: text;
}
