/* Stone Studio. Identity: Beausite Classic (UltraLight/Thin headlines, uppercase, +80 tracking; Light text),
   Mulberry R71 G6 B30, Tan R209 G177 B156, Black R25 G25 B25, off-white paper. The stones carry the colour. */
@font-face { font-family: "Beausite"; src: url("/static/fonts/BeausiteClassic-UltraLight.otf") format("opentype"); font-weight: 100; font-display: swap; }
@font-face { font-family: "Beausite"; src: url("/static/fonts/BeausiteClassic-Thin.woff2") format("woff2"); font-weight: 200; font-display: swap; }
@font-face { font-family: "Beausite"; src: url("/static/fonts/BeausiteClassic-Light.otf") format("opentype"); font-weight: 300; font-display: swap; }

:root {
  --paper: #f7f4f0;
  --white: #ffffff;
  --ink: #191919;
  --muted: #6e6862;
  --faint: #a59d95;
  --line: #e3dcd4;
  --mulberry: #47061e;
  --mulberry-soft: #f3e9ec;
  --blush: #eee2da; /* the site's button fill */
  --tan: #d1b19c;
  --tap: 48px;
  --radius: 2px;
  --pad: 20px;
  --font: "Beausite", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); font-weight: 300; font-size: 16px; line-height: 1.35; color: var(--ink);
  background: var(--paper); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
input, textarea { -webkit-user-select: text; user-select: text; font-family: var(--font); }
img { -webkit-user-drag: none; }
h2 { font-weight: 100; text-transform: uppercase; letter-spacing: .08em; font-size: 22px; margin: 0; }
.muted { color: var(--muted); }

/* buttons: every control is at least 44 pt tall and has a pressed state (no hover-only behaviour) */
.btn {
  font: inherit; font-weight: 300; font-size: 14px; letter-spacing: .1em; text-transform: uppercase;
  min-height: var(--tap); min-width: var(--tap); padding: 0 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: background-color .12s, border-color .12s, opacity .12s, transform .06s;
}
.btn:active { transform: scale(.98); background: var(--blush); }
.btn[disabled] { opacity: .38; pointer-events: none; }
.btn.primary { background: var(--mulberry); border-color: var(--mulberry); color: var(--paper); }
.btn.primary:active { background: #2e0313; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:active { background: var(--mulberry-soft); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { min-height: 44px; padding: 0 14px; }
.btn.icon { padding: 0; font-size: 22px; letter-spacing: 0; }
.btn.chip { font-size: 13px; padding: 0 14px; }
.btn.chip.on { border-color: var(--mulberry); color: var(--mulberry); background: var(--blush); }
.btn.chip .n { color: var(--faint); font-size: 12px; letter-spacing: .04em; }

/* top bar */
.bar { flex: none; height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc(var(--pad) - 6px) 0 var(--pad); border-bottom: 1px solid var(--line); background: var(--paper); }
.brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.logo { display: block; height: 36px; width: auto; }
.logo.big { height: 70px; margin-bottom: 6px; }
.wordmark { font-weight: 100; text-transform: uppercase; letter-spacing: .08em; font-size: 22px; white-space: nowrap; }
.wordmark.big { font-size: 30px; margin: 0; }
.brand-sub { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.bar-actions { display: flex; align-items: center; gap: 2px; }
.count { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; align-items: center;
  justify-content: center; background: var(--mulberry); color: var(--paper); font-size: 12px; letter-spacing: 0; }
.count.zero { background: var(--line); color: var(--muted); }
.mode-badge { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mulberry);
  border: 1px dashed var(--mulberry); padding: 6px 10px; margin-right: 8px; }

/* two panes: stones left, the picture right (landscape); the picture on top (portrait) */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 41fr) minmax(0, 59fr); }
.finder { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.stage { min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 16px var(--pad) 16px; overflow: hidden; }
@media (orientation: portrait) {
  .layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 60fr) minmax(0, 40fr); }
  .stage { order: -1; border-bottom: 1px solid var(--line); }
  .finder { border-right: 0; }
}

/* finder */
.finder-head { flex: none; padding: 14px var(--pad) 8px; display: flex; flex-direction: column; gap: 10px; }
.search { position: relative; }
.search input { width: 100%; height: var(--tap); border: 1px solid var(--line); background: var(--white); border-radius: var(--radius);
  font-size: 17px; font-weight: 300; padding: 0 48px 0 14px; color: var(--ink); -webkit-appearance: none; appearance: none; }
.search input:focus { outline: none; border-color: var(--mulberry); }
.search input::-webkit-search-cancel-button { display: none; }
.search .btn.icon { position: absolute; right: 2px; top: 0; border: 0; background: transparent; color: var(--muted); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.finder-count { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); min-height: 16px; }
.grid { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 4px var(--pad) var(--pad); display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px; align-content: start; grid-auto-rows: max-content; }
.card { position: relative; font: inherit; text-align: left; border: 1px solid var(--line); background: var(--white);
  padding: 0; border-radius: var(--radius); color: var(--ink); cursor: pointer; display: flex; flex-direction: column;
  min-height: var(--tap); transition: border-color .12s, transform .06s; }
.card:active { transform: scale(.985); }
.card.selected { border-color: var(--mulberry); box-shadow: 0 0 0 1px var(--mulberry); }
.card.is-group { box-shadow: 4px 4px 0 -1px var(--white), 4px 4px 0 0 var(--line); }
.card.is-group.selected { box-shadow: 0 0 0 1px var(--mulberry), 4px 4px 0 -1px var(--white), 4px 4px 0 0 var(--mulberry); }
.thumb { flex: none; display: block; aspect-ratio: 1 / 1; background: #eceae6; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meta { flex: none; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 10px; min-width: 0; }
.meta .ref { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.meta .name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .dims { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.92); border: 1px solid var(--line);
  font-size: 12px; letter-spacing: .06em; padding: 3px 8px; border-radius: 12px; color: var(--ink); }
.empty { grid-column: 1 / -1; color: var(--muted); padding: 30px 0; text-align: center; }

/* stage: the picks */
.picks { flex: none; display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: stretch; min-width: 0; }
.slots { flex: 1 1 auto; display: flex; gap: 10px; min-width: 0; padding-top: 8px; }
.slot { position: relative; display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); background: var(--white);
  padding: 8px 10px 8px 8px; min-height: 104px; border-radius: var(--radius); font: inherit; text-align: left; color: var(--ink);
  width: 360px; cursor: pointer; }
.slot.active { border-color: var(--mulberry); box-shadow: 0 0 0 1px var(--mulberry); }
.slot.compact { flex: 1 1 0; width: auto; max-width: 250px; min-width: 0; gap: 8px; padding-right: 8px; min-height: 92px; }
.slot.compact .slot-remove { top: 2px; left: 2px; right: auto; width: 44px; height: 44px; background: rgba(255,255,255,.7); color: var(--ink); }
.slot.compact.three { max-width: 210px; }
.slot.compact .slot-img { width: 56px; height: 56px; }
.slot.compact .slot-text > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.compact .slot-name { font-size: 14px; }
.slot.compact .slot-dims { font-size: 12px; }
.slot .slot-img { flex: none; width: 86px; height: 86px; background: #eceae6; overflow: hidden; }
.slot .slot-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot .slot-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.slot .slot-ref { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.slot .slot-name { font-size: 16px; }
.slot .slot-dims { font-size: 13px; color: var(--muted); }
.slot .price-btn { margin-top: 4px; min-height: 44px; padding: 0 10px; font-size: 12px; align-self: flex-start; }
.slot .price-btn.shown { border-color: var(--tan); background: #fbf6f2; letter-spacing: .04em; text-transform: none; font-size: 14px; }
.slot.empty-slot { justify-content: center; color: var(--muted); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.slot.add { flex: 0 1 150px; min-width: 110px; border-style: dashed; justify-content: center; text-align: center; color: var(--muted); font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; }
.slot .slot-remove { position: absolute; top: 0; right: 0; min-height: 44px; min-width: 44px; border: 0; background: transparent;
  color: var(--muted); font-size: 20px; font-family: var(--font); }
.slot-label { position: absolute; top: -9px; left: 10px; background: var(--white); padding: 0 6px; font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); }

/* lane K: the ticked pieces above the board */
.pieces-bar { flex: none; display: flex; gap: 8px; align-items: center; min-width: 0; }
.ticked { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 2px 0; }
.tchip { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-height: var(--tap); max-width: 210px; padding: 3px 12px 3px 3px;
  border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.tchip:active { background: var(--blush); }
.tchip-img { flex: none; width: 42px; height: 42px; background: var(--white); overflow: hidden; }
.tchip-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tchip-text { display: flex; flex-direction: column; min-width: 0; }
.tchip-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tchip-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
#btn-pieces { flex: none; }

/* lane L: one main piece large, the other ticked pieces as small tiles alongside (a column on the right in
   landscape, a row under the main piece in portrait). In the main spot the worn picture is the large picture once it
   has arrived; the stone and the other picture sit in the column beside it, with Keep, New take and Full screen. */
.board { flex: 1; min-height: 0; display: grid; gap: 10px; }
.board.featured { grid-template-columns: minmax(0, 1fr) 120px; grid-template-rows: minmax(0, 1fr); }
.board.featured.solo { grid-template-columns: minmax(0, 1fr); }
.board-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; border: 1px dashed var(--line); }
.board-empty p, .mpic .placeholder { color: var(--faint); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; text-align: center; padding: 12px; }

.mspot { min-width: 0; min-height: 0; display: grid; gap: 10px; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr); grid-template-areas: "side hero"; }
.mhero, .mpic { position: relative; min-width: 0; min-height: 0; margin: 0; background: var(--white); border: 1px solid var(--line);
  overflow: hidden; display: flex; align-items: center; justify-content: center; }
.mhero { grid-area: hero; }
.mhero > img, .mpic > img, .spic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mpic > img.cover { object-fit: cover; }
.mhero.ok, .msecond.ok { cursor: pointer; }
.mhero.dim > img, .mpic.dim > img, .spic.dim > img { opacity: .28; filter: grayscale(.4); }
.mhero.before > img, .mpic.before > img, .spic.before > img { opacity: .55; }
.mnote { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3; background: rgba(255,255,255,.96); border: 1px solid var(--tan);
  padding: 10px 12px; font-size: 14px; line-height: 1.3; }
.mside { grid-area: side; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.mpics { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.mstone { flex: 0.55 1 0; }
.msecond { flex: 1 1 0; }
.mspot.no-second .mstone { flex: 0 1 auto; aspect-ratio: 1 / 1; max-height: 100%; }
.mpic .stack, .present-img .stack { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 1px; background: var(--line); }
.mpic .stack > div, .present-img .stack > div { position: relative; flex: 1; overflow: hidden; background: var(--white); }
.mpic .stack img, .present-img .stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* the stone photos are square with the stone in the middle: shown whole, never cropped through the stone */
.mstone > img.cover, .mstone .stack img { object-fit: contain; }
.mstone .stack { flex-direction: row; gap: 2px; background: var(--white); }
/* lane Q: the one-call worn half is drawn by the model, not his model's photograph: said in small type for the jeweller */
.mhero .wcap { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 2; font-size: 10px; letter-spacing: .1em; white-space: nowrap;
  text-transform: uppercase; color: var(--muted); background: rgba(255,255,255,.82); padding: 2px 6px; pointer-events: none; }
.present-pair figcaption.drawn { font-size: 11px; }
.mworn { background: #fbf9f7; }
.mworn .bw-note { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); text-align: center; padding: 10px; }
.mworn.failed { border-color: var(--tan); }
.mworn-note { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; font-size: 13px; line-height: 1.3; text-align: center; color: #8a1b2e; }
.mworn-note .btn.small { min-height: 44px; padding: 0 14px; font-size: 12px; color: var(--ink); }
.mcap { flex: none; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-height: 15px; }
.mctl { flex: none; display: flex; flex-wrap: wrap; gap: 6px; }
.mctl .btn.small { flex: 1 1 auto; min-height: 44px; padding: 0 10px; font-size: 12px; letter-spacing: .08em; }
.mctl .keep[aria-pressed="true"] { border-color: var(--mulberry); color: var(--mulberry); background: var(--blush); }
.mctl .retry { border-color: var(--mulberry); color: var(--mulberry); }

.bprogress { position: absolute; left: 8px; right: 8px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column;
  align-items: center; gap: 6px; background: rgba(255,255,255,.9); padding: 12px 8px; text-align: center; z-index: 2; }
.bprogress .bp-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.bprogress .bp-secs { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bprogress .progress-track { align-self: stretch; }
.progress-track { height: 2px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--mulberry); transition: width .5s linear; }

.strip { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.stile { position: relative; flex: 1 1 0; min-height: 72px; max-height: 150px; border: 1px solid var(--line); background: var(--white);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform .06s; }
.stile:active { transform: scale(.97); }
.stile.failed { border-color: var(--tan); }
.spic { position: absolute; inset: 0 0 16px 0; }
.stile-label { position: absolute; left: 5px; right: 5px; bottom: 2px; font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sprog { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; z-index: 2; }
.sprog .bp-label { display: none; }
.sprog .bp-secs { font-size: 12px; color: var(--ink); background: rgba(255,255,255,.88); padding: 1px 6px; white-space: nowrap; }
.sprog .progress-track { width: 70%; }
.sworn { position: absolute; right: 3px; bottom: 18px; height: 58%; aspect-ratio: 1 / 1; background: var(--white);
  border: 2px solid var(--white); box-shadow: 0 1px 5px rgba(25,25,25,.22); overflow: hidden; z-index: 3;
  display: flex; align-items: center; justify-content: center; }
.sworn > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sworn.pending, .sworn.running, .sworn.failed { background: #fbf9f7; border-color: var(--line); box-shadow: none; }
.sworn .bw-note { font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: center; padding: 2px; }
.sworn.failed .bw-note { color: #8a1b2e; }
.sworn .sprog .bp-secs { font-size: 10px; padding: 0 3px; }
.skept { position: absolute; top: 1px; left: 5px; z-index: 3; font-size: 15px; color: var(--mulberry); }
/* the retry is a corner button, so a tap anywhere else on a failed tile still shows it large (and costs nothing) */
.stile .sretry { position: absolute; left: 0; top: 0; z-index: 4; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0;
  font-size: 20px; letter-spacing: 0; border: 0; border-right: 1px solid var(--tan); border-bottom: 1px solid var(--tan);
  background: rgba(255,255,255,.96); border-radius: 0; color: var(--mulberry); }
.snote { position: absolute; top: 4px; left: 50px; right: 4px; z-index: 3; font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: #8a1b2e; line-height: 1.2; }
.tchip.is-main { border-color: var(--mulberry); box-shadow: 0 0 0 1px var(--mulberry); }

@media (orientation: portrait) {
  .board.featured { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 96px; }
  .board.featured.solo { grid-template-rows: minmax(0, 1fr); }
  .mpics { flex-direction: row; }
  .mstone .stack { flex-direction: column; }
  .strip { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .stile { min-width: 96px; max-width: 170px; min-height: 0; max-height: none; }
}

.actions { flex: none; display: flex; gap: 14px; align-items: center; }
.actions .btn.primary { min-width: 240px; min-height: 52px; font-size: 15px; }
.run-cost { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.heart { font-size: 18px; letter-spacing: 0; line-height: 1; }

/* sheets and overlays */
.scrim { position: fixed; inset: 0; background: rgba(25, 25, 25, .28); z-index: 20; }
.sheet { position: fixed; z-index: 30; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 40px));
  max-height: calc(100dvh - 80px); background: var(--paper); border: 1px solid var(--line); display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(25,25,25,.16); }
.sheet.small-sheet { width: min(480px, calc(100vw - 40px)); }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 22px;
  border-bottom: 1px solid var(--line); }
.sheet-head-actions { display: flex; gap: 8px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 22px 22px; }
.sheet-body.grid { padding: 18px 22px 22px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.chips-wrap .btn.chip { text-transform: none; letter-spacing: .02em; font-size: 15px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.08); }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.row-center { display: flex; justify-content: center; margin-top: 24px; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.hcard { position: relative; border: 1px solid var(--line); background: var(--white); padding: 0; font: inherit; text-align: left; color: var(--ink);
  cursor: pointer; display: flex; flex-direction: column; }
.hcard .hpair { display: grid; grid-template-columns: 1fr 2fr; gap: 1px; background: var(--line); }
.hcard .hpair > div { aspect-ratio: 1 / 2; background: var(--white); overflow: hidden; position: relative; }
.hcard .hpair > div:last-child { aspect-ratio: 1 / 1; }
.hcard .hpair img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hcard .hpair > div:last-child img { object-fit: contain; }
.hcard .hpair.with-worn { grid-template-columns: 1fr 1.5fr 1.5fr; }
.hcard .hpair.with-worn > div, .hcard .hpair.with-worn > div:last-child { aspect-ratio: 3 / 4; }
.hcard .hpair.with-worn > div:not(:first-child) img { object-fit: contain; }
.hcard .hmeta { padding: 8px 10px; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.hcard .hstate { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.hcard .hlike { position: absolute; top: 4px; right: 4px; min-height: 44px; min-width: 44px; border: 0; background: rgba(255,255,255,.85);
  font-size: 22px; color: var(--mulberry); }

.overlay { position: fixed; inset: 0; z-index: 40; background: var(--paper); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.overlay-inner { max-width: 860px; margin: 0 auto; padding: 28px 32px 40px; }
.overlay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lead { font-size: 18px; color: var(--muted); margin: 6px 0 18px; }
.email-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; }
.eitem { position: relative; border: 1px solid var(--line); background: var(--white); padding: 0; cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.eitem img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; display: block; }
.eitem .ecap { font-size: 12px; padding: 6px 8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eitem .etick { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--white); display: flex; align-items: center; justify-content: center; font-size: 16px; color: transparent; }
.eitem.on { border-color: var(--mulberry); box-shadow: 0 0 0 1px var(--mulberry); }
.eitem.on .etick { background: var(--mulberry); border-color: var(--mulberry); color: var(--paper); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field input { height: 52px; border: 1px solid var(--line); background: var(--white); font-size: 19px; font-weight: 300; padding: 0 14px;
  border-radius: var(--radius); color: var(--ink); -webkit-appearance: none; appearance: none; }
.field input:focus { outline: none; border-color: var(--mulberry); }
.check { display: flex; gap: 12px; align-items: center; min-height: var(--tap); font-size: 16px; cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--mulberry); flex: none; }
.error { color: #8a1b2e; font-size: 15px; margin: 8px 0 0; }
.thanks { text-align: center; padding: 60px 0; }
.thanks-title { font-weight: 100; font-size: 40px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }

.present { background: var(--white); display: flex; align-items: center; justify-content: center; }
.present-pair { width: 100%; height: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 40px 40px 80px; }
.present-pair figure { margin: 0; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.present-img { flex: 1; min-height: 0; position: relative; }
.present-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.present-pair figcaption { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; }
.present-actions { position: absolute; right: 20px; bottom: 20px; display: flex; gap: 10px; }
#present-like[aria-pressed="true"] { border-color: var(--mulberry); color: var(--mulberry); background: var(--blush); }
.present-pair.has-worn { grid-template-columns: 0.8fr 1fr 1fr; gap: 20px; padding: 32px 28px 80px; }
@media (orientation: portrait) {
  .present-pair { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  /* full screen, portrait: the stone and the piece on top, the piece worn large below */
  .present-pair.has-worn { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1.25fr); padding: 28px 24px 80px; }
  .present-pair.has-worn #present-worn-fig { grid-column: 1 / -1; }
}

.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--paper);
  padding: 12px 18px; font-size: 15px; max-width: 80vw; }

/* login */
.login-page { align-items: center; justify-content: center; }
.login { width: min(420px, calc(100vw - 48px)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.login-form { width: 100%; margin-top: 40px; text-align: left; display: flex; flex-direction: column; }
.login-form .btn { margin-top: 8px; min-height: 52px; }

/* portrait sizing: the top bar loses the sub-title and tightens */
@media (orientation: portrait) {
  .brand-sub { display: none; }
  .logo { height: 30px; }
  .mode-badge { padding: 6px 8px; margin-right: 4px; }
  .mode-badge .long { display: none; }
  .bar-actions .btn { padding: 0 10px; font-size: 13px; }
}
@media (max-width: 900px) and (orientation: landscape) {
  .slot { width: 250px; }
}

/* lane K: the piece picker and the seats of one piece */
.sheet.big-sheet { width: min(980px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); }
.pieces-count { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); align-self: center; margin-right: 6px; }
.psection { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 10px; }
.psection h3 { font-weight: 100; font-size: 18px; letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.psection-note { font-size: 12px; color: var(--muted); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 22px; }
.pcard { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0 0 8px; border: 1px solid var(--line); background: var(--white);
  border-radius: var(--radius); font: inherit; color: var(--ink); cursor: pointer; min-height: var(--tap); }
.pcard:active { transform: scale(.985); }
.pcard.on { border-color: var(--mulberry); box-shadow: 0 0 0 1px var(--mulberry); }
.pcard-img { display: block; aspect-ratio: 1 / 1; background: var(--white); overflow: hidden; }
.pcard-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pcard-title { font-size: 14px; padding: 6px 10px 0; line-height: 1.25; }
.pcard-sub { font-size: 12px; color: var(--muted); padding: 2px 10px 0; }
.pcard-tick { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--white); display: flex; align-items: center; justify-content: center; font-size: 16px; color: transparent; }
.pcard.on .pcard-tick { background: var(--mulberry); border-color: var(--mulberry); color: var(--paper); }
.seat-head { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; }
.seat-head-img { flex: none; width: 120px; height: 120px; background: var(--white); border: 1px solid var(--line); overflow: hidden; }
.seat-head-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.seat-row { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.seat-name { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.seat-now { font-size: 13px; color: var(--muted); }
.seat-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seat-chips .btn.chip { text-transform: none; letter-spacing: .02em; font-size: 14px; }
.seat-chips .btn.chip.variant { font-size: 13px; }
.stone-chip { padding-left: 4px; }
.stone-chip[disabled] { opacity: 1; }
.sc-img { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none; background: #eceae6; }
.sc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.seat-hint { font-size: 13px; color: var(--muted); }
@media (orientation: portrait) {
  .pieces-bar .tchip { max-width: 180px; }
  .actions .btn.primary { min-width: 220px; }
}

/* lane N: the picker by kind and collection, its search, trust marks, the settings sheet and the lot */
.psearch { display: flex; gap: 8px; align-items: center; padding: 0 20px 10px; }
.psearch input { flex: 1; min-height: var(--tap); font: inherit; font-size: 16px; padding: 0 14px; border: 1px solid var(--line); background: var(--white); border-radius: 0; }
.psearch .btn.icon { min-width: var(--tap); min-height: var(--tap); }
.psearch input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.psub { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 2px 0 8px; }
.pcard.off { opacity: .55; }
.pcard.off .pcard-tick { display: none; }
.trust { display: inline-block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 2px 10px 0; }
.trust.tested { color: var(--muted); }
.seat-name .trust, .btn.chip .trust { padding: 0 0 0 8px; }
.seat-head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.seat-head-text .trust { padding: 0; }
.seat-group-title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mulberry); margin: 14px 0 2px; }
.seat-row.inlay { opacity: .7; }
.stone-chip.lot { height: auto; min-height: var(--tap); padding-top: 4px; padding-bottom: 4px; }
.sc-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.sc-lot { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.lot-note { font-size: 13px; color: var(--mulberry); }
