:root {
  --bone: #F3EFE9;
  --paper: #FBF9F6;
  --ink: #1C1A17;
  --ink-2: #4A453F;
  --muted: #8C857B;
  --line: #E3DDD3;
  --clay: #B46A4C;
  --serif: "Instrument Serif", "Didot", Georgia, serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r: 22px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bone); color-scheme: light; }
body {
  margin: 0; background: var(--bone); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; background: var(--bone); }
@media (min-width: 560px) {
  body { background: #E9E4DC; }
  #app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px -40px rgba(40, 30, 20, .35); }
}
#view { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); min-height: 100dvh; }
.enter { animation: enter .45s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 30;
  width: 100%; max-width: 480px; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(3, 1fr); align-items: center;
  background: rgba(243, 239, 233, .82); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid rgba(28, 26, 23, .07);
  transition: transform .35s var(--ease);
}
.tabbar.hide { transform: translate(-50%, 110%); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; letter-spacing: .02em; color: var(--muted); padding: 8px 0; }
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.tab.on { color: var(--ink); }
.tab.on svg { stroke-width: 1.8; }
.tab-create .plus { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bone); display: grid; place-items: center; margin-top: -2px; }
.tab-create .plus svg { width: 16px; height: 16px; stroke-width: 2; }
.tab-create.on .plus { background: var(--clay); }

/* ---------- Header ---------- */
.top { padding: calc(var(--safe-t) + 18px) 20px 6px; display: flex; align-items: flex-end; justify-content: space-between; }
.brand { font-family: var(--serif); font-size: 38px; line-height: 1; letter-spacing: -.01em; }
.brand i { color: var(--clay); font-style: normal; }
.tab-logo { display: none; }
.pill-left { font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 6px 11px; white-space: nowrap; }
.lede { padding: 2px 20px 0; color: var(--muted); font-size: 14px; }
.h-sec { font-family: var(--serif); font-size: 28px; line-height: 1.1; padding: 26px 20px 12px; margin: 0; font-weight: 400; }
.h-sec em { color: var(--muted); }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 20px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 15px; border-radius: 99px; font-size: 13px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); transition: all .25s var(--ease); }
.chip.on { background: var(--ink); color: var(--bone); border-color: var(--ink); }

/* ---------- Feed cards ---------- */
.feed { padding: 12px 16px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { position: relative; border-radius: var(--r); overflow: hidden; background: #DDD6CB; aspect-ratio: 3 / 4; isolation: isolate; transition: transform .35s var(--ease); }
.card:active { transform: scale(.975); }
.card.hero { grid-column: 1 / -1; aspect-ratio: 4 / 5; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .6s; opacity: 0; }
.card img.ld { opacity: 1; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 48%, rgba(15,12,10,.62) 100%); z-index: 1; }
.card .meta { position: absolute; left: 14px; right: 14px; bottom: 13px; z-index: 2; color: #FFF; }
.card .tag { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .82; }
.card .name { font-family: var(--serif); font-size: 23px; line-height: 1.05; margin-top: 3px; }
.card.hero .name { font-size: 36px; }
.card.hero .vibe { font-size: 13.5px; opacity: .88; margin-top: 6px; max-width: 30ch; }
.badge { position: absolute; top: 12px; left: 12px; z-index: 2; font-size: 11px; font-weight: 500; letter-spacing: .02em; color: var(--ink); background: rgba(251, 249, 246, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 5px 9px 5px 8px; border-radius: 99px; display: flex; align-items: center; gap: 5px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--clay); }

/* ---------- Preset detail ---------- */
.detail-cover { position: relative; height: 64dvh; min-height: 420px; overflow: hidden; background: #DDD6CB; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; animation: slowzoom 14s ease-out both; }
@keyframes slowzoom { from { transform: scale(1.06); } to { transform: scale(1); } }
.back { position: absolute; top: calc(var(--safe-t) + 14px); left: 14px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; background: rgba(251, 249, 246, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: grid; place-items: center; }
.back svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sheet { position: relative; margin-top: -28px; background: var(--bone); border-radius: 28px 28px 0 0; padding: 26px 20px 20px; z-index: 2; }
.sheet .tag { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sheet h1 { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; margin: 8px 0 10px; letter-spacing: -.01em; }
.sheet p.vibe { margin: 0; color: var(--ink-2); font-size: 15.5px; }

.slot { margin-top: 22px; display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 18px; border: 1px dashed #CFC7BA; background: var(--paper); width: 100%; text-align: left; transition: border-color .2s; }
.slot:active { border-color: var(--ink-2); }
.slot .thumb { width: 64px; height: 80px; border-radius: 12px; flex: none; background: var(--bone); display: grid; place-items: center; overflow: hidden; }
.slot .thumb img { width: 100%; height: 100%; object-fit: cover; }
.slot .thumb svg { width: 24px; height: 24px; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.slot b { display: block; font-weight: 500; font-size: 15px; }
.slot small { color: var(--muted); font-size: 13px; }
.slot.has { border-style: solid; border-color: var(--line); }

.cta { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; border-radius: 99px; background: var(--ink); color: var(--bone); font-size: 16px; font-weight: 500; letter-spacing: .01em; margin-top: 16px; transition: transform .2s var(--ease), opacity .2s; }
.cta:active { transform: scale(.98); }
.cta[disabled] { opacity: .32; }
.cta.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.fine { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 12px; }

/* ---------- Create ---------- */
.create-slot { margin: 6px 20px 0; border-radius: 26px; border: 1px dashed #CFC7BA; background: var(--paper); aspect-ratio: 4 / 5; display: grid; place-items: center; overflow: hidden; position: relative; width: calc(100% - 40px); }
.create-slot img { width: 100%; height: 100%; object-fit: cover; }
.create-slot .inner { text-align: center; color: var(--ink-2); }
.create-slot .ring { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--bone); display: grid; place-items: center; margin: 0 auto 14px; }
.create-slot .ring svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.5; }
.create-slot .inner b { font-family: var(--serif); font-weight: 400; font-size: 26px; display: block; color: var(--ink); }
.create-slot .change { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: rgba(251, 249, 246, .88); backdrop-filter: blur(10px); padding: 8px 14px; border-radius: 99px; font-size: 13px; }
.rail { display: flex; gap: 10px; overflow-x: auto; padding: 0 20px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail .card { flex: none; width: 128px; scroll-snap-align: start; }
.rail .card .name { font-size: 18px; }

/* ---------- Making ---------- */
.making { position: fixed; inset: 0; z-index: 40; background: var(--bone); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; overflow: hidden; max-width: 480px; margin: 0 auto; }
.making .bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(34px) saturate(1.15); opacity: .7; animation: breathe 9s ease-in-out infinite alternate; }
@keyframes breathe { from { transform: scale(1.05); } to { transform: scale(1.2); } }
.making .veil { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(243,239,233,.25), rgba(243,239,233,.85) 75%); }
.frame { position: relative; width: 62%; max-width: 260px; aspect-ratio: 3 / 4; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(40,25,15,.5); background: #DDD6CB; }
.frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.25) contrast(.95); }
.frame .scan { position: absolute; left: 0; right: 0; height: 40%; top: -40%; background: linear-gradient(180deg, rgba(251,249,246,0), rgba(251,249,246,.55), rgba(251,249,246,0)); animation: scan 2.8s var(--ease) infinite; }
@keyframes scan { to { top: 100%; } }
.status { position: relative; font-family: var(--serif); font-style: italic; font-size: 28px; margin-top: 34px; text-align: center; min-height: 1.3em; transition: opacity .5s; }
.sub { position: relative; color: var(--muted); font-size: 13px; margin-top: 6px; text-align: center; }
.bar { position: relative; width: 62%; max-width: 260px; height: 2px; background: rgba(28,26,23,.1); border-radius: 2px; margin-top: 22px; overflow: hidden; }
.bar i { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); transition: transform 1s linear; }

/* ---------- Result ---------- */
.result-wrap { padding: calc(var(--safe-t) + 14px) 16px 0; }
.result-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.result-top .back { position: static; background: var(--paper); border: 1px solid var(--line); }
.result-top .t { font-family: var(--serif); font-size: 22px; }
.result-img { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 3 / 4; background: #DDD6CB; box-shadow: 0 24px 50px -32px rgba(40,25,15,.55); }
.result-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.result-img .after { transition: opacity .12s linear; z-index: 1; }
.result-img.show-before .after { opacity: 0 !important; transition: opacity .25s; }
.hold { position: absolute; right: 12px; bottom: 12px; z-index: 2; font-size: 12px; background: rgba(251,249,246,.88); backdrop-filter: blur(10px); padding: 8px 12px; border-radius: 99px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.actions .cta { margin-top: 0; }
.actions .wide { grid-column: 1 / -1; }
.cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Saved ---------- */
.saved-grid { padding: 4px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.empty { text-align: center; padding: 60px 30px; color: var(--muted); }
.empty b { font-family: var(--serif); font-weight: 400; font-size: 30px; color: var(--ink); display: block; margin-bottom: 6px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bone); padding: 11px 18px; border-radius: 99px; font-size: 13.5px; z-index: 60; transition: all .35s var(--ease); pointer-events: none; max-width: calc(100% - 40px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Strength slider ---------- */
.level { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.level span { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.level b { font-weight: 500; font-size: 13px; width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.level input { --p: 100%; flex: 1; -webkit-appearance: none; appearance: none; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--ink) var(--p), var(--line) var(--p)); outline: none; }
.level input::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink); box-shadow: 0 4px 12px -4px rgba(40,25,15,.4); cursor: grab; }
.level input::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink); }

/* ---------- Browse while developing ---------- */
.browse { position: relative; margin-top: 30px; padding: 13px 22px; border-radius: 99px; border: 1px solid var(--ink); background: rgba(251,249,246,.6); backdrop-filter: blur(10px); font-size: 14px; font-weight: 500; }
.browse:active { transform: scale(.98); }
.sub.tiny { font-size: 12px; margin-top: 10px; }

#dock { position: fixed; left: 50%; transform: translate(-50%, 20px); bottom: calc(var(--safe-b) + 16px); z-index: 35; width: calc(100% - 32px); max-width: 448px; display: flex; flex-direction: column; gap: 8px; opacity: 0; pointer-events: none; transition: all .4s var(--ease); }
#dock.lift { bottom: calc(var(--tab-h) + var(--safe-b) + 12px); }
#dock.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.dock-item { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 99px; background: rgba(28,26,23,.92); color: var(--bone); backdrop-filter: blur(14px); box-shadow: 0 16px 34px -18px rgba(20,12,6,.7); text-align: left; animation: enter .45s var(--ease) both; }
.dock-item b { display: block; font-weight: 500; font-size: 14px; }
.dock-item small { display: block; font-size: 12px; opacity: .7; }
.dock-item > img, .dock-item .ring { width: 42px; height: 42px; border-radius: 50%; flex: none; object-fit: cover; }
.dock-item .ring { position: relative; padding: 3px; background: conic-gradient(var(--clay) 0 28%, rgba(243,239,233,.18) 28% 100%); animation: spin 1.1s linear infinite; }
.dock-item .ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; animation: spin 1.1s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.dock-item.ready { background: var(--clay); animation: enter .45s var(--ease) both, glow 1.8s ease-in-out infinite; }
.dock-item.ready::after { content: "›"; margin-left: auto; font-size: 22px; opacity: .8; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(180,106,76,.22), 0 16px 34px -18px rgba(20,12,6,.7); } }
.tab.dot { position: relative; }
.tab.dot::after { content: ""; position: absolute; top: 6px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 2px var(--bone); }

.ready-card { position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); transform: translate(-50%, -140%); z-index: 70; width: calc(100% - 24px); max-width: 456px; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 50px -24px rgba(40,25,15,.55); transition: transform .55s cubic-bezier(.2,1.4,.3,1); overflow: hidden; }
.ready-card.on { transform: translate(-50%, 0); }
.ready-card > img { width: 52px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; animation: pop .6s .25s cubic-bezier(.2,1.6,.3,1) both; }
@keyframes pop { from { transform: scale(.4) rotate(-8deg); } to { transform: none; } }
.ready-card div { flex: 1; min-width: 0; }
.ready-card b { display: block; font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.1; }
.ready-card small { color: var(--muted); font-size: 12.5px; }
.ready-card button { flex: none; background: var(--ink); color: var(--bone); border-radius: 99px; padding: 10px 16px; font-size: 13.5px; font-weight: 500; }
.ready-card i { position: absolute; top: 50%; left: 30px; width: 6px; height: 6px; border-radius: 2px; background: var(--clay); opacity: 0; pointer-events: none; animation: burst 1.1s .2s ease-out both; }
.ready-card i:nth-of-type(3n) { background: #E8C27A; } .ready-card i:nth-of-type(3n+1) { background: #9FB3A0; border-radius: 50%; }
.ready-card i:nth-of-type(1) { --x: 60px; --y: -26px; } .ready-card i:nth-of-type(2) { --x: 90px; --y: 14px; } .ready-card i:nth-of-type(3) { --x: 40px; --y: 30px; }
.ready-card i:nth-of-type(4) { --x: 120px; --y: -18px; } .ready-card i:nth-of-type(5) { --x: 150px; --y: 22px; } .ready-card i:nth-of-type(6) { --x: 70px; --y: -34px; }
.ready-card i:nth-of-type(7) { --x: 180px; --y: -10px; } .ready-card i:nth-of-type(8) { --x: 30px; --y: -30px; } .ready-card i:nth-of-type(9) { --x: 210px; --y: 18px; } .ready-card i:nth-of-type(10) { --x: 110px; --y: 32px; }
@keyframes burst { 0% { opacity: 1; transform: translate(0,0) scale(.6) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.1) rotate(220deg); } }


/* ---------- Account entry ---------- */
.acct { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.acct:empty { display: none; }
button.pill-left { cursor: pointer; transition: background .2s, border-color .2s; }
button.pill-left:active { transform: scale(.97); }
.pill-left.signin { background: var(--ink); color: var(--bone); border-color: var(--ink); font-weight: 500; padding: 7px 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--clay); color: #FFF; font-weight: 500; font-size: 14px; box-shadow: 0 0 0 1px var(--line), 0 0 0 3px var(--bone); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; box-shadow: none; }
.avatar.sm.ghost { background: transparent; color: currentColor; }
.avatar.sm.ghost svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; font-family: var(--serif); margin: 6px auto 12px; box-shadow: 0 0 0 1px var(--line), 0 0 0 5px var(--paper); }
.avatar-btn { border-radius: 50%; }
.tab-acct { display: none; }

/* ---------- Sheet: bottom sheet on phones, modal on desktop ---------- */
#acct-sheet { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
#acct-sheet .sh-back { position: absolute; inset: 0; background: rgba(28, 22, 16, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .35s var(--ease); }
#acct-sheet .sh-panel { position: absolute; left: 50%; bottom: 0; width: 100%; max-width: 480px; transform: translate(-50%, 104%); background: var(--bone); border-radius: 28px 28px 0 0; padding: 10px 22px calc(var(--safe-b) + 26px); box-shadow: 0 -24px 60px -30px rgba(40, 25, 15, .45); transition: transform .45s var(--ease); max-height: 92dvh; overflow-y: auto; }
#acct-sheet.on { pointer-events: auto; }
#acct-sheet.on .sh-back { opacity: 1; }
#acct-sheet.on .sh-panel { transform: translate(-50%, 0); }
.sh-grab { width: 38px; height: 4px; border-radius: 4px; background: rgba(28, 26, 23, .16); margin: 0 auto 8px; }
.sh-body { position: relative; text-align: center; padding-top: 14px; }
.sh-x { position: absolute; top: -8px; right: -8px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.sh-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.sh-mark { width: 52px; height: 52px; margin: 4px auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); box-shadow: 0 0 0 1px var(--line); color: var(--clay); }
.sh-mark svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.sh-title { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; margin: 0 0 8px; letter-spacing: -.01em; }
.sh-sub { color: var(--ink-2); font-size: 14.5px; margin: 0 auto 18px; max-width: 34ch; }
.sh-sub b { font-weight: 500; color: var(--ink); }
.sh-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 56px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); font-size: 16px; font-weight: 500; box-shadow: 0 10px 24px -18px rgba(40, 25, 15, .5); transition: transform .2s var(--ease), border-color .2s; }
.sh-btn:active { transform: scale(.98); }
.sh-btn:hover { border-color: #CFC7BA; }
.sh-btn[disabled] { opacity: .5; }
.sh-btn .g { width: 20px; height: 20px; }
.sh-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin: 16px 0; }
.sh-or::before, .sh-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sh-form { display: flex; flex-direction: column; gap: 10px; }
.sh-form input { width: 100%; height: 54px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); padding: 0 18px; font: inherit; font-size: 16px; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.sh-form input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 4px rgba(28, 26, 23, .06); }
.sh-form .cta { margin-top: 0; }
.sh-err { color: #A2452A; font-size: 13px; margin: 10px 0 0; }
.sh-fine { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; }
.sh-who { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.sh-who small { display: block; font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.sh-credits { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 20px 0 6px; padding: 18px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); }
.sh-credits b { font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: .9; color: var(--clay); }
.sh-credits span { color: var(--ink-2); font-size: 14px; }
.cta.soon { flex-wrap: wrap; gap: 8px; border-style: dashed; }
.cta.soon[disabled] { opacity: .55; }
.cta.soon small { font-size: 12px; font-weight: 400; opacity: .8; background: var(--line); padding: 3px 8px; border-radius: 99px; }
.sh-link { display: block; margin: 18px auto 0; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.sh-body > .cta + .cta { margin-top: 10px; }
body.sheet-open { overflow: hidden; }

/* ---------- Desktop ---------- */
@media (min-width: 1000px) {

  .top .acct-btn, .top .acct { display: none; }
  .tab-acct { display: flex; margin-left: 10px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
  .tab-acct:hover { background: var(--paper); border-color: #CFC7BA; }
  .tab-acct .avatar.sm.ghost { color: var(--clay); }
  #acct-sheet .sh-panel { top: 50%; bottom: auto; width: 440px; border-radius: 28px; padding: 30px 34px 32px; transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .4s var(--ease), opacity .3s; box-shadow: 0 40px 100px -40px rgba(40, 25, 15, .55); }
  #acct-sheet.on .sh-panel { transform: translate(-50%, -50%); opacity: 1; }
  .sh-grab { display: none; }
  .sh-x { top: -14px; right: -18px; }
  :root { --tab-h: 72px; }
  body { background: var(--bone); }
  #app { max-width: 1240px; box-shadow: none; }
  #view { padding: calc(var(--tab-h) + 8px) 32px 64px; }
  .tabbar, .tabbar.hide { top: 0; bottom: auto; transform: translateX(-50%); max-width: none; height: var(--tab-h); padding: 0 max(32px, calc((100vw - 1240px) / 2 + 32px)); display: flex; justify-content: flex-end; gap: 6px; border-top: 0; border-bottom: 1px solid rgba(28,26,23,.07); }
  .tab-logo { display: block; font-family: var(--serif); font-size: 30px; margin-right: auto; letter-spacing: -.01em; color: var(--ink); }
  .tab { flex-direction: row; gap: 8px; font-size: 14px; padding: 10px 16px; border-radius: 99px; transition: background .2s; }
  .tab:hover { background: rgba(28,26,23,.05); color: var(--ink); }
  .tab.on { background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
  .tab svg { width: 18px; height: 18px; }
  .tab-create .plus { width: 22px; height: 22px; margin: 0; }
  .tab-create .plus svg { width: 12px; height: 12px; }
  .tab.dot::after { top: 8px; left: 30px; }

  .top { padding: 34px 0 8px; } .top .brand { font-size: 56px; }
  .top .home-brand { visibility: hidden; width: 0; }
  .lede:first-of-type { font-family: var(--serif); font-size: 44px; color: var(--ink); margin-top: -64px; line-height: 1.1; }
  .lede { padding: 4px 0 0; font-size: 16px; } .h-sec { padding: 34px 0 14px; font-size: 34px; }
  .chips { padding: 22px 0 8px; } .feed { padding: 16px 0 0; grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .card.hero { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .card:hover img { transform: scale(1.04); }
  .card.hero .name { font-size: 48px; }

  .enter:has(> .detail-cover) { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; padding-top: 24px; }
  .detail-cover { height: calc(100dvh - var(--tab-h) - 72px); min-height: 520px; border-radius: 28px; }
  .detail-cover .back { top: 16px; left: 16px; }
  .sheet { margin: 0; padding: 0 24px 0 0; background: transparent; max-width: 460px; }
  .sheet h1 { font-size: 72px; }
  .sheet p.vibe { font-size: 17px; }

  .create-slot { margin: 10px 0 0; width: 100%; max-width: 440px; }
  .rail { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; padding: 0; overflow: visible; }
  .rail .card { width: auto; }

  .result-wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 48px; align-items: start; padding: 24px 0 0; }
  .result-top { grid-column: 1 / -1; }
  .result-img { grid-row: 2 / span 2; max-height: calc(100dvh - var(--tab-h) - 140px); margin-inline: auto; width: auto; max-width: 100%; height: calc(100dvh - var(--tab-h) - 140px); }
  .level { margin-top: 0; } .actions { grid-column: 2; align-self: start; }
  .result-wrap > .level { grid-column: 2; align-self: end; }

  .saved-grid { padding: 6px 0; grid-template-columns: repeat(4, 1fr); gap: 18px; }

  .making { max-width: none; } .frame { max-width: 320px; } .bar { max-width: 320px; }
  #dock, #dock.lift { left: auto; right: 28px; bottom: 28px; width: 360px; transform: translateY(20px); }
  #dock.on { transform: none; }
  .ready-card { left: auto; right: 24px; top: calc(var(--tab-h) + 14px); transform: translateX(140%); width: 400px; }
  .ready-card.on { transform: none; }
  #toast { bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .card img { opacity: 1; } }
[hidden] { display: none !important; }
body.has-dock #view { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 110px); }
.cta.ai { flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cta.ai small { font-size: 12px; font-weight: 400; opacity: .6; }
.ai-badge { left: auto; right: 10px; }
.ai-badge::before { display: none; }

/* ---------- Before / after slider (effects) ---------- */
.ba { position: absolute; inset: 0; touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: none; pointer-events: none; }
.ba .ba-before { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: rgba(255,255,255,.95); box-shadow: 0 0 12px rgba(0,0,0,.25); pointer-events: none; }
.ba-knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-size: 15px; font-weight: 700; letter-spacing: 2px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.ba-tag { position: absolute; bottom: 58px; padding: 6px 11px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .02em; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
.ba-tag.l { left: 14px; } .ba-tag.r { right: 14px; }
@media (min-width: 900px) { .ba-tag { bottom: 18px; } }

/* ---------- Home cards: auto before/after (no interaction) ---------- */
.card img.cb { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); animation: cbSweep 6s ease-in-out infinite; }
.card .cb-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: rgba(255,255,255,.9); box-shadow: 0 0 10px rgba(0,0,0,.25); z-index: 1; animation: cbLine 6s ease-in-out infinite; }
.card .cb-tags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; z-index: 2; pointer-events: none; }
.card .cb-tags b { font: 600 10.5px/1 var(--sans, system-ui); letter-spacing: .04em; color: #fff; background: rgba(0,0,0,.42); padding: 5px 8px; border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.card:has(.cb) .badge { display: none; }
@keyframes cbSweep { 0%, 100% { clip-path: inset(0 30% 0 0); } 50% { clip-path: inset(0 70% 0 0); } }
@keyframes cbLine { 0%, 100% { left: 70%; } 50% { left: 30%; } }
@media (prefers-reduced-motion: reduce) { .card img.cb, .card .cb-line { animation: none; } }
