/* K Mineral Lens
   Light-table neutrals, K Mineral orange for actions, and one accent
   borrowed from whichever stone is on screen. The emerald-cut octagon
   is the only decorative shape. */

:root {
  --paper: #EEF1F0;
  --surface: #FFFFFF;
  --ink: #15222B;
  --ink-2: #51606B;
  --ink-3: #8A969E;
  --line: #D6DDDF;
  --line-strong: #B9C3C7;

  --night: #0F1B21;
  --night-2: #1A2B33;
  --night-line: rgba(255, 255, 255, .14);
  --on-night-2: rgba(255, 255, 255, .68);

  --flame: #FF7010;
  --flame-deep: #C24E00;
  --flame-tint: #FFF0E3;
  --danger: #B42D18;

  /* Overridden inline per stone */
  --stone-deep: #0E6A87;
  --stone-mid: #3FA9C9;
  --stone-tint: #DDF0F5;

  --font-display: "Piazzolla", Georgia, "Times New Roman", serif;
  --font-ui: "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;

  --tab-h: 64px;
  --c: 12px;   /* corner cut */
  --b: 1.5px;  /* outline weight for cut rings */
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100%;
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 350 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--flame); outline-offset: 2px; }
.page :focus-visible, .guide :focus-visible, .sheet :focus-visible { outline-color: var(--ink); }

/* ---------- Emerald-cut shapes ---------- */

.btn::before,
.btn--ghost::after,
.shutter::before,
.reticle__win,
.samples img,
.read__swatches i,
.plate__photo,
.plate__fig,
.gallery__track img,
.lot__img,
.species__img,
.scanrow__img,
.paid__mark {
  clip-path: polygon(
    var(--c) 0, calc(100% - var(--c)) 0,
    100% var(--c), 100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%, var(--c) 100%,
    0 calc(100% - var(--c)), 0 var(--c));
}

.reticle__ring,
.btn--ghost::before {
  --i: calc(var(--c) + .414 * var(--b));
  clip-path: polygon(evenodd,
    var(--c) 0, calc(100% - var(--c)) 0,
    100% var(--c), 100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%, var(--c) 100%,
    0 calc(100% - var(--c)), 0 var(--c), var(--c) 0,
    var(--i) var(--b), var(--b) var(--i),
    var(--b) calc(100% - var(--i)), var(--i) calc(100% - var(--b)),
    calc(100% - var(--i)) calc(100% - var(--b)), calc(100% - var(--b)) calc(100% - var(--i)),
    calc(100% - var(--b)) var(--i), calc(100% - var(--i)) var(--b), var(--i) var(--b));
}

/* ---------- Stage, guide and device ---------- */

.stage { min-height: 100dvh; display: grid; place-items: center; }

.guide { display: none; }

.device {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; outline: none; }
.view > section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view.is-entering > section { animation: enter .2s ease-out; }

@media (min-width: 560px) {
  body { background: #DCE3E2; }
  .stage { padding: 24px; }
  .device {
    width: 402px;
    height: min(868px, calc(100dvh - 48px));
    border-radius: 40px;
    box-shadow: 0 0 0 9px var(--night), 0 0 0 10px #33464F, 0 50px 90px -40px rgba(16, 40, 52, .55);
  }
}

@media (min-width: 1040px) {
  .stage { grid-template-columns: minmax(0, 430px) auto; justify-content: center; gap: clamp(48px, 7vw, 104px); }
  .guide { display: block; }
  /* The guide can be taller than a short laptop screen; keep the phone in view. */
  .device { position: sticky; top: max(24px, calc((100dvh - 868px) / 2)); align-self: start; }
}

.wordmark {
  display: flex; align-items: center; gap: 9px;
  font: 650 19px/1 var(--font-display);
  letter-spacing: -.005em;
}
.wordmark em {
  font: 500 11.5px/1 var(--font-ui);
  padding: 4px 8px 4px;
  border: 1px solid currentColor;
  border-radius: 99px;
  opacity: .72;
}
.mark { width: 22px; height: 22px; fill: none; stroke: var(--flame); stroke-width: 1.3; stroke-linejoin: round; }

.guide__title {
  font: 700 clamp(40px, 4.3vw, 58px)/1.02 var(--font-display);
  letter-spacing: -.012em;
  word-spacing: .1em;
  margin: 32px 0 18px;
  text-wrap: balance;
}
.guide__lede { font-size: 17px; line-height: 1.55; color: var(--ink-2); max-width: 40ch; margin-bottom: 36px; }

.guide__steps { list-style: none; margin: 0; padding: 0; counter-reset: step; border-top: 1px solid var(--line-strong); }
.guide__steps li { counter-increment: step; border-bottom: 1px solid var(--line-strong); }
.guide__steps button {
  display: grid; grid-template-columns: 40px 1fr; width: 100%;
  padding: 13px 8px 13px 0; text-align: left; color: var(--ink-2);
}
.guide__steps button::before {
  content: counter(step);
  grid-row: 1 / 3;
  font: 600 24px/1.1 var(--font-display);
  color: var(--ink-3);
}
.guide__steps b { font-weight: 500; font-size: 16px; color: var(--ink); }
.guide__steps span { grid-column: 2; font-size: 14px; }
.guide__steps button:hover b { text-decoration: underline; text-underline-offset: 3px; }
.guide__steps button[aria-current="step"]::before { color: var(--flame-deep); }
.guide__steps button[aria-current="step"] b { font-weight: 650; }

.guide__note { font-size: 13px; color: var(--ink-2); max-width: 46ch; margin-top: 28px; }

@media (min-width: 1040px) and (max-height: 800px) {
  .guide__title { font-size: clamp(34px, 3.5vw, 46px); margin: 20px 0 12px; }
  .guide__lede { font-size: 16px; margin-bottom: 20px; }
  .guide__steps button { padding: 9px 8px 9px 0; }
  .guide__note { margin-top: 16px; }
}

/* ---------- Tabs ---------- */

.tabs {
  flex: none;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabs[hidden] { display: none; }
.tabs a {
  display: grid; place-content: center; justify-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 500; color: var(--ink-2); text-decoration: none;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.tabs a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 2px 0 var(--flame); }
.tabs a:focus-visible { outline-offset: -4px; }

.device.is-dark .tabs { background: var(--night); border-top-color: var(--night-line); }
.device.is-dark .tabs a { color: var(--on-night-2); }
.device.is-dark .tabs a[aria-current="page"] { color: #fff; }

/* ---------- Shared controls ---------- */

.iconbtn {
  position: relative; flex: none;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; text-decoration: none;
}
.iconbtn svg, .ctl svg, .btn svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.iconbtn:hover { background: rgba(21, 34, 43, .07); }
.scan .iconbtn:hover { background: rgba(255, 255, 255, .1); }
.bagbtn b {
  position: absolute; top: 5px; right: 3px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--flame); color: var(--ink);
  font: 600 11px/18px var(--font-ui); text-align: center;
}

.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px;
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  color: var(--btn-fg, var(--ink));
  --c: 13px;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--btn-bg, var(--flame));
  transition: filter .15s;
}
.btn:hover::before { filter: brightness(.93); }
.btn:active { transform: translateY(1px); }
.btn--ink { --btn-bg: var(--ink); --btn-fg: #fff; }
.btn--ink:hover::before { filter: brightness(1.35); }
.btn--ghost { --btn-bg: var(--ink); --btn-fg: var(--ink); }
.btn--ghost::after { content: ""; position: absolute; inset: 0; z-index: -2; background: transparent; transition: background .15s; }
.btn--ghost:hover::after { background: rgba(21, 34, 43, .07); }
.btn--ghost:hover::before { filter: none; }
.btn--light { --btn-bg: #fff; --btn-fg: var(--ink); }
.btn--sm { min-height: 40px; padding: 0 15px; font-size: 14px; --c: 10px; }
.btn--sm svg { width: 16px; height: 16px; stroke-width: 2.2; }
.btn--grow { flex: 1; }
.btn--block { display: flex; width: 100%; }
.btn[disabled] { cursor: default; opacity: .7; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}

/* Crystal habit drawings */
.crystal { display: block; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.crystal__fine { stroke-width: .8; opacity: .75; }
.crystal__fine--dash { stroke-dasharray: 2.6 2.6; }
.crystal--sm { stroke-width: 2.4; }
.crystal--sm .crystal__fine { stroke-width: 1.3; }

/* ---------- Scan ---------- */

.scan { position: relative; background: var(--night); color: #fff; }

.scan__top {
  flex: none; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 0 20px;
}

.scan__stage {
  flex: 1; min-height: 150px;
  container-type: size;
  display: grid; place-items: center;
  margin: 4px 26px 0;
}

.reticle {
  position: relative;
  height: min(100cqh, 125cqw);
  aspect-ratio: 4 / 5;
  --c: clamp(20px, 11cqw, 44px);
}
.reticle__win { position: absolute; inset: 0; overflow: hidden; background: var(--night-2); }
.reticle__ring { position: absolute; inset: 0; background: rgba(255, 255, 255, .9); pointer-events: none; }

.reticle__feed, .reticle__still {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: none;
}
.scan[data-cam="live"][data-mode="capture"] .reticle__feed { display: block; }
.scan[data-mode="read"] .reticle__still { display: block; filter: brightness(.8); }

.reticle__idle {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 10px;
  padding: 10% 12%; text-align: center;
}
.scan[data-cam="live"] .reticle__idle,
.scan[data-mode="read"] .reticle__idle { display: none; }
.reticle__idle .crystal { height: clamp(48px, 26cqh, 104px); color: rgba(255, 255, 255, .42); margin-bottom: 4px; }
.reticle__idle h2 { font: 650 21px/1.15 var(--font-display); }
.reticle__idle p { font-size: 14px; color: var(--on-night-2); max-width: 24ch; }
.reticle__idle .btn { margin-top: 8px; }
@container (max-height: 300px) {
  .reticle__idle .crystal, .reticle__idle p { display: none; }
}

.reticle__dots, .reticle__fit { position: absolute; inset: 0; pointer-events: none; display: none; }
.scan[data-mode="read"] .reticle__dots { display: block; }
.scan[data-mode="read"] .reticle__fit { display: grid; place-items: center; }

.reticle__dots i {
  position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .25);
  opacity: 0; transform: scale(.3);
  animation: pop .3s cubic-bezier(.2, .9, .3, 1.3) forwards;
  animation-delay: calc(var(--n) * 110ms + 200ms);
}

.reticle__fit .crystal { height: 58%; color: #fff; filter: drop-shadow(0 1px 5px rgba(0, 0, 0, .55)); }
.crystal--draw .crystal__edge { stroke-dasharray: 1; stroke-dashoffset: 1; }
.crystal--draw .crystal__fine { opacity: 0; }
.is-drawing .crystal--draw .crystal__edge { animation: draw .85s cubic-bezier(.6, 0, .3, 1) forwards; }
.is-drawing .crystal--draw .crystal__fine { animation: fade .35s .6s forwards; }

.scan__panels { flex: none; display: grid; }
.scan__panel { grid-area: 1 / 1; padding: 14px 20px 14px; }
.scan[data-mode="read"] .scan__panel--capture,
.scan[data-mode="capture"] .scan__panel--read { visibility: hidden; }

.scan__hint { text-align: center; font-size: 15px; font-weight: 500; }
.scan__hint span { display: block; font-size: 13px; font-weight: 350; color: var(--on-night-2); }

.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 14px 0 14px; }
.ctl {
  justify-self: center; display: grid; justify-items: center; gap: 4px;
  min-width: 68px; padding: 6px; border-radius: 10px;
  font-size: 12px; font-weight: 450; color: rgba(255, 255, 255, .86);
}
.ctl svg { width: 24px; height: 24px; }
.ctl:hover { background: rgba(255, 255, 255, .08); }

.shutter {
  width: 76px; height: 76px; border-radius: 50%;
  border: 2px solid #fff; display: grid; place-items: center;
  --c: 16px;
}
.shutter::before {
  content: ""; grid-area: 1 / 1; width: 58px; height: 58px;
  background: var(--flame); transition: transform .12s;
}
.shutter svg {
  grid-area: 1 / 1; z-index: 1; width: 26px; height: 26px;
  fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round;
}
.scan[data-cam="live"] .shutter svg { display: none; }
.shutter:active::before { transform: scale(.9); }

.samples { border-top: 1px solid var(--night-line); padding-top: 12px; }
.samples p { font-size: 13px; color: var(--on-night-2); margin-bottom: 10px; }
.samples__row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.samples button { display: block; }
.samples img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; --c: 10px; transition: filter .15s; }
.samples button:hover img { filter: brightness(1.12); }

.read__title { font: 650 24px/1.1 var(--font-display); word-spacing: .06em; margin-bottom: 12px; }
.read__swatches { display: flex; gap: 6px; margin-bottom: 16px; }
.read__swatches i {
  width: 30px; height: 30px; --c: 8px;
  background: var(--sw, rgba(255, 255, 255, .14));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  opacity: 0; transform: scale(.4);
  animation: pop .3s cubic-bezier(.2, .9, .3, 1.3) forwards;
  animation-delay: calc(var(--n) * 110ms + 260ms);
}
.read__steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 9px; }
.read__steps li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: rgba(255, 255, 255, .4); transition: color .2s; }
.read__steps li::before {
  content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid currentColor;
}
.read__steps li.is-active { color: #fff; }
.read__steps li.is-active::before { border-color: var(--flame); border-top-color: transparent; animation: spin .7s linear infinite; }
.read__steps li.is-done { color: rgba(255, 255, 255, .82); }
.read__steps li.is-done::before {
  border-color: var(--flame);
  background: var(--flame) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2315222B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.4l2.6 2.6L12 5.6'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.linkbtn { font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; color: var(--on-night-2); padding: 6px 0; }
.linkbtn:hover { color: #fff; }

/* Short screens: give the viewfinder the room back. */
@media (max-height: 740px) {
  .scan__hint span { display: none; }
  .controls { margin: 10px 0 10px; }
  .shutter { width: 66px; height: 66px; --c: 14px; }
  .shutter::before { width: 50px; height: 50px; }
  .samples { padding-top: 10px; }
  .samples p { margin-bottom: 8px; }
  .samples__row { grid-template-columns: repeat(5, 54px); justify-content: space-between; }
  .scan__panel { padding-bottom: 10px; }
}

/* ---------- Light pages ---------- */

.page { background: var(--paper); }

.topbar { flex: none; height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 10px 0 8px; }
.topbar--root { padding-left: 20px; }
.topbar__title { flex: 1; text-align: center; font-weight: 600; font-size: 15px; }

.page__scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 20px 32px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.page__bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.bar__sum { flex: 1; min-width: 0; line-height: 1.3; }
.bar__sum b { display: block; font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.bar__sum span { font-size: 13px; color: var(--ink-2); }

.t-display { font: 700 40px/1.02 var(--font-display); letter-spacing: -.012em; word-spacing: .1em; text-wrap: balance; }
.t-display--sm { font-size: 34px; }
.t-sub { margin-top: 6px; color: var(--ink-2); }
.t-head { font: 650 22px/1.2 var(--font-display); letter-spacing: -.005em; word-spacing: .06em; margin: 34px 0 12px; }
.lede { font-size: 17px; line-height: 1.5; margin-top: 18px; }
.prose { margin-top: 12px; color: var(--ink-2); max-width: 62ch; }
.fine { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); margin-top: 22px; }

.notice {
  display: grid; grid-template-columns: 20px 1fr; gap: 10px;
  padding: 12px 14px; margin-bottom: 20px;
  background: var(--flame-tint); border-left: 3px solid var(--flame);
  font-size: 14px; line-height: 1.45;
}
.notice svg { width: 20px; height: 20px; fill: none; stroke: var(--flame-deep); stroke-width: 1.7; stroke-linecap: round; }
.notice b { font-weight: 600; }

/* Result */

.plate { display: grid; grid-template-columns: 1.32fr 1fr; gap: 10px; margin-bottom: 22px; }
.plate__photo { aspect-ratio: 4 / 5; background: var(--stone-tint); --c: 28px; }
.plate__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.plate__fig {
  --c: 28px;
  display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; gap: 10px;
  padding: 22px 12px 18px;
  background: var(--stone-tint); color: var(--stone-deep);
}
.plate__fig .crystal { height: 100%; max-height: 132px; min-height: 0; }
.plate__fig figcaption { font-size: 12.5px; font-weight: 500; text-align: center; line-height: 1.25; }

.match__label { font-size: 14px; font-weight: 500; color: var(--stone-deep); margin-bottom: 2px; }

.meter { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.meter__bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.meter__bar i { display: block; height: 100%; background: var(--stone-deep); border-radius: 3px; }
.meter p { font-size: 14px; white-space: nowrap; }
.meter b { font-weight: 600; font-size: 19px; color: var(--stone-deep); font-variant-numeric: tabular-nums; }

.dl { margin: 0; border-top: 1px solid var(--line); }
.dl > div { display: grid; grid-template-columns: var(--dt, 92px) 1fr; gap: 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.dl dt { font-size: 14px; color: var(--ink-2); }
.dl dd { margin: 0; font-weight: 450; overflow-wrap: anywhere; }
.dl--props { --dt: 112px; }
.swatches { display: inline-flex; gap: 3px; margin-right: 8px; vertical-align: -3px; }
.swatches i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(21, 34, 43, .12); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts > div { padding: 12px 10px 12px 0; }
.facts > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.facts dt { font-size: 12.5px; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-weight: 500; font-size: 15px; line-height: 1.3; }

.est { margin-top: 30px; padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.est .t-head { margin: 0 0 14px; }
.est__controls { display: flex; flex-wrap: wrap; gap: 10px; }
.stepper {
  display: inline-grid; grid-template-columns: 42px auto 42px; align-items: center;
  height: 44px; border: 1px solid var(--line-strong); border-radius: 6px;
}
.stepper button { height: 42px; font-size: 21px; line-height: 1; font-weight: 400; border-radius: 5px; }
.stepper button:hover { background: var(--paper); }
.stepper output { min-width: 62px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
.seg {
  flex: 1; min-width: 190px; height: 44px; padding: 3px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border: 1px solid var(--line-strong); border-radius: 6px;
}
.seg button { border-radius: 4px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--ink); color: #fff; }
.est__value { font: 700 31px/1.1 var(--font-display); letter-spacing: -.01em; word-spacing: .04em; font-variant-numeric: tabular-nums lining-nums; margin: 18px 0 6px; }
.est__note { font-size: 13px; color: var(--ink-2); }

.alts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.alts a {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 99px;
  background: var(--surface); text-decoration: none; font-weight: 450; font-size: 14px;
}
.alts a:hover { border-color: var(--ink); }
.alts span { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Stone profile */

.gallery { margin: 0 -20px 22px; }
.gallery__track {
  display: flex; gap: 10px; overflow-x: auto; padding: 0 20px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track img {
  flex: none; width: 84%; aspect-ratio: 1; object-fit: cover;
  scroll-snap-align: center; background: var(--stone-tint); --c: 30px;
}
.gallery__dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.gallery__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background .15s, transform .15s; }
.gallery__dots i.is-on { background: var(--ink); transform: scale(1.25); }

.mohs { position: relative; height: 66px; margin: 16px 6px 4px; }
.mohs__track { position: absolute; left: 0; right: 0; top: 14px; height: 2px; background: var(--line-strong); }
.mohs__band { position: absolute; top: 6px; height: 18px; min-width: 6px; background: var(--stone-mid); border-radius: 2px; }
.mohs__tick { position: absolute; top: 9px; width: 1px; height: 12px; background: var(--ink-3); }
.mohs__num { position: absolute; top: 28px; transform: translateX(-50%); font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mohs__ref { position: absolute; top: 47px; transform: translateX(-50%); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.mohs__ref.is-first { transform: translateX(-4px); }
.mohs__ref.is-last { transform: translateX(calc(-100% + 6px)); }
.mohs-note b { font-weight: 600; color: var(--stone-deep); }

.origins { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.origins li { padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); font-size: 14px; }
.origins li.is-own { border-color: var(--stone-mid); background: var(--stone-tint); color: var(--stone-deep); font-weight: 500; }
.caption { margin-top: 10px; font-size: 13px; color: var(--ink-2); }

.rates { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rates li { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rates b { display: block; font-weight: 500; }
.rates span { font-size: 13px; color: var(--ink-2); }
.rates em { font-style: normal; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rates em span { display: block; font-weight: 350; }

.lots { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lot { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.lot__img { display: block; width: 76px; height: 76px; object-fit: cover; --c: 13px; background: var(--stone-tint); }
.lot__title { font-weight: 500; line-height: 1.3; }
.lot__meta { margin: 3px 0 5px; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.lot__price { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Reference set and My scans */

.intro { margin: 8px 0 22px; }
.intro p { margin-top: 10px; color: var(--ink-2); max-width: 40ch; }

.species { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.species a {
  display: grid; grid-template-columns: 92px 1fr 34px; gap: 16px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.species__img { display: block; width: 92px; height: 100px; object-fit: cover; --c: 16px; }
.species h2 { font: 650 24px/1.1 var(--font-display); letter-spacing: -.01em; }
.species p { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }
.species p b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.species .crystal { width: 34px; }
.species a:hover h2 { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }

.scanrow {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.scanrow__img { display: block; width: 64px; height: 80px; object-fit: cover; --c: 12px; }
.scanrow h2 { font: 650 21px/1.15 var(--font-display); }
.scanrow p { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.scanrow b { font-weight: 600; font-variant-numeric: tabular-nums; }
.scanrow svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.empty { padding: 40px 8px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.empty .crystal { height: 84px; color: var(--ink-3); margin-bottom: 6px; }
.empty h2 { font: 650 24px/1.15 var(--font-display); }
.empty p { color: var(--ink-2); max-width: 30ch; }
.empty .btn { margin-top: 12px; }

/* Checkout */

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13.5px; font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink);
  font: 400 16px/1.4 var(--font-ui);
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field__err { font-size: 13px; color: var(--danger); }

.choices { border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); overflow: hidden; }
.choice { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: center; padding: 14px; cursor: pointer; }
.choice + .choice { border-top: 1px solid var(--line); }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.choice b { display: block; font-weight: 500; line-height: 1.3; }
.choice span { font-size: 13px; color: var(--ink-2); }
.choice em { font-style: normal; font-weight: 500; font-variant-numeric: tabular-nums; }
.choice:has(input:checked) { box-shadow: inset 3px 0 0 var(--flame); }
.choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: -2px; }

.cardform { margin-top: 16px; }
.paynote { margin-top: 14px; padding: 12px 14px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 6px; font-size: 14px; color: var(--ink-2); }

.totals { margin: 26px 0 0; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; font-weight: 450; }
.totals > div.is-total { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line-strong); }
.totals > div.is-total dt { color: var(--ink); font-weight: 500; }
.totals > div.is-total dd { font: 700 26px/1 var(--font-display); }

/* Paid */

.paid__mark { width: 72px; height: 72px; --c: 20px; display: grid; place-items: center; background: var(--flame); margin: 20px 0 22px; animation: pop .4s cubic-bezier(.2, .9, .3, 1.3) both; }
.paid__mark svg { width: 36px; height: 36px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.receipt { margin-top: 26px; padding: 2px 16px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.receipt .lots { border-top: 0; }
.receipt .lot { grid-template-columns: 56px 1fr auto; }
.receipt .lot__img { width: 56px; height: 56px; --c: 10px; }
.receipt .totals { margin-top: 12px; }
.next { margin: 0; padding: 0; list-style: none; counter-reset: next; border-top: 1px solid var(--line); }
.next li { counter-increment: next; display: grid; grid-template-columns: 34px 1fr; padding: 12px 0; border-bottom: 1px solid var(--line); }
.next li::before { content: counter(next); font: 600 21px/1.2 var(--font-display); color: var(--flame-deep); }

/* ---------- Sheet and toast ---------- */

.sheet { position: absolute; inset: 0; z-index: 20; display: grid; align-items: end; }
.sheet[hidden] { display: none; }
.sheet__scrim { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(9, 17, 21, .6); animation: fade .2s both; }
.sheet__panel {
  position: relative; background: var(--surface); color: var(--ink);
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  animation: rise .24s cubic-bezier(.2, .8, .3, 1) both;
}
.sheet__panel h2 { font: 650 24px/1.15 var(--font-display); margin-bottom: 6px; }
.tips { list-style: none; margin: 0 0 20px; padding: 0; }
.tips li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.tips b { display: block; font-weight: 500; }
.tips span { font-size: 14px; color: var(--ink-2); }

.toast {
  position: absolute; left: 16px; right: 16px; top: 62px; z-index: 30;
  padding: 12px 16px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 14px; line-height: 1.4;
  box-shadow: 0 10px 30px -10px rgba(9, 17, 21, .6);
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.device.is-dark .toast { background: #fff; color: var(--ink); }
.toast.is-on { opacity: 1; transform: none; }

/* ---------- Motion ---------- */

@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; } to { opacity: .75; } }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.sheet__scrim { animation-name: scrim; }
@keyframes scrim { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
