/* CHIQUE Summer 2027 review — built on the Replenishment Center tokens
   (navy on white, Inter + Outfit, hairline borders, the 32px net grid),
   warmed for summer: the amber accent becomes the sun. */
:root {
  --paper: #ffffff;
  --sand: #fbf6ea;
  --sand-2: #f4ecd8;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #475569;
  --soft: #64748b;
  --sun: #f5b301;
  --sun-deep: #d99a00;
  --sun-soft: #fff4cc;
  --leaf: #15803d;
  --leaf-soft: #e7f5ec;
  --rust: #c2410c;
  --rust-soft: #fdece3;
  --line: #ebe4d3;
  --line-strong: #d9cfb8;
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --sh-frame: 0 18px 40px -18px rgba(15, 23, 42, .35), 0 2px 6px rgba(15, 23, 42, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --flip: 560ms;
  --flip-ease: cubic-bezier(.5, .05, .3, 1);   /* visible turn, quick settle */
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--sand-2);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow: hidden; overscroll-behavior: none;
}
h1, h2, h3 { font-family: "Outfit", sans-serif; letter-spacing: -.015em; line-height: 1.1; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ stage + page flip */
#stage { position: fixed; inset: 0; perspective: 2200px; perspective-origin: 0% 50%; overflow: hidden; }
.page {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, .13) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, .13) 1px, transparent 1px);
  background-size: 32px 32px;
  transform-origin: 0% 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overscroll-behavior: contain;
  scroll-padding-top: 76px; scroll-padding-bottom: 100px;   /* keep focused/scrolled items clear of the sticky bars */
}
.page.turning { pointer-events: none; will-change: transform; z-index: 3; }
.page .shade {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, .28) 100%);
}
.page.under .shade { background: rgba(15, 23, 42, .18); }
/* forward: the current page lifts away around its left edge, revealing the next */
.page.turn-out { animation: turnOut var(--flip) var(--flip-ease) forwards; }
.page.turn-out .shade { animation: shadeIn var(--flip) var(--flip-ease) forwards; }
/* back: the previous page swings back in over the current one */
.page.turn-in { animation: turnIn var(--flip) var(--flip-ease) forwards; }
.page.turn-in .shade { animation: shadeOut var(--flip) var(--flip-ease) forwards; }
.page.under .shade { animation: underLight var(--flip) var(--flip-ease) forwards; }
.page.under.dim .shade { animation: underDim var(--flip) var(--flip-ease) forwards; }
@keyframes turnOut { from { transform: rotateY(0); } to { transform: rotateY(-96deg); } }
@keyframes turnIn { from { transform: rotateY(-96deg); } to { transform: rotateY(0); } }
@keyframes shadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes underLight { from { opacity: 1; } to { opacity: 0; } }
@keyframes underDim { from { opacity: 0; } to { opacity: 1; } }
.page.fade-in { animation: fadeIn 160ms ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------------ shared bits */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 14px;
  font-family: "Outfit", sans-serif; font-weight: 700; font-size: 1.05rem;
  transition: transform .12s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
  touch-action: manipulation; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-ink { background: var(--ink); color: #fff; box-shadow: 0 10px 22px -12px rgba(15, 23, 42, .6); }
.btn-ink:hover { background: var(--ink-2); }
.btn-ghost { background: #fff; border: 1px solid var(--line-strong); color: var(--ink); }
.btn-sun { background: var(--sun); color: var(--ink); box-shadow: 0 10px 24px -12px rgba(217, 154, 0, .9); }
.btn-sun:hover { background: #ffc21f; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .ico { width: 20px; height: 20px; flex: none; }
.linkish { color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 60;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-weight: 600; font-size: .92rem;
  padding: 12px 18px; border-radius: 12px; max-width: calc(100vw - 32px); text-align: center;
  box-shadow: 0 12px 30px -12px rgba(15, 23, 42, .6); transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ welcome */
.welcome {
  height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: max(14px, env(safe-area-inset-top)) 20px calc(16px + var(--safe-b)); position: relative; overflow: hidden;
}
.welcome .logo { width: clamp(60px, 10.5vh, 112px); height: auto; position: relative; z-index: 2; flex: none; }
/* The hero fills the height left over by the logo, text and button, so the whole
   welcome always fits the first screen — no scrolling on any phone. */
.hero { flex: 1 1 0; min-height: 96px; width: 100%; margin: 4px 0; container-type: size; display: flex; align-items: center; justify-content: center; }
.hero-in { position: relative; width: min(92vw, 34vh, 440px); width: min(100cqw, 100cqh, 440px); aspect-ratio: 1; }
.sun { position: absolute; left: 50%; top: 52%; width: 74%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.sun.solo { top: 50%; width: 66%; }
.sun .disc .sun-mark { position: absolute; left: 50%; top: 50%; width: 44%; height: auto; transform: translate(-50%, -54%); }
.sun .rays { position: absolute; inset: -22%; animation: spin 70s linear infinite; opacity: .9; }
.sun .disc {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff1b8 0%, #ffd23f 38%, var(--sun) 64%, var(--sun-deep) 100%);
  box-shadow: 0 0 60px 10px rgba(245, 179, 1, .35), 0 0 140px 40px rgba(245, 179, 1, .18);
  animation: rise 1.4s var(--ease) both;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { transform: translateY(26%) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.polaroid {
  position: absolute; top: 50%; left: 50%; width: 34%; background: #fff; padding: 6px 6px 22px;
  border-radius: 4px; box-shadow: var(--sh-frame); transform-origin: 50% 90%;
  animation: deal .9s var(--ease) both;
}
.polaroid img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; border-radius: 2px; background: var(--sand); }
.polaroid.p1 { --r: -13deg; --x: -118%; --y: -44%; animation-delay: .35s; }
.polaroid.p2 { --r: 2deg; --x: -50%; --y: -58%; animation-delay: .5s; z-index: 2; }
.polaroid.p3 { --r: 14deg; --x: 18%; --y: -42%; animation-delay: .65s; }
.polaroid { transform: translate(var(--x), var(--y)) rotate(var(--r)); }
@keyframes deal {
  from { opacity: 0; transform: translate(-50%, -10%) rotate(0deg) scale(.8); }
  to { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
}
.motes { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.mote { position: absolute; color: var(--sun); opacity: .35; animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(0, 0) rotate(0); } to { transform: translate(10px, -14px) rotate(20deg); } }
.welcome h1 { font-size: clamp(1.9rem, min(10.5vw, 6.2vh), 4.2rem); font-weight: 800; position: relative; z-index: 2; margin-top: 2px; flex: none; }
.welcome.finish h1 { font-size: clamp(1.7rem, min(8.4vw, 5vh), 3.2rem); max-width: 16ch; }
.welcome h1 .yr { display: block; font-weight: 300; font-size: .52em; letter-spacing: .02em; color: var(--muted); margin-top: 2px; }
.welcome .lede { max-width: 32ch; color: var(--muted); font-size: clamp(.9rem, 2.2vh, 1.02rem); line-height: 1.45; margin: clamp(6px, 1.5vh, 14px) auto clamp(10px, 2.4vh, 22px); position: relative; z-index: 2; flex: none; }
.welcome .cta { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; max-width: 340px; flex: none; }
.welcome .cta.quiet { gap: 0; }
.welcome .cta .btn { width: 100%; }
.welcome .fine { font-size: .8rem; color: var(--soft); margin-top: 8px; position: relative; z-index: 2; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: max(28px, env(safe-area-inset-top)) 22px calc(28px + var(--safe-b)); }
.login .card { width: 100%; max-width: 420px; margin: 0 auto; }
.login .mark { width: 44px; height: auto; margin-bottom: 26px; }
.login h2 { font-size: 2rem; font-weight: 800; }
.login .sub { color: var(--muted); margin: 10px 0 26px; line-height: 1.5; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.field input {
  width: 100%; height: 54px; padding: 0 16px; border-radius: 12px; font-size: 1.05rem;
  border: 1px solid var(--line-strong); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(245, 179, 1, .28); }
.field.err input { border-color: var(--rust); }
.field .msg { color: var(--rust); font-size: .82rem; margin-top: 6px; min-height: 1em; }
.login .btn { width: 100%; margin-top: 8px; }
.steps { list-style: none; margin-top: 26px; display: grid; gap: 10px; color: var(--muted); font-size: .9rem; }
.steps li { display: flex; gap: 10px; align-items: flex-start; }
.steps svg { flex: none; width: 18px; height: 18px; color: var(--sun-deep); margin-top: 1px; }

/* ------------------------------------------------------------------ top bar + bottom bar */
.topbar {
  position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar .row { display: flex; align-items: center; gap: 12px; height: 58px; }
.topbar .mark { width: 26px; height: auto; flex: none; }
.topbar .where { flex: 1; min-width: 0; }
.topbar .where b { font-family: "Outfit"; font-weight: 700; font-size: 1rem; }
.topbar .where small { display: block; color: var(--soft); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 3px; background: var(--sand-2); }
.progress i { display: block; height: 100%; background: var(--sun); transition: width .4s var(--ease); }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--soft); white-space: nowrap; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); flex: none; }
.sync.saving .dot { background: var(--sun); animation: pulse 1s ease-in-out infinite; }
.sync.offline .dot, .sync.error .dot { background: var(--rust); }
@keyframes pulse { 50% { opacity: .35; } }
.iconbtn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; flex: none; }
.iconbtn svg { width: 20px; height: 20px; }

.bottombar {
  position: sticky; bottom: 0; z-index: 10; background: rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding: 10px 0 calc(10px + var(--safe-b));
}
.bottombar .row { display: flex; gap: 10px; }
.bottombar .btn { min-height: 54px; }
.bottombar .back { flex: 0 0 auto; padding: 0 18px; }
.bottombar .next { flex: 1; }
.bottombar .next.ready { background: var(--ink); }

/* ------------------------------------------------------------------ style page */
.style-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 18px; padding-bottom: 26px; }
.style-grid > * { min-width: 0; }   /* a wide photo must never widen the page */
.frame {
  position: relative; background: #fff; border-radius: 6px; padding: 12px; box-shadow: var(--sh-frame);
  border: 1px solid var(--line);
}
.frame .mat {
  position: relative; background: var(--sand); border-radius: 2px; display: grid; place-items: center;
  width: 100%; min-height: 240px; max-height: min(56vh, 540px); overflow: hidden; cursor: zoom-in;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .05), inset 0 6px 14px -8px rgba(15, 23, 42, .25);
}
.frame .mat img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.frame .zoom { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .9); display: grid; place-items: center; box-shadow: var(--sh-sm); }
.frame .zoom svg { width: 18px; height: 18px; }
.frame .caption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 4px 2px; }
.frame .caption .num { font-family: "Outfit"; font-weight: 600; color: var(--soft); font-size: .9rem; }
.frame .caption .month { font-size: .85rem; font-weight: 600; color: var(--sun-deep); }

.id h2 { font-size: clamp(1.9rem, 8vw, 2.5rem); font-weight: 800; word-break: break-word; }
.id .by { color: var(--muted); margin-top: 6px; font-size: .98rem; }
.id h2 .of { font-size: .5em; font-weight: 600; color: var(--soft); letter-spacing: 0; }
.id .mrp { font-family: "Outfit"; font-weight: 700; font-size: 1.3rem; margin-top: 6px; }
.id .mrp.none { font-family: "Inter"; font-weight: 600; font-size: .95rem; color: var(--soft); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ink); background: var(--sun-soft); border: 1px solid #fbe39a; border-radius: 999px; padding: 4px 10px; margin-top: 12px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.specs div { padding: 12px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.specs div:nth-child(odd) { border-right: 1px solid var(--line); }
.specs div.wide { grid-column: 1 / -1; border-right: 0; }
.specs dt { font-size: .76rem; color: var(--soft); font-weight: 600; }
.specs dd { font-weight: 600; font-size: .98rem; margin-top: 3px; overflow-wrap: anywhere; line-height: 1.35; }
.specs .last-row { border-bottom: 0; }

.qs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }   /* the month wheel must scroll, not widen the page */
.qs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 4px; }
.qs-head h3 { font-size: 1.35rem; font-weight: 800; }
.qs-head span { color: var(--soft); font-size: .85rem; }
.q { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; transition: border-color .2s, box-shadow .2s; }
.q.need { border-color: var(--rust); box-shadow: 0 0 0 4px var(--rust-soft); }
.q.shake { animation: shake .42s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.q h4 { font-family: "Outfit"; font-weight: 700; font-size: 1.08rem; display: flex; justify-content: space-between; gap: 10px; }
.q h4 .req { font-family: "Inter"; font-size: .74rem; font-weight: 600; color: var(--soft); }
.q.answered h4 .req { color: var(--leaf); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.scale button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px 9px; min-height: 76px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--paper);
  font-size: .72rem; font-weight: 600; color: var(--muted); line-height: 1.15; text-align: center;
  transition: background .15s, border-color .15s, color .15s, transform .1s; touch-action: manipulation;
}
.scale button:active { transform: scale(.95); }
.scale button svg { width: 28px; height: 28px; }
.scale button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.scale button[aria-pressed="true"] svg .core { fill: var(--sun); }
.scale button[aria-pressed="true"] svg .ray { stroke: var(--sun); }

/* Production-month wheel: a snap-scrolling strip; the middle slot is marked. */
.wheel-wrap { position: relative; margin-top: 12px; }
.wheel-wrap::after {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 80px; transform: translateX(-50%);
  border: 2px dashed var(--line-strong); border-radius: 16px; pointer-events: none;
}
.wheel {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 4px calc(50% - 36px); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%);
}
.wheel::-webkit-scrollbar { display: none; }
.wm {
  flex: 0 0 72px; height: 72px; scroll-snap-align: center; border-radius: 14px; border: 1px solid var(--line);
  background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s, transform .1s; touch-action: pan-x;
}
.wm b { font-family: "Outfit"; font-weight: 800; font-size: 1.2rem; }
.wm small { font-size: .7rem; font-weight: 600; color: var(--soft); }
.wm:active { transform: scale(.95); }
.wm[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--sun); position: relative; z-index: 1; }
.wm[aria-pressed="true"] small { color: #fff4cc; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; font-weight: 600; font-size: .9rem; touch-action: manipulation;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.chip svg { width: 16px; height: 16px; display: none; }
.good .chip[aria-pressed="true"] { background: var(--leaf-soft); border-color: var(--leaf); color: var(--leaf); }
.bad .chip[aria-pressed="true"] { background: var(--rust-soft); border-color: var(--rust); color: var(--rust); }
.chip[aria-pressed="true"] svg { display: block; }
.chip.taken { opacity: .38; }
.note { width: 100%; min-height: 84px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; resize: vertical; font-size: 1rem; line-height: 1.45; background: var(--paper); }
.note:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(245, 179, 1, .25); }
.q .hint { color: var(--soft); font-size: .84rem; margin-top: 4px; }

/* ------------------------------------------------------------------ month splash, summary, done */
.splash { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px 24px calc(40px + var(--safe-b)); position: relative; overflow: hidden; }
.splash .big { font-family: "Outfit"; font-weight: 800; font-size: clamp(3rem, 16vw, 6rem); line-height: .95; position: relative; }
.splash .big small { display: block; font-weight: 300; font-size: .34em; color: var(--muted); margin-top: 10px; }
.splash p { color: var(--muted); margin: 18px 0 28px; max-width: 32ch; line-height: 1.5; position: relative; }
.splash .btn { min-width: 240px; position: relative; }
.splash .sunset { position: absolute; left: 50%; bottom: -34vmin; width: 90vmin; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 50% 40%, #ffe07a, var(--sun) 60%, var(--sun-deep)); opacity: .28; }

.sum-head { padding: 22px 0 8px; }
.sum-head h2 { font-size: 1.8rem; font-weight: 800; }
.sum-head p { color: var(--muted); margin-top: 6px; }
.month-h { font-family: "Outfit"; font-weight: 700; font-size: 1.05rem; margin: 20px 0 10px; display: flex; justify-content: space-between; }
.month-h span { font-family: "Inter"; font-size: .82rem; color: var(--soft); font-weight: 600; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.thumb { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 5px 5px 7px; text-align: left; transition: border-color .15s, transform .1s; }
.thumb:active { transform: scale(.97); }
.thumb img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: var(--sand); display: block; }
.thumb b { display: block; font-size: .72rem; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb small { color: var(--soft); font-size: .68rem; }
.thumb .st { position: absolute; top: 9px; right: 9px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line-strong); }
.thumb.ok .st { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.thumb.ok .st svg { width: 13px; height: 13px; }
.thumb.cur { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.submit-box { margin: 26px 0 8px; padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.submit-box p { color: var(--muted); font-size: .92rem; margin-bottom: 14px; line-height: 1.5; }
.submit-box .btn { width: 100%; }

/* ------------------------------------------------------------------ lightbox + sheet */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .94); display: none; align-items: center; justify-content: center; padding: 16px; }
.lightbox.open { display: flex; animation: fadeIn .18s ease; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lightbox .x { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; }
.lightbox .x svg { width: 22px; height: 22px; }

.dialog-back { position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, .45); display: none; align-items: flex-end; justify-content: center; }
.dialog-back.open { display: flex; animation: fadeIn .15s ease; }
.dialog { background: #fff; width: 100%; max-width: 460px; border-radius: 20px 20px 0 0; padding: 22px 20px calc(20px + var(--safe-b)); animation: sheetUp .22s var(--ease); }
.dialog h3 { font-size: 1.3rem; font-weight: 800; }
.dialog p { color: var(--muted); margin: 8px 0 18px; line-height: 1.5; }
.dialog .row { display: flex; gap: 10px; }
.dialog .row .btn { flex: 1; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ desktop */
@media (min-width: 960px) {
  .style-grid { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 28px; }
  .style-grid .left { position: sticky; top: 90px; }
  .frame .mat { max-height: min(64vh, 640px); }
  .bottombar .row { max-width: 560px; margin-left: auto; }
  .dialog-back { align-items: center; }
  .dialog { border-radius: 20px; }
}
/* Phones held sideways (very short screens): let the welcome scroll rather than clip. */
@media (max-height: 520px) {
  .welcome { height: auto; min-height: 100%; overflow: visible; }
  .hero { flex: none; height: max(150px, 44vh); }
}
@media (max-width: 370px) {
  .scale button { font-size: .66rem; min-height: 70px; }
  .scale button svg { width: 24px; height: 24px; }
  .topbar .sync .txt { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
