/* Takcheeta end-user app prototype — a light couture SPA inside a phone frame,
   set on the dark lab stage. Distinct from the dark lab chrome by design. */

:root {
  --stage: #14110e;
  --c-bg: #f6efe3;
  --c-card: #fffdf9;
  --c-ink: #2b2218;
  --c-dim: #897b64;
  --c-faint: #b3a48c;
  --c-line: #e8ddc9;
  --c-gold: #b0863a;
  --c-gold-soft: #d9b97e;
  --c-emerald: #1f6b52;
  --c-emerald-deep: #134236;
  --serif: "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans: -apple-system, "SF Pro Text", system-ui, sans-serif;
  --mono: "SF Mono", "DM Mono", ui-monospace, "Roboto Mono", monospace;
  --shadow: 0 10px 30px rgba(20, 14, 6, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #221c15, var(--stage));
  color: #e8ddc9; font-family: var(--sans);
  min-height: 100%; display: flex; flex-direction: column; align-items: center;
}

/* ---------- stage chrome ---------- */
.stage { width: 100%; max-width: 520px; padding: 22px 16px 50px; }
.stage-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.brand .mark { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--c-gold-soft); }
.brand .sub { display: block; font-size: 11px; letter-spacing: .04em; color: #9a8c74; margin-top: 2px; }
.stage-links { display: flex; align-items: center; gap: 10px; }
.stage-links a { color: #9a8c74; font-size: 12px; text-decoration: none; }
.stage-links a:hover { color: var(--c-gold-soft); }
.ghost { background: none; border: 1px solid #3a322a; color: #b3a48c; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.ghost:hover { border-color: var(--c-gold); color: var(--c-gold-soft); }
.stage-note { text-align: center; color: #7a6e5a; font-size: 11px; margin-top: 14px; }

/* ---------- phone ---------- */
.phone {
  position: relative; width: 390px; height: 800px; margin: 0 auto;
  background: var(--c-bg); border-radius: 46px; overflow: hidden;
  border: 10px solid #0c0a08; box-shadow: var(--shadow), 0 0 0 2px #2b2620;
}
.notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 150px; height: 26px; background: #0c0a08; border-radius: 0 0 18px 18px; z-index: 20; }
.statusbar { position: absolute; top: 0; left: 0; right: 0; height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; font-size: 13px; font-weight: 600; color: var(--c-ink); z-index: 15; }
.sb-time { letter-spacing: .02em; }
.sb-icons { font-size: 12px; letter-spacing: 2px; opacity: .8; }
.homebar { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 130px; height: 5px; border-radius: 3px; background: rgba(40,32,22,.35); z-index: 20; }

.viewport { position: absolute; inset: 44px 0 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.viewport::-webkit-scrollbar { width: 0; }
.screen { min-height: 100%; display: flex; flex-direction: column; }

/* ---------- shared UI ---------- */
.pad { padding: 8px 22px 30px; }
.eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--c-gold); font-weight: 600; }
h1.title { font-family: var(--serif); font-weight: 600; font-size: 27px; line-height: 1.15; color: var(--c-ink); margin: 8px 0 6px; }
.lead { color: var(--c-dim); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.section-title { font-family: var(--serif); font-size: 16px; color: var(--c-ink); margin: 22px 0 9px; display: flex; align-items: center; gap: 8px; }
.moat-badge { font: 9px var(--sans); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--c-emerald); padding: 2px 7px; border-radius: 99px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px; border-radius: 15px; border: none; font-size: 15px; font-weight: 600;
  font-family: var(--sans); cursor: pointer; transition: .15s;
}
.btn.primary { background: var(--c-emerald); color: #fdfbf4; box-shadow: 0 8px 18px rgba(31,107,82,.28); }
.btn.primary:active { transform: scale(.985); }
.btn.primary:disabled { background: #cdc4b2; color: #f3eee2; box-shadow: none; }
.btn.soft { background: var(--c-card); color: var(--c-ink); border: 1px solid var(--c-line); }
.btn.ghosty { background: none; color: var(--c-dim); }

/* sticky footer action inside a screen */
.screen-foot { margin-top: auto; padding: 16px 22px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, var(--c-bg) 70%, transparent); position: sticky; bottom: 0; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 6px 18px 2px; }
.back { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--c-line); background: var(--c-card); color: var(--c-ink); font-size: 17px; cursor: pointer; display: grid; place-items: center; }
.topbar .step { font-size: 12px; color: var(--c-faint); margin-left: auto; letter-spacing: .04em; }

/* progress dots */
.dots { display: flex; gap: 6px; padding: 4px 22px 0; }
.dot { height: 4px; flex: 1; border-radius: 3px; background: var(--c-line); }
.dot.on { background: var(--c-gold); }

/* ---------- welcome ---------- */
.welcome { background: linear-gradient(170deg, #20503f, var(--c-emerald-deep) 60%, #0f2c23); color: #f4ebd8; flex: 1; height: 100%; position: relative; overflow: hidden; }

/* ---------- login mosaic: angled, infinite wall of creations ---------- */
.mosaic { position: absolute; inset: -28%; display: flex; gap: 9px; transform: rotate(-12deg) scale(1.36); transform-origin: center; z-index: 0; pointer-events: none; }
.mosaic-col { flex: 1; display: flex; flex-direction: column; gap: 9px; will-change: transform; }
.mosaic-col.down { animation: mosaic-down var(--dur, 80s) linear infinite; }
.mosaic-col.up { animation: mosaic-up var(--dur, 80s) linear infinite; }
.mosaic-col img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 9px; display: block; }
@keyframes mosaic-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }
@keyframes mosaic-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }
/* bottom-heavy so the top of the wall breathes and the editorial copy stays legible */
.mosaic-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10,18,14,.40) 0%, rgba(10,18,14,.12) 22%, rgba(9,16,13,.48) 54%, rgba(8,13,10,.88) 84%, rgba(7,12,9,.96) 100%); }
.welcome-content { position: relative; z-index: 2; }

/* ---------- editorial splash (idea ported from the onboarding design) ---------- */
.welcome-editorial { flex: 1; min-height: 100%; display: flex; flex-direction: column; padding: 52px 26px calc(34px + env(safe-area-inset-bottom)); }
.welcome-editorial .wmark-top { font-family: var(--serif); font-style: italic; font-size: 24px; color: #f0dcab; letter-spacing: .005em; }
.welcome-editorial .w-bottom { margin-top: auto; animation: tk-rise .6s cubic-bezier(.22,1,.36,1) both; }
.w-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--c-gold-soft); margin-bottom: 13px; }
.w-eyebrow .w-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-gold-soft); }
.w-head { font-family: var(--serif); font-weight: 600; font-size: 33px; line-height: 1.06; letter-spacing: -.01em; color: #f6f2ea; margin: 0; text-wrap: balance; }
.w-head em { font-style: italic; color: #f0dcab; }
.w-sub { color: #e0e6da; font-size: 15px; line-height: 1.5; margin: 14px 0 0; max-width: 332px; }
.welcome-editorial .signin-field { margin-top: 22px; }
.welcome-editorial .w-cta { margin-top: 14px; border-radius: 999px; padding: 16px; }
.welcome-editorial .signin-note { margin-top: 12px; }
@keyframes tk-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mosaic-col { animation: none !important; } .welcome-editorial .w-bottom { animation: none; } }
.welcome .pad { padding-top: 70px; display: flex; flex-direction: column; min-height: 100%; }
.welcome .wmark { font-family: var(--serif); font-style: italic; font-size: 40px; color: #f0dcab; }
.welcome .wsub { color: #cfe0d4; font-size: 14px; line-height: 1.55; margin: 12px 0 0; max-width: 80%; }
.welcome .hero-art { margin: 30px auto; width: 188px; height: 234px; border-radius: 18px; background: #faf6ee; border: 1px solid rgba(240,220,171,.45); display: grid; place-items: center; box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.welcome .hero-art img { width: 82%; height: 82%; object-fit: contain; }
.welcome .promise { display: flex; gap: 10px; align-items: center; color: #d8e6dc; font-size: 13px; margin-top: 6px; }
.welcome .promise b { color: #f0dcab; font-weight: 600; }
.welcome .screen-foot { background: none; margin-top: 26px; padding: 10px 0 0; }
.welcome .btn.primary { background: #f0dcab; color: #18382c; box-shadow: 0 8px 18px rgba(0,0,0,.25); }
.welcome .btn.ghosty { color: #bcd0c2; margin-top: 4px; }

/* ---------- capture cards ---------- */
.cap-grid { display: flex; flex-direction: column; gap: 12px; }
.cap-card {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px;
  background: var(--c-card); border: 1.5px solid var(--c-line); cursor: pointer; transition: .15s; text-align: left;
}
.cap-card:active { transform: scale(.99); }
.cap-card.done { border-color: var(--c-emerald); background: #f3f8f4; }
.cap-thumb { width: 64px; height: 80px; border-radius: 11px; background: #faf6ee; border: 1px dashed var(--c-gold-soft); display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; }
.cap-card.done .cap-thumb { border-style: solid; border-color: var(--c-emerald); }
.cap-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cap-meta { flex: 1; }
.cap-meta .cm-name { font-weight: 600; color: var(--c-ink); font-size: 15px; }
.cap-meta .cm-hint { color: var(--c-dim); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }
.cap-state { font-size: 13px; color: var(--c-faint); }
.cap-card.done .cap-state { color: var(--c-emerald); font-weight: 600; }

/* ---------- ready screen ---------- */
.ready { flex: 1; display: flex; flex-direction: column; }
.ready .seal { width: 110px; height: 110px; margin: 34px auto 0; border-radius: 50%; background: #f3f8f4; border: 1px solid var(--c-line); display: grid; place-items: center; }
.ready .seal img { width: 64%; height: 64%; object-fit: contain; }
.ready .check { margin: 14px auto 0; width: 30px; height: 30px; border-radius: 50%; background: var(--c-emerald); color: #fff; display: grid; place-items: center; font-size: 16px; }

/* ---------- brief builder ---------- */
.occ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.brief-hero {
  display: block; width: 100%; text-align: left; cursor: pointer; font-family: var(--sans);
  margin: 6px 0 4px; border: none; border-radius: 18px; padding: 18px; color: #f4ebd8; position: relative; overflow: hidden;
  background: linear-gradient(140deg, var(--hero-a, #1f6b52), var(--hero-b, #134236));
}
.brief-hero:active { transform: scale(.995); }
.brief-hero .bh-occ { text-decoration: none; }
.brief-hero .bh-occ { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.brief-hero .bh-name { font-family: var(--serif); font-size: 22px; margin-top: 4px; }
.brief-hero .bh-sub { font-size: 12.5px; opacity: .82; margin-top: 6px; }
.brief-hero .bh-icon { position: absolute; right: 14px; bottom: 14px; width: 58px; height: 58px; background: #faf6ee; border-radius: 13px; display: grid; place-items: center; box-shadow: 0 6px 14px rgba(0,0,0,.18); }
.brief-hero .bh-icon img { width: 84%; height: 84%; object-fit: contain; }

/* brief: untouched elements sit in a 2-up grid (icon + label); choosing a value
   expands that element to a full-width row showing the choice. */
.brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gtile {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 8px 12px; background: var(--c-card); border: 1px solid var(--c-line); border-radius: 16px;
  cursor: pointer; transition: .14s;
}
.gtile:hover { border-color: var(--c-gold-soft); box-shadow: var(--shadow); }
.gtile:active { transform: scale(.98); }
.gt-ic { width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.gt-ic img { width: 100%; height: 100%; object-fit: contain; }
.gt-ic .row-swatch { width: 54px; height: 54px; box-shadow: 0 0 0 1px var(--c-line), inset 0 0 0 3px #fff; }
.gt-label { font-size: 13px; color: var(--c-ink); text-align: center; font-weight: 600; line-height: 1.2; }
.brief-grid > .row { grid-column: 1 / -1; }
.row.just-picked { animation: expandRow .26s cubic-bezier(.2,.8,.3,1); }
@keyframes expandRow { from { transform: scale(.97); opacity: .35; } to { transform: scale(1); opacity: 1; } }

.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 14px;
  background: var(--c-card); border: 1px solid var(--c-line); cursor: pointer; transition: .12s; width: 100%; text-align: left;
}
.row:active { transform: scale(.99); }
.row:hover { border-color: var(--c-gold-soft); }
.row-ic { width: 50px; height: 50px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; }
.row-ic img { width: 100%; height: 100%; object-fit: contain; }
.row-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--c-line); }
.row-body { flex: 1; min-width: 0; }
.row-label { font-size: 13px; color: var(--c-dim); }
.row-value { font-size: 14.5px; color: var(--c-ink); font-weight: 600; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-chev { color: var(--c-faint); font-size: 18px; flex: 0 0 auto; }

/* ---------- mode choice (Designer / Style me) — full-height illustration cards ---------- */
.fill { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.choose-head { padding: 2px 22px 8px; flex: 0 0 auto; }
.choose-head .title { margin: 3px 0 0; font-size: 24px; }
.mode-stack { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 2px 20px 16px; }

.mode-card {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; width: 100%; text-align: left; padding: 0;
  border-radius: 20px; overflow: hidden; border: 1.5px solid var(--c-line);
  background: var(--c-card); cursor: pointer; transition: .15s; box-shadow: var(--shadow);
}
.mode-card:hover { border-color: var(--c-gold); }
.mode-card:active { transform: scale(.99); }
.mode-illus { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.mode-illus img { height: 100%; width: 100%; object-fit: contain; padding: 6px; }
.illus-warm { background: radial-gradient(120% 100% at 70% 10%, #f9f0da, #efdfbd); }
.illus-sage { background: radial-gradient(120% 100% at 30% 10%, #eef4ee, #d8e6db); }
.mode-badge {
  position: absolute; top: 12px; right: 12px; z-index: 2; background: var(--c-gold); color: #2e2206;
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px;
}
.mode-body { flex: 0 0 auto; padding: 11px 16px 13px; }
.mode-title { font-family: var(--serif); font-size: 18px; color: var(--c-ink); }
.mode-sub { font-size: 12.5px; color: var(--c-dim); margin-top: 4px; line-height: 1.45; }

/* ---------- profile / my creations ---------- */
.prof-head { display: flex; align-items: center; gap: 12px; padding: 4px 20px 12px; flex: 0 0 auto; }
.prof-ava { width: 48px; height: 48px; border-radius: 50%; background: #faf6ee; border: 1px solid var(--c-line); display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; }
.prof-ava img { width: 100%; height: 100%; object-fit: contain; }
.prof-name { font-family: var(--serif); font-size: 20px; color: var(--c-ink); }
.prof-sub { font-size: 12px; color: var(--c-dim); margin-top: 1px; }
.prof-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 20px 16px; }

.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.proj-card { padding: 0; text-align: left; border-radius: 16px; overflow: hidden; border: 1px solid var(--c-line); background: var(--c-card); cursor: pointer; transition: .14s; box-shadow: var(--shadow); }
.proj-card:active { transform: scale(.98); }
.proj-card:hover { border-color: var(--c-gold-soft); }
.proj-hero { position: relative; aspect-ratio: 3 / 3.4; display: grid; place-items: center; background: linear-gradient(150deg, var(--hero-a, #1f6b52), var(--hero-b, #134236)); }
.proj-hero-ic { width: 60%; height: 60%; background: #faf6ee; border-radius: 12px; display: grid; place-items: center; box-shadow: 0 6px 14px rgba(0,0,0,.16); }
.proj-hero-ic img { width: 84%; height: 84%; object-fit: contain; }
.proj-status { position: absolute; top: 8px; left: 8px; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: rgba(255,253,248,.92); color: var(--c-dim); }
.proj-status.ordered { background: var(--c-emerald); color: #fff; }
.proj-meta { padding: 10px 12px 12px; }
.proj-title { font-weight: 600; font-size: 13.5px; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-occ { font-size: 11.5px; color: var(--c-dim); margin-top: 2px; }

.prof-empty { text-align: center; color: var(--c-faint); padding: 50px 20px; }
.pe-ic { width: 88px; height: 88px; margin: 0 auto 14px; opacity: .5; }
.pe-ic img { width: 100%; height: 100%; object-fit: contain; }
.prof-empty p { font-size: 14px; line-height: 1.55; }

/* project detail */
.poses-head { font-family: var(--serif); font-size: 15px; color: var(--c-ink); margin: 18px 0 10px; }
.poses-head span { font-size: 12px; color: var(--c-dim); font-weight: 400; margin-left: 4px; }
.poses-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.poses-row::-webkit-scrollbar { height: 0; }
.pose-card { flex: 0 0 auto; width: 96px; padding: 0; border-radius: 13px; overflow: hidden; border: 1.5px solid var(--c-line); background: var(--c-card); cursor: pointer; font: inherit; color: inherit; transition: .14s; }
.pose-card:active { transform: scale(.97); }
.pose-card.active { border-color: var(--c-emerald); box-shadow: 0 0 0 3px rgba(31,107,82,.18); }
.pose-ic { aspect-ratio: 3 / 3.5; display: grid; place-items: center; background: linear-gradient(150deg, var(--hero-a, #1f6b52), var(--hero-b, #134236)); }
.pose-frame { width: 74%; height: 74%; background: #faf6ee; border-radius: 9px; display: grid; place-items: center; }
.pose-frame img { width: 84%; height: 84%; object-fit: contain; }
.pose-lbl { display: block; font-size: 11px; color: var(--c-ink); text-align: center; padding: 6px 4px; font-weight: 600; }
.pose-add { flex: 0 0 auto; width: 96px; border-radius: 13px; border: 1.5px dashed var(--c-gold-soft); background: none; color: var(--c-dim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 11px; }
.pose-add:active { transform: scale(.97); }
.pa-plus { font-size: 22px; color: var(--c-gold); line-height: 1; }

.proj-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }

/* ---------- picker bottom sheet ---------- */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20,14,6,.4); z-index: 30; }
.picker {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--c-bg);
  border-radius: 22px 22px 0 0; max-height: 76%; display: flex; flex-direction: column;
  box-shadow: 0 -10px 30px rgba(0,0,0,.2); transition: transform .25s ease;
}
.picker.hidden, .sheet-backdrop.hidden { display: none; }
.picker-grip { width: 38px; height: 4px; border-radius: 3px; background: #d8cdb8; margin: 9px auto 4px; }
.picker-head { font-family: var(--serif); font-size: 18px; color: var(--c-ink); padding: 4px 22px 10px; border-bottom: 1px solid var(--c-line); }
.picker-body {
  overflow-y: auto; padding: 12px 14px calc(16px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start;
}
.picker-foot { flex: 0 0 auto; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--c-line); background: var(--c-bg); }
.picker-foot.hidden { display: none; }
.picker-empty { grid-column: 1 / -1; text-align: center; color: var(--c-faint); font-size: 13.5px; padding: 30px 12px; }
.otile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 9px 11px; border-radius: 15px; cursor: pointer; text-align: center;
  background: var(--c-card); border: 1.5px solid var(--c-line); transition: .14s;
}
.otile:active { transform: scale(.98); }
.otile:hover { border-color: var(--c-gold-soft); }
.otile.sel { border-color: var(--c-emerald); background: #f3f8f4; box-shadow: 0 0 0 3px rgba(31,107,82,.12); }
.ot-ic { width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.ot-ic img { width: 100%; height: 100%; object-fit: contain; }
.ot-empty { width: 60%; height: 60%; border: 1.5px dashed var(--c-line); border-radius: 12px; }
.ot-swatch { width: 64px; height: 64px; border-radius: 50%; box-shadow: 0 0 0 1px var(--c-line), inset 0 0 0 4px #fff; }
.ot-label { font-size: 12.5px; color: var(--c-ink); line-height: 1.25; font-weight: 600; }
.ot-check {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-emerald); color: #fff; display: none; place-items: center; font-size: 12px; z-index: 2;
}
.otile.sel .ot-check { display: grid; }

/* ---------- preview / order ---------- */
.preview-hero {
  margin: 6px 0 0; border-radius: 20px; aspect-ratio: 3/4.1; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--hero-a, #1f6b52), var(--hero-b, #0f2c23));
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.preview-hero .ph-frame { width: 62%; height: 72%; background: #faf6ee; border: 1px solid rgba(240,220,171,.5); border-radius: 14px; display: grid; place-items: center; box-shadow: 0 14px 34px rgba(0,0,0,.3); }
.preview-hero .ph-frame img { width: 84%; height: 84%; object-fit: contain; }
.preview-hero .ph-tag { position: absolute; left: 14px; bottom: 14px; color: #f4ebd8; }
.preview-hero .ph-tag .t1 { font-family: var(--serif); font-size: 20px; }
.preview-hero .ph-tag .t2 { font-size: 12px; opacity: .85; margin-top: 2px; }
.preview-hero .ph-mock { position: absolute; top: 12px; right: 12px; font: 9px var(--sans); font-weight: 700; letter-spacing: .08em; color: #f0dcab; border: 1px solid rgba(240,220,171,.5); padding: 3px 7px; border-radius: 99px; }

.wysiwyg { display: flex; gap: 9px; align-items: center; margin: 14px 0 2px; padding: 12px 14px; border-radius: 13px; background: #f3f8f4; border: 1px solid #d7e7dd; }
.wysiwyg .w-em { color: var(--c-emerald); font-size: 20px; }
.wysiwyg p { margin: 0; font-size: 12.5px; color: #2f5546; line-height: 1.45; }
.wysiwyg b { color: var(--c-emerald-deep); }

.summary { margin-top: 16px; }
.sum-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--c-line); font-size: 13.5px; }
.sum-row:last-child { border-bottom: none; }
.sum-k { color: var(--c-dim); flex: 0 0 42%; }
.sum-v { color: var(--c-ink); text-align: right; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.chip { font-size: 12px; color: var(--c-gold); background: #fbf4e6; border: 1px solid #ecdcbe; padding: 4px 10px; border-radius: 99px; }

/* toast */
.toast { position: absolute; left: 22px; right: 22px; bottom: 26px; z-index: 40; background: var(--c-emerald-deep); color: #eef6f0; padding: 13px 16px; border-radius: 13px; font-size: 13px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; animation: rise .25s ease; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }

.hidden { display: none !important; }

/* ---------- web-app: sign-in ---------- */
.signin-field { width: 100%; margin-top: 18px; }
.signin-field input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(240,220,171,.4);
  background: rgba(255,253,248,.12); color: #f4ebd8; font: 15px var(--sans); outline: none;
}
.signin-field input::placeholder { color: #bcd0c2; }
.signin-note { color: #bcd0c2; font-size: 12px; margin-top: 10px; line-height: 1.45; }

/* ---------- web-app: real render image in a hero ---------- */
.render-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview-hero.has-img .ph-frame { display: none; }
.preview-hero .ph-tag { z-index: 2; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.preview-hero.has-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.5), transparent 45%); z-index: 1; }
.proj-hero .render-img { border-radius: 0; }
/* Contain the pose-strip thumbnail: .render-img is absolute, so its container
   must establish a positioning context or it escapes to the viewport. */
.pose-ic { position: relative; overflow: hidden; }
.pose-ic .render-img { object-fit: cover; }

/* ---------- web-app: credits + spinner ---------- */
.credits-pill { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--c-gold); background: #fbf4e6; border: 1px solid #ecdcbe; padding: 4px 11px; border-radius: 99px; }
.gen-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; flex: 1; padding: 40px 24px; text-align: center; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--c-line); border-top-color: var(--c-emerald); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen-loading .gl-title { font-family: var(--serif); font-size: 18px; color: var(--c-ink); }
.gen-loading .gl-sub { font-size: 13px; color: var(--c-dim); line-height: 1.5; max-width: 78%; }
.btn.primary.busy { opacity: .8; cursor: wait; }
.err-banner { background: #fbeae6; border: 1px solid #e6b8ab; color: #8a3b2a; font-size: 13px; padding: 11px 14px; border-radius: 12px; margin: 0 0 12px; }

/* boot splash */
#boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--c-emerald-deep); color: #f0dcab; z-index: 100; }
#boot .bm { font-family: var(--serif); font-style: italic; font-size: 32px; }
#boot.hidden { display: none; }

/* ---------- colorimetry analysis (the "You're all set" sequence) ---------- */
.btn.primary:disabled { opacity: .5; box-shadow: none; cursor: default; }
.cm-analysis { margin: 22px auto 0; max-width: 320px; width: 100%; }
.cm-step { display: flex; align-items: center; gap: 10px; padding: 7px 4px; color: var(--c-faint); font-size: 14px; transition: color .3s; }
.cm-step .cm-dot { width: 9px; height: 9px; border-radius: 99px; border: 1.5px solid var(--c-line); flex: 0 0 auto; transition: all .3s; }
.cm-step.active { color: var(--c-ink); }
.cm-step.active .cm-dot { border-color: var(--c-gold); box-shadow: 0 0 0 4px rgba(176,134,58,.14); animation: cm-pulse 1.1s ease-in-out infinite; }
.cm-step.done { color: var(--c-dim); }
.cm-step.done .cm-dot { background: var(--c-emerald); border-color: var(--c-emerald); box-shadow: none; animation: none; }
@keyframes cm-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(176,134,58,.18); } 50% { box-shadow: 0 0 0 6px rgba(176,134,58,.06); } }
.cm-payoff { margin-top: 16px; text-align: center; animation: cm-fade .5s ease both; }
.cm-season { font-family: var(--serif); font-size: 19px; color: var(--c-emerald); margin-bottom: 4px; }
.cm-summary { color: var(--c-dim); font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
.cm-swatches { display: flex; gap: 8px; justify-content: center; }
.cm-swatch { width: 26px; height: 26px; border-radius: 99px; border: 2px solid var(--c-card); box-shadow: 0 1px 4px rgba(43,34,24,.18); }
@keyframes cm-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- recommendation nudge (picker) ---------- */
.rec-hint { font-size: 12.5px; color: var(--c-gold); background: #fbf4e6; border: 1px solid #ecdcbe; border-radius: 12px; padding: 9px 11px; margin-bottom: 11px; line-height: 1.45; }
.rec-hint b { color: var(--c-ink); }
.otile.rec { border-color: var(--c-gold-soft); box-shadow: 0 0 0 1px var(--c-gold-soft) inset; }
.ot-rec { position: absolute; top: 6px; left: 6px; color: var(--c-gold); font-size: 13px; line-height: 1; }

/* ---------- responsive: real device fills the screen, desktop keeps the frame ---------- */
@media (max-width: 560px) {
  body { display: block; }
  .phone { width: 100vw; height: 100dvh; min-height: 100dvh; margin: 0; border: none; border-radius: 0; box-shadow: none; }
  .notch, .homebar { display: none; }
  .statusbar { display: none; }
  .viewport { inset: env(safe-area-inset-top, 0) 0 0 0; }
}

/* ---------- live camera capture sheet ---------- */
.cam { position: absolute; inset: 0; z-index: 40; background: #0b0a08; overflow: hidden; color: #fff;
  font-family: var(--sans); display: flex; flex-direction: column; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-video.mir { transform: scaleX(-1); }

/* alignment frame — soft ivory by default, gold + glow when the pose locks */
.cam-frame { position: absolute; inset: 0; pointer-events: none; }
.cam-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.af-main { stroke: rgba(255,253,247,.92); stroke-width: 2.4; }
.af-soft { stroke: rgba(255,253,247,.5); stroke-width: 1.6; }
.af-tick { stroke: rgba(217,185,126,.95); stroke-width: 2.2; }
.af-hand { stroke: rgba(217,185,126,.9); stroke-width: 2; stroke-dasharray: 3 4; }
.cam .afg { transition: stroke .2s; filter: drop-shadow(0 1px 6px rgba(0,0,0,.45)); }
.cam.lock .af-main, .cam.lock .af-soft { stroke: var(--c-gold-soft); stroke-width: 3; }
.cam.lock .cam-frame { filter: drop-shadow(0 0 14px rgba(217,185,126,.85)); }

/* top bar */
.cam-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0; }
.cam-top .cam-ttl { flex: 1; text-align: center; font-family: var(--serif); font-size: 17px;
  text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.cam-x, .cam-flip { width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(20,16,10,.42); color: #fff; font-size: 18px; backdrop-filter: blur(6px);
  display: grid; place-items: center; }
.cam-flip { font-size: 16px; }

.cam-hint { position: relative; z-index: 2; margin: 10px auto 0; max-width: 80%; text-align: center;
  font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 99px;
  background: rgba(20,16,10,.42); backdrop-filter: blur(6px); text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.cam.lock .cam-hint { background: rgba(176,134,58,.5); }

/* guidance chips */
.cam-chips { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px; margin: 10px 16px 0; }
.cam-chips .chip { font-size: 11px; letter-spacing: .02em; padding: 4px 10px; border-radius: 99px;
  background: rgba(20,16,10,.4); color: rgba(255,255,255,.72); backdrop-filter: blur(6px);
  border: 1px solid transparent; transition: .18s; }
.cam-chips .chip.ok { background: rgba(31,107,82,.62); color: #fff; border-color: rgba(255,255,255,.25); }
.cam.manual .cam-chips { display: none; }

/* footer: tip, shutter, upload escape hatch */
.cam-foot { margin-top: auto; position: relative; z-index: 2; text-align: center;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
  background: linear-gradient(0deg, rgba(11,10,8,.78), transparent); }
.cam-tip { font-size: 11.5px; color: rgba(255,255,255,.66); line-height: 1.4; margin: 0 auto 12px; max-width: 84%; }
.cam-controls { display: flex; justify-content: center; align-items: center; margin-bottom: 12px; }
.cam-shutter { width: 72px; height: 72px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.16); padding: 6px; -webkit-tap-highlight-color: transparent; }
.cam-shutter .sr { display: block; width: 100%; height: 100%; border-radius: 50%;
  background: #fffdf9; box-shadow: inset 0 0 0 3px rgba(11,10,8,.5); transition: .15s; }
.cam-shutter:active .sr { transform: scale(.92); }
.cam.lock .cam-shutter .sr { background: var(--c-gold-soft); }
.cam-upload { background: none; border: none; color: rgba(255,255,255,.78); font-size: 13px;
  font-family: var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* countdown + capture flash */
.cam-count { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  font-family: var(--serif); font-size: 120px; color: var(--c-gold-soft); pointer-events: none;
  text-shadow: 0 4px 26px rgba(0,0,0,.6); }
.cam-count.hidden { display: none; }
.cam-count.pop { animation: cam-pop .6s ease-out; }
@keyframes cam-pop { 0% { transform: scale(.5); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: .85; } }
.cam-flash { position: absolute; inset: 0; z-index: 4; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.on { animation: cam-flash .35s ease-out; }
@keyframes cam-flash { 0% { opacity: .85; } 100% { opacity: 0; } }

/* review */
.cam-review { position: absolute; inset: 0; z-index: 5; background: #0b0a08; display: flex; flex-direction: column; }
.cam-review.hidden { display: none; }
.cam-shot { flex: 1; width: 100%; object-fit: contain; min-height: 0; }
.cam-review-act { display: flex; gap: 10px; padding: 16px 18px calc(env(safe-area-inset-bottom, 0px) + 20px); }
.cam-review-act .btn { width: auto; flex: 1; }
